Source Code Cross Referenced for DefaultGraphBubbleActivity.java in  » Workflow-Engines » JaWE » org » enhydra » jawe » components » graph » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » JaWE » org.enhydra.jawe.components.graph 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.enhydra.jawe.components.graph;
002:
003:        import java.awt.Point;
004:        import java.util.Enumeration;
005:        import java.util.HashSet;
006:        import java.util.Iterator;
007:        import java.util.Set;
008:
009:        import org.enhydra.jawe.ResourceManager;
010:        import org.enhydra.shark.xpdl.XMLComplexElement;
011:        import org.enhydra.shark.xpdl.elements.ExtendedAttribute;
012:
013:        /**
014:         * Used to define End object.
015:         * @author Sasa Bojanic
016:         */
017:        public class DefaultGraphBubbleActivity extends
018:                GraphBubbleActivityInterface {
019:
020:            protected boolean isStart;
021:            protected String type;
022:
023:            /**
024:             * Creates End with given userObject.
025:             */
026:            public DefaultGraphBubbleActivity(ExtendedAttribute ea) {
027:                setUserObject(ea);
028:                StartEndDescription sed = getStartEndDescription();
029:                isStart = sed.isStart();
030:                type = sed.getType();
031:                addPort();
032:            }
033:
034:            protected void addPort() {
035:                // Create Port
036:                // Floating Center Port (Child 0 is Default)
037:                GraphPortInterface port = GraphUtilities.getGraphController()
038:                        .getGraphObjectFactory().createPort("Center",
039:                                GraphEAConstants.PORT_TYPE_DEFAULT);
040:                add(port);
041:            }
042:
043:            public String getType() {
044:                return type;
045:            }
046:
047:            public boolean isStart() {
048:                return isStart;
049:            }
050:
051:            public StartEndDescription getStartEndDescription() {
052:                return new StartEndDescription((ExtendedAttribute) userObject);
053:            }
054:
055:            /**
056:             * Gets the port associate with this activity.
057:             */
058:            public GraphPortInterface getPort() {
059:                for (Enumeration e = children(); e.hasMoreElements();) {
060:                    Object child = e.nextElement();
061:                    if (child instanceof  GraphPortInterface) {
062:                        return (GraphPortInterface) child;
063:                    }
064:                }
065:                return null;
066:            }
067:
068:            public XMLComplexElement getPropertyObject() {
069:                if (userObject instanceof  XMLComplexElement) {//Harald Meister: fixes a rare bug
070:                    return (XMLComplexElement) userObject;
071:                }
072:                return null;//Harald Meister
073:            }
074:
075:            /**
076:             * Gets a tooltip text for activity.
077:             */
078:            public String getTooltip() {
079:                return "";
080:            }
081:
082:            /**
083:             * Returns <code>true</code> if End is a valid target for transition.
084:             * This depends if there is any transition already connected to it.
085:             */
086:            public boolean acceptsTarget() {
087:                if (isStart()) {
088:                    return false;
089:                }
090:                if (getReferencingActivities().size() < 1) {
091:                    return true;
092:                }
093:                return false;
094:            }
095:
096:            public boolean acceptsSource() {
097:                if (isStart()) {
098:                    if (getReferencedActivities().size() < 1) {
099:                        return true;
100:                    }
101:                    return false;
102:                }
103:                return false;
104:            }
105:
106:            /**
107:             *
108:             */
109:            public String toString() {
110:                String toRet = ResourceManager
111:                        .getLanguageDependentString("EndKey");
112:                if (isStart()) {
113:                    toRet = ResourceManager
114:                            .getLanguageDependentString("StartKey");
115:                }
116:                if (toRet != null) {
117:                    return toRet;
118:                }
119:                return "";
120:            }
121:
122:            /**
123:             * Create a clone of the cell. The cloning of the
124:             * user object is deferred to the cloneUserObject()
125:             * method.
126:             * NOTE: this original method of DefaultGraphCell is
127:             *       modified to retain synchronization of userObject and
128:             *       value attribute from attribute map when model
129:             *       is attribute store
130:             *
131:             * @return Object  a clone of this object.
132:             */
133:            public Object clone() {
134:                DefaultGraphBubbleActivity c = (DefaultGraphBubbleActivity) super 
135:                        .clone();
136:                c.setUserObject(c.userObject);
137:                return c;
138:            }
139:
140:            /**
141:             * Create a clone of the ActivityProperties object.
142:             * @return Object a clone of this activity property object.
143:             */
144:            protected Object cloneUserObject() {
145:                return ((ExtendedAttribute) userObject).clone();
146:            }
147:
148:            /**
149:             * Gets all activities that reference this one.
150:             */
151:            public Set getReferencingActivities() {
152:                Set referencingActivities = new HashSet();
153:                for (Iterator i = getPort().edges(); i.hasNext();) {
154:                    GraphTransitionInterface l = (GraphTransitionInterface) i
155:                            .next();
156:                    Object target = ((GraphPortInterface) (l.getTarget()))
157:                            .getParent();
158:                    if (this  == target) {
159:                        referencingActivities.add(((GraphPortInterface) (l
160:                                .getSource())).getParent());
161:                    }
162:                }
163:                return referencingActivities;
164:            }
165:
166:            /**
167:             * Gets all activities that this activity references.
168:             */
169:            public Set getReferencedActivities() {
170:                Set referencedActivities = new HashSet();
171:                for (Iterator i = getPort().edges(); i.hasNext();) {
172:                    GraphTransitionInterface l = (GraphTransitionInterface) i
173:                            .next();
174:                    Object source = ((GraphPortInterface) (l.getSource()))
175:                            .getParent();
176:                    if (this  == source) {
177:                        referencedActivities.add(((GraphPortInterface) (l
178:                                .getTarget())).getParent());
179:                    }
180:                }
181:                return referencedActivities;
182:            }
183:
184:            public Point getOffset() {
185:                return getStartEndDescription().getOffset();
186:            }
187:
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.