Source Code Cross Referenced for EnterpriseUserObject.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:        import java.util.Iterator;
020:        import java.util.SortedSet;
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.auxilarydialogs.DiagramSelectDialog;
027:        import com.metaboss.applications.designstudio.components.SeparatorAction;
028:        import com.metaboss.applications.designstudio.propertiesdialogs.SimpleObjectPropertiesdialog;
029:        import com.metaboss.applications.designstudio.propertiesview.PropertiesTableModel;
030:        import com.metaboss.applications.designstudio.systemsmodel.SystemsPanel;
031:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
032:        import com.metaboss.sdlctools.models.metabossmodel.ModelElementUtils;
033:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Enterprise;
034:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EnterpriseClass;
035:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EnterpriseModelPackage;
036:        import com.metaboss.sdlctools.models.metabossmodel.visualmodel.EnterpriseSystemsDiagram;
037:
038:        /*		User objects Enterprises		*/
039:
040:        public class EnterpriseUserObject extends BaseUserObject {
041:            public static final int SYSTEMS_ACTION = 1;
042:            public static final int DATADICTIONARY_ACTION = 2;
043:            public static final int ADD_DIAGRAM = 3;
044:
045:            private Enterprise mEnterprise = null;
046:            private AddNewSystemAction mAddSystemAction = new AddNewSystemAction();
047:            private ShowSystemsDiagramAction mShowSystemsDiagramAction = new ShowSystemsDiagramAction();
048:            private AddDiagramAction mAddDiagramAction = new AddDiagramAction();
049:            private StudyDependenciesAction mShowDataTypeDependenciesAction = new StudyDependenciesAction();
050:
051:            public EnterpriseUserObject(Enterprise pEnterprise) {
052:                super (pEnterprise, Application.ENTERPRISE_ICON);
053:                mEnterprise = pEnterprise;
054:            }
055:
056:            public EnterpriseUserObject(Enterprise pEnterprise,
057:                    String pCaption, int pMode) {
058:                super (pEnterprise, pCaption, pMode);
059:                mEnterprise = pEnterprise;
060:            }
061:
062:            // create new system
063:            public static EnterpriseUserObject addNewEnterprise(
064:                    MetaBossModelPackage pPackage) throws Exception {
065:                return (EnterpriseUserObject) new EnterpriseUserObject(null)
066:                        .addNewObject(pPackage);
067:            }
068:
069:            public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
070:                EnterpriseModelPackage lEnterpriseModelPackage = pPackage
071:                        .getEnterpriseModel();
072:                EnterpriseClass lEntepriseClass = lEnterpriseModelPackage
073:                        .getEnterprise();
074:                return new EnterpriseUserObject(lEntepriseClass
075:                        .createEnterprise());
076:            }
077:
078:            // return object root node captions
079:            public String getRootNodeName() {
080:                return null;
081:            }
082:
083:            public Enterprise getEnterprise() {
084:                return mEnterprise;
085:            }
086:
087:            // view systems diagram
088:            public void viewSystemsDiagram() {
089:                if (mEnterprise == null)
090:                    return;
091:
092:                try {
093:                    SortedSet lDiagrams = ModelElementUtils
094:                            .getSetOfModelElementsInAlphabeticalOrder(mEnterprise
095:                                    .getEnterpriseSystemsDiagrams());
096:                    if (lDiagrams != null) {
097:                        if (lDiagrams.size() == 0) {
098:                            EnterpriseSystemsDiagramUserObject lDiagramObject = EnterpriseSystemsDiagramUserObject
099:                                    .addNewEntrpriseEntitiesDiagram(mEnterprise);
100:                            if (lDiagramObject != null)
101:                                lDiagramObject.viewSystemsDiagram();
102:                        } else if (lDiagrams.size() == 1) {
103:                            EnterpriseSystemsDiagram lDiagram = (EnterpriseSystemsDiagram) lDiagrams
104:                                    .first();
105:                            Application.fireShowContainer(new SystemsPanel(
106:                                    lDiagram), UserObjectFactory
107:                                    .createUserObject(lDiagram),
108:                                    Application.SYSTEMSDIAGRAM_ICON);
109:                        } else {
110:                            ArrayList lDiagramsArray = new ArrayList();
111:                            for (Iterator lIterator = lDiagrams.iterator(); lIterator
112:                                    .hasNext();) {
113:                                EnterpriseSystemsDiagram lDiagram = (EnterpriseSystemsDiagram) lIterator
114:                                        .next();
115:                                lDiagramsArray
116:                                        .add(new EnterpriseSystemsDiagramUserObject(
117:                                                lDiagram));
118:                            }
119:                            DiagramSelectDialog lDialog = new DiagramSelectDialog(
120:                                    Application.mainFrame, lDiagramsArray);
121:                            if (lDialog.getModalResult() == DiagramSelectDialog.MR_OK) {
122:                                for (int i = 0; i < lDiagramsArray.size(); i++) {
123:                                    EnterpriseSystemsDiagramUserObject lEnterpriseSystemsDiagram = (EnterpriseSystemsDiagramUserObject) lDiagramsArray
124:                                            .get(i);
125:                                    Application
126:                                            .fireShowContainer(
127:                                                    new SystemsPanel(
128:                                                            lEnterpriseSystemsDiagram
129:                                                                    .getEnterpriseSystemsDiagram()),
130:                                                    lEnterpriseSystemsDiagram,
131:                                                    Application.SYSTEMSDIAGRAM_ICON);
132:                                }
133:                            }
134:                        }
135:                    }
136:                } catch (Exception e) {
137:                    e.printStackTrace();
138:                }
139:            }
140:
141:            // view systems diagram
142:            /*public void viewDependencies()
143:            {
144:                if (mEnterprise==null) return;
145:                try
146:            	{
147:                	Application.fireShowContainer(new DependencyViewPanel(mEnterprise,2), this, Application.SYSTEMSDIAGRAM_ICON);
148:                }
149:                catch (Exception e)
150:                {
151:                    e.printStackTrace();
152:                }
153:            }*/
154:
155:            // add new System object
156:            public void addNewSystem() throws Exception {
157:                SystemUserObject.addNewSystem(mEnterprise);
158:            }
159:
160:            // add new diagram
161:            protected void addNewDiagram() {
162:                try {
163:                    EnterpriseSystemsDiagramUserObject
164:                            .addNewEntrpriseEntitiesDiagram(mEnterprise);
165:                } catch (Throwable t) {
166:                    Application.processError(t);
167:                }
168:            }
169:
170:            public void fillActionsList(ArrayList pList) {
171:                switch (mMode) {
172:                case ALL_ACTIONS:
173:                    super .fillActionsList(pList);
174:                    pList.add(new SeparatorAction());
175:                    pList.add(mShowSystemsDiagramAction);
176:                    pList.add(new SeparatorAction());
177:                    pList.add(mAddSystemAction);
178:                    pList.add(mAddDiagramAction);
179:                    pList.add(new SeparatorAction());
180:                    pList.add(mShowDataTypeDependenciesAction);
181:                    break;
182:                case SYSTEMS_ACTION:
183:                    pList.add(mShowSystemsDiagramAction);
184:                    pList.add(new SeparatorAction());
185:                    pList.add(mAddSystemAction);
186:                    pList.add(mAddDiagramAction);
187:                    pList.add(new SeparatorAction());
188:                    pList.add(mShowDataTypeDependenciesAction);
189:                    break;
190:                case ADD_DIAGRAM:
191:                    pList.add(mAddDiagramAction);
192:                    break;
193:                }
194:            }
195:
196:            // get object editor
197:            public BasePropertiesDialog getObjectEditor() {
198:                return new SimpleObjectPropertiesdialog("Enterprise");
199:            }
200:
201:            // load object properties into grid control
202:            public void loadObjectProperties(PropertiesTableModel pModel)
203:                    throws Exception {
204:                super .loadObjectProperties(pModel);
205:                if (pModel == null || mEnterprise == null)
206:                    return;
207:
208:                addModelElement(pModel, "Design Library", mEnterprise
209:                        .getDesignLibrary());
210:                addModelElement(pModel, "Technology Library", mEnterprise
211:                        .getTechnologyLibrary());
212:            }
213:
214:            /*				Actions				*/
215:
216:            /*		Show Systems diagram		*/
217:
218:            public class ShowSystemsDiagramAction extends BaseAction {
219:                public ShowSystemsDiagramAction() {
220:                    super (Application
221:                            .getString("view_enterprisesystemsdiagram"),
222:                            Application.SYSTEMSDIAGRAM_ICON);
223:                }
224:
225:                public void actionPerformed(ActionEvent arg0) {
226:                    viewSystemsDiagram();
227:                }
228:            }
229:
230:            /*		Add New System Action class		*/
231:
232:            public class AddNewSystemAction extends BaseAction {
233:                public AddNewSystemAction() {
234:                    super ("Add New System", Application
235:                            .getAddIcon(Application.SYSTEM_ICON));
236:                }
237:
238:                public void actionPerformed(ActionEvent arg0) {
239:                    try {
240:                        addNewSystem();
241:                    } catch (Throwable t) {
242:                        t.printStackTrace();
243:                    }
244:                }
245:            }
246:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.