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