Merge lp:~libowen96/workcraft/trunk-son-time-intermediate into lp:~libowen96/workcraft/trunk-son-alter
- trunk-son-time-intermediate
- Merge into trunk-son-alter
Proposed by
Bowen Li
Status: | Merged |
---|---|
Approved by: | Bowen Li |
Approved revision: | 666 |
Merged at revision: | 667 |
Proposed branch: | lp:~libowen96/workcraft/trunk-son-time-intermediate |
Merge into: | lp:~libowen96/workcraft/trunk-son-alter |
Diff against target: |
450 lines (+114/-42) 11 files modified
SONPlugin/src/org/workcraft/plugins/son/SON.java (+20/-1) SONPlugin/src/org/workcraft/plugins/son/algorithm/EstimationAlg.java (+66/-21) SONPlugin/src/org/workcraft/plugins/son/gui/ParallelSimDialog.java (+3/-3) SONPlugin/src/org/workcraft/plugins/son/gui/TimeConsistencyDialog.java (+1/-1) SONPlugin/src/org/workcraft/plugins/son/gui/TimeEstimatorDialog.java (+9/-4) SONPlugin/src/org/workcraft/plugins/son/tools/ColorResetTool.java (+1/-1) SONPlugin/src/org/workcraft/plugins/son/tools/SONSimulationTool.java (+1/-1) SONPlugin/src/org/workcraft/plugins/son/tools/ScenarioGeneratorTool.java (+3/-3) SONPlugin/src/org/workcraft/plugins/son/tools/StructurePropertyChecker.java (+2/-2) SONPlugin/src/org/workcraft/plugins/son/tools/TimeConsistencyChecker.java (+2/-2) SONPlugin/src/org/workcraft/plugins/son/tools/TimeValueSetterTool.java (+6/-3) |
To merge this branch: | bzr merge lp:~libowen96/workcraft/trunk-son-time-intermediate |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bowen Li | Pending | ||
Review via email: mp+281354@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/SON.java' | |||
2 | --- SONPlugin/src/org/workcraft/plugins/son/SON.java 2015-10-05 19:59:54 +0000 | |||
3 | +++ SONPlugin/src/org/workcraft/plugins/son/SON.java 2015-12-25 22:57:38 +0000 | |||
4 | @@ -185,7 +185,7 @@ | |||
5 | 185 | } | 185 | } |
6 | 186 | } | 186 | } |
7 | 187 | 187 | ||
9 | 188 | public void refreshColor(){ | 188 | public void refreshAllColor(){ |
10 | 189 | for(Node n: getComponents()){ | 189 | for(Node n: getComponents()){ |
11 | 190 | setFillColor(n,CommonVisualSettings.getFillColor()); | 190 | setFillColor(n,CommonVisualSettings.getFillColor()); |
12 | 191 | setForegroundColor(n, CommonVisualSettings.getBorderColor()); | 191 | setForegroundColor(n, CommonVisualSettings.getBorderColor()); |
13 | @@ -206,6 +206,25 @@ | |||
14 | 206 | } | 206 | } |
15 | 207 | } | 207 | } |
16 | 208 | 208 | ||
17 | 209 | public void refreshNodeColor(){ | ||
18 | 210 | for(Node n: getComponents()){ | ||
19 | 211 | setFillColor(n,CommonVisualSettings.getFillColor()); | ||
20 | 212 | setForegroundColor(n, CommonVisualSettings.getBorderColor()); | ||
21 | 213 | setTokenColor(n, Color.BLACK); | ||
22 | 214 | } | ||
23 | 215 | for (ONGroup group : this.getGroups()){ | ||
24 | 216 | setForegroundColor(group, SONSettings.getGroupForegroundColor()); | ||
25 | 217 | } | ||
26 | 218 | |||
27 | 219 | for (SONConnection con : this.getSONConnections()){ | ||
28 | 220 | setForegroundColor(con, CommonVisualSettings.getBorderColor()); | ||
29 | 221 | } | ||
30 | 222 | for (Block block : this.getBlocks()){ | ||
31 | 223 | setFillColor(block, CommonVisualSettings.getFillColor()); | ||
32 | 224 | setForegroundColor(block, CommonVisualSettings.getBorderColor()); | ||
33 | 225 | } | ||
34 | 226 | } | ||
35 | 227 | |||
36 | 209 | public void setTimeColor(Node n, Color color){ | 228 | public void setTimeColor(Node n, Color color){ |
37 | 210 | if(n instanceof PlaceNode){ | 229 | if(n instanceof PlaceNode){ |
38 | 211 | ((PlaceNode) n).setDurationColor(color); | 230 | ((PlaceNode) n).setDurationColor(color); |
39 | 212 | 231 | ||
40 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/algorithm/EstimationAlg.java' | |||
41 | --- SONPlugin/src/org/workcraft/plugins/son/algorithm/EstimationAlg.java 2015-10-09 16:21:17 +0000 | |||
42 | +++ SONPlugin/src/org/workcraft/plugins/son/algorithm/EstimationAlg.java 2015-12-25 22:57:38 +0000 | |||
43 | @@ -41,6 +41,8 @@ | |||
44 | 41 | private Before before; | 41 | private Before before; |
45 | 42 | private Granularity g; | 42 | private Granularity g; |
46 | 43 | private Color color =Color.ORANGE; | 43 | private Color color =Color.ORANGE; |
47 | 44 | private Collection<Path> fwdPaths = new ArrayList<Path>(); | ||
48 | 45 | private Collection<Path> bwdPaths = new ArrayList<Path>(); | ||
49 | 44 | 46 | ||
50 | 45 | public EstimationAlg(SON net, Interval d, Granularity g, ScenarioRef s) { | 47 | public EstimationAlg(SON net, Interval d, Granularity g, ScenarioRef s) { |
51 | 46 | super(net); | 48 | super(net); |
52 | @@ -83,7 +85,7 @@ | |||
53 | 83 | return scenario; | 85 | return scenario; |
54 | 84 | } | 86 | } |
55 | 85 | 87 | ||
57 | 86 | public void twoDirEstimation(Node n) throws AlternativeStructureException, TimeEstimationException, TimeOutOfBoundsException, TimeInconsistencyException{ | 88 | public void twoDirEstimation(Node n, boolean interm) throws AlternativeStructureException, TimeEstimationException, TimeOutOfBoundsException, TimeInconsistencyException{ |
58 | 87 | ConsistencyAlg alg = new ConsistencyAlg(net); | 89 | ConsistencyAlg alg = new ConsistencyAlg(net); |
59 | 88 | Time node = null; | 90 | Time node = null; |
60 | 89 | 91 | ||
61 | @@ -242,7 +244,7 @@ | |||
62 | 242 | }else if(start == null && end == null){ | 244 | }else if(start == null && end == null){ |
63 | 243 | throw new TimeEstimationException("cannot find causally time values."); | 245 | throw new TimeEstimationException("cannot find causally time values."); |
64 | 244 | } | 246 | } |
66 | 245 | 247 | ||
67 | 246 | if(iCons.size() == 0){ | 248 | if(iCons.size() == 0){ |
68 | 247 | node.setStartTime(start); | 249 | node.setStartTime(start); |
69 | 248 | if(node instanceof Condition){ | 250 | if(node instanceof Condition){ |
70 | @@ -256,7 +258,7 @@ | |||
71 | 256 | ((Condition) node).setEndTimeColor(color); | 258 | ((Condition) node).setEndTimeColor(color); |
72 | 257 | } | 259 | } |
73 | 258 | } | 260 | } |
75 | 259 | 261 | ||
76 | 260 | iCons.removeAll(iSpec); | 262 | iCons.removeAll(iSpec); |
77 | 261 | for(SONConnection con : iCons){ | 263 | for(SONConnection con : iCons){ |
78 | 262 | con.setTime(start); | 264 | con.setTime(start); |
79 | @@ -268,12 +270,54 @@ | |||
80 | 268 | con.setTime(end); | 270 | con.setTime(end); |
81 | 269 | con.setTimeLabelColor(color); | 271 | con.setTimeLabelColor(color); |
82 | 270 | } | 272 | } |
83 | 273 | |||
84 | 274 | if(interm) intermediateEst(); | ||
85 | 275 | |||
86 | 271 | if(!alg.nodeConsistency(node, start, end, node.getDuration(), g).isEmpty()){ | 276 | if(!alg.nodeConsistency(node, start, end, node.getDuration(), g).isEmpty()){ |
87 | 272 | throw new TimeInconsistencyException("Warning: Estimated start and end times are inconsistent."); | 277 | throw new TimeInconsistencyException("Warning: Estimated start and end times are inconsistent."); |
88 | 273 | } | 278 | } |
89 | 274 | } | 279 | } |
90 | 275 | } | 280 | } |
91 | 281 | |||
92 | 282 | private void intermediateEst() throws TimeOutOfBoundsException{ | ||
93 | 276 | 283 | ||
94 | 284 | for(Path path : fwdPaths){ | ||
95 | 285 | for(int i = 1; i < path.size(); i++){ | ||
96 | 286 | Time n = (Time)path.get(i); | ||
97 | 287 | if(!n.getDuration().isSpecified()){ | ||
98 | 288 | n.setDuration(defaultDuration); | ||
99 | 289 | } | ||
100 | 290 | SONConnection preCon = net.getSONConnection(path.get(i-1), path.get(i)); | ||
101 | 291 | Interval time = granularity.plusTD(preCon.getTime(), n.getDuration()); | ||
102 | 292 | if( (i+1) < path.size()){ | ||
103 | 293 | SONConnection postCon = net.getSONConnection(path.get(i), path.get(i+1)); | ||
104 | 294 | postCon.setTime(time); | ||
105 | 295 | postCon.setTimeLabelColor(color); | ||
106 | 296 | } | ||
107 | 297 | } | ||
108 | 298 | } | ||
109 | 299 | |||
110 | 300 | fwdPaths.clear(); | ||
111 | 301 | |||
112 | 302 | for(Path path : bwdPaths){ | ||
113 | 303 | for(int i = 1; i < path.size(); i++){ | ||
114 | 304 | Time n = (Time)path.get(i); | ||
115 | 305 | if(!n.getDuration().isSpecified()){ | ||
116 | 306 | n.setDuration(defaultDuration); | ||
117 | 307 | } | ||
118 | 308 | SONConnection preCon = net.getSONConnection(path.get(i-1), path.get(i)); | ||
119 | 309 | Interval time = granularity.subtractTD(preCon.getTime(), n.getDuration()); | ||
120 | 310 | if( (i+1) < path.size()){ | ||
121 | 311 | SONConnection postCon = net.getSONConnection(path.get(i), path.get(i+1)); | ||
122 | 312 | postCon.setTime(time); | ||
123 | 313 | postCon.setTimeLabelColor(color); | ||
124 | 314 | } | ||
125 | 315 | } | ||
126 | 316 | } | ||
127 | 317 | |||
128 | 318 | bwdPaths.clear(); | ||
129 | 319 | |||
130 | 320 | } | ||
131 | 277 | 321 | ||
132 | 278 | private boolean hasConflict(){ | 322 | private boolean hasConflict(){ |
133 | 279 | RelationAlgorithm alg = new RelationAlgorithm(net); | 323 | RelationAlgorithm alg = new RelationAlgorithm(net); |
134 | @@ -596,6 +640,10 @@ | |||
135 | 596 | result[0] = visited.getLast().getEndTime(); | 640 | result[0] = visited.getLast().getEndTime(); |
136 | 597 | result[1] = durationAccumulator1(visited); | 641 | result[1] = durationAccumulator1(visited); |
137 | 598 | resultTimeAndDuration.add(result); | 642 | resultTimeAndDuration.add(result); |
138 | 643 | |||
139 | 644 | Path path = new Path(); | ||
140 | 645 | path.addAll(visited); | ||
141 | 646 | fwdPaths.add(path); | ||
142 | 599 | } | 647 | } |
143 | 600 | 648 | ||
144 | 601 | // examine post nodes | 649 | // examine post nodes |
145 | @@ -611,6 +659,11 @@ | |||
146 | 611 | result[0] = con.getTime(); | 659 | result[0] = con.getTime(); |
147 | 612 | result[1] = durationAccumulator1(visited); | 660 | result[1] = durationAccumulator1(visited); |
148 | 613 | resultTimeAndDuration.add(result); | 661 | resultTimeAndDuration.add(result); |
149 | 662 | |||
150 | 663 | Path path = new Path(); | ||
151 | 664 | visited.addLast(node); | ||
152 | 665 | path.addAll(visited); | ||
153 | 666 | fwdPaths.add(path); | ||
154 | 614 | } | 667 | } |
155 | 615 | } | 668 | } |
156 | 616 | // in depth-first, recursion needs to come after visiting post nodes | 669 | // in depth-first, recursion needs to come after visiting post nodes |
157 | @@ -633,8 +686,11 @@ | |||
158 | 633 | Interval[] result = new Interval[2]; | 686 | Interval[] result = new Interval[2]; |
159 | 634 | result[0] = visited.getLast().getStartTime(); | 687 | result[0] = visited.getLast().getStartTime(); |
160 | 635 | result[1] = durationAccumulator1(visited); | 688 | result[1] = durationAccumulator1(visited); |
161 | 636 | |||
162 | 637 | resultTimeAndDuration.add(result); | 689 | resultTimeAndDuration.add(result); |
163 | 690 | |||
164 | 691 | Path path = new Path(); | ||
165 | 692 | path.addAll(visited); | ||
166 | 693 | bwdPaths.add(path); | ||
167 | 638 | } | 694 | } |
168 | 639 | 695 | ||
169 | 640 | // examine post nodes | 696 | // examine post nodes |
170 | @@ -649,7 +705,12 @@ | |||
171 | 649 | Interval[] result = new Interval[2]; | 705 | Interval[] result = new Interval[2]; |
172 | 650 | result[0] = con.getTime(); | 706 | result[0] = con.getTime(); |
173 | 651 | result[1] = durationAccumulator1(visited); | 707 | result[1] = durationAccumulator1(visited); |
175 | 652 | resultTimeAndDuration.add(result); | 708 | resultTimeAndDuration.add(result); |
176 | 709 | |||
177 | 710 | Path path = new Path(); | ||
178 | 711 | visited.addLast(node); | ||
179 | 712 | path.addAll(visited); | ||
180 | 713 | bwdPaths.add(path); | ||
181 | 653 | } | 714 | } |
182 | 654 | } | 715 | } |
183 | 655 | // in depth-first, recursion needs to come after visiting post nodes | 716 | // in depth-first, recursion needs to come after visiting post nodes |
184 | @@ -682,22 +743,6 @@ | |||
185 | 682 | return result; | 743 | return result; |
186 | 683 | } | 744 | } |
187 | 684 | 745 | ||
188 | 685 | // private Interval durationAccumulator2 (LinkedList<Time> visited){ | ||
189 | 686 | // Interval result = new Interval(0000, 0000); | ||
190 | 687 | // Time first = visited.getFirst(); | ||
191 | 688 | // Time last = visited.getLast(); | ||
192 | 689 | // for(Time time : visited){ | ||
193 | 690 | // if(time != first || time != last){ | ||
194 | 691 | // if (time.getDuration().isSpecified()) | ||
195 | 692 | // result = result.add(time.getDuration()); | ||
196 | 693 | // else{ | ||
197 | 694 | // result = result.add(defaultDuration); | ||
198 | 695 | // } | ||
199 | 696 | // } | ||
200 | 697 | // } | ||
201 | 698 | // return result; | ||
202 | 699 | // } | ||
203 | 700 | |||
204 | 701 | private LinkedList<Time> getCausalPreset(Time n, Collection<Node> nodes){ | 746 | private LinkedList<Time> getCausalPreset(Time n, Collection<Node> nodes){ |
205 | 702 | LinkedList<Time> preSet = new LinkedList<Time>(); | 747 | LinkedList<Time> preSet = new LinkedList<Time>(); |
206 | 703 | LinkedList<Time> result = new LinkedList<Time>(); | 748 | LinkedList<Time> result = new LinkedList<Time>(); |
207 | 704 | 749 | ||
208 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/gui/ParallelSimDialog.java' | |||
209 | --- SONPlugin/src/org/workcraft/plugins/son/gui/ParallelSimDialog.java 2015-10-05 19:59:54 +0000 | |||
210 | +++ SONPlugin/src/org/workcraft/plugins/son/gui/ParallelSimDialog.java 2015-12-25 22:57:38 +0000 | |||
211 | @@ -220,7 +220,7 @@ | |||
212 | 220 | @Override | 220 | @Override |
213 | 221 | public void actionPerformed(ActionEvent e) { | 221 | public void actionPerformed(ActionEvent e) { |
214 | 222 | run = 1; | 222 | run = 1; |
216 | 223 | net.refreshColor(); | 223 | net.refreshAllColor(); |
217 | 224 | setVisible(false); | 224 | setVisible(false); |
218 | 225 | } | 225 | } |
219 | 226 | }); | 226 | }); |
220 | @@ -231,7 +231,7 @@ | |||
221 | 231 | @Override | 231 | @Override |
222 | 232 | public void actionPerformed(ActionEvent e) { | 232 | public void actionPerformed(ActionEvent e) { |
223 | 233 | run = 2; | 233 | run = 2; |
225 | 234 | net.refreshColor(); | 234 | net.refreshAllColor(); |
226 | 235 | setVisible(false); | 235 | setVisible(false); |
227 | 236 | } | 236 | } |
228 | 237 | }); | 237 | }); |
229 | @@ -304,7 +304,7 @@ | |||
230 | 304 | { | 304 | { |
231 | 305 | public void windowClosing(WindowEvent e) | 305 | public void windowClosing(WindowEvent e) |
232 | 306 | { | 306 | { |
234 | 307 | getSONModel().refreshColor(); | 307 | getSONModel().refreshAllColor(); |
235 | 308 | } | 308 | } |
236 | 309 | }); | 309 | }); |
237 | 310 | 310 | ||
238 | 311 | 311 | ||
239 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/gui/TimeConsistencyDialog.java' | |||
240 | --- SONPlugin/src/org/workcraft/plugins/son/gui/TimeConsistencyDialog.java 2015-10-05 19:59:54 +0000 | |||
241 | +++ SONPlugin/src/org/workcraft/plugins/son/gui/TimeConsistencyDialog.java 2015-12-25 22:57:38 +0000 | |||
242 | @@ -212,7 +212,7 @@ | |||
243 | 212 | 212 | ||
244 | 213 | selectionTabbedPane.addChangeListener(new ChangeListener() { | 213 | selectionTabbedPane.addChangeListener(new ChangeListener() { |
245 | 214 | public void stateChanged(ChangeEvent e) { | 214 | public void stateChanged(ChangeEvent e) { |
247 | 215 | net.refreshColor(); | 215 | net.refreshAllColor(); |
248 | 216 | addAllButton.setEnabled(true); | 216 | addAllButton.setEnabled(true); |
249 | 217 | removeAllButton.setEnabled(true); | 217 | removeAllButton.setEnabled(true); |
250 | 218 | int index = getTabIndex(); | 218 | int index = getTabIndex(); |
251 | 219 | 219 | ||
252 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/gui/TimeEstimatorDialog.java' | |||
253 | --- SONPlugin/src/org/workcraft/plugins/son/gui/TimeEstimatorDialog.java 2015-10-06 16:44:57 +0000 | |||
254 | +++ SONPlugin/src/org/workcraft/plugins/son/gui/TimeEstimatorDialog.java 2015-12-25 22:57:38 +0000 | |||
255 | @@ -49,7 +49,7 @@ | |||
256 | 49 | 49 | ||
257 | 50 | protected JPanel buttonsPanel, durationPanel; | 50 | protected JPanel buttonsPanel, durationPanel; |
258 | 51 | protected JButton runButton, cancelButton; | 51 | protected JButton runButton, cancelButton; |
260 | 52 | protected JCheckBox setDuration; | 52 | protected JCheckBox setDuration, intermediate; |
261 | 53 | protected Dimension buttonSize = new Dimension(80, 25); | 53 | protected Dimension buttonSize = new Dimension(80, 25); |
262 | 54 | protected int run = 0; | 54 | protected int run = 0; |
263 | 55 | 55 | ||
264 | @@ -82,18 +82,23 @@ | |||
265 | 82 | } | 82 | } |
266 | 83 | 83 | ||
267 | 84 | protected void createDurationPanel(){ | 84 | protected void createDurationPanel(){ |
269 | 85 | setDuration = new JCheckBox("Set default value for all unspecifed nodes"); | 85 | setDuration = new JCheckBox("Set default duration for all unspecifed nodes"); |
270 | 86 | setDuration.setSelected(false); | 86 | setDuration.setSelected(false); |
271 | 87 | setDuration.setLayout(new FlowLayout(FlowLayout.LEFT)); | 87 | setDuration.setLayout(new FlowLayout(FlowLayout.LEFT)); |
272 | 88 | 88 | ||
273 | 89 | intermediate = new JCheckBox("Set values for intermediate nodes"); | ||
274 | 90 | intermediate.setSelected(false); | ||
275 | 91 | intermediate.setLayout(new FlowLayout(FlowLayout.LEFT)); | ||
276 | 92 | |||
277 | 89 | defaultDurationPanel = new DefaultDurationPanel(settings.getDuration()); | 93 | defaultDurationPanel = new DefaultDurationPanel(settings.getDuration()); |
278 | 90 | defaultDurationPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); | 94 | defaultDurationPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); |
279 | 91 | 95 | ||
280 | 92 | durationPanel = new JPanel(); | 96 | durationPanel = new JPanel(); |
281 | 93 | //durationPanel.setBorder(BorderFactory.createTitledBorder("Default Duration Setting")); | 97 | //durationPanel.setBorder(BorderFactory.createTitledBorder("Default Duration Setting")); |
283 | 94 | durationPanel.setLayout(new GridLayout(2,0)); | 98 | durationPanel.setLayout(new GridLayout(3,0)); |
284 | 95 | durationPanel.add(defaultDurationPanel); | 99 | durationPanel.add(defaultDurationPanel); |
285 | 96 | durationPanel.add(setDuration); | 100 | durationPanel.add(setDuration); |
286 | 101 | durationPanel.add(intermediate); | ||
287 | 97 | } | 102 | } |
288 | 98 | 103 | ||
289 | 99 | protected void createScenarioTable(){ | 104 | protected void createScenarioTable(){ |
290 | @@ -173,7 +178,7 @@ | |||
291 | 173 | alg.setDefaultDuration(); | 178 | alg.setDefaultDuration(); |
292 | 174 | 179 | ||
293 | 175 | try { | 180 | try { |
295 | 176 | alg.twoDirEstimation(selection); | 181 | alg.twoDirEstimation(selection, intermediate.isSelected()); |
296 | 177 | } catch (AlternativeStructureException e1) { | 182 | } catch (AlternativeStructureException e1) { |
297 | 178 | errMsg(e1.getMessage()); | 183 | errMsg(e1.getMessage()); |
298 | 179 | } catch (TimeEstimationException e1) { | 184 | } catch (TimeEstimationException e1) { |
299 | 180 | 185 | ||
300 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/ColorResetTool.java' | |||
301 | --- SONPlugin/src/org/workcraft/plugins/son/tools/ColorResetTool.java 2014-09-29 17:07:11 +0000 | |||
302 | +++ SONPlugin/src/org/workcraft/plugins/son/tools/ColorResetTool.java 2015-12-25 22:57:38 +0000 | |||
303 | @@ -21,7 +21,7 @@ | |||
304 | 21 | 21 | ||
305 | 22 | public void run(WorkspaceEntry we){ | 22 | public void run(WorkspaceEntry we){ |
306 | 23 | SON net=(SON)we.getModelEntry().getMathModel(); | 23 | SON net=(SON)we.getModelEntry().getMathModel(); |
308 | 24 | net.refreshColor(); | 24 | net.refreshAllColor(); |
309 | 25 | } | 25 | } |
310 | 26 | 26 | ||
311 | 27 | } | 27 | } |
312 | 28 | 28 | ||
313 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/SONSimulationTool.java' | |||
314 | --- SONPlugin/src/org/workcraft/plugins/son/tools/SONSimulationTool.java 2015-10-14 18:26:17 +0000 | |||
315 | +++ SONPlugin/src/org/workcraft/plugins/son/tools/SONSimulationTool.java 2015-12-25 22:57:38 +0000 | |||
316 | @@ -863,7 +863,7 @@ | |||
317 | 863 | } | 863 | } |
318 | 864 | 864 | ||
319 | 865 | protected void setDecoration(Step enabled){ | 865 | protected void setDecoration(Step enabled){ |
321 | 866 | net.refreshColor(); | 866 | net.refreshAllColor(); |
322 | 867 | 867 | ||
323 | 868 | for(TransitionNode e : enabled){ | 868 | for(TransitionNode e : enabled){ |
324 | 869 | //e.setFillColor(CommonSimulationSettings.getEnabledForegroundColor()); | 869 | //e.setFillColor(CommonSimulationSettings.getEnabledForegroundColor()); |
325 | 870 | 870 | ||
326 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/ScenarioGeneratorTool.java' | |||
327 | --- SONPlugin/src/org/workcraft/plugins/son/tools/ScenarioGeneratorTool.java 2015-10-05 19:59:54 +0000 | |||
328 | +++ SONPlugin/src/org/workcraft/plugins/son/tools/ScenarioGeneratorTool.java 2015-12-25 22:57:38 +0000 | |||
329 | @@ -86,7 +86,7 @@ | |||
330 | 86 | //workcraft invoke this method before activate method | 86 | //workcraft invoke this method before activate method |
331 | 87 | visualNet = (VisualSON)editor.getModel(); | 87 | visualNet = (VisualSON)editor.getModel(); |
332 | 88 | net = (SON)visualNet.getMathModel(); | 88 | net = (SON)visualNet.getMathModel(); |
334 | 89 | net.refreshColor(); | 89 | net.refreshAllColor(); |
335 | 90 | 90 | ||
336 | 91 | startButton = SONGUI.createIconToggleButton(GUI.createIconFromSVG("images/icons/svg/son-scenario-start.svg"), "Generate"); | 91 | startButton = SONGUI.createIconToggleButton(GUI.createIconFromSVG("images/icons/svg/son-scenario-start.svg"), "Generate"); |
337 | 92 | resetButton = GUI.createIconButton(GUI.createIconFromSVG("images/icons/svg/son-scenario-reset.svg"), "Reset"); | 92 | resetButton = GUI.createIconButton(GUI.createIconFromSVG("images/icons/svg/son-scenario-reset.svg"), "Reset"); |
338 | @@ -237,7 +237,7 @@ | |||
339 | 237 | }else{ | 237 | }else{ |
340 | 238 | scenarioRef.clear(); | 238 | scenarioRef.clear(); |
341 | 239 | net.clearMarking(); | 239 | net.clearMarking(); |
343 | 240 | net.refreshColor(); | 240 | net.refreshAllColor(); |
344 | 241 | scenarioTable.setIsCellColor(false); | 241 | scenarioTable.setIsCellColor(false); |
345 | 242 | saveList.setPosition(0); | 242 | saveList.setPosition(0); |
346 | 243 | scenarioGenerator(editor); | 243 | scenarioGenerator(editor); |
347 | @@ -272,7 +272,7 @@ | |||
348 | 272 | BlockConnector.blockInternalConnector(visualNet); | 272 | BlockConnector.blockInternalConnector(visualNet); |
349 | 273 | exportScenarios(); | 273 | exportScenarios(); |
350 | 274 | scenarioRef.clear(); | 274 | scenarioRef.clear(); |
352 | 275 | net.refreshColor(); | 275 | net.refreshAllColor(); |
353 | 276 | net.clearMarking(); | 276 | net.clearMarking(); |
354 | 277 | } | 277 | } |
355 | 278 | 278 | ||
356 | 279 | 279 | ||
357 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/StructurePropertyChecker.java' | |||
358 | --- SONPlugin/src/org/workcraft/plugins/son/tools/StructurePropertyChecker.java 2015-09-27 18:17:29 +0000 | |||
359 | +++ SONPlugin/src/org/workcraft/plugins/son/tools/StructurePropertyChecker.java 2015-12-25 22:57:38 +0000 | |||
360 | @@ -35,7 +35,7 @@ | |||
361 | 35 | final Framework framework = Framework.getInstance(); | 35 | final Framework framework = Framework.getInstance(); |
362 | 36 | final MainWindow mainWindow = framework.getMainWindow(); | 36 | final MainWindow mainWindow = framework.getMainWindow(); |
363 | 37 | 37 | ||
365 | 38 | net.refreshColor(); | 38 | net.refreshAllColor(); |
366 | 39 | StructureVerifyDialog dialog = new StructureVerifyDialog(mainWindow, we); | 39 | StructureVerifyDialog dialog = new StructureVerifyDialog(mainWindow, we); |
367 | 40 | GUI.centerToParent(dialog, mainWindow); | 40 | GUI.centerToParent(dialog, mainWindow); |
368 | 41 | dialog.setVisible(true); | 41 | dialog.setVisible(true); |
369 | @@ -46,6 +46,6 @@ | |||
370 | 46 | SONMainTask sonTask = new SONMainTask(dialog.getSettings(), we); | 46 | SONMainTask sonTask = new SONMainTask(dialog.getSettings(), we); |
371 | 47 | framework.getTaskManager().queue(sonTask, "Verification"); | 47 | framework.getTaskManager().queue(sonTask, "Verification"); |
372 | 48 | } | 48 | } |
374 | 49 | net.refreshColor(); | 49 | net.refreshAllColor(); |
375 | 50 | } | 50 | } |
376 | 51 | } | 51 | } |
377 | 52 | 52 | ||
378 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/TimeConsistencyChecker.java' | |||
379 | --- SONPlugin/src/org/workcraft/plugins/son/tools/TimeConsistencyChecker.java 2015-09-27 18:17:29 +0000 | |||
380 | +++ SONPlugin/src/org/workcraft/plugins/son/tools/TimeConsistencyChecker.java 2015-12-25 22:57:38 +0000 | |||
381 | @@ -40,7 +40,7 @@ | |||
382 | 40 | SON net = (SON)we.getModelEntry().getMathModel(); | 40 | SON net = (SON)we.getModelEntry().getMathModel(); |
383 | 41 | 41 | ||
384 | 42 | BlockConnector.blockBoundingConnector(visualNet); | 42 | BlockConnector.blockBoundingConnector(visualNet); |
386 | 43 | net.refreshColor(); | 43 | net.refreshAllColor(); |
387 | 44 | TimeConsistencyDialog dialog = new TimeConsistencyDialog(mainWindow, we); | 44 | TimeConsistencyDialog dialog = new TimeConsistencyDialog(mainWindow, we); |
388 | 45 | GUI.centerToParent(dialog, mainWindow); | 45 | GUI.centerToParent(dialog, mainWindow); |
389 | 46 | dialog.setVisible(true); | 46 | dialog.setVisible(true); |
390 | @@ -52,7 +52,7 @@ | |||
391 | 52 | } | 52 | } |
392 | 53 | 53 | ||
393 | 54 | if(dialog.getTabIndex() !=1){ | 54 | if(dialog.getTabIndex() !=1){ |
395 | 55 | net.refreshColor(); | 55 | net.refreshAllColor(); |
396 | 56 | } | 56 | } |
397 | 57 | 57 | ||
398 | 58 | BlockConnector.blockInternalConnector(visualNet); | 58 | BlockConnector.blockInternalConnector(visualNet); |
399 | 59 | 59 | ||
400 | === modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/TimeValueSetterTool.java' | |||
401 | --- SONPlugin/src/org/workcraft/plugins/son/tools/TimeValueSetterTool.java 2015-10-06 23:26:41 +0000 | |||
402 | +++ SONPlugin/src/org/workcraft/plugins/son/tools/TimeValueSetterTool.java 2015-12-25 22:57:38 +0000 | |||
403 | @@ -553,7 +553,7 @@ | |||
404 | 553 | timeAlg = new ConsistencyAlg(net); | 553 | timeAlg = new ConsistencyAlg(net); |
405 | 554 | settings = new TimeEstimatorSettings(); | 554 | settings = new TimeEstimatorSettings(); |
406 | 555 | 555 | ||
408 | 556 | net.refreshColor(); | 556 | net.refreshAllColor(); |
409 | 557 | net.clearMarking(); | 557 | net.clearMarking(); |
410 | 558 | 558 | ||
411 | 559 | //set property states for initial and final states | 559 | //set property states for initial and final states |
412 | @@ -574,13 +574,13 @@ | |||
413 | 574 | timeAlg.removeProperties(); | 574 | timeAlg.removeProperties(); |
414 | 575 | } | 575 | } |
415 | 576 | SONSettings.setTimeVisibility(visibility); | 576 | SONSettings.setTimeVisibility(visibility); |
417 | 577 | net.refreshColor(); | 577 | net.refreshAllColor(); |
418 | 578 | net.clearMarking(); | 578 | net.clearMarking(); |
419 | 579 | } | 579 | } |
420 | 580 | 580 | ||
421 | 581 | @Override | 581 | @Override |
422 | 582 | public void mousePressed(GraphEditorMouseEvent e){ | 582 | public void mousePressed(GraphEditorMouseEvent e){ |
424 | 583 | net.refreshColor(); | 583 | net.refreshNodeColor(); |
425 | 584 | 584 | ||
426 | 585 | Node node = HitMan.hitTestForConnection(e.getPosition(), e.getModel().getRoot()); | 585 | Node node = HitMan.hitTestForConnection(e.getPosition(), e.getModel().getRoot()); |
427 | 586 | if( node instanceof VisualSONConnection){ | 586 | if( node instanceof VisualSONConnection){ |
428 | @@ -591,6 +591,7 @@ | |||
429 | 591 | if(con.getSemantics()==Semantics.PNLINE){ | 591 | if(con.getSemantics()==Semantics.PNLINE){ |
430 | 592 | ((VisualSONConnection) node).setColor(selectedColor); | 592 | ((VisualSONConnection) node).setColor(selectedColor); |
431 | 593 | updateTimePanel(e.getEditor(), node); | 593 | updateTimePanel(e.getEditor(), node); |
432 | 594 | net.setTimeColor(selection, Color.BLACK); | ||
433 | 594 | return; | 595 | return; |
434 | 595 | } | 596 | } |
435 | 596 | } | 597 | } |
436 | @@ -603,6 +604,7 @@ | |||
437 | 603 | estimatorButton.setEnabled(true); | 604 | estimatorButton.setEnabled(true); |
438 | 604 | ((VisualBlock) node2).setForegroundColor(selectedColor); | 605 | ((VisualBlock) node2).setForegroundColor(selectedColor); |
439 | 605 | updateTimePanel(e.getEditor(), node2); | 606 | updateTimePanel(e.getEditor(), node2); |
440 | 607 | net.setTimeColor(selection, Color.BLACK); | ||
441 | 606 | return; | 608 | return; |
442 | 607 | } | 609 | } |
443 | 608 | } | 610 | } |
444 | @@ -622,6 +624,7 @@ | |||
445 | 622 | visualSelection = node3; | 624 | visualSelection = node3; |
446 | 623 | ((VisualComponent) node3).setForegroundColor(selectedColor); | 625 | ((VisualComponent) node3).setForegroundColor(selectedColor); |
447 | 624 | updateTimePanel(e.getEditor(), node3); | 626 | updateTimePanel(e.getEditor(), node3); |
448 | 627 | net.setTimeColor(selection, Color.BLACK); | ||
449 | 625 | } | 628 | } |
450 | 626 | } | 629 | } |
451 | 627 | 630 |