48
48
private static final long serialVersionUID = 5588142404135607382L;
50
protected Polygon head = new Polygon(new int[] { 0, 5, 0, -5 }, new int[] {
51
0, -10, -7, -10 }, 4);
53
50
private dk.aau.cs.model.tapn.TimedOutputArc outputArc;
168
public void paintComponent(Graphics g) {
169
super.paintComponent(g);
170
Graphics2D g2 = (Graphics2D) g;
172
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
173
RenderingHints.VALUE_ANTIALIAS_ON);
175
g2.translate(COMPONENT_DRAW_OFFSET + zoomGrow
176
- myPath.getBounds().getX(), COMPONENT_DRAW_OFFSET + zoomGrow
177
- myPath.getBounds().getY());
179
AffineTransform reset = g2.getTransform();
181
if (selected && !ignoreSelection) {
182
g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
183
this.label.setForeground(Pipe.SELECTION_LINE_COLOUR);
185
g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
186
this.label.setForeground(Pipe.ELEMENT_LINE_COLOUR);
189
g2.setStroke(new BasicStroke(0.01f * zoom));
192
g2.translate(myPath.getPoint(myPath.getEndIndex()).getX(), myPath
193
.getPoint(myPath.getEndIndex()).getY());
195
g2.rotate(myPath.getEndAngle() + Math.PI);
196
g2.setColor(java.awt.Color.WHITE);
198
g2.transform(Zoomer.getTransform(zoom));
199
g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
201
if (selected && !ignoreSelection) {
202
g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
203
this.label.setForeground(Pipe.SELECTION_LINE_COLOUR);
205
g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
206
this.label.setForeground(Pipe.ELEMENT_LINE_COLOUR);
209
g2.setStroke(new BasicStroke(0.8f));
210
g2.fillPolygon(head);
215
166
public dk.aau.cs.model.tapn.TimedOutputArc underlyingArc() {
216
167
return outputArc;
220
171
this.outputArc = outputArc;
223
public TimedOutputArcComponent copy(TimedArcPetriNet tapn, DataLayer guiModel, Hashtable<PlaceTransitionObject, PlaceTransitionObject> oldToNewMapping) {
174
public TimedOutputArcComponent copy(TimedArcPetriNet tapn, Hashtable<PlaceTransitionObject, PlaceTransitionObject> oldToNewMapping) {
224
175
TimedOutputArcComponent newCopyArc = new TimedOutputArcComponent(this);
225
176
newCopyArc.setSource(oldToNewMapping.get(this.getSource()));
226
177
newCopyArc.setTarget(oldToNewMapping.get(this.getTarget()));