Source Code Cross Referenced for SystemUserObject.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 com.metaboss.applications.designstudio.Application;
021:        import com.metaboss.applications.designstudio.BaseAction;
022:        import com.metaboss.applications.designstudio.BasePropertiesDialog;
023:        import com.metaboss.applications.designstudio.BaseUserObject;
024:        import com.metaboss.applications.designstudio.components.SeparatorAction;
025:        import com.metaboss.applications.designstudio.propertiesdialogs.SimpleObjectPropertiesdialog;
026:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
027:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Enterprise;
028:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EnterpriseModelPackage;
029:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Servicemodule;
030:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.System;
031:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.SystemClass;
032:
033:        /*		BOSystem user object class		*/
034:
035:        public class SystemUserObject extends BaseUserObject {
036:            public static final int APPLICATION_ACTION = 1;
037:            public static final int DOMAIN_ACTION = 2;
038:            public static final int SERVICEMODULE_ACTION = 3;
039:            public static final int PUBLICINTERFACES_ACTION = 4;
040:            public static final int IMPLEMETATIONCOMPONENTS_ACTION = 5;
041:
042:            private System mSystem = null;
043:            private AddNewApplicationAction mAddNewApplicationAction = new AddNewApplicationAction();
044:            private AddNewDomainAction mAddNewDomainAction = new AddNewDomainAction();
045:            private AddNewServiceModuleAction mAddServiceModuleAction = new AddNewServiceModuleAction();
046:            private StudyDependenciesAction mShowDataTypeDependenciesAction = new StudyDependenciesAction();
047:            private AddNewUsageSpecificationAction mAddNewUsageSpecificationAction = new AddNewUsageSpecificationAction();
048:
049:            public SystemUserObject(System pSystem) {
050:                super (pSystem, Application.SYSTEM_ICON);
051:                mSystem = pSystem;
052:            }
053:
054:            public SystemUserObject(System pSystem, String pCaption, int pMode) {
055:                super (pSystem, pCaption, pMode);
056:                mSystem = pSystem;
057:            }
058:
059:            // create new system
060:            public static SystemUserObject addNewSystem(Enterprise pEnterprise)
061:                    throws Exception {
062:                return (SystemUserObject) new SystemUserObject(null)
063:                        .addNewObject(getObjectPackage(pEnterprise),
064:                                pEnterprise.getSystems());
065:            }
066:
067:            public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
068:                EnterpriseModelPackage lEnterpriseModelPackage = pPackage
069:                        .getEnterpriseModel();
070:                SystemClass lSystemClass = lEnterpriseModelPackage.getSystem();
071:                return new SystemUserObject(lSystemClass.createSystem());
072:            }
073:
074:            // return object root node captions
075:            public String getRootNodeName() {
076:                return Application.getString("systems_node");
077:            }
078:
079:            // convert tree element to an action code
080:            public int convertCaptionToAction(String pCaption) {
081:                if (pCaption.equals(Application
082:                        .getString("publicinterfaces_node")))
083:                    return PUBLICINTERFACES_ACTION;
084:                else if (pCaption.equals(Application
085:                        .getString("servicemodules_node")))
086:                    return SERVICEMODULE_ACTION;
087:                else if (pCaption.equals(Application
088:                        .getString("implemetationcomponents_node")))
089:                    return IMPLEMETATIONCOMPONENTS_ACTION;
090:                else if (pCaption.equals(Application.getString("domains_node")))
091:                    return DOMAIN_ACTION;
092:                else
093:                    return super .convertCaptionToAction(pCaption);
094:            }
095:
096:            public System getSystem() {
097:                return mSystem;
098:            }
099:
100:            // fill actions list
101:            public void fillActionsList(ArrayList pList) {
102:                switch (mMode) {
103:                case ALL_ACTIONS:
104:                    super .fillActionsList(pList);
105:                    pList.add(new SeparatorAction());
106:                    //???pList.add(mAddNewApplicationAction);
107:                    pList.add(mAddNewDomainAction);
108:                    pList.add(mAddServiceModuleAction);
109:                    if (mSystem.getUsageSpecification() == null)
110:                        pList.add(mAddNewUsageSpecificationAction);
111:                    pList.add(new SeparatorAction());
112:                    pList.add(mShowDataTypeDependenciesAction);
113:                    break;
114:                case APPLICATION_ACTION:
115:                    pList.add(mAddNewApplicationAction);
116:                    break;
117:                case DOMAIN_ACTION:
118:                    pList.add(mAddNewDomainAction);
119:                    break;
120:                case SERVICEMODULE_ACTION:
121:                    pList.add(mAddServiceModuleAction);
122:                    break;
123:                case PUBLICINTERFACES_ACTION:
124:                    pList.add(mAddServiceModuleAction);
125:                    break;
126:                case IMPLEMETATIONCOMPONENTS_ACTION:
127:                    pList.add(mAddNewDomainAction);
128:                    break;
129:                }
130:            }
131:
132:            // add new Domain
133:            public void addNewDomain() throws Exception {
134:                DomainUserObject.addNewDomain(mSystem);
135:            }
136:
137:            // add new service module
138:            public void addNewServiceModule() throws Exception {
139:                ServicemoduleUserObject.addNewServiceModule(mSystem);
140:            }
141:
142:            // add new state machine
143:            public void addNewUsageSpecification() throws Exception {
144:                UsageSpecificationUserObject.addNewStateMachine(mSystem);
145:            }
146:
147:            // get object editor
148:            public BasePropertiesDialog getObjectEditor() {
149:                return new SimpleObjectPropertiesdialog("System");
150:            }
151:
152:            // returns true if drop object could be accepted
153:            public boolean canAcceptDropObject(BaseUserObject pUserObject,
154:                    boolean pCopy) {
155:                if (pUserObject != null
156:                        && super .canAcceptDropObject(pUserObject, pCopy)) {
157:                    if ((pUserObject instanceof  ServicemoduleUserObject && (mMode == BaseUserObject.ALL_ACTIONS || mMode == SystemUserObject.SERVICEMODULE_ACTION))) {
158:                        return (pCopy) ? pUserObject.canDuplicate() : true;
159:                    }
160:                }
161:                return false;
162:            }
163:
164:            // acccept drop target in transaction
165:            protected void transactionalAccept(BaseUserObject pUserObject,
166:                    boolean pCopy) throws Exception {
167:                if (pUserObject != null) {
168:                    if (pUserObject instanceof  ServicemoduleUserObject) {
169:                        ServicemoduleUserObject lUserObject = (ServicemoduleUserObject) pUserObject;
170:                        if (pCopy) {
171:                            Servicemodule lServicemodule = (Servicemodule) Application.sModelRepository
172:                                    .duplicateModelElement(lUserObject
173:                                            .getServiceModule());
174:                            lServicemodule.setSystem(mSystem);
175:                        } else
176:                            lUserObject.getServiceModule().setSystem(mSystem);
177:                    }
178:                }
179:            }
180:
181:            /*				Actions				*/
182:
183:            /*		Add New Application Action Class		*/
184:
185:            public class AddNewApplicationAction extends BaseAction {
186:                public AddNewApplicationAction() {
187:                    super ("Add New Applciation", Application
188:                            .getAddIcon(Application.APPLICATION_ICON));
189:                }
190:
191:                public void actionPerformed(ActionEvent e) {
192:                    try {
193:                        //???addNewApplication();
194:                    } catch (Throwable t) {
195:                        t.printStackTrace();
196:                    }
197:                }
198:            }
199:
200:            /*		Add New Domain Action Class		*/
201:
202:            public class AddNewDomainAction extends BaseAction {
203:                public AddNewDomainAction() {
204:                    super ("Add New Domain", Application
205:                            .getAddIcon(Application.DOMAIN_ICON));
206:                }
207:
208:                public void actionPerformed(ActionEvent e) {
209:                    try {
210:                        addNewDomain();
211:                    } catch (Throwable t) {
212:                        t.printStackTrace();
213:                    }
214:                }
215:            }
216:
217:            /*		Add New Service Module Action Class		*/
218:
219:            public class AddNewServiceModuleAction extends BaseAction {
220:                public AddNewServiceModuleAction() {
221:                    super ("Add New Service Module", Application
222:                            .getAddIcon(Application.SERVICEMODULE_ICON));
223:                }
224:
225:                public void actionPerformed(ActionEvent e) {
226:                    try {
227:                        addNewServiceModule();
228:                    } catch (Throwable t) {
229:                        t.printStackTrace();
230:                    }
231:                }
232:            }
233:
234:            /*      Add New Usage Specification Class     */
235:
236:            public class AddNewUsageSpecificationAction extends BaseAction {
237:                public AddNewUsageSpecificationAction() {
238:                    super ("Add New Usage Specification", Application
239:                            .getAddIcon(Application.USAGESPECIFICATION_ICON));
240:                }
241:
242:                public void actionPerformed(ActionEvent e) {
243:                    try {
244:                        addNewUsageSpecification();
245:                    } catch (Throwable t) {
246:                        t.printStackTrace();
247:                    }
248:                }
249:            }
250:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.