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


001:        package newprocess.diagram.edit.policies;
002:
003:        import org.eclipse.draw2d.ColorConstants;
004:        import org.eclipse.draw2d.Figure;
005:        import org.eclipse.draw2d.Graphics;
006:        import org.eclipse.draw2d.IFigure;
007:        import org.eclipse.draw2d.Label;
008:        import org.eclipse.draw2d.RectangleFigure;
009:        import org.eclipse.draw2d.geometry.Rectangle;
010:        import org.eclipse.gef.editpolicies.SelectionEditPolicy;
011:        import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
012:
013:        /**
014:         * @generated
015:         */
016:        public class New_processTextSelectionEditPolicy extends
017:                SelectionEditPolicy {
018:
019:            /**
020:             * @generated
021:             */
022:            private IFigure selectionFeedbackFigure;
023:
024:            /**
025:             * @generated
026:             */
027:            private IFigure focusFeedbackFigure;
028:
029:            /**
030:             * @generated
031:             */
032:            protected void showPrimarySelection() {
033:                if (getHostFigure() instanceof  WrapLabel) {
034:                    ((WrapLabel) getHostFigure()).setSelected(true);
035:                    ((WrapLabel) getHostFigure()).setFocus(true);
036:                } else {
037:                    showSelection();
038:                    showFocus();
039:                }
040:            }
041:
042:            /**
043:             * @generated
044:             */
045:            protected void showSelection() {
046:                if (getHostFigure() instanceof  WrapLabel) {
047:                    ((WrapLabel) getHostFigure()).setSelected(true);
048:                    ((WrapLabel) getHostFigure()).setFocus(false);
049:                } else {
050:                    hideSelection();
051:                    addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
052:                    refreshSelectionFeedback();
053:                    hideFocus();
054:                }
055:            }
056:
057:            /**
058:             * @generated
059:             */
060:            protected void hideSelection() {
061:                if (getHostFigure() instanceof  WrapLabel) {
062:                    ((WrapLabel) getHostFigure()).setSelected(false);
063:                    ((WrapLabel) getHostFigure()).setFocus(false);
064:                } else {
065:                    if (selectionFeedbackFigure != null) {
066:                        removeFeedback(selectionFeedbackFigure);
067:                        selectionFeedbackFigure = null;
068:                    }
069:                    hideFocus();
070:                }
071:            }
072:
073:            /**
074:             * @generated
075:             */
076:            protected void showFocus() {
077:                if (getHostFigure() instanceof  WrapLabel) {
078:                    ((WrapLabel) getHostFigure()).setFocus(true);
079:                } else {
080:                    hideFocus();
081:                    addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
082:                    refreshFocusFeedback();
083:                }
084:            }
085:
086:            /**
087:             * @generated
088:             */
089:            protected void hideFocus() {
090:                if (getHostFigure() instanceof  WrapLabel) {
091:                    ((WrapLabel) getHostFigure()).setFocus(false);
092:                } else {
093:                    if (focusFeedbackFigure != null) {
094:                        removeFeedback(focusFeedbackFigure);
095:                        focusFeedbackFigure = null;
096:                    }
097:                }
098:            }
099:
100:            /**
101:             * @generated
102:             */
103:            protected Rectangle getFeedbackBounds() {
104:                Rectangle bounds;
105:                if (getHostFigure() instanceof  Label) {
106:                    bounds = ((Label) getHostFigure()).getTextBounds();
107:                    bounds.intersect(getHostFigure().getBounds());
108:                } else {
109:                    bounds = getHostFigure().getBounds().getCopy();
110:                }
111:                getHostFigure().getParent().translateToAbsolute(bounds);
112:                getFeedbackLayer().translateToRelative(bounds);
113:                return bounds;
114:            }
115:
116:            /**
117:             * @generated
118:             */
119:            protected IFigure createSelectionFeedbackFigure() {
120:                if (getHostFigure() instanceof  Label) {
121:                    Label feedbackFigure = new Label();
122:                    feedbackFigure.setOpaque(true);
123:                    feedbackFigure
124:                            .setBackgroundColor(ColorConstants.menuBackgroundSelected);
125:                    feedbackFigure
126:                            .setForegroundColor(ColorConstants.menuForegroundSelected);
127:                    return feedbackFigure;
128:                } else {
129:                    RectangleFigure feedbackFigure = new RectangleFigure();
130:                    feedbackFigure.setFill(false);
131:                    return feedbackFigure;
132:                }
133:            }
134:
135:            /**
136:             * @generated
137:             */
138:            protected IFigure createFocusFeedbackFigure() {
139:                return new Figure() {
140:
141:                    protected void paintFigure(Graphics graphics) {
142:                        graphics.drawFocus(getBounds().getResized(-1, -1));
143:                    }
144:                };
145:            }
146:
147:            /**
148:             * @generated
149:             */
150:            protected void updateLabel(Label target) {
151:                Label source = (Label) getHostFigure();
152:                target.setText(source.getText());
153:                target.setTextAlignment(source.getTextAlignment());
154:                target.setFont(source.getFont());
155:            }
156:
157:            /**
158:             * @generated
159:             */
160:            protected void refreshSelectionFeedback() {
161:                if (selectionFeedbackFigure != null) {
162:                    if (selectionFeedbackFigure instanceof  Label) {
163:                        updateLabel((Label) selectionFeedbackFigure);
164:                        selectionFeedbackFigure.setBounds(getFeedbackBounds());
165:                    } else {
166:                        selectionFeedbackFigure.setBounds(getFeedbackBounds()
167:                                .expand(5, 5));
168:                    }
169:                }
170:            }
171:
172:            /**
173:             * @generated
174:             */
175:            protected void refreshFocusFeedback() {
176:                if (focusFeedbackFigure != null) {
177:                    focusFeedbackFigure.setBounds(getFeedbackBounds());
178:                }
179:            }
180:
181:            /**
182:             * @generated
183:             */
184:            public void refreshFeedback() {
185:                refreshSelectionFeedback();
186:                refreshFocusFeedback();
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.