Source Code Cross Referenced for TransitionUserObject.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 com.metaboss.applications.designstudio.Application;
018:        import com.metaboss.applications.designstudio.BasePropertiesDialog;
019:        import com.metaboss.applications.designstudio.BaseUserObject;
020:        import com.metaboss.applications.designstudio.propertiesdialogs.StateTransitionPropertiesDialog;
021:        import com.metaboss.applications.designstudio.propertiesview.PropertiesTableModel;
022:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
023:        import com.metaboss.sdlctools.models.metabossmodel.statemachinemodel.State;
024:        import com.metaboss.sdlctools.models.metabossmodel.statemachinemodel.StateMachine;
025:        import com.metaboss.sdlctools.models.metabossmodel.statemachinemodel.StateTypeEnum;
026:        import com.metaboss.sdlctools.models.metabossmodel.statemachinemodel.Transition;
027:        import com.metaboss.sdlctools.models.metabossmodel.statemachinemodel.TransitionClass;
028:
029:        /*		StateTransition node user object 		*/
030:
031:        public class TransitionUserObject extends BaseUserObject {
032:            private Transition mStateTransition = null;
033:
034:            public TransitionUserObject(Transition pStateTransition) {
035:                super (pStateTransition, Application.STATETRANSITION_ICON);
036:                mStateTransition = pStateTransition;
037:            }
038:
039:            // create new Transition
040:            public static TransitionUserObject addNewTransition(
041:                    StateMachine pStateMachine) throws Exception {
042:                return (TransitionUserObject) new TransitionUserObject(null)
043:                        .addNewObject(getObjectPackage(pStateMachine),
044:                                pStateMachine.getTransitions());
045:            }
046:
047:            public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
048:                TransitionClass lClass = pPackage.getStateMachineModel()
049:                        .getTransition();
050:                return new TransitionUserObject(lClass.createTransition());
051:            }
052:
053:            // create new transition
054:            public static TransitionUserObject addNewTransition(
055:                    StateMachine pStateMachine, State pFromState, State pToState)
056:                    throws Exception {
057:                TransitionUserObject lResult = null;
058:                Application.beginTransaction();
059:                try {
060:                    lResult = (TransitionUserObject) new TransitionUserObject(
061:                            null).createNewObject(BaseUserObject
062:                            .getObjectPackage(pStateMachine));
063:                    if (lResult != null) {
064:                        Transition lTransition = lResult.getStateTransition();
065:                        pStateMachine.getTransitions().add(lTransition);
066:                        if (pFromState != null) {
067:                            if (pFromState.getType() == StateTypeEnum.FINAL)
068:                                throw new Exception(
069:                                        "You can't start any transition from the Final State!");
070:                            lTransition.setStartState(pFromState);
071:                        }
072:                        if (pToState != null) {
073:                            if (pToState.getType() == StateTypeEnum.INITIAL)
074:                                throw new Exception(
075:                                        "You can't point any transition to the Initial State!");
076:                            lTransition.setEndState(pToState);
077:                        }
078:                        if (pFromState != null && pToState != null)
079:                            lTransition.setName(pFromState.getName() + "To"
080:                                    + pToState.getName());
081:                    }
082:                    Application.commit();
083:                } finally {
084:                    if (Application.isInTransaction()) {
085:                        Application.rollback();
086:                        lResult = null;
087:                    }
088:                }
089:                //Application.fireObjectInserted(lResult);
090:                return lResult;
091:            }
092:
093:            public Transition getStateTransition() {
094:                return mStateTransition;
095:            }
096:
097:            // return object root node captions
098:            public String getRootNodeName() {
099:                return Application.getString("transitions_node");
100:            }
101:
102:            // load object properties into grid control
103:            public void loadObjectProperties(PropertiesTableModel pModel)
104:                    throws Exception {
105:                super .loadObjectProperties(pModel);
106:                if (pModel == null || mStateTransition == null)
107:                    return;
108:
109:                addModelElement(pModel, "Start State", mStateTransition
110:                        .getStartState());
111:                addModelElement(pModel, "End State", mStateTransition
112:                        .getEndState());
113:            }
114:
115:            public BasePropertiesDialog getObjectEditor() {
116:                return new StateTransitionPropertiesDialog();
117:            }
118:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.