~cpn-gui/tapaal/transportArc

« back to all changes in this revision

Viewing changes to src/pipe/gui/graphicElements/cpn/ColoredTransportArcComponent.java

  • Committer: Mark Glavind
  • Date: 2019-03-13 14:11:55 UTC
  • Revision ID: mglavi14@student.aau.dk-20190313141155-236fi45zomgojr11
changed coloredTransport label to reflect TACPN and updated toString for colored time constraints

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import dk.aau.cs.gui.Context;
4
4
import dk.aau.cs.model.tapn.Colored.Color;
5
5
import dk.aau.cs.model.tapn.Colored.ColoredTimeInterval;
 
6
import dk.aau.cs.model.tapn.Colored.ColoredTransportArc;
6
7
import dk.aau.cs.model.tapn.Colored.Expressions.ArcExpression;
7
8
import pipe.gui.CreateGui;
8
9
import pipe.gui.graphicElements.PlaceTransitionObject;
23
24
    }
24
25
 
25
26
    @Override
 
27
    public void updateLabel(boolean displayConstantNames) {
 
28
        String labelText = "";
 
29
        if (underlyingTransportArc() != null) {
 
30
            if (((ColoredTransportArc)underlyingTransportArc()).getExpression() != null)
 
31
                labelText += ((ColoredTransportArc)underlyingTransportArc()).getExpression().toString() + "\n";
 
32
 
 
33
            List<ColoredTimeInterval> ctiList = ((ColoredTransportArc)underlyingTransportArc()).getCtiList();
 
34
            for (ColoredTimeInterval timeInterval : ctiList) {
 
35
                if (timeInterval != null)
 
36
                    labelText += timeInterval.toString() + "\n";
 
37
            }
 
38
        }
 
39
        label.setText(labelText);
 
40
    }
 
41
    
 
42
    
 
43
    @Override
26
44
    public void showTimeIntervalEditor() {
27
45
        EscapableDialog guiDialog = new EscapableDialog(CreateGui.getApp(), "Edit Transport Arc", true);
28
46