diff options
author | 2021-08-03 18:42:39 +0900 | |
---|---|---|
committer | 2021-08-06 19:32:38 +0900 | |
commit | be4f78978faba3d3ceb88df02a7f93a2e09ff1e0 (patch) | |
tree | 1f3f1a96251ac4f655c8a96fc33d5d4ee779cd06 /rba.tool.core/src/rba/tool/core/sort/SortValueManager.java | |
parent | 71ca7c6cab863767ef30c8bd05b2bbfda8731cb5 (diff) |
Initial commit
Bug-AGL: SPEC-4033
Signed-off-by: Kenji Hosokawa <khosokawa@jp.adit-jv.com>
Diffstat (limited to 'rba.tool.core/src/rba/tool/core/sort/SortValueManager.java')
-rw-r--r-- | rba.tool.core/src/rba/tool/core/sort/SortValueManager.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/rba.tool.core/src/rba/tool/core/sort/SortValueManager.java b/rba.tool.core/src/rba/tool/core/sort/SortValueManager.java new file mode 100644 index 0000000..17fbb37 --- /dev/null +++ b/rba.tool.core/src/rba/tool/core/sort/SortValueManager.java @@ -0,0 +1,56 @@ +package rba.tool.core.sort; + +import org.eclipse.core.resources.IProject; + +import rba.tool.core.console.ConsoleManager; +import rba.tool.core.z3.Z3CodeManager; + +public class SortValueManager { + + public static SortValueManager INSTANCE = new SortValueManager(); + + private static final String CONSOLE_TITLE = "#### Execution of Constraint ####"; + + private SortValue areaZorderSortValue = new SortValue(); + + private SortValue visibilitySortValue = new SortValue();; + + private SortValue csPrioritySortValue = new SortValue();; + + private static final String NOTIFIER_ID = "rba.tool.core.CalculateSortValue"; + + public boolean updateSortValue(IProject project) { + + try { + ISortValueCalculation calc = Z3CodeManager.INSTNACE.getSortCaluculator(project); + calc.setUp(); + areaZorderSortValue.setSortValue(calc.calculateArea_zorder()); + visibilitySortValue.setSortValue(calc.calculateAllocatable_visibility()); + csPrioritySortValue.setSortValue(calc.calculateContentState_priority()); + calc.close(); + + } catch (RuntimeException e) { + ConsoleManager.INSTANCE.output(CONSOLE_TITLE, NOTIFIER_ID); + ConsoleManager.INSTANCE.output(e.getMessage(), NOTIFIER_ID); + ConsoleManager.INSTANCE.output("##################", NOTIFIER_ID); + + areaZorderSortValue.clear(); + visibilitySortValue.clear(); + csPrioritySortValue.clear(); + return false; + } + return true; + } + + public SortValue getAreaZorderSortValue() { + return areaZorderSortValue; + } + + public SortValue getAllocatableVisibilitySortValue() { + return visibilitySortValue; + } + + public SortValue getCsPrioritySortValue() { + return csPrioritySortValue; + } +} |