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

« back to all changes in this revision

Viewing changes to src/pipe/dataLayer/TimedOutputArcComponent.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:
6
6
import java.awt.Polygon;
7
7
import java.awt.RenderingHints;
8
8
import java.awt.geom.AffineTransform;
9
 
 
10
 
import pipe.gui.CreateGui;
 
9
import java.util.Hashtable;
 
10
 
 
11
import dk.aau.cs.model.tapn.TimedArcPetriNet;
 
12
 
 
13
import pipe.gui.DrawingSurfaceImpl;
11
14
import pipe.gui.Pipe;
12
15
import pipe.gui.Zoomer;
13
 
import pipe.gui.undo.ArcWeightEdit;
14
 
import pipe.gui.undo.ClearInverseArcEdit;
15
 
import pipe.gui.undo.JoinInverseArcEdit;
16
 
import pipe.gui.undo.SetInverseArcEdit;
17
 
import pipe.gui.undo.SplitInverseArcEdit;
18
 
import pipe.gui.undo.TagArcEdit;
19
 
import pipe.gui.undo.UndoableEdit;
20
 
 
 
16
import pipe.gui.handler.ArcHandler;
21
17
 
22
18
/**
23
19
 * <b>Arc</b> - Petri-Net Normal Arc Class
24
 
 *
25
 
 * @see <p><a href="..\PNMLSchema\index.html">PNML  -  Petri-Net XMLSchema (stNet.xsd)</a>
26
 
 * @see </p><p><a href="..\..\..\UML\dataLayer.html">UML  -  PNML Package </a></p>
 
20
 * 
 
21
 * @see <p>
 
22
 *      <a href="..\PNMLSchema\index.html">PNML - Petri-Net XMLSchema
 
23
 *      (stNet.xsd)</a>
 
24
 * @see </p>
 
25
 *      <p>
 
26
 *      <a href="..\..\..\UML\dataLayer.html">UML - PNML Package </a>
 
27
 *      </p>
27
28
 * @version 1.0
28
29
 */
29
 
public class NormalArc
30
 
        extends Arc {
31
 
/**
 
30
public class TimedOutputArcComponent extends Arc {
 
31
        /**
32
32
         * 
33
33
         */
34
34
        private static final long serialVersionUID = 5588142404135607382L;
35
35
 
36
 
/*CB Joakim Byg - probably not needed   
37
 
   public final static String type = "normal";
38
 
EOC*/   
39
 
   protected Polygon head = 
40
 
           new Polygon(new int[]{0, 5, 0, -5}, new int[]{0, -10, -7, -10}, 4);
41
 
   
42
 
   // bidirectional arc?
43
 
   private boolean joined = false;
44
 
   
45
 
   // Whether or not exists an inverse arc
46
 
   private NormalArc inverse = null;
47
 
   
48
 
      
49
 
   /** Whether or not the Arc is capable of carrying tagged tokens
50
 
    *  By default it is not
51
 
    */
52
 
   private Boolean tagged = false;   
53
 
 
54
 
   
55
 
   /**
56
 
    * Create Petri-Net Arc object
57
 
    * @param startPositionXInput Start X-axis Position
58
 
    * @param startPositionYInput Start Y-axis Position
59
 
    * @param endPositionXInput End X-axis Position
60
 
    * @param endPositionYInput End Y-axis Position
61
 
    * @param sourceInput Arc source
62
 
    * @param targetInput Arc target
63
 
    * @param idInput Arc id
64
 
    */
65
 
   public NormalArc(double startPositionXInput, double startPositionYInput, 
66
 
                    double endPositionXInput, double endPositionYInput, 
67
 
                    PlaceTransitionObject sourceInput, 
68
 
                    PlaceTransitionObject targetInput,
69
 
                    int weightInput,
70
 
                    String idInput,
71
 
                    boolean taggedInput){
72
 
      super(startPositionXInput, startPositionYInput,
73
 
            endPositionXInput, endPositionYInput,
74
 
            sourceInput, 
75
 
            targetInput, 
76
 
            weightInput, 
77
 
            idInput);
78
 
      setTagged(taggedInput);
79
 
   }
80
 
   
81
 
   
82
 
   /**
83
 
    * Create Petri-Net Arc object
84
 
    */
85
 
   public NormalArc(PlaceTransitionObject newSource) {
86
 
      super(newSource);
87
 
   }
88
 
   
89
 
   
90
 
   public NormalArc(NormalArc arc) {
91
 
      weightLabel = new NameLabel(zoom);
92
 
      
93
 
      for (int i = 0; i <= arc.myPath.getEndIndex(); i++){
94
 
         this.myPath.addPoint(arc.myPath.getPoint(i).getX(),
95
 
                              arc.myPath.getPoint(i).getY(),
96
 
                              arc.myPath.getPointType(i));         
97
 
      }      
98
 
      this.myPath.createPath();
99
 
      this.updateBounds();  
100
 
      this.id = arc.id;
101
 
      this.setSource(arc.getSource());
102
 
      this.setTarget(arc.getTarget());
103
 
      this.setWeight(arc.getWeight());
104
 
      this.inView = arc.inView;
105
 
      this.joined = arc.joined;
106
 
   }
107
 
 
108
 
   
109
 
   public NormalArc paste(double despX, double despY, boolean toAnotherView){
110
 
      PlaceTransitionObject source = this.getSource().getLastCopy();
111
 
      PlaceTransitionObject target = this.getTarget().getLastCopy();
112
 
      
113
 
      if (source == null && target == null) {
114
 
         // don't paste an arc with neither source nor target
115
 
         return null;
116
 
      }
117
 
      
118
 
      if (source == null){
119
 
         if (toAnotherView) {
120
 
            // if the source belongs to another Petri Net, the arc can't be 
121
 
            // pasted
122
 
            return null;
123
 
         } else {
124
 
            source = this.getSource();
125
 
         }
126
 
      }
127
 
      
128
 
      if (target == null){
129
 
         if (toAnotherView) {
130
 
            // if the target belongs to another Petri Net, the arc can't be 
131
 
            // pasted            
132
 
            return null;
133
 
         } else {
134
 
            target = this.getTarget();
135
 
         }
136
 
      }
137
 
      
138
 
      NormalArc copy =  new NormalArc(0, 0, //startPoint
139
 
                                      0, 0, //endPoint
140
 
                                      source,
141
 
                                      target,
142
 
                                      this.getWeight(),
143
 
                                      source.getId() + " to " + target.getId(),
144
 
                                      false);      
145
 
      
146
 
      copy.myPath.delete();
147
 
      for (int i = 0; i <= this.myPath.getEndIndex(); i++){
148
 
         copy.myPath.addPoint(this.myPath.getPoint(i).getX() + despX,
149
 
                              this.myPath.getPoint(i).getY() + despY,
150
 
                              this.myPath.getPointType(i));         
151
 
         copy.myPath.selectPoint(i); 
152
 
      }
153
 
            
154
 
      source.addConnectFrom(copy);
155
 
      target.addConnectTo(copy);
156
 
      
157
 
      copy.inView = this.inView;
158
 
      copy.joined = this.joined;
159
 
      
160
 
      return copy;
161
 
   }
162
 
   
163
 
   
164
 
   public NormalArc copy(){
165
 
      return new NormalArc(this);
166
 
   }   
167
 
   
168
 
/*CB Joakim Byg - This is sortof ugly, since it is only used one place 
169
 
  and we would like to make an other type of arc that inherits from NormalArc 
170
 
   public String getType(){
171
 
      return this.type;
172
 
   }
173
 
 EOC*/  
174
 
      
175
 
   @Override
176
 
public UndoableEdit setWeight(int weightInput){
177
 
      int oldWeight = weight;
178
 
 
179
 
      weight = weightInput;
180
 
      updateWeightLabel();
181
 
      return new ArcWeightEdit(this, oldWeight, weight);      
182
 
   }
183
 
   
184
 
   
185
 
   
186
 
   /** Accessor function to set whether or not the Arc is tagged */             
187
 
   public UndoableEdit setTagged(boolean flag){
188
 
      /**Set the timed transition attribute (for GSPNs)*/
189
 
 
190
 
      tagged = flag;
191
 
      
192
 
      // If it becomes tagged we must remove any existing weight....
193
 
      // ...and thus we can reuse the weightLabel to display that it's tagged!!!
194
 
      // Because remember that a tagged arc must have a weight of 1...
195
 
      if (tagged) {
196
 
         //weight = 1;
197
 
         weightLabel.setText("TAG");
198
 
         setWeightLabelPosition();
199
 
         weightLabel.updateSize();         
200
 
      } else {
201
 
         weightLabel.setText((weight > 1)?Integer.toString(weight) : "");
202
 
      }
203
 
      repaint();
204
 
      return new TagArcEdit(this);      
205
 
   }
206
 
 
207
 
   
208
 
   /** Accessor function to check whether or not the Arc is tagged */
209
 
   public boolean isTagged(){
210
 
      return tagged;
211
 
   }      
212
 
   
213
 
   
214
 
   public void updateWeightLabel(){   
215
 
      if (hasInverse() && !inView) {
216
 
         inverse.updateWeightLabel();
217
 
      } else {
218
 
         if (!hasInvisibleInverse()){
219
 
            if (weight == 1){
220
 
               weightLabel.setText("");
221
 
            } else {
222
 
               weightLabel.setText(Integer.toString(weight));            
223
 
            }
224
 
         } else {
225
 
            if (weight == 1 && inverse.weight == 1){         
226
 
               weightLabel.setText("");
227
 
            } else {
228
 
               if (getSource() instanceof Place){
229
 
                  weightLabel.setText(weight + "(PT) / " + inverse.getWeight() + "(TP)");
230
 
               } else {
231
 
                  weightLabel.setText(inverse.getWeight() + "(PT) / " + weight + "(TP)");
232
 
               }   
233
 
            }
234
 
         }
235
 
         setWeightLabelPosition();
236
 
      }
237
 
   }
238
 
 
239
 
   
240
 
   public void setInView(boolean flag) {
241
 
      inView = flag;
242
 
   }
243
 
 
244
 
   
245
 
   public void setJoined(boolean flag) {
246
 
      joined = flag;
247
 
   }
248
 
 
249
 
   
250
 
   public UndoableEdit clearInverse() {
251
 
      NormalArc oldInverse = inverse;
252
 
 
253
 
      inverse.inView = true;
254
 
      inView = true;
255
 
      
256
 
      inverse.joined = false;            
257
 
      joined = false;
258
 
 
259
 
      inverse.updateWeightLabel();                
260
 
      updateWeightLabel();             
261
 
  
262
 
      inverse.inverse = null;
263
 
      inverse = null;   
264
 
      
265
 
      return new ClearInverseArcEdit(this, oldInverse, false);
266
 
   }
267
 
 
268
 
   
269
 
   public boolean hasInverse() {
270
 
      return inverse != null;
271
 
   }
272
 
   
273
 
 
274
 
   public NormalArc getInverse() {
275
 
      return inverse;
276
 
   }
277
 
   
278
 
   
279
 
   public UndoableEdit setInverse(NormalArc _inverse, boolean joined) {
280
 
      inverse = _inverse;
281
 
      inverse.inverse = this;
282
 
      updateArc(joined);
283
 
      return new SetInverseArcEdit(this, inverse, joined); 
284
 
   }
285
 
 
286
 
   
287
 
   private void updateArc(boolean isJoined){
288
 
      inView = true;
289
 
      inverse.inView = !isJoined;
290
 
      
291
 
      if (isJoined) {
292
 
         inverse.removeFromView();
293
 
         Transition transition = this.getTransition();
294
 
         transition.removeFromArc(inverse);
295
 
         transition.removeArcCompareObject(inverse);
296
 
         transition.updateConnected();
297
 
         joined = isJoined;
298
 
      }
299
 
      updateWeightLabel();
300
 
   }
301
 
   
302
 
   
303
 
   public boolean isJoined() {
304
 
      return joined;
305
 
   }
306
 
 
307
 
   
308
 
   public UndoableEdit split() {
309
 
      //
310
 
      if (!this.inverse.inView) { 
311
 
         CreateGui.getView().add(inverse);
312
 
         inverse.getSource().addConnectFrom(inverse);
313
 
         inverse.getTarget().addConnectTo(inverse);
314
 
      }
315
 
      if (!this.inView) {
316
 
         CreateGui.getView().add(this);
317
 
         this.getSource().addConnectFrom(this);
318
 
         this.getTarget().addConnectTo(this);
319
 
      }
320
 
 
321
 
      //
322
 
      inverse.inView = true;
323
 
      this.inView = true;
324
 
      this.joined = false;
325
 
      inverse.joined = false;
326
 
 
327
 
      this.updateWeightLabel();
328
 
      inverse.updateWeightLabel();    
329
 
 
330
 
      this.updateArcPosition();
331
 
      inverse.updateArcPosition();
332
 
      
333
 
      return new SplitInverseArcEdit(this);
334
 
   }
335
 
 
336
 
   
337
 
   public UndoableEdit join() {
338
 
      this.updateArc(true);
339
 
      //((NormalArc)arc.getInverse()).setInView(false);
340
 
      //arc.getParent().remove(arc.getInverse());
341
 
      inverse.removeFromView();
342
 
      this.setJoined(true);
343
 
      if (this.getParent() != null) {
344
 
         this.getParent().repaint();
345
 
      }
346
 
      
347
 
      return new JoinInverseArcEdit(this);
348
 
   }
349
 
 
350
 
   
351
 
   public boolean hasInvisibleInverse() {
352
 
      return ((this.inverse!=null) && !(this.inverse.inView()));
353
 
   }
354
 
  
355
 
 
356
 
   @Override
357
 
public void paintComponent(Graphics g) {
358
 
      super.paintComponent(g);
359
 
      Graphics2D g2 = (Graphics2D)g;   
360
 
 
361
 
      g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, 
362
 
                          RenderingHints.VALUE_ANTIALIAS_ON);
363
 
      
364
 
      g2.translate(COMPONENT_DRAW_OFFSET + zoomGrow - myPath.getBounds().getX(),
365
 
               COMPONENT_DRAW_OFFSET + zoomGrow - myPath.getBounds().getY());
366
 
      
367
 
      AffineTransform reset = g2.getTransform();      
368
 
 
369
 
      if (selected && !ignoreSelection){
370
 
         g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
371
 
      } else{
372
 
         g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
373
 
      }      
374
 
      
375
 
      if (joined) {
376
 
         g2.translate(myPath.getPoint(0).getX(), myPath.getPoint(0).getY());
377
 
         g2.rotate(myPath.getStartAngle() + Math.PI);
378
 
         g2.transform(Zoomer.getTransform(zoom)); 
379
 
         g2.fillPolygon(head);
380
 
         g2.setTransform(reset);         
381
 
      }
382
 
      
383
 
      g2.setStroke(new BasicStroke(0.01f * zoom));
384
 
      g2.draw(myPath);
385
 
 
386
 
      g2.translate(myPath.getPoint(myPath.getEndIndex()).getX(),
387
 
               myPath.getPoint(myPath.getEndIndex()).getY());
388
 
        
389
 
      g2.rotate(myPath.getEndAngle()+Math.PI);
390
 
      g2.setColor(java.awt.Color.WHITE);
391
 
            
392
 
      g2.transform(Zoomer.getTransform(zoom));   
393
 
      g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);    
394
 
 
395
 
      if (selected && !ignoreSelection){
396
 
         g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
397
 
      } else{
398
 
         g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
399
 
      }
400
 
      
401
 
      g2.setStroke(new BasicStroke(0.8f));
402
 
      g2.fillPolygon(head);
403
 
      
404
 
      g2.transform(reset);   
405
 
   }   
406
 
 
407
 
   @Override
408
 
public NormalArc clone(){
409
 
 
410
 
           NormalArc toReturn = (NormalArc)super.clone();
411
 
           toReturn.setTagged(tagged);
412
 
           return toReturn;
413
 
 
414
 
   }
 
36
        protected Polygon head = new Polygon(new int[] { 0, 5, 0, -5 }, new int[] {
 
37
                        0, -10, -7, -10 }, 4);
 
38
 
 
39
        private dk.aau.cs.model.tapn.TimedOutputArc outputArc;
 
40
 
 
41
        /**
 
42
         * Create Petri-Net Arc object
 
43
         * 
 
44
         * @param startPositionXInput
 
45
         *            Start X-axis Position
 
46
         * @param startPositionYInput
 
47
         *            Start Y-axis Position
 
48
         * @param endPositionXInput
 
49
         *            End X-axis Position
 
50
         * @param endPositionYInput
 
51
         *            End Y-axis Position
 
52
         * @param sourceInput
 
53
         *            Arc source
 
54
         * @param targetInput
 
55
         *            Arc target
 
56
         * @param idInput
 
57
         *            Arc id
 
58
         */
 
59
        public TimedOutputArcComponent(double startPositionXInput,
 
60
                        double startPositionYInput, double endPositionXInput,
 
61
                        double endPositionYInput, PlaceTransitionObject sourceInput,
 
62
                        PlaceTransitionObject targetInput, int weightInput, String idInput,
 
63
                        boolean taggedInput) {
 
64
                super(startPositionXInput, startPositionYInput, endPositionXInput,
 
65
                                endPositionYInput, sourceInput, targetInput, weightInput,
 
66
                                idInput);
 
67
        }
 
68
 
 
69
        /**
 
70
         * Create Petri-Net Arc object
 
71
         */
 
72
        public TimedOutputArcComponent(PlaceTransitionObject newSource) {
 
73
                super(newSource);
 
74
        }
 
75
 
 
76
        public TimedOutputArcComponent(TimedOutputArcComponent arc) {
 
77
                weightLabel = new NameLabel(zoom);
 
78
                
 
79
                this.myPath = new ArcPath(this);
 
80
                for (int i = 0; i <= arc.myPath.getEndIndex(); i++) {
 
81
                        this.myPath.addPoint(arc.myPath.getPoint(i).getX(), arc.myPath.getPoint(i).getY(), arc.myPath.getPointType(i));
 
82
                }
 
83
                this.myPath.createPath();
 
84
                this.updateBounds();
 
85
                this.id = arc.id;
 
86
                this.setSource(arc.getSource());
 
87
                this.setTarget(arc.getTarget());
 
88
                this.setWeight(arc.getWeight());
 
89
                this.inView = arc.inView;
 
90
        }
 
91
 
 
92
        public TimedOutputArcComponent paste(double despX, double despY,
 
93
                        boolean toAnotherView) {
 
94
                PlaceTransitionObject source = this.getSource().getLastCopy();
 
95
                PlaceTransitionObject target = this.getTarget().getLastCopy();
 
96
 
 
97
                if (source == null && target == null) {
 
98
                        // don't paste an arc with neither source nor target
 
99
                        return null;
 
100
                }
 
101
 
 
102
                if (source == null) {
 
103
                        if (toAnotherView) {
 
104
                                // if the source belongs to another Petri Net, the arc can't be
 
105
                                // pasted
 
106
                                return null;
 
107
                        } else {
 
108
                                source = this.getSource();
 
109
                        }
 
110
                }
 
111
 
 
112
                if (target == null) {
 
113
                        if (toAnotherView) {
 
114
                                // if the target belongs to another Petri Net, the arc can't be
 
115
                                // pasted
 
116
                                return null;
 
117
                        } else {
 
118
                                target = this.getTarget();
 
119
                        }
 
120
                }
 
121
 
 
122
                TimedOutputArcComponent copy = new TimedOutputArcComponent(0, 0, // startPoint
 
123
                                0, 0, // endPoint
 
124
                                source, target, this.getWeight(), source.getId() + " to "
 
125
                                                + target.getId(), false);
 
126
 
 
127
                copy.myPath.delete();
 
128
                for (int i = 0; i <= this.myPath.getEndIndex(); i++) {
 
129
                        copy.myPath.addPoint(this.myPath.getPoint(i).getX() + despX,
 
130
                                        this.myPath.getPoint(i).getY() + despY, this.myPath
 
131
                                                        .getPointType(i));
 
132
                        copy.myPath.selectPoint(i);
 
133
                }
 
134
 
 
135
                source.addConnectFrom(copy);
 
136
                target.addConnectTo(copy);
 
137
 
 
138
                copy.inView = this.inView;
 
139
 
 
140
                return copy;
 
141
        }
 
142
 
 
143
        public TimedOutputArcComponent copy() {
 
144
                return new TimedOutputArcComponent(this);
 
145
        }
 
146
 
 
147
        public void updateWeightLabel(boolean displayConstantNames) {
 
148
                weightLabel.setText("");
 
149
                setWeightLabelPosition();
 
150
        }
 
151
 
 
152
        @Override
 
153
        public void delete() {
 
154
                if (outputArc != null)
 
155
                        outputArc.delete();
 
156
                super.delete();
 
157
        }
 
158
 
 
159
        @Override
 
160
        public void paintComponent(Graphics g) {
 
161
                super.paintComponent(g);
 
162
                Graphics2D g2 = (Graphics2D) g;
 
163
 
 
164
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
 
165
                                RenderingHints.VALUE_ANTIALIAS_ON);
 
166
 
 
167
                g2.translate(COMPONENT_DRAW_OFFSET + zoomGrow
 
168
                                - myPath.getBounds().getX(), COMPONENT_DRAW_OFFSET + zoomGrow
 
169
                                - myPath.getBounds().getY());
 
170
 
 
171
                AffineTransform reset = g2.getTransform();
 
172
 
 
173
                if (selected && !ignoreSelection) {
 
174
                        g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
 
175
                } else {
 
176
                        g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
 
177
                }
 
178
 
 
179
                g2.setStroke(new BasicStroke(0.01f * zoom));
 
180
                g2.draw(myPath);
 
181
 
 
182
                g2.translate(myPath.getPoint(myPath.getEndIndex()).getX(), myPath
 
183
                                .getPoint(myPath.getEndIndex()).getY());
 
184
 
 
185
                g2.rotate(myPath.getEndAngle() + Math.PI);
 
186
                g2.setColor(java.awt.Color.WHITE);
 
187
 
 
188
                g2.transform(Zoomer.getTransform(zoom));
 
189
                g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
 
190
 
 
191
                if (selected && !ignoreSelection) {
 
192
                        g2.setPaint(Pipe.SELECTION_LINE_COLOUR);
 
193
                } else {
 
194
                        g2.setPaint(Pipe.ELEMENT_LINE_COLOUR);
 
195
                }
 
196
 
 
197
                g2.setStroke(new BasicStroke(0.8f));
 
198
                g2.fillPolygon(head);
 
199
 
 
200
                g2.transform(reset);
 
201
        }
 
202
 
 
203
        public dk.aau.cs.model.tapn.TimedOutputArc underlyingArc() {
 
204
                return outputArc;
 
205
        }
 
206
 
 
207
        public void setUnderlyingArc(dk.aau.cs.model.tapn.TimedOutputArc outputArc) {
 
208
                this.outputArc = outputArc;
 
209
        }
 
210
 
 
211
        public TimedOutputArcComponent copy(TimedArcPetriNet tapn, DataLayer guiModel, Hashtable<PlaceTransitionObject, PlaceTransitionObject> oldToNewMapping) {
 
212
                TimedOutputArcComponent arc = new TimedOutputArcComponent(this);
 
213
                arc.setSource(oldToNewMapping.get(this.getSource()));
 
214
                arc.setTarget(oldToNewMapping.get(this.getTarget()));
 
215
                arc.setUnderlyingArc(tapn.getOutputArcFromTransitionAndPlace(tapn.getTransitionByName(outputArc.source().name()), tapn.getPlaceByName(outputArc.destination().name())));
 
216
                
 
217
                arc.getSource().addConnectFrom(arc);
 
218
                arc.getTarget().addConnectTo(arc);
 
219
                
 
220
                ArcHandler arcHandler = new ArcHandler((DrawingSurfaceImpl)getParent(), arc);
 
221
                arc.addMouseListener(arcHandler);
 
222
                arc.addMouseWheelListener(arcHandler);
 
223
                arc.addMouseMotionListener(arcHandler);
 
224
                
 
225
                arc.setGuiModel(guiModel);
 
226
                
 
227
                return arc;
 
228
        }
415
229
 
416
230
}