Source Code Cross Referenced for EventSubscriptionOperationUserObject.java in  » UML » MetaBoss » com » metaboss » applications » designstudio » userobjects » 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 » UML » MetaBoss » com.metaboss.applications.designstudio.userobjects 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002:        //CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003:        //BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004:        //FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005:        //OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006:        //INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007:        //LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008:        //OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009:        //LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010:        //NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011:        //EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012:        //POSSIBILITY OF SUCH DAMAGE.
013:        //
014:        //Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015:        package com.metaboss.applications.designstudio.userobjects;
016:
017:        import java.awt.event.ActionEvent;
018:        import java.util.ArrayList;
019:
020:        import javax.swing.JTabbedPane;
021:
022:        import com.metaboss.applications.designstudio.Application;
023:        import com.metaboss.applications.designstudio.BaseAction;
024:        import com.metaboss.applications.designstudio.BasePropertiesDialog;
025:        import com.metaboss.applications.designstudio.BaseUserObject;
026:        import com.metaboss.applications.designstudio.components.SeparatorAction;
027:        import com.metaboss.applications.designstudio.constraintstable.ConstraintsViewPanel;
028:        import com.metaboss.applications.designstudio.fieldstable.FieldsViewPanel;
029:        import com.metaboss.applications.designstudio.propertiesdialogs.EventSubscriptionOperationPropertiesDialog;
030:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
031:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EventSubscription;
032:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EventSubscriptionOperation;
033:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EventSubscriptionOperationClass;
034:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.OperationInputField;
035:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.OperationOutputField;
036:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.OperationOutputMessage;
037:
038:        /*      Event subscription operation user object    */
039:
040:        public class EventSubscriptionOperationUserObject extends
041:                BaseUserObject {
042:            public static final int ADD_INPUTFIELD = 1;
043:            public static final int ADD_OUTPUTFIELD = 2;
044:            public static final int ADD_OUTPUTMESSAGE = 3;
045:            public static final int ADD_CONSTRAINT = 4;
046:
047:            private EventSubscriptionOperation mEventSubscriptionOperation = null;
048:            private EventSubscription mEventSubscription = null;
049:            private AddNewInputFieldAction mAddNewInputFieldAction = new AddNewInputFieldAction();
050:            private AddNewOutputFieldAction mAddNewOutputFieldAction = new AddNewOutputFieldAction();
051:            private AddNewMessageFieldAction mAddNewMessageFieldAction = new AddNewMessageFieldAction();
052:            private AddNewConstraint mAddNewConstraint = new AddNewConstraint();
053:            private StudyDependenciesAction mShowDataTypeDependenciesAction = new StudyDependenciesAction();
054:
055:            public EventSubscriptionOperationUserObject(
056:                    EventSubscriptionOperation pEventSubscriptionOperation) {
057:                super (pEventSubscriptionOperation, Application.OPERATION_ICON);
058:                mEventSubscriptionOperation = pEventSubscriptionOperation;
059:            }
060:
061:            public EventSubscriptionOperationUserObject(
062:                    EventSubscriptionOperation pEventSubscriptionOperation,
063:                    String pCaption, int pMode) {
064:                super (pEventSubscriptionOperation, pCaption, pMode);
065:                mEventSubscriptionOperation = pEventSubscriptionOperation;
066:            }
067:
068:            // create new StateMachine
069:            public static void addNewEventSubscriptionOperation(
070:                    EventSubscription pEventSubscription) throws Exception {
071:                EventSubscriptionOperationUserObject lObject = new EventSubscriptionOperationUserObject(
072:                        null);
073:                lObject.mEventSubscription = pEventSubscription;
074:                lObject
075:                        .addNewObject(getObjectPackage(pEventSubscription),
076:                                null);
077:            }
078:
079:            public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
080:                EventSubscriptionOperationClass lClass = pPackage
081:                        .getEnterpriseModel().getEventSubscriptionOperation();
082:                EventSubscriptionOperation lEventSubscriptionOperation = lClass
083:                        .createEventSubscriptionOperation();
084:                if (mEventSubscription != null)
085:                    mEventSubscription
086:                            .setSubscriptionOperation(lEventSubscriptionOperation);
087:                lEventSubscriptionOperation.setName("Default");
088:                return new EventSubscriptionOperationUserObject(
089:                        lEventSubscriptionOperation);
090:            }
091:
092:            public String toString() {
093:                if (mCaption.length() > 0)
094:                    return mCaption;
095:                else
096:                    return "Subscription Operation";
097:            }
098:
099:            // return object root node captions
100:            public String getRootNodeName() {
101:                return null;
102:            }
103:
104:            // fill actions list
105:            public void fillActionsList(ArrayList pList) {
106:                switch (mMode) {
107:                case ALL_ACTIONS:
108:                    super .fillActionsList(pList);
109:                    pList.add(new SeparatorAction());
110:                    pList.add(mAddNewInputFieldAction);
111:                    pList.add(mAddNewConstraint);
112:                    pList.add(mAddNewOutputFieldAction);
113:                    pList.add(mAddNewMessageFieldAction);
114:                    pList.add(new SeparatorAction());
115:                    pList.add(mShowDataTypeDependenciesAction);
116:                    break;
117:                case ADD_INPUTFIELD:
118:                    pList.add(mAddNewInputFieldAction);
119:                    break;
120:                case ADD_OUTPUTFIELD:
121:                    pList.add(mAddNewOutputFieldAction);
122:                    break;
123:                case ADD_OUTPUTMESSAGE:
124:                    pList.add(mAddNewMessageFieldAction);
125:                    break;
126:                case ADD_CONSTRAINT:
127:                    pList.add(mAddNewConstraint);
128:                    break;
129:                }
130:            }
131:
132:            // convert tree element to an action code
133:            public int convertCaptionToAction(String pCaption) {
134:                if (pCaption.equals(Application.getString("inputfields_node")))
135:                    return ADD_INPUTFIELD;
136:                else if (pCaption.equals(Application
137:                        .getString("outputfields_node")))
138:                    return ADD_OUTPUTFIELD;
139:                else if (pCaption.equals(Application
140:                        .getString("outputmessages_node")))
141:                    return ADD_OUTPUTMESSAGE;
142:                else if (pCaption.equals(Application
143:                        .getString("inputconstraints_node")))
144:                    return ADD_CONSTRAINT;
145:                else
146:                    return super .convertCaptionToAction(pCaption);
147:            }
148:
149:            // add extra properties tabs
150:            public void addExtraPropertiesTabs(JTabbedPane pTabbedPane) {
151:                super .addExtraPropertiesTabs(pTabbedPane);
152:                pTabbedPane.insertTab("Input Fields", null,
153:                        new FieldsViewPanel(mEventSubscriptionOperation, 1),
154:                        null, 1);
155:                pTabbedPane.insertTab("Input Constraints", null,
156:                        new ConstraintsViewPanel(mEventSubscriptionOperation),
157:                        null, 2);
158:                pTabbedPane.insertTab("Output Fields", null,
159:                        new FieldsViewPanel(mEventSubscriptionOperation, 2),
160:                        null, 3);
161:                pTabbedPane.insertTab("Output Messages", null,
162:                        new FieldsViewPanel(mEventSubscriptionOperation, 3),
163:                        null, 4);
164:            }
165:
166:            public EventSubscriptionOperation getEventSubscriptionOperation() {
167:                return mEventSubscriptionOperation;
168:            }
169:
170:            // get object editor
171:            public BasePropertiesDialog getObjectEditor() {
172:                return new EventSubscriptionOperationPropertiesDialog();
173:            }
174:
175:            private void addInputField() throws Exception {
176:                OperationInputFieldUserObject
177:                        .addNewOperationInputField(mEventSubscriptionOperation);
178:            }
179:
180:            private void addOutputField() throws Exception {
181:                OperationOutputFieldUserObject
182:                        .addNewOperationOutputField(mEventSubscriptionOperation);
183:            }
184:
185:            // add new Output Message object
186:            private void addOutputMessage() throws Exception {
187:                OperationOutputMessageUserObject
188:                        .addNewMessage(mEventSubscriptionOperation);
189:            }
190:
191:            // add new Model Element Constraint
192:            public void addNewConstraint() throws Exception {
193:                ModelElementConstraintUserObject
194:                        .addNewConstraint(mEventSubscriptionOperation);
195:            }
196:
197:            // returns true if drop object could be accepted
198:            public boolean canAcceptDropObject(BaseUserObject pUserObject,
199:                    boolean pCopy) {
200:                if (pUserObject != null
201:                        && super .canAcceptDropObject(pUserObject, pCopy)) {
202:                    if ((pUserObject instanceof  OperationInputFieldUserObject && (mMode == BaseUserObject.ALL_ACTIONS || mMode == EventSubscriptionOperationUserObject.ADD_INPUTFIELD))
203:                            || (pUserObject instanceof  OperationOutputFieldUserObject && (mMode == BaseUserObject.ALL_ACTIONS || mMode == EventSubscriptionOperationUserObject.ADD_OUTPUTFIELD))
204:                            || (pUserObject instanceof  OperationOutputMessageUserObject && (mMode == BaseUserObject.ALL_ACTIONS || mMode == EventSubscriptionOperationUserObject.ADD_OUTPUTMESSAGE))) {
205:                        return (pCopy) ? pUserObject.canDuplicate() : true;
206:                    }
207:                }
208:                return false;
209:            }
210:
211:            // acccept drop target in transaction
212:            protected void transactionalAccept(BaseUserObject pUserObject,
213:                    boolean pCopy) throws Exception {
214:                if (pUserObject != null) {
215:                    if (pUserObject instanceof  OperationInputFieldUserObject) {
216:                        OperationInputFieldUserObject lUserObject = (OperationInputFieldUserObject) pUserObject;
217:                        if (pCopy) {
218:                            OperationInputField lField = (OperationInputField) Application.sModelRepository
219:                                    .duplicateModelElement(lUserObject
220:                                            .getField());
221:                            lField.setOperation(mEventSubscriptionOperation);
222:                        } else
223:                            lUserObject.getField().setOperation(
224:                                    mEventSubscriptionOperation);
225:                    } else if (pUserObject instanceof  OperationOutputFieldUserObject) {
226:                        OperationOutputFieldUserObject lUserObject = (OperationOutputFieldUserObject) pUserObject;
227:                        if (pCopy) {
228:                            OperationOutputField lField = (OperationOutputField) Application.sModelRepository
229:                                    .duplicateModelElement(lUserObject
230:                                            .getField());
231:                            lField.setOperation(mEventSubscriptionOperation);
232:                        } else
233:                            lUserObject.getField().setOperation(
234:                                    mEventSubscriptionOperation);
235:                    } else if (pUserObject instanceof  OperationOutputMessageUserObject) {
236:                        OperationOutputMessageUserObject lUserObject = (OperationOutputMessageUserObject) pUserObject;
237:                        if (pCopy) {
238:                            OperationOutputMessage lMessage = (OperationOutputMessage) Application.sModelRepository
239:                                    .duplicateModelElement(lUserObject
240:                                            .getMessage());
241:                            lMessage.setOperation(mEventSubscriptionOperation);
242:                        } else
243:                            lUserObject.getMessage().setOperation(
244:                                    mEventSubscriptionOperation);
245:                    }
246:                }
247:            }
248:
249:            /*              Actions             */
250:
251:            public class AddNewInputFieldAction extends BaseAction {
252:                public AddNewInputFieldAction() {
253:                    super ("Add New Input Field", Application
254:                            .getAddIcon(Application.INPUTFIELD_ICON));
255:                }
256:
257:                public void actionPerformed(ActionEvent e) {
258:                    try {
259:                        addInputField();
260:                    } catch (Throwable t) {
261:                        Application.processError(t);
262:                    }
263:                }
264:            }
265:
266:            public class AddNewOutputFieldAction extends BaseAction {
267:                public AddNewOutputFieldAction() {
268:                    super ("Add New Output Field", Application
269:                            .getAddIcon(Application.OUTPUTFIELD_ICON));
270:                }
271:
272:                public void actionPerformed(ActionEvent e) {
273:                    try {
274:                        addOutputField();
275:                    } catch (Throwable t) {
276:                        Application.processError(t);
277:                    }
278:                }
279:            }
280:
281:            public class AddNewMessageFieldAction extends BaseAction {
282:                public AddNewMessageFieldAction() {
283:                    super ("Add New Output Message", Application
284:                            .getAddIcon(Application.OUTMESSAGE_ICON));
285:                }
286:
287:                public void actionPerformed(ActionEvent e) {
288:                    try {
289:                        addOutputMessage();
290:                    } catch (Throwable t) {
291:                        Application.processError(t);
292:                    }
293:                }
294:            }
295:
296:            /*      Add New Model Element Constraint Action        */
297:
298:            public class AddNewConstraint extends BaseAction {
299:                public AddNewConstraint() {
300:                    super ("Add New Input Constraint", Application
301:                            .getAddIcon(Application.CONSTRAINT_ICON));
302:                }
303:
304:                public void actionPerformed(ActionEvent arg0) {
305:                    try {
306:                        addNewConstraint();
307:                    } catch (Exception e) {
308:                        e.printStackTrace();
309:                    }
310:                }
311:            }
312:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.