~tapaal-contributor/tapaal/disappearing-tokens-1940098

« back to all changes in this revision

Viewing changes to src/pipe/dataLayer/PlaceTransitionObject.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2011-04-12 09:50:16 UTC
  • mfrom: (329.1.188 tapaal-1.5)
  • Revision ID: mail@yrke.dk-20110412095016-e4hqdgab5596ja09
Merged with branch addning support for new 1.5 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
import pipe.gui.Zoomer;
12
12
 
13
13
/**
14
 
 * <b>PlaceTransitionObject</b> - Petri-Net PLace or Transition SuperClass<b> - <i>Abstract</i></b>
15
 
 *
16
 
 * @see <p><a href="..\PNMLSchema\index.html">PNML  -  Petri-Net XMLSchema (stNet.xsd)</a>
17
 
 * @see </p><p><a href="..\..\..\UML\dataLayer.html">UML  -  PNML Package </a></p>
 
14
 * <b>PlaceTransitionObject</b> - Petri-Net PLace or Transition SuperClass<b> -
 
15
 * <i>Abstract</i></b>
 
16
 * 
 
17
 * @see <p>
 
18
 *      <a href="..\PNMLSchema\index.html">PNML - Petri-Net XMLSchema
 
19
 *      (stNet.xsd)</a>
 
20
 * @see </p>
 
21
 *      <p>
 
22
 *      <a href="..\..\..\UML\dataLayer.html">UML - PNML Package </a>
 
23
 *      </p>
18
24
 * @version 1.0
19
25
 * @author James D Bloom
20
 
 *
21
 
 * @author Edwin Chung 16 Mar 2007: modified the constructor and several
22
 
 * other functions so that DataLayer objects can be created outside the
23
 
 * GUI
 
26
 * 
 
27
 * @author Edwin Chung 16 Mar 2007: modified the constructor and several other
 
28
 *         functions so that DataLayer objects can be created outside the GUI
24
29
 */
25
 
public abstract class PlaceTransitionObject 
26
 
extends PetriNetObject 
27
 
implements Cloneable {
 
30
public abstract class PlaceTransitionObject extends PetriNetObject implements
 
31
Cloneable {
28
32
 
29
33
        /**
30
34
         * 
31
35
         */
32
36
        private static final long serialVersionUID = -6629006415467929184L;
33
 
        /** X-axis Position on screen*/
 
37
        /** X-axis Position on screen */
34
38
        protected double positionX;
35
 
        /** Y-axis Position on screen*/
 
39
        /** Y-axis Position on screen */
36
40
        protected double positionY;
37
41
 
38
 
        /** X-axis Position on screen*/
 
42
        /** X-axis Position on screen */
39
43
        protected double nameOffsetX;
40
 
        /** Y-axis Position on screen*/
 
44
        /** Y-axis Position on screen */
41
45
        protected double nameOffsetY;
42
46
 
43
47
        protected double componentWidth;
47
51
        private LinkedList<Arc> connectFrom = new LinkedList<Arc>();
48
52
        protected static Arc someArc;
49
53
 
50
 
 
51
54
        private PlaceTransitionObject lastCopy = null;
52
55
        private PlaceTransitionObject original = null;
53
56
        private int copyNumber = 0;
62
65
        // i.e. the y position at 100% zoom.
63
66
        private double locationY;
64
67
 
65
 
 
66
68
        /**
67
69
         * Create Petri-Net Object
68
 
         * @param positionXInput X-axis Position
69
 
         * @param positionYInput Y-axis Position
70
 
         * @param idInput Place id
71
 
         * @param nameInput Name
72
 
         * @param nameOffsetXInput Name X-axis Position
73
 
         * @param nameOffsetYInput Name Y-axis Position
 
70
         * 
 
71
         * @param positionXInput
 
72
         *            X-axis Position
 
73
         * @param positionYInput
 
74
         *            Y-axis Position
 
75
         * @param idInput
 
76
         *            Place id
 
77
         * @param nameInput
 
78
         *            Name
 
79
         * @param nameOffsetXInput
 
80
         *            Name X-axis Position
 
81
         * @param nameOffsetYInput
 
82
         *            Name Y-axis Position
74
83
         */
75
 
        public PlaceTransitionObject(double positionXInput, 
76
 
                        double positionYInput,
77
 
                        String idInput, 
78
 
                        String nameInput, 
79
 
                        double nameOffsetXInput,
 
84
        public PlaceTransitionObject(double positionXInput, double positionYInput,
 
85
                        String idInput, String nameInput, double nameOffsetXInput,
80
86
                        double nameOffsetYInput) {
81
 
                this(positionXInput, positionYInput, idInput);
 
87
                this(positionXInput, positionYInput);
 
88
                id = idInput;
82
89
                nameOffsetX = nameOffsetXInput;
83
90
                nameOffsetY = nameOffsetYInput;
84
 
                pnName.setPosition((int)nameOffsetX, (int)nameOffsetY);
85
 
                setName(nameInput);
86
 
        }
87
 
 
88
 
 
89
 
        /**
90
 
         * Create Petri-Net Object
91
 
         * @param positionXInput X-axis Position
92
 
         * @param positionYInput Y-axis Position
93
 
         * @param idInput Place id
94
 
         */
95
 
        public PlaceTransitionObject(double positionXInput, 
96
 
                        double positionYInput,
97
 
                        String idInput) {
98
 
                this(positionXInput, positionYInput);
99
 
                id = idInput;
100
 
        }
101
 
 
102
 
 
103
 
        /**
104
 
         * Create Petri-Net Object
105
 
         * This constructor does all the work, the others just call it.
106
 
         * @param positionXInput X-axis Position
107
 
         * @param positionYInput Y-axis Position
 
91
                pnName.setPosition((int) nameOffsetX, (int) nameOffsetY);
 
92
                // setName(nameInput);
 
93
        }
 
94
 
 
95
        /**
 
96
         * Create Petri-Net Object This constructor does all the work, the others
 
97
         * just call it.
 
98
         * 
 
99
         * @param positionXInput
 
100
         *            X-axis Position
 
101
         * @param positionYInput
 
102
         *            Y-axis Position
108
103
         */
109
104
        public PlaceTransitionObject(double positionXInput, double positionYInput) {
110
105
 
111
106
                setPositionX(positionXInput);
112
 
                setPositionY(positionYInput);      
 
107
                setPositionY(positionYInput);
113
108
 
114
109
                nameOffsetX = Pipe.DEFAULT_OFFSET_X;
115
110
                nameOffsetY = Pipe.DEFAULT_OFFSET_Y;
118
113
                pnName = new NameLabel(zoom);
119
114
        }
120
115
 
121
 
 
122
116
        /**
123
117
         * Set X-axis position
124
 
         * @param positionXInput Double value for X-axis position
 
118
         * 
 
119
         * @param positionXInput
 
120
         *            Double value for X-axis position
125
121
         */
126
122
        public void setPositionX(double positionXInput) {
127
 
                positionX = positionXInput;     
 
123
                positionX = positionXInput;
128
124
                locationX = Zoomer.getUnzoomedValue(positionX, zoom);
129
125
        }
130
126
 
131
 
 
132
127
        /**
133
128
         * Set Y-axis position
134
 
         * @param positionYInput Double value for Y-axis position
 
129
         * 
 
130
         * @param positionYInput
 
131
         *            Double value for Y-axis position
135
132
         */
136
133
        public void setPositionY(double positionYInput) {
137
134
                positionY = positionYInput;
138
135
                locationY = Zoomer.getUnzoomedValue(positionY, zoom);
139
136
        }
140
137
 
141
 
 
142
138
        /**
143
139
         * Set name
144
 
         * @param nameInput String value for Place name;
 
140
         * 
 
141
         * @param nameInput
 
142
         *            String value for Place name;
145
143
         */
146
144
        @Override
147
145
        public void setName(String nameInput) {
148
 
                //sets the text within the label
149
 
                //System.out.println("setting name to: " + nameInput);
 
146
                // sets the text within the label
 
147
                // System.out.println("setting name to: " + nameInput);
150
148
                pnName.setName(nameInput);
151
149
        }
152
150
 
153
 
 
154
151
        /**
155
152
         * Set X-axis offset for name position
156
 
         * @param nameOffsetXInput Double value for name X-axis offset
 
153
         * 
 
154
         * @param nameOffsetXInput
 
155
         *            Double value for name X-axis offset
157
156
         */
158
157
        public void setNameOffsetX(double nameOffsetXInput) {
159
158
                nameOffsetX += Zoomer.getUnzoomedValue(nameOffsetXInput, zoom);
160
159
        }
161
160
 
162
 
 
163
161
        /**
164
162
         * Set Y-axis offset for name position
165
 
         * @param nameOffsetYInput Double value for name Y-axis offset
 
163
         * 
 
164
         * @param nameOffsetYInput
 
165
         *            Double value for name Y-axis offset
166
166
         */
167
167
        public void setNameOffsetY(double nameOffsetYInput) {
168
 
                nameOffsetY += Zoomer.getUnzoomedValue(nameOffsetYInput, zoom);      
 
168
                nameOffsetY += Zoomer.getUnzoomedValue(nameOffsetYInput, zoom);
169
169
        }
170
170
 
171
 
 
172
171
        /**
173
172
         * Get X-axis position
 
173
         * 
174
174
         * @return Double value for X-axis position
175
175
         */
176
176
        public double getPositionX() {
177
177
                return positionX;
178
178
        }
179
179
 
180
 
 
181
180
        /**
182
181
         * Get Y-axis position
 
182
         * 
183
183
         * @return Double value for Y-axis position
184
184
         */
185
185
        public double getPositionY() {
186
186
                return positionY;
187
187
        }
188
188
 
189
 
 
190
189
        /**
191
190
         * Set id
192
 
         * @param idInput String value for Place id;
 
191
         * 
 
192
         * @param idInput
 
193
         *            String value for Place id;
193
194
         */
194
195
        @Override
195
196
        public void setId(String idInput) {
196
197
                id = idInput;
197
198
                setName(id);
198
 
                //      System.out.println("setting id to: " + idInput);
 
199
                // System.out.println("setting id to: " + idInput);
199
200
        }
200
201
 
201
 
 
202
202
        /**
203
203
         * Get id
 
204
         * 
204
205
         * @return String value for Place id;
205
206
         */
206
207
        @Override
207
208
        public String getId() {
208
 
                return (id!=null) ? id : pnName.getName();
 
209
                return (id != null) ? id : pnName.getName();
209
210
        }
210
211
 
211
 
 
212
212
        /**
213
213
         * Get name
 
214
         * 
214
215
         * @return String value for Place name;
215
216
         */
216
217
        @Override
217
218
        public String getName() {
218
 
                return (pnName!=null) ? pnName.getName() : id;
 
219
                return (pnName != null) ? pnName.getName() : id;
219
220
        }
220
221
 
221
 
 
222
222
        public double getNameOffsetX() {
223
223
                return nameOffsetX;
224
 
        }   
225
 
 
 
224
        }
226
225
 
227
226
        public double getNameOffsetY() {
228
227
                return nameOffsetY;
229
 
        }      
230
 
 
231
 
 
232
 
        /** 
 
228
        }
 
229
 
 
230
        /**
233
231
         * Get X-axis offset for ...
 
232
         * 
234
233
         * @return Double value for X-axis offset of ...
235
234
         */
236
235
        public Double getNameOffsetXObject() {
237
236
                return this.nameOffsetX;
238
237
        }
239
238
 
240
 
 
241
 
        /** Moved to PlaceTransitionObject
242
 
         * Get Y-axis offset for ...
 
239
        /**
 
240
         * Moved to PlaceTransitionObject Get Y-axis offset for ...
 
241
         * 
243
242
         * @return Double value for Y-axis offset of ...
244
243
         */
245
244
        public Double getNameOffsetYObject() {
246
245
                return this.nameOffsetY;
247
 
        }   
248
 
 
 
246
        }
249
247
 
250
248
        /**
251
249
         * Get X-axis position, returns null if value not yet entered
 
250
         * 
252
251
         * @return Double value for X-axis position
253
252
         */
254
253
        public Double getPositionXObject() {
255
254
                return new Double(locationX);
256
 
                //return new Double(positionX);
 
255
                // return new Double(positionX);
257
256
        }
258
257
 
259
 
 
260
258
        /**
261
259
         * Get Y-axis position, returns null if value not yet entered
 
260
         * 
262
261
         * @return Double value for Y-axis position
263
262
         */
264
263
        public Double getPositionYObject() {
265
264
                return new Double(locationY);
266
 
                //return new Double(positionY);
 
265
                // return new Double(positionY);
267
266
        }
268
267
 
269
 
 
270
 
        /** Implemented in subclasses as involves some tailoring according to the shape
271
 
         * @param e Mouse Event
 
268
        /**
 
269
         * Implemented in subclasses as involves some tailoring according to the
 
270
         * shape
 
271
         * 
 
272
         * @param e
 
273
         *            Mouse Event
272
274
         */
273
275
        @Override
274
276
        public void paintComponent(Graphics g) {
275
277
                super.paintComponent(g);
276
278
 
277
 
                Graphics2D g2 = (Graphics2D)g;
 
279
                Graphics2D g2 = (Graphics2D) g;
278
280
                g2.translate(COMPONENT_DRAW_OFFSET, COMPONENT_DRAW_OFFSET);
279
281
                g2.transform(Zoomer.getTransform(zoom));
280
282
        }
281
283
 
282
 
 
283
284
        public Point2D getIntersectOffset(Point2D start) {
284
285
                return new Point2D.Double();
285
286
        }
286
287
 
287
 
 
288
 
        /** Returns the distance between the outside of the component to the centre, 
289
 
         * in order to position the centre of the place where the mouse clicks on the
290
 
         * screen
 
288
        /**
 
289
         * Returns the distance between the outside of the component to the centre,
 
290
         * in order to position the centre of the place where the mouse clicks on
 
291
         * the screen
 
292
         * 
291
293
         * @return Top offset of Place
292
294
         */
293
295
        public int centreOffsetTop() {
294
 
                return (int)(Zoomer.getZoomedValue(componentHeight/2.0, zoom));
 
296
                return (int) (Zoomer.getZoomedValue(componentHeight / 2.0, zoom));
295
297
        }
296
298
 
297
 
 
298
 
        /** Returns the distance between the outside of the component to the centre, 
299
 
         * in order to position the centre of the place where the mouse clicks on the
300
 
         * screen
 
299
        /**
 
300
         * Returns the distance between the outside of the component to the centre,
 
301
         * in order to position the centre of the place where the mouse clicks on
 
302
         * the screen
 
303
         * 
301
304
         * @return Left offset of Place
302
305
         */
303
306
        public int centreOffsetLeft() {
304
 
                return (int)(Zoomer.getZoomedValue(componentWidth/2.0, zoom));
 
307
                return (int) (Zoomer.getZoomedValue(componentWidth / 2.0, zoom));
305
308
        }
306
309
 
307
 
 
308
310
        /** Calculates the BoundsOffsets used for setBounds() method */
309
311
        public void updateBounds() {
310
312
                double scaleFactor = Zoomer.getScaleFactor(zoom);
311
313
                positionX = locationX * scaleFactor;
312
314
                positionY = locationY * scaleFactor;
313
 
                bounds.setBounds((int)positionX,
314
 
                                (int)positionY,
315
 
                                (int)(componentWidth * scaleFactor),
316
 
                                (int)(componentHeight * scaleFactor));
 
315
                bounds.setBounds((int) positionX, (int) positionY,
 
316
                                (int) (componentWidth * scaleFactor),
 
317
                                (int) (componentHeight * scaleFactor));
317
318
                bounds.grow(COMPONENT_DRAW_OFFSET, COMPONENT_DRAW_OFFSET);
318
319
                setBounds(bounds);
319
320
        }
320
321
 
321
 
 
322
322
        /** Adds outwards arc to place/transition */
323
323
        public void addConnectTo(Arc newArc) {
324
 
                //      System.out.println("DEBUG: added arc (to)!:" + newArc + " de " + this);
 
324
                // System.out.println("DEBUG: added arc (to)!:" + newArc + " de " +
 
325
                // this);
325
326
                connectTo.add(newArc);
326
327
        }
327
328
 
328
 
 
329
329
        /** Adds inwards arc to place/transition */
330
330
        public void addConnectFrom(Arc newArc) {
331
 
                //      System.out.println("DEBUG: added arc (from)!:" + newArc + " de " + this);
 
331
                // System.out.println("DEBUG: added arc (from)!:" + newArc + " de " +
 
332
                // this);
332
333
                connectFrom.add(newArc);
333
334
        }
334
335
 
335
 
 
336
336
        public void removeFromArc(Arc oldArc) {
337
337
                if (connectFrom.remove(oldArc)) {
338
 
                        //         System.out.println("DEBUG: removeFromArc_ok");
 
338
                        // System.out.println("DEBUG: removeFromArc_ok");
339
339
                } else {
340
 
                        //         System.out.println("DEBUG: removeFromArc_ko");
 
340
                        // System.out.println("DEBUG: removeFromArc_ko");
341
341
                }
342
342
        }
343
343
 
344
 
 
345
344
        public void removeToArc(Arc oldArc) {
346
345
                if (connectTo.remove(oldArc)) {
347
 
                        //         System.out.println("DEBUG: removeToArc_ok");
 
346
                        // System.out.println("DEBUG: removeToArc_ok");
348
347
                } else {
349
 
                        //         System.out.println("DEBUG: removeToArc_ko");
 
348
                        // System.out.println("DEBUG: removeToArc_ko");
350
349
                }
351
350
        }
352
351
 
353
 
 
354
352
        /** Updates location of any attached arcs */
355
353
        public void updateConnected() {
356
354
                Iterator<Arc> arcsFrom = connectFrom.iterator();
369
367
                }
370
368
        }
371
369
 
372
 
 
373
370
        /** Translates the component by x,y */
374
371
        public void translate(int x, int y) {
375
372
                setPositionX(positionX + x);
376
 
                setPositionY(positionY + y);  
377
 
                update();
 
373
                setPositionY(positionY + y);
 
374
                updateOnMove();
378
375
        }
379
376
 
380
 
 
381
377
        /** Sets the center of the component to position x, y */
382
 
        public void setCentre(double x,double y) {
383
 
                setPositionX(x - (getWidth()/2.0));
384
 
                setPositionY(y - (getHeight()/2.0));
385
 
                update();
386
 
        }
387
 
 
388
 
 
389
 
        public void update() {
390
 
                updateBounds();
391
 
                updateLabelLocation();
392
 
                updateConnected();
393
 
        }
394
 
 
 
378
        public void setCentre(double x, double y) {
 
379
                setPositionX(x - (getWidth() / 2.0));
 
380
                setPositionY(y - (getHeight() / 2.0));
 
381
                update(true);
 
382
        }
 
383
 
 
384
        public void update(boolean displayConstantNames) {
 
385
                updateOnMove();
 
386
        }
395
387
 
396
388
        public Point2D.Double getCentre() {
397
 
                return new Point2D.Double(positionX + getWidth()/2.0, 
398
 
                                positionY + getHeight()/2.0); 
 
389
                return new Point2D.Double(positionX + getWidth() / 2.0, positionY
 
390
                                + getHeight() / 2.0);
399
391
        }
400
392
 
401
 
 
402
393
        protected void updateLabelLocation() {
403
 
                pnName.setPosition(Grid.getModifiedX((int)(positionX + 
404
 
                                Zoomer.getZoomedValue(nameOffsetX, zoom))),
405
 
                                Grid.getModifiedY((int)(positionY + 
406
 
                                                Zoomer.getZoomedValue(nameOffsetY, zoom))));          
407
 
        }  
408
 
 
 
394
                pnName.setPosition(
 
395
                                Grid.getModifiedX((int) (positionX + Zoomer.getZoomedValue(nameOffsetX, zoom))), 
 
396
                                Grid.getModifiedY((int) (positionY + Zoomer.getZoomedValue(nameOffsetY, zoom)))
 
397
                );
 
398
        }
409
399
 
410
400
        @Override
411
401
        public void delete() {
415
405
                super.delete();
416
406
        }
417
407
 
418
 
 
419
408
        /** Handles selection for Place/Transitions */
420
409
        @Override
421
410
        public void select() {
423
412
                        selected = true;
424
413
 
425
414
                        Iterator<Arc> arcsFrom = connectFrom.iterator();
426
 
                        while(arcsFrom.hasNext()) {
 
415
                        while (arcsFrom.hasNext()) {
427
416
                                arcsFrom.next().select();
428
417
                        }
429
418
 
430
419
                        Iterator<Arc> arcsTo = connectTo.iterator();
431
 
                        while(arcsTo.hasNext()) {
 
420
                        while (arcsTo.hasNext()) {
432
421
                                arcsTo.next().select();
433
422
                        }
434
423
                        repaint();
435
424
                }
436
425
        }
437
426
 
438
 
 
439
427
        @Override
440
428
        public void addedToGui() {
441
429
                deleted = false;
442
430
                markedAsDeleted = false;
443
431
                addLabelToContainer();
444
 
                update();
 
432
                update(true);
 
433
                updateOnMove();
445
434
        }
446
435
 
 
436
        // TODO: Find a better name for this
 
437
        public void updateOnMove() {
 
438
                updateBounds();
 
439
                updateConnected();
 
440
                updateLabelLocation();
 
441
        }
447
442
 
448
443
        public boolean areNotSameType(PlaceTransitionObject o) {
449
444
                return (this.getClass() != o.getClass());
450
 
        }   
451
 
 
452
 
 
453
 
        /* KYRKE - added functions for getting pre and post set af lists */ 
454
 
        public LinkedList<Arc> getPreset(){
455
 
                //XXX - possible type error
 
445
        }
 
446
 
 
447
        /* KYRKE - added functions for getting pre and post set af lists */
 
448
        public LinkedList<Arc> getPreset() {
 
449
                // XXX - possible type error
456
450
                return new LinkedList<Arc>(connectTo);
457
451
        }
458
452
 
459
 
        public LinkedList<Arc> getPostset(){
460
 
                //XXX - possible type error
 
453
        public LinkedList<Arc> getPostset() {
 
454
                // XXX - possible type error
461
455
                return new LinkedList<Arc>(connectFrom);
462
456
        }
463
457
 
465
459
                return connectFrom.iterator();
466
460
        }
467
461
 
468
 
 
469
462
        public Iterator<Arc> getConnectToIterator() {
470
463
                return connectTo.iterator();
471
464
        }
472
465
 
473
 
 
474
466
        public abstract void updateEndPoint(Arc arc);
475
467
 
476
 
 
477
468
        public int getCopyNumber() {
478
469
                if (original != null) {
479
470
                        return original.copyNumber;
481
472
                        return 0;
482
473
                }
483
474
        }
484
 
        public void incrementCopyNumber(){
485
 
                if (original != null){
 
475
 
 
476
        public void incrementCopyNumber() {
 
477
                if (original != null) {
486
478
                        original.copyNumber++;
487
479
                }
488
480
        }
489
481
 
490
 
 
491
482
        public void newCopy(PlaceTransitionObject ptObject) {
492
483
                if (original != null) {
493
484
                        original.lastCopy = ptObject;
494
485
                }
495
486
        }
496
487
 
497
 
 
498
488
        public PlaceTransitionObject getLastCopy() {
499
 
                return lastCopy;  
 
489
                return lastCopy;
500
490
        }
501
491
 
502
 
 
503
492
        public void resetLastCopy() {
504
493
                lastCopy = null;
505
494
        }
506
495
 
507
 
 
508
 
        public void setOriginal(PlaceTransitionObject ptObject) {   
 
496
        public void setOriginal(PlaceTransitionObject ptObject) {
509
497
                original = ptObject;
510
498
        }
511
499
 
512
 
 
513
500
        public PlaceTransitionObject getOriginal() {
514
501
                return original;
515
502
        }
516
503
 
517
 
 
518
504
        public abstract void showEditor();
519
505
 
520
 
 
521
 
        public void setAttributesVisible(boolean flag){
522
 
                attributesVisible = flag;   
 
506
        public void setAttributesVisible(boolean flag) {
 
507
                attributesVisible = flag;
523
508
        }
524
509
 
525
 
 
526
 
        public boolean getAttributesVisible(){
 
510
        public boolean getAttributesVisible() {
527
511
                return attributesVisible;
528
 
        }   
529
 
 
 
512
        }
530
513
 
531
514
        @Override
532
515
        public int getLayerOffset() {
533
516
                return Pipe.PLACE_TRANSITION_LAYER_OFFSET;
534
 
        }   
535
 
 
 
517
        }
536
518
 
537
519
        public abstract void toggleAttributesVisible();
538
520
 
539
 
 
540
521
        public void zoomUpdate(int value) {
541
522
                zoom = value;
542
 
                update();
 
523
                update(true);
543
524
        }
544
525
 
545
 
 
546
526
        // XXX - kyrke now also clones arcs
547
527
        // Clone object and deep copy the pnNames
548
528
        @Override
549
529
        public PlaceTransitionObject clone() {
550
 
                PlaceTransitionObject toReturn = (PlaceTransitionObject)super.clone();
 
530
                PlaceTransitionObject toReturn = (PlaceTransitionObject) super.clone();
551
531
                toReturn.pnName = (NameLabel) pnName.clone();
552
532
 
553
533
                toReturn.connectFrom = this.connectFrom;