Source Code Cross Referenced for RootEditPart.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.RootItemSemanticEditPolicy;
005:
006:        import org.eclipse.draw2d.Graphics;
007:        import org.eclipse.draw2d.IFigure;
008:        import org.eclipse.draw2d.RectangleFigure;
009:        import org.eclipse.draw2d.StackLayout;
010:        import org.eclipse.draw2d.geometry.Dimension;
011:        import org.eclipse.gef.EditPart;
012:        import org.eclipse.gef.EditPolicy;
013:        import org.eclipse.gef.Request;
014:        import org.eclipse.gef.commands.Command;
015:        import org.eclipse.gef.editpolicies.LayoutEditPolicy;
016:        import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
017:        import org.eclipse.gef.requests.CreateRequest;
018:        import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderItemEditPart;
019:        import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
020:        import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
021:        import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
022:        import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
023:        import org.eclipse.gmf.runtime.notation.View;
024:        import org.eclipse.swt.graphics.Color;
025:
026:        /**
027:         * @generated
028:         */
029:        public class RootEditPart extends AbstractBorderItemEditPart {
030:
031:            /**
032:             * @generated
033:             */
034:            public static final int VISUAL_ID = 3002;
035:
036:            /**
037:             * @generated
038:             */
039:            protected IFigure contentPane;
040:
041:            /**
042:             * @generated
043:             */
044:            protected IFigure primaryShape;
045:
046:            /**
047:             * @generated
048:             */
049:            public RootEditPart(View view) {
050:                super (view);
051:            }
052:
053:            /**
054:             * @generated NOT
055:             * @author sh
056:             */
057:            protected void createDefaultEditPolicies() {
058:                super .createDefaultEditPolicies();
059:
060:                installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE,
061:                        getPrimaryDragEditPolicy());
062:                installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
063:                        new RootItemSemanticEditPolicy());
064:                installEditPolicy(EditPolicy.LAYOUT_ROLE,
065:                        createLayoutEditPolicy());
066:                // install this policy to disable deleting of RootPorts
067:                installEditPolicy(EditPolicy.COMPONENT_ROLE,
068:                        new NodeComponentEditPolicy());
069:            }
070:
071:            /**
072:             * @generated
073:             */
074:            protected LayoutEditPolicy createLayoutEditPolicy() {
075:                LayoutEditPolicy lep = new LayoutEditPolicy() {
076:
077:                    protected EditPolicy createChildEditPolicy(EditPart child) {
078:                        EditPolicy result = child
079:                                .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
080:                        if (result == null) {
081:                            result = new NonResizableEditPolicy();
082:                        }
083:                        return result;
084:                    }
085:
086:                    protected Command getMoveChildrenCommand(Request request) {
087:                        return null;
088:                    }
089:
090:                    protected Command getCreateCommand(CreateRequest request) {
091:                        return null;
092:                    }
093:                };
094:                return lep;
095:            }
096:
097:            /**
098:             * @generated
099:             */
100:            protected IFigure createNodeShape() {
101:                ConditionTermFigure figure = new ConditionTermFigure();
102:                return primaryShape = figure;
103:            }
104:
105:            /**
106:             * @generated
107:             */
108:            public ConditionTermFigure getPrimaryShape() {
109:                return (ConditionTermFigure) primaryShape;
110:            }
111:
112:            /**
113:             * @generated
114:             */
115:            protected NodeFigure createNodePlate() {
116:                DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(
117:                        getMapMode().DPtoLP(10), getMapMode().DPtoLP(5));
118:
119:                //FIXME: workaround for #154536
120:                result.getBounds().setSize(result.getPreferredSize());
121:                return result;
122:            }
123:
124:            /**
125:             * Creates figure for this edit part.
126:             * 
127:             * Body of this method does not depend on settings in generation model
128:             * so you may safely remove <i>generated</i> tag and modify it.
129:             * 
130:             * @generated
131:             */
132:            protected NodeFigure createNodeFigure() {
133:                NodeFigure figure = createNodePlate();
134:                figure.setLayoutManager(new StackLayout());
135:                IFigure shape = createNodeShape();
136:                figure.add(shape);
137:                contentPane = setupContentPane(shape);
138:                return figure;
139:            }
140:
141:            /**
142:             * Default implementation treats passed figure as content pane.
143:             * Respects layout one may have set for generated figure.
144:             * @param nodeShape instance of generated figure class
145:             * @generated
146:             */
147:            protected IFigure setupContentPane(IFigure nodeShape) {
148:                if (nodeShape.getLayoutManager() == null) {
149:                    ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
150:                    layout.setSpacing(getMapMode().DPtoLP(5));
151:                    nodeShape.setLayoutManager(layout);
152:                }
153:                return nodeShape; // use nodeShape itself as contentPane
154:            }
155:
156:            /**
157:             * @generated
158:             */
159:            public IFigure getContentPane() {
160:                if (contentPane != null) {
161:                    return contentPane;
162:                }
163:                return super .getContentPane();
164:            }
165:
166:            /**
167:             * @generated
168:             */
169:            public class ConditionTermFigure extends RectangleFigure {
170:                /**
171:                 * @generated
172:                 */
173:                public ConditionTermFigure() {
174:                    this .setFill(true);
175:                    this .setFillXOR(false);
176:                    this .setOutline(true);
177:                    this .setOutlineXOR(false);
178:                    this .setLineWidth(1);
179:                    this .setLineStyle(Graphics.LINE_SOLID);
180:                    this .setBackgroundColor(CONDITIONTERMFIGURE_BACK);
181:                    this .setPreferredSize(new Dimension(
182:                            getMapMode().DPtoLP(10), getMapMode().DPtoLP(5)));
183:                    this .setMaximumSize(new Dimension(getMapMode().DPtoLP(10),
184:                            getMapMode().DPtoLP(5)));
185:                    this .setMinimumSize(new Dimension(getMapMode().DPtoLP(10),
186:                            getMapMode().DPtoLP(5)));
187:                }
188:
189:                /**
190:                 * @generated
191:                 */
192:                private boolean myUseLocalCoordinates = false;
193:
194:                /**
195:                 * @generated
196:                 */
197:                protected boolean useLocalCoordinates() {
198:                    return myUseLocalCoordinates;
199:                }
200:
201:                /**
202:                 * @generated
203:                 */
204:                protected void setUseLocalCoordinates(
205:                        boolean useLocalCoordinates) {
206:                    myUseLocalCoordinates = useLocalCoordinates;
207:                }
208:
209:            }
210:
211:            /**
212:             * @generated
213:             */
214:            static final Color CONDITIONTERMFIGURE_BACK = new Color(null, 49,
215:                    106, 197);
216:
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.