KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* Start.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 Start object in graph.
23 */

24 public class Start extends Activity {
25
26    /**
27    * Creates start.
28    */

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

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

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

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

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

75    public String JavaDoc toString () {
76       String JavaDoc toRet=ResourceManager.getLanguageDependentString("StartKey");
77       if (toRet!=null) {
78          return toRet;
79       } else {
80          return "";
81       }
82    }
83 }
84
85 /* End of Start.java */
86
Popular Tags