File tree Expand file tree Collapse file tree 2 files changed +16
-11
lines changed
src/main/java/nl/utwente/groove/gui Expand file tree Collapse file tree 2 files changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -470,21 +470,16 @@ private Collection<LTSJCell> getTransitionCells(GraphTransition trans) {
470
470
}
471
471
472
472
/** Returns the traces from the given set of states to the start state. */
473
- public Set <LTSJCell > findTraces (Iterable <GraphState > states ) {
474
- Set <GraphTransition > simulatorTrace = new HashSet <>();
475
- Set <LTSJCell > result = new HashSet <>();
476
- LTSJModel model = getNonNullModel ();
473
+ public Set <GraphTransition > findTraces (Iterable <GraphState > states ) {
474
+ Set <GraphTransition > result = new HashSet <>();
477
475
for (GraphState state : states ) {
478
476
while (state instanceof GraphNextState ) {
479
- result .add ((LTSJVertex ) model .getJCellForNode (state ));
480
477
GraphTransition trans = ((GraphNextState ) state ).getInTransition ();
481
- result .add ((LTSJEdge ) model .getJCellForEdge (trans ));
482
- simulatorTrace .add (trans );
478
+ result .add (trans );
483
479
state = trans .source ();
484
480
}
485
- result .add ((LTSJCell ) model .getJCellForNode (state ));
486
481
}
487
- getSimulatorModel ().setTrace (simulatorTrace );
482
+ getSimulatorModel ().setTrace (result );
488
483
return result ;
489
484
}
490
485
Original file line number Diff line number Diff line change 57
57
import nl .utwente .groove .io .GrooveFileChooser ;
58
58
import nl .utwente .groove .io .HTMLConverter ;
59
59
import nl .utwente .groove .lts .GTS ;
60
+ import nl .utwente .groove .lts .GraphTransition ;
60
61
import nl .utwente .groove .util .parse .FormatException ;
61
62
62
63
/**
@@ -699,10 +700,19 @@ public void actionPerformed(ActionEvent evt) {
699
700
700
701
@ Override
701
702
protected boolean isInvolved (JCell <@ NonNull GTS > jCell ) {
702
- return this .trace .contains (jCell );
703
+ boolean result = false ;
704
+ if (jCell instanceof LTSJCell ltsJCell ) {
705
+ for (var t : ltsJCell .getEdges ()) {
706
+ result = this .trace .contains (t );
707
+ if (result ) {
708
+ break ;
709
+ }
710
+ }
711
+ }
712
+ return result ;
703
713
}
704
714
705
- private Set <LTSJCell > trace ;
715
+ private Set <GraphTransition > trace ;
706
716
}
707
717
708
718
/**
You can’t perform that action at this time.
0 commit comments