Merge lp:~libowen96/workcraft/trunk-son-time-intermediate into lp:~libowen96/workcraft/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
Reviewer Review Type Date Requested Status
Bowen Li Pending
Review via email: mp+281354@code.launchpad.net
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
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/SON.java'
--- SONPlugin/src/org/workcraft/plugins/son/SON.java 2015-10-05 19:59:54 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/SON.java 2015-12-25 22:57:38 +0000
@@ -185,7 +185,7 @@
185 }185 }
186 }186 }
187 187
188 public void refreshColor(){188 public void refreshAllColor(){
189 for(Node n: getComponents()){189 for(Node n: getComponents()){
190 setFillColor(n,CommonVisualSettings.getFillColor());190 setFillColor(n,CommonVisualSettings.getFillColor());
191 setForegroundColor(n, CommonVisualSettings.getBorderColor());191 setForegroundColor(n, CommonVisualSettings.getBorderColor());
@@ -206,6 +206,25 @@
206 }206 }
207 }207 }
208 208
209 public void refreshNodeColor(){
210 for(Node n: getComponents()){
211 setFillColor(n,CommonVisualSettings.getFillColor());
212 setForegroundColor(n, CommonVisualSettings.getBorderColor());
213 setTokenColor(n, Color.BLACK);
214 }
215 for (ONGroup group : this.getGroups()){
216 setForegroundColor(group, SONSettings.getGroupForegroundColor());
217 }
218
219 for (SONConnection con : this.getSONConnections()){
220 setForegroundColor(con, CommonVisualSettings.getBorderColor());
221 }
222 for (Block block : this.getBlocks()){
223 setFillColor(block, CommonVisualSettings.getFillColor());
224 setForegroundColor(block, CommonVisualSettings.getBorderColor());
225 }
226 }
227
209 public void setTimeColor(Node n, Color color){228 public void setTimeColor(Node n, Color color){
210 if(n instanceof PlaceNode){229 if(n instanceof PlaceNode){
211 ((PlaceNode) n).setDurationColor(color);230 ((PlaceNode) n).setDurationColor(color);
212231
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/algorithm/EstimationAlg.java'
--- SONPlugin/src/org/workcraft/plugins/son/algorithm/EstimationAlg.java 2015-10-09 16:21:17 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/algorithm/EstimationAlg.java 2015-12-25 22:57:38 +0000
@@ -41,6 +41,8 @@
41 private Before before;41 private Before before;
42 private Granularity g;42 private Granularity g;
43 private Color color =Color.ORANGE;43 private Color color =Color.ORANGE;
44 private Collection<Path> fwdPaths = new ArrayList<Path>();
45 private Collection<Path> bwdPaths = new ArrayList<Path>();
44 46
45 public EstimationAlg(SON net, Interval d, Granularity g, ScenarioRef s) {47 public EstimationAlg(SON net, Interval d, Granularity g, ScenarioRef s) {
46 super(net);48 super(net);
@@ -83,7 +85,7 @@
83 return scenario;85 return scenario;
84 }86 }
85 87
86 public void twoDirEstimation(Node n) throws AlternativeStructureException, TimeEstimationException, TimeOutOfBoundsException, TimeInconsistencyException{88 public void twoDirEstimation(Node n, boolean interm) throws AlternativeStructureException, TimeEstimationException, TimeOutOfBoundsException, TimeInconsistencyException{
87 ConsistencyAlg alg = new ConsistencyAlg(net);89 ConsistencyAlg alg = new ConsistencyAlg(net);
88 Time node = null;90 Time node = null;
89 91
@@ -242,7 +244,7 @@
242 }else if(start == null && end == null){244 }else if(start == null && end == null){
243 throw new TimeEstimationException("cannot find causally time values.");245 throw new TimeEstimationException("cannot find causally time values.");
244 }246 }
245 247
246 if(iCons.size() == 0){248 if(iCons.size() == 0){
247 node.setStartTime(start);249 node.setStartTime(start);
248 if(node instanceof Condition){250 if(node instanceof Condition){
@@ -256,7 +258,7 @@
256 ((Condition) node).setEndTimeColor(color);258 ((Condition) node).setEndTimeColor(color);
257 }259 }
258 } 260 }
259261
260 iCons.removeAll(iSpec);262 iCons.removeAll(iSpec);
261 for(SONConnection con : iCons){263 for(SONConnection con : iCons){
262 con.setTime(start);264 con.setTime(start);
@@ -268,12 +270,54 @@
268 con.setTime(end);270 con.setTime(end);
269 con.setTimeLabelColor(color);271 con.setTimeLabelColor(color);
270 }272 }
273
274 if(interm) intermediateEst();
275
271 if(!alg.nodeConsistency(node, start, end, node.getDuration(), g).isEmpty()){ 276 if(!alg.nodeConsistency(node, start, end, node.getDuration(), g).isEmpty()){
272 throw new TimeInconsistencyException("Warning: Estimated start and end times are inconsistent.");277 throw new TimeInconsistencyException("Warning: Estimated start and end times are inconsistent.");
273 }278 }
274 } 279 }
275 }280 }
281
282 private void intermediateEst() throws TimeOutOfBoundsException{
276283
284 for(Path path : fwdPaths){
285 for(int i = 1; i < path.size(); i++){
286 Time n = (Time)path.get(i);
287 if(!n.getDuration().isSpecified()){
288 n.setDuration(defaultDuration);
289 }
290 SONConnection preCon = net.getSONConnection(path.get(i-1), path.get(i));
291 Interval time = granularity.plusTD(preCon.getTime(), n.getDuration());
292 if( (i+1) < path.size()){
293 SONConnection postCon = net.getSONConnection(path.get(i), path.get(i+1));
294 postCon.setTime(time);
295 postCon.setTimeLabelColor(color);
296 }
297 }
298 }
299
300 fwdPaths.clear();
301
302 for(Path path : bwdPaths){
303 for(int i = 1; i < path.size(); i++){
304 Time n = (Time)path.get(i);
305 if(!n.getDuration().isSpecified()){
306 n.setDuration(defaultDuration);
307 }
308 SONConnection preCon = net.getSONConnection(path.get(i-1), path.get(i));
309 Interval time = granularity.subtractTD(preCon.getTime(), n.getDuration());
310 if( (i+1) < path.size()){
311 SONConnection postCon = net.getSONConnection(path.get(i), path.get(i+1));
312 postCon.setTime(time);
313 postCon.setTimeLabelColor(color);
314 }
315 }
316 }
317
318 bwdPaths.clear();
319
320 }
277 321
278 private boolean hasConflict(){322 private boolean hasConflict(){
279 RelationAlgorithm alg = new RelationAlgorithm(net);323 RelationAlgorithm alg = new RelationAlgorithm(net);
@@ -596,6 +640,10 @@
596 result[0] = visited.getLast().getEndTime();640 result[0] = visited.getLast().getEndTime();
597 result[1] = durationAccumulator1(visited);641 result[1] = durationAccumulator1(visited);
598 resultTimeAndDuration.add(result); 642 resultTimeAndDuration.add(result);
643
644 Path path = new Path();
645 path.addAll(visited);
646 fwdPaths.add(path);
599 }647 }
600 648
601 // examine post nodes649 // examine post nodes
@@ -611,6 +659,11 @@
611 result[0] = con.getTime();659 result[0] = con.getTime();
612 result[1] = durationAccumulator1(visited);660 result[1] = durationAccumulator1(visited);
613 resultTimeAndDuration.add(result); 661 resultTimeAndDuration.add(result);
662
663 Path path = new Path();
664 visited.addLast(node);
665 path.addAll(visited);
666 fwdPaths.add(path);
614 }667 }
615 }668 }
616 // in depth-first, recursion needs to come after visiting post nodes669 // in depth-first, recursion needs to come after visiting post nodes
@@ -633,8 +686,11 @@
633 Interval[] result = new Interval[2];686 Interval[] result = new Interval[2];
634 result[0] = visited.getLast().getStartTime();687 result[0] = visited.getLast().getStartTime();
635 result[1] = durationAccumulator1(visited);688 result[1] = durationAccumulator1(visited);
636
637 resultTimeAndDuration.add(result);689 resultTimeAndDuration.add(result);
690
691 Path path = new Path();
692 path.addAll(visited);
693 bwdPaths.add(path);
638 }694 }
639 695
640 // examine post nodes696 // examine post nodes
@@ -649,7 +705,12 @@
649 Interval[] result = new Interval[2];705 Interval[] result = new Interval[2];
650 result[0] = con.getTime();706 result[0] = con.getTime();
651 result[1] = durationAccumulator1(visited);707 result[1] = durationAccumulator1(visited);
652 resultTimeAndDuration.add(result); 708 resultTimeAndDuration.add(result);
709
710 Path path = new Path();
711 visited.addLast(node);
712 path.addAll(visited);
713 bwdPaths.add(path);
653 }714 }
654 }715 }
655 // in depth-first, recursion needs to come after visiting post nodes716 // in depth-first, recursion needs to come after visiting post nodes
@@ -682,22 +743,6 @@
682 return result;743 return result;
683 }744 }
684 745
685// private Interval durationAccumulator2 (LinkedList<Time> visited){
686// Interval result = new Interval(0000, 0000);
687// Time first = visited.getFirst();
688// Time last = visited.getLast();
689// for(Time time : visited){
690// if(time != first || time != last){
691// if (time.getDuration().isSpecified())
692// result = result.add(time.getDuration());
693// else{
694// result = result.add(defaultDuration);
695// }
696// }
697// }
698// return result;
699// }
700
701 private LinkedList<Time> getCausalPreset(Time n, Collection<Node> nodes){746 private LinkedList<Time> getCausalPreset(Time n, Collection<Node> nodes){
702 LinkedList<Time> preSet = new LinkedList<Time>();747 LinkedList<Time> preSet = new LinkedList<Time>();
703 LinkedList<Time> result = new LinkedList<Time>();748 LinkedList<Time> result = new LinkedList<Time>();
704749
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/gui/ParallelSimDialog.java'
--- SONPlugin/src/org/workcraft/plugins/son/gui/ParallelSimDialog.java 2015-10-05 19:59:54 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/gui/ParallelSimDialog.java 2015-12-25 22:57:38 +0000
@@ -220,7 +220,7 @@
220 @Override220 @Override
221 public void actionPerformed(ActionEvent e) {221 public void actionPerformed(ActionEvent e) {
222 run = 1;222 run = 1;
223 net.refreshColor();223 net.refreshAllColor();
224 setVisible(false); 224 setVisible(false);
225 }225 }
226 });226 });
@@ -231,7 +231,7 @@
231 @Override231 @Override
232 public void actionPerformed(ActionEvent e) {232 public void actionPerformed(ActionEvent e) {
233 run = 2;233 run = 2;
234 net.refreshColor();234 net.refreshAllColor();
235 setVisible(false); 235 setVisible(false);
236 }236 }
237 });237 });
@@ -304,7 +304,7 @@
304 {304 {
305 public void windowClosing(WindowEvent e)305 public void windowClosing(WindowEvent e)
306 {306 {
307 getSONModel().refreshColor();307 getSONModel().refreshAllColor();
308 }308 }
309 });309 });
310 310
311311
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/gui/TimeConsistencyDialog.java'
--- SONPlugin/src/org/workcraft/plugins/son/gui/TimeConsistencyDialog.java 2015-10-05 19:59:54 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/gui/TimeConsistencyDialog.java 2015-12-25 22:57:38 +0000
@@ -212,7 +212,7 @@
212 212
213 selectionTabbedPane.addChangeListener(new ChangeListener() {213 selectionTabbedPane.addChangeListener(new ChangeListener() {
214 public void stateChanged(ChangeEvent e) {214 public void stateChanged(ChangeEvent e) {
215 net.refreshColor();215 net.refreshAllColor();
216 addAllButton.setEnabled(true);216 addAllButton.setEnabled(true);
217 removeAllButton.setEnabled(true);217 removeAllButton.setEnabled(true);
218 int index = getTabIndex();218 int index = getTabIndex();
219219
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/gui/TimeEstimatorDialog.java'
--- SONPlugin/src/org/workcraft/plugins/son/gui/TimeEstimatorDialog.java 2015-10-06 16:44:57 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/gui/TimeEstimatorDialog.java 2015-12-25 22:57:38 +0000
@@ -49,7 +49,7 @@
49 49
50 protected JPanel buttonsPanel, durationPanel;50 protected JPanel buttonsPanel, durationPanel;
51 protected JButton runButton, cancelButton;51 protected JButton runButton, cancelButton;
52 protected JCheckBox setDuration;52 protected JCheckBox setDuration, intermediate;
53 protected Dimension buttonSize = new Dimension(80, 25);53 protected Dimension buttonSize = new Dimension(80, 25);
54 protected int run = 0;54 protected int run = 0;
55 55
@@ -82,18 +82,23 @@
82 }82 }
83 83
84 protected void createDurationPanel(){ 84 protected void createDurationPanel(){
85 setDuration = new JCheckBox("Set default value for all unspecifed nodes");85 setDuration = new JCheckBox("Set default duration for all unspecifed nodes");
86 setDuration.setSelected(false);86 setDuration.setSelected(false);
87 setDuration.setLayout(new FlowLayout(FlowLayout.LEFT));87 setDuration.setLayout(new FlowLayout(FlowLayout.LEFT));
88 88
89 intermediate = new JCheckBox("Set values for intermediate nodes");
90 intermediate.setSelected(false);
91 intermediate.setLayout(new FlowLayout(FlowLayout.LEFT));
92
89 defaultDurationPanel = new DefaultDurationPanel(settings.getDuration());93 defaultDurationPanel = new DefaultDurationPanel(settings.getDuration());
90 defaultDurationPanel.setLayout(new FlowLayout(FlowLayout.LEFT));94 defaultDurationPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
91 95
92 durationPanel = new JPanel();96 durationPanel = new JPanel();
93 //durationPanel.setBorder(BorderFactory.createTitledBorder("Default Duration Setting"));97 //durationPanel.setBorder(BorderFactory.createTitledBorder("Default Duration Setting"));
94 durationPanel.setLayout(new GridLayout(2,0));98 durationPanel.setLayout(new GridLayout(3,0));
95 durationPanel.add(defaultDurationPanel);99 durationPanel.add(defaultDurationPanel);
96 durationPanel.add(setDuration);100 durationPanel.add(setDuration);
101 durationPanel.add(intermediate);
97 }102 }
98103
99 protected void createScenarioTable(){104 protected void createScenarioTable(){
@@ -173,7 +178,7 @@
173 alg.setDefaultDuration();178 alg.setDefaultDuration();
174 179
175 try {180 try {
176 alg.twoDirEstimation(selection);181 alg.twoDirEstimation(selection, intermediate.isSelected());
177 } catch (AlternativeStructureException e1) {182 } catch (AlternativeStructureException e1) {
178 errMsg(e1.getMessage());183 errMsg(e1.getMessage());
179 } catch (TimeEstimationException e1) {184 } catch (TimeEstimationException e1) {
180185
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/ColorResetTool.java'
--- SONPlugin/src/org/workcraft/plugins/son/tools/ColorResetTool.java 2014-09-29 17:07:11 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/tools/ColorResetTool.java 2015-12-25 22:57:38 +0000
@@ -21,7 +21,7 @@
21 21
22 public void run(WorkspaceEntry we){22 public void run(WorkspaceEntry we){
23 SON net=(SON)we.getModelEntry().getMathModel();23 SON net=(SON)we.getModelEntry().getMathModel();
24 net.refreshColor();24 net.refreshAllColor();
25 }25 }
26 26
27}27}
2828
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/SONSimulationTool.java'
--- SONPlugin/src/org/workcraft/plugins/son/tools/SONSimulationTool.java 2015-10-14 18:26:17 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/tools/SONSimulationTool.java 2015-12-25 22:57:38 +0000
@@ -863,7 +863,7 @@
863 }863 }
864 864
865 protected void setDecoration(Step enabled){865 protected void setDecoration(Step enabled){
866 net.refreshColor();866 net.refreshAllColor();
867 867
868 for(TransitionNode e : enabled){868 for(TransitionNode e : enabled){
869 //e.setFillColor(CommonSimulationSettings.getEnabledForegroundColor());869 //e.setFillColor(CommonSimulationSettings.getEnabledForegroundColor());
870870
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/ScenarioGeneratorTool.java'
--- SONPlugin/src/org/workcraft/plugins/son/tools/ScenarioGeneratorTool.java 2015-10-05 19:59:54 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/tools/ScenarioGeneratorTool.java 2015-12-25 22:57:38 +0000
@@ -86,7 +86,7 @@
86 //workcraft invoke this method before activate method86 //workcraft invoke this method before activate method
87 visualNet = (VisualSON)editor.getModel(); 87 visualNet = (VisualSON)editor.getModel();
88 net = (SON)visualNet.getMathModel();88 net = (SON)visualNet.getMathModel();
89 net.refreshColor();89 net.refreshAllColor();
90 90
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");
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");
@@ -237,7 +237,7 @@
237 }else{237 }else{
238 scenarioRef.clear();238 scenarioRef.clear();
239 net.clearMarking();239 net.clearMarking();
240 net.refreshColor();240 net.refreshAllColor();
241 scenarioTable.setIsCellColor(false);241 scenarioTable.setIsCellColor(false);
242 saveList.setPosition(0);242 saveList.setPosition(0);
243 scenarioGenerator(editor);243 scenarioGenerator(editor);
@@ -272,7 +272,7 @@
272 BlockConnector.blockInternalConnector(visualNet);272 BlockConnector.blockInternalConnector(visualNet);
273 exportScenarios(); 273 exportScenarios();
274 scenarioRef.clear();274 scenarioRef.clear();
275 net.refreshColor();275 net.refreshAllColor();
276 net.clearMarking();276 net.clearMarking();
277 }277 }
278 278
279279
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/StructurePropertyChecker.java'
--- SONPlugin/src/org/workcraft/plugins/son/tools/StructurePropertyChecker.java 2015-09-27 18:17:29 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/tools/StructurePropertyChecker.java 2015-12-25 22:57:38 +0000
@@ -35,7 +35,7 @@
35 final Framework framework = Framework.getInstance();35 final Framework framework = Framework.getInstance();
36 final MainWindow mainWindow = framework.getMainWindow();36 final MainWindow mainWindow = framework.getMainWindow();
3737
38 net.refreshColor();38 net.refreshAllColor();
39 StructureVerifyDialog dialog = new StructureVerifyDialog(mainWindow, we);39 StructureVerifyDialog dialog = new StructureVerifyDialog(mainWindow, we);
40 GUI.centerToParent(dialog, mainWindow);40 GUI.centerToParent(dialog, mainWindow);
41 dialog.setVisible(true);41 dialog.setVisible(true);
@@ -46,6 +46,6 @@
46 SONMainTask sonTask = new SONMainTask(dialog.getSettings(), we); 46 SONMainTask sonTask = new SONMainTask(dialog.getSettings(), we);
47 framework.getTaskManager().queue(sonTask, "Verification");47 framework.getTaskManager().queue(sonTask, "Verification");
48 }48 }
49 net.refreshColor();49 net.refreshAllColor();
50 }50 }
51}51}
5252
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/TimeConsistencyChecker.java'
--- SONPlugin/src/org/workcraft/plugins/son/tools/TimeConsistencyChecker.java 2015-09-27 18:17:29 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/tools/TimeConsistencyChecker.java 2015-12-25 22:57:38 +0000
@@ -40,7 +40,7 @@
40 SON net = (SON)we.getModelEntry().getMathModel();40 SON net = (SON)we.getModelEntry().getMathModel();
41 41
42 BlockConnector.blockBoundingConnector(visualNet);42 BlockConnector.blockBoundingConnector(visualNet);
43 net.refreshColor();43 net.refreshAllColor();
44 TimeConsistencyDialog dialog = new TimeConsistencyDialog(mainWindow, we);44 TimeConsistencyDialog dialog = new TimeConsistencyDialog(mainWindow, we);
45 GUI.centerToParent(dialog, mainWindow);45 GUI.centerToParent(dialog, mainWindow);
46 dialog.setVisible(true);46 dialog.setVisible(true);
@@ -52,7 +52,7 @@
52 }52 }
53 53
54 if(dialog.getTabIndex() !=1){54 if(dialog.getTabIndex() !=1){
55 net.refreshColor();55 net.refreshAllColor();
56 }56 }
57 57
58 BlockConnector.blockInternalConnector(visualNet);58 BlockConnector.blockInternalConnector(visualNet);
5959
=== modified file 'SONPlugin/src/org/workcraft/plugins/son/tools/TimeValueSetterTool.java'
--- SONPlugin/src/org/workcraft/plugins/son/tools/TimeValueSetterTool.java 2015-10-06 23:26:41 +0000
+++ SONPlugin/src/org/workcraft/plugins/son/tools/TimeValueSetterTool.java 2015-12-25 22:57:38 +0000
@@ -553,7 +553,7 @@
553 timeAlg = new ConsistencyAlg(net);553 timeAlg = new ConsistencyAlg(net);
554 settings = new TimeEstimatorSettings();554 settings = new TimeEstimatorSettings();
555 555
556 net.refreshColor();556 net.refreshAllColor();
557 net.clearMarking(); 557 net.clearMarking();
558 558
559 //set property states for initial and final states559 //set property states for initial and final states
@@ -574,13 +574,13 @@
574 timeAlg.removeProperties();574 timeAlg.removeProperties();
575 }575 }
576 SONSettings.setTimeVisibility(visibility);576 SONSettings.setTimeVisibility(visibility);
577 net.refreshColor();577 net.refreshAllColor();
578 net.clearMarking();578 net.clearMarking();
579 }579 }
580580
581 @Override581 @Override
582 public void mousePressed(GraphEditorMouseEvent e){ 582 public void mousePressed(GraphEditorMouseEvent e){
583 net.refreshColor();583 net.refreshNodeColor();
584 584
585 Node node = HitMan.hitTestForConnection(e.getPosition(), e.getModel().getRoot());585 Node node = HitMan.hitTestForConnection(e.getPosition(), e.getModel().getRoot());
586 if( node instanceof VisualSONConnection){586 if( node instanceof VisualSONConnection){
@@ -591,6 +591,7 @@
591 if(con.getSemantics()==Semantics.PNLINE){591 if(con.getSemantics()==Semantics.PNLINE){
592 ((VisualSONConnection) node).setColor(selectedColor);592 ((VisualSONConnection) node).setColor(selectedColor);
593 updateTimePanel(e.getEditor(), node);593 updateTimePanel(e.getEditor(), node);
594 net.setTimeColor(selection, Color.BLACK);
594 return;595 return;
595 }596 }
596 }597 }
@@ -603,6 +604,7 @@
603 estimatorButton.setEnabled(true);604 estimatorButton.setEnabled(true);
604 ((VisualBlock) node2).setForegroundColor(selectedColor);605 ((VisualBlock) node2).setForegroundColor(selectedColor);
605 updateTimePanel(e.getEditor(), node2);606 updateTimePanel(e.getEditor(), node2);
607 net.setTimeColor(selection, Color.BLACK);
606 return;608 return;
607 }609 }
608 }610 }
@@ -622,6 +624,7 @@
622 visualSelection = node3;624 visualSelection = node3;
623 ((VisualComponent) node3).setForegroundColor(selectedColor);625 ((VisualComponent) node3).setForegroundColor(selectedColor);
624 updateTimePanel(e.getEditor(), node3);626 updateTimePanel(e.getEditor(), node3);
627 net.setTimeColor(selection, Color.BLACK);
625 }628 }
626 }629 }
627 630

Subscribers

People subscribed via source and target branches

to all changes: