Source Code Cross Referenced for LoaderEditPart.java in  » Workflow-Engines » osbl-1_0 » newprocess » diagram » edit » parts » 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 » osbl 1_0 » newprocess.diagram.edit.parts 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package newprocess.diagram.edit.parts;
002:
003:        import newprocess.diagram.cust.policies.NodeComponentEditPolicy;
004:        import newprocess.diagram.edit.policies.LoaderItemSemanticEditPolicy;
005:        import newprocess.diagram.part.New_processVisualIDRegistry;
006:
007:        import org.eclipse.draw2d.Graphics;
008:        import org.eclipse.draw2d.IFigure;
009:        import org.eclipse.draw2d.RectangleFigure;
010:        import org.eclipse.draw2d.StackLayout;
011:        import org.eclipse.draw2d.geometry.Dimension;
012:        import org.eclipse.gef.EditPart;
013:        import org.eclipse.gef.EditPolicy;
014:        import org.eclipse.gef.Request;
015:        import org.eclipse.gef.commands.Command;
016:        import org.eclipse.gef.editpolicies.LayoutEditPolicy;
017:        import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
018:        import org.eclipse.gef.requests.CreateRequest;
019:        import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
020:        import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
021:        import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
022:        import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
023:        import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
024:        import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
025:        import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
026:        import org.eclipse.gmf.runtime.notation.View;
027:        import org.eclipse.swt.graphics.Color;
028:
029:        /**
030:         * @generated
031:         */
032:        public class LoaderEditPart extends ShapeNodeEditPart {
033:
034:            /**
035:             * @generated
036:             */
037:            public static final int VISUAL_ID = 3013;
038:
039:            /**
040:             * @generated
041:             */
042:            protected IFigure contentPane;
043:
044:            /**
045:             * @generated
046:             */
047:            protected IFigure primaryShape;
048:
049:            /**
050:             * @generated
051:             */
052:            public LoaderEditPart(View view) {
053:                super (view);
054:            }
055:
056:            /**
057:             * @generated NOT
058:             * @author sh
059:             */
060:            protected void createDefaultEditPolicies() {
061:                super .createDefaultEditPolicies();
062:
063:                installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
064:                        new LoaderItemSemanticEditPolicy());
065:                installEditPolicy(EditPolicy.LAYOUT_ROLE,
066:                        createLayoutEditPolicy());
067:                // install this policy to disable deleting of the Globals Figure
068:                installEditPolicy(EditPolicy.COMPONENT_ROLE,
069:                        new NodeComponentEditPolicy());
070:            }
071:
072:            /**
073:             * @generated
074:             */
075:            protected LayoutEditPolicy createLayoutEditPolicy() {
076:                LayoutEditPolicy lep = new LayoutEditPolicy() {
077:
078:                    protected EditPolicy createChildEditPolicy(EditPart child) {
079:                        EditPolicy result = child
080:                                .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
081:                        if (result == null) {
082:                            result = new NonResizableEditPolicy();
083:                        }
084:                        return result;
085:                    }
086:
087:                    protected Command getMoveChildrenCommand(Request request) {
088:                        return null;
089:                    }
090:
091:                    protected Command getCreateCommand(CreateRequest request) {
092:                        return null;
093:                    }
094:                };
095:                return lep;
096:            }
097:
098:            /**
099:             * @generated
100:             */
101:            protected IFigure createNodeShape() {
102:                LoaderFigure figure = new LoaderFigure();
103:                return primaryShape = figure;
104:            }
105:
106:            /**
107:             * @generated
108:             */
109:            public LoaderFigure getPrimaryShape() {
110:                return (LoaderFigure) primaryShape;
111:            }
112:
113:            /**
114:             * @generated
115:             */
116:            protected boolean addFixedChild(EditPart childEditPart) {
117:                if (childEditPart instanceof  LoaderNameEditPart) {
118:                    ((LoaderNameEditPart) childEditPart)
119:                            .setLabel(getPrimaryShape()
120:                                    .getFigureLoaderNameFigure());
121:                    return true;
122:                }
123:                return false;
124:            }
125:
126:            /**
127:             * @generated
128:             */
129:            protected boolean removeFixedChild(EditPart childEditPart) {
130:
131:                return false;
132:            }
133:
134:            /**
135:             * @generated
136:             */
137:            protected void addChildVisual(EditPart childEditPart, int index) {
138:                if (addFixedChild(childEditPart)) {
139:                    return;
140:                }
141:                super .addChildVisual(childEditPart, -1);
142:            }
143:
144:            /**
145:             * @generated
146:             */
147:            protected void removeChildVisual(EditPart childEditPart) {
148:                if (removeFixedChild(childEditPart)) {
149:                    return;
150:                }
151:                super .removeChildVisual(childEditPart);
152:            }
153:
154:            /**
155:             * @generated
156:             */
157:            protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
158:
159:                return super .getContentPaneFor(editPart);
160:            }
161:
162:            /**
163:             * @generated
164:             */
165:            protected NodeFigure createNodePlate() {
166:                DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(
167:                        getMapMode().DPtoLP(120), getMapMode().DPtoLP(20));
168:
169:                return result;
170:            }
171:
172:            /**
173:             * Creates figure for this edit part.
174:             * 
175:             * Body of this method does not depend on settings in generation model
176:             * so you may safely remove <i>generated</i> tag and modify it.
177:             * 
178:             * @generated
179:             */
180:            protected NodeFigure createNodeFigure() {
181:                NodeFigure figure = createNodePlate();
182:                figure.setLayoutManager(new StackLayout());
183:                IFigure shape = createNodeShape();
184:                figure.add(shape);
185:                contentPane = setupContentPane(shape);
186:                return figure;
187:            }
188:
189:            /**
190:             * Default implementation treats passed figure as content pane.
191:             * Respects layout one may have set for generated figure.
192:             * @param nodeShape instance of generated figure class
193:             * @generated
194:             */
195:            protected IFigure setupContentPane(IFigure nodeShape) {
196:                if (nodeShape.getLayoutManager() == null) {
197:                    ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
198:                    layout.setSpacing(getMapMode().DPtoLP(5));
199:                    nodeShape.setLayoutManager(layout);
200:                }
201:                return nodeShape; // use nodeShape itself as contentPane
202:            }
203:
204:            /**
205:             * @generated
206:             */
207:            public IFigure getContentPane() {
208:                if (contentPane != null) {
209:                    return contentPane;
210:                }
211:                return super .getContentPane();
212:            }
213:
214:            /**
215:             * @generated
216:             */
217:            public EditPart getPrimaryChildEditPart() {
218:                return getChildBySemanticHint(New_processVisualIDRegistry
219:                        .getType(LoaderNameEditPart.VISUAL_ID));
220:            }
221:
222:            /**
223:             * @generated
224:             */
225:            public class LoaderFigure extends RectangleFigure {
226:                /**
227:                 * @generated
228:                 */
229:                public LoaderFigure() {
230:                    this .setFill(true);
231:                    this .setFillXOR(false);
232:                    this .setOutline(true);
233:                    this .setOutlineXOR(false);
234:                    this .setLineWidth(1);
235:                    this .setLineStyle(Graphics.LINE_SOLID);
236:                    this .setBackgroundColor(LOADERFIGURE_BACK);
237:                    this .setPreferredSize(new Dimension(getMapMode()
238:                            .DPtoLP(120), getMapMode().DPtoLP(20)));
239:                    createContents();
240:                }
241:
242:                /**
243:                 * @generated
244:                 */
245:                private void createContents() {
246:
247:                    WrapLabel loaderNameFigure0 = new WrapLabel();
248:                    loaderNameFigure0.setText("<...>");
249:
250:                    this .add(loaderNameFigure0);
251:                    setFigureLoaderNameFigure(loaderNameFigure0);
252:
253:                }
254:
255:                /**
256:                 * @generated
257:                 */
258:                private WrapLabel fLoaderNameFigure;
259:
260:                /**
261:                 * @generated
262:                 */
263:                public WrapLabel getFigureLoaderNameFigure() {
264:                    return fLoaderNameFigure;
265:                }
266:
267:                /**
268:                 * @generated
269:                 */
270:                private void setFigureLoaderNameFigure(WrapLabel fig) {
271:                    fLoaderNameFigure = fig;
272:                }
273:
274:                /**
275:                 * @generated
276:                 */
277:                private boolean myUseLocalCoordinates = false;
278:
279:                /**
280:                 * @generated
281:                 */
282:                protected boolean useLocalCoordinates() {
283:                    return myUseLocalCoordinates;
284:                }
285:
286:                /**
287:                 * @generated
288:                 */
289:                protected void setUseLocalCoordinates(
290:                        boolean useLocalCoordinates) {
291:                    myUseLocalCoordinates = useLocalCoordinates;
292:                }
293:
294:            }
295:
296:            /**
297:             * @generated
298:             */
299:            static final Color LOADERFIGURE_BACK = new Color(null, 204, 255,
300:                    204);
301:
302:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.