~tapaal-contributor/tapaal/change-export-batch-shortcut-1820012

« back to all changes in this revision

Viewing changes to src/pipe/gui/graphicElements/tapn/TimedOutputArcComponent.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2019-03-13 07:17:48 UTC
  • mfrom: (989 tapaal)
  • mto: This revision was merged to the branch mainline in revision 991.
  • Revision ID: kenneth@yrke.dk-20190313071748-fm6dc00yy27un3xd
Merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
         */
48
48
        private static final long serialVersionUID = 5588142404135607382L;
49
49
 
50
 
        protected Polygon head = new Polygon(new int[] { 0, 5, 0, -5 }, new int[] {
51
 
                        0, -10, -7, -10 }, 4);
52
 
 
53
50
        private dk.aau.cs.model.tapn.TimedOutputArc outputArc;
54
51
 
55
52
        /**
164
161
 
165
162
        }
166
163
 
167
 
        @Override
168
 
        public void paintComponent(Graphics g) {
169
 
                super.paintComponent(g);
170
 
                Graphics2D g2 = (Graphics2D) g;
171
 
 
172
 
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
173
 
                                RenderingHints.VALUE_ANTIALIAS_ON);
174
 
 
175
 
                g2.translate(COMPONENT_DRAW_OFFSET + zoomGrow
176
 
                                - myPath.getBounds().getX(), COMPONENT_DRAW_OFFSET + zoomGrow
177
 
                                - myPath.getBounds().getY());
178
 
 
179
 
                AffineTransform reset = g2.getTransform();
180
 
 
181
 
                if (selected && !ignoreSelection) {
182
 
                        g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
183
 
                        this.label.setForeground(Pipe.SELECTION_LINE_COLOUR);
184
 
                } else {
185
 
                        g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
186
 
                        this.label.setForeground(Pipe.ELEMENT_LINE_COLOUR);
187
 
                }
188
 
 
189
 
                g2.setStroke(new BasicStroke(0.01f * zoom));
190
 
                g2.draw(myPath);
191
 
 
192
 
                g2.translate(myPath.getPoint(myPath.getEndIndex()).getX(), myPath
193
 
                                .getPoint(myPath.getEndIndex()).getY());
194
 
 
195
 
                g2.rotate(myPath.getEndAngle() + Math.PI);
196
 
                g2.setColor(java.awt.Color.WHITE);
197
 
 
198
 
                g2.transform(Zoomer.getTransform(zoom));
199
 
                g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
200
 
 
201
 
                if (selected && !ignoreSelection) {
202
 
                        g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
203
 
                        this.label.setForeground(Pipe.SELECTION_LINE_COLOUR);
204
 
                } else {
205
 
                        g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
206
 
                        this.label.setForeground(Pipe.ELEMENT_LINE_COLOUR);
207
 
                }
208
 
 
209
 
                g2.setStroke(new BasicStroke(0.8f));
210
 
                g2.fillPolygon(head);
211
 
 
212
 
                g2.transform(reset);
213
 
        }
 
164
 
214
165
 
215
166
        public dk.aau.cs.model.tapn.TimedOutputArc underlyingArc() {
216
167
                return outputArc;
220
171
                this.outputArc = outputArc;
221
172
        }
222
173
 
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()));
229
180
                newCopyArc.getSource().addConnectFrom(newCopyArc);
230
181
                newCopyArc.getTarget().addConnectTo(newCopyArc);
231
182
                
232
 
                newCopyArc.setGuiModel(guiModel);
233
 
                
234
183
                return newCopyArc;
235
184
        }
236
185