KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > graph > End


1 /* End.java
2  *
3  * Authors:
4  * Stefanovic Nenad chupo@iis.ns.ac.yu
5  * Bojanic Sasa sasaboy@neobee.net
6  * Puskas Vladimir vpuskas@eunet.yu
7  * Pilipovic Goran zboniek@uns.ac.yu
8  *
9  */

10
11 package org.enhydra.jawe.graph;
12
13 import org.enhydra.jawe.*;
14 import org.enhydra.jawe.xml.*;
15
16 import org.jgraph.graph.*;
17
18 import java.util.*;
19 import java.awt.*;
20
21 /**
22  * Used to define End object.
23  */

24 public class End extends Activity {
25
26    /**
27     * Creates end.
28     */

29    public End() {
30       this(null);
31    }
32
33    /**
34     * Creates End with given userObject.
35     */

36    public End(Object JavaDoc userObject) {
37       super(userObject);
38       activityVisualType=JaWEConstants.TYPE_OF_ELEMENT_ENDING;
39    }
40
41    public void showPropertyDialog(Window parentWindow,AbstractGraph graph){}
42
43    /**
44     * Returns <code>true</code> if End is a valid target for transition.
45     * This depends if there is any transition already connected to it.
46     */

47    public boolean acceptsTarget() {
48       if (getIncomingTransitions().size()<1) {
49          return true;
50       }
51       else {
52          return false;
53       }
54    }
55
56    /**
57     * Gets an userObject property which name is given in parameter what.
58     */

59    public XMLElement get (String JavaDoc what) {
60       return null;
61    }
62
63    /**
64     *
65     */

66    public void set (String JavaDoc what,Object JavaDoc value) {
67       return;
68    }
69
70    /**
71     *
72     */

73    public String JavaDoc toString () {
74       String JavaDoc toRet=ResourceManager.getLanguageDependentString("EndKey");
75       if (toRet!=null) {
76          return toRet;
77       } else {
78          return "";
79       }
80    }
81
82 }
83
Popular Tags