├── .gitignore ├── README.md ├── build.xml ├── manifest.mf ├── nbproject ├── build-impl.xml ├── genfiles.properties ├── private │ ├── config.properties │ ├── private.properties │ └── private.xml ├── project.properties └── project.xml └── src └── edu └── ua ├── fortran ├── FortranLexer.g ├── FortranLexer.java ├── FortranParser03.g ├── FortranParser08.g ├── FortranParser08.java ├── FortranParserExtras.g ├── FortranParserExtras.java ├── FortranParserExtras_FortranParser08.java ├── FortranParserRiceCAF.g ├── FortranParserRiceCAF.java └── FortranParserRiceCAF_FortranParser08.java ├── front ├── 1380762678_001_01.png ├── 1380762803_001_05.png ├── 1380762935_001_39.png ├── 1380763165_001_52.gif ├── 1380763299_001_37.gif ├── 1hqic.png ├── About.form ├── About.java ├── DragListener.java ├── ExtensionFileFilter.java ├── Filewalker.java ├── FrontUI.form ├── FrontUI.java ├── Gear.png ├── Generator.java ├── ParserProcessor.java ├── add1.png ├── add2.png ├── add3.png ├── file.png ├── frameGUI.png ├── gear-logo 2.png ├── gear-logo.png ├── generate1.png ├── generate2.png ├── generate3.png ├── remove1.png ├── remove2.png ├── remove3.png ├── reset1.png ├── reset2.png ├── reset3.png ├── save1.png ├── save2.png ├── save3.png ├── view1.png ├── view2.png └── view3.png ├── meta ├── ClassMeta.java ├── FunctionMeta.java ├── ParameterMeta.java ├── SubroutineMeta.java ├── VariableMeta.java ├── ViewFactory.java └── ViewMeta.java ├── node ├── AbstractionNode.java ├── AssociationConnection.java ├── AssociationConnectionNode.java ├── AssociationEndNodeComposite.java ├── AssociationEndNodeNone.java ├── AssociationEndParticipant.java ├── AttributeNode.java ├── BehavioralFeatureNode.java ├── ClassNode.java ├── ClassRefNode.java ├── ClassifierFeatureNode.java ├── ContentNode.java ├── DataTypeNode.java ├── DependencyClientNode.java ├── DependencySupplierNode.java ├── FunctionNode.java ├── GeneralizableElementNode.java ├── GeneralizationChildNode.java ├── GeneralizationEntryNode.java ├── GeneralizationNode.java ├── GeneralizationParentNode.java ├── InterfaceNode.java ├── InterfaceRefNode.java ├── ModelNode.java ├── ModelStereotype.java ├── MultiplicityNode.java ├── MultiplicityRange.java ├── MultiplicityRangeNode.java ├── NamespaceNode.java ├── ParameterDataTypeNode.java ├── ParameterNode.java ├── ParameterTypeNode.java ├── StereoBaseClassNode.java ├── StereotypeNode.java ├── StereotypeRefNode.java ├── StructuralFeatureMultiNode.java ├── StructuralFeatureTypeNode.java ├── SubroutineNode.java └── UMLNode.java └── util ├── DataWriter.java ├── Fortran2XMI.java ├── FortranLexicalPrepass.java ├── FortranParser.java ├── FortranParserActionFactory.java ├── FortranParserActionNull.java ├── FortranParserActionPrint.java ├── FortranStream.java ├── FortranToken.java ├── FortranTokenStream.java ├── GlobalErrorException.java ├── IActionEnums.java ├── IFortranParser.java ├── IFortranParserAction.java ├── TypeConverter.java ├── UIDGenerator.java ├── XMLWriter.java └── typeconfig.properties /.gitignore: -------------------------------------------------------------------------------- 1 | /build/ 2 | /dist/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [This document is formatted with GitHub-Flavored Markdown. ]:# 2 | [For better viewing, including hyperlinks, read it online at ]:# 3 | [https://github.com/time2time/ForUML/blob/master/README.md ]:# 4 | 5 | 6 | 7 | ForUML 8 | ====== 9 | 10 | * [Overview](#overview) 11 | * [Getting Started](#getting-started) 12 | * [Developer Instructions](#developer-instructions) 13 | - [Build Instructions](#build-instructions) 14 | - [Execution Instructions](#execution-instructions) 15 | * [Publications](#publications) 16 | 17 | Overview 18 | ======== 19 | ForUML is a reverse engineering tool that generates Unified Modeling Language (UML) class 20 | diagrams from object-oriented Fortran programs. ForUML understands and diagrams Fortran 21 | class relationships, including inheritance and aggregation. ForUML also detects and 22 | depicts operator overloading, constructors, and parallel data structures (coarrays). 23 | 24 | ForUML generates a formal description of each diagram in the XML Metadata Interchange (XMI) 25 | format and launches [ArgoUML] to display the resulting class diagrams. Launching 26 | ArgoUML gives users the option to edit ForUML diagrams and to export the diagrams 27 | to a graphics file format for inclusion in other documents. 28 | 29 | Getting Started 30 | =============== 31 | Users not wishing to contribute code to the ForUML project may download our 32 | end-user distribution from the [ForUML project page] and view an 33 | [online video demonstration] of using ForUML. 34 | 35 | Developer Instructions 36 | ====================== 37 | Prior to work on the project, please download and install the following: 38 | 39 | 1. [Java SE Development Kit] version 1.7.0 or higher - 40 | 2. [NetBeans IDE] v.8.0.0 or higher 41 | 3. [Additional libraries] \(lib.zip) available on the project web site. 42 | 43 | Extract the lib.zip file on your machine. 44 | 45 | After installing the above packages, open the ForUML project in NetBeans as follows: 46 | 47 | 1. Launch NetBean 48 | 2. Go the the menu File > Open Project, then select the project that you cloned from the repository. 49 | 3. On the project, right click on the project and select Properties. In the popup window, select Libraries and select buttons 'Add Library' and 'Create' respectively. You must provide the library name as "LibForUML". 50 | You have to select the button "Add Jar/Folder..." that will ask you to add Jar files. You should select all Jar files contained in the extracted lib folder. 51 | 4. Now you can work on the project! 52 | 53 | You only need to do steps #2 and #3 above once. 54 | 55 | Build Instructions 56 | ------------------ 57 | To build the project from the command line, use 'Ant', an automation tool, to build the Java application. 58 | You can download Ant [here](http://ant.apache.org/bindownload.cgi). Once you have Ant, following these steps: 59 | 60 | 1. Go to the project directory and type the following: 61 | ``` 62 | ant -f build.xml 63 | ``` 64 | 2. If you built successfully, you will see the 2 new folders, including `build` and `dist`. The build folder contains all compiled classes and the `dist` folder contains the ForUML application and its required libraries. 65 | 66 | Notes: 67 | 68 | * DO not push those 2 directories (`build` and `dist`) into the remote repository. We intend to keep only source code and configuration files in the repository. 69 | 70 | Execution Instructions 71 | ------------------ 72 | 73 | To run the application from the command line, go to the dist folder and type the following: 74 | ``` 75 | java -jar "ForUML.jar" 76 | ``` 77 | To distribute this project, zip up the `dist` folder (including the `lib` folder) and distribute the ZIP file. 78 | 79 | Publications 80 | ============ 81 | If you find ForUML useful, please cite the following paper in publications that employ ForUML-generated diagrams: 82 | 83 | Nanthaamornphong, Aziz, Jeffrey Carver, Karla Morris, and Salvatore Filippone. 84 | "Extracting uml class diagrams from object-oriented fortran: Foruml." 85 | [Scientific Programming 2015 (2015): 1.](http://dl.acm.org/citation.cfm?id=2814697) 86 | 87 | For other releated publications, please visit the [publications page] of Prof. Aziz Nanthaamornphong. 88 | 89 | [Java SE Development Kit]: http://www.oracle.com/technetwork/java/javase/downloads/index.html 90 | [publications page]: http://research.te.psu.ac.th/aziz/pub.htm 91 | [online video demonstration]: http://research.te.psu.ac.th/aziz/VDO.htm 92 | [ForUML project page]: http://research.te.psu.ac.th/aziz/foruml.htm 93 | [ArgoUML]: http://argouml.tigris.org/ 94 | [NetBeans IDE]: https://netbeans.org/ 95 | [Additional libraries]: http://research.te.psu.ac.th/aziz/foruml/lib.zip 96 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project ForUML. 12 | 13 | 73 | 74 | -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=2827b76e 2 | build.xml.script.CRC32=e0252b44 3 | build.xml.stylesheet.CRC32=8064a381@1.79.1.48 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=2827b76e 7 | nbproject/build-impl.xml.script.CRC32=d543ba21 8 | nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48 9 | -------------------------------------------------------------------------------- /nbproject/private/config.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/nbproject/private/config.properties -------------------------------------------------------------------------------- /nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=false 3 | do.jar=true 4 | javac.debug=true 5 | javadoc.preview=true 6 | user.properties.file=C:\\Users\\t2time\\AppData\\Roaming\\NetBeans\\8.1\\build.properties 7 | -------------------------------------------------------------------------------- /nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | file:/C:/Users/t2tim/Desktop/ForUML/src/edu/ua/front/FrontUI.java 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=ForUML 7 | application.vendor=t2tim 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.test.classpath=\ 23 | ${run.test.classpath} 24 | # Files in build.classes.dir which should be excluded from distribution jar 25 | dist.archive.excludes= 26 | # This directory is removed when the project is cleaned: 27 | dist.dir=dist 28 | dist.jar=${dist.dir}/ForUML.jar 29 | dist.javadoc.dir=${dist.dir}/javadoc 30 | endorsed.classpath= 31 | excludes= 32 | file.reference.AnimatonClass.jar=C:\\Users\\t2time\\OneDrive\\Fortran\\Animation\\AnimatonClass.jar 33 | includes=** 34 | jar.compress=false 35 | javac.classpath=\ 36 | ${libs.LibForUML.classpath}:\ 37 | ${libs.swing-layout.classpath}:\ 38 | ${libs.absolutelayout.classpath}:\ 39 | ${file.reference.AnimatonClass.jar} 40 | # Space-separated list of extra javac options 41 | javac.compilerargs= 42 | javac.deprecation=false 43 | javac.external.vm=true 44 | javac.processorpath=\ 45 | ${javac.classpath} 46 | javac.source=1.7 47 | javac.target=1.7 48 | javac.test.classpath=\ 49 | ${javac.classpath}:\ 50 | ${build.classes.dir} 51 | javac.test.processorpath=\ 52 | ${javac.test.classpath} 53 | javadoc.additionalparam= 54 | javadoc.author=false 55 | javadoc.encoding=${source.encoding} 56 | javadoc.noindex=false 57 | javadoc.nonavbar=false 58 | javadoc.notree=false 59 | javadoc.private=false 60 | javadoc.splitindex=true 61 | javadoc.use=true 62 | javadoc.version=false 63 | javadoc.windowtitle= 64 | main.class=edu.ua.front.FrontUI 65 | manifest.file=manifest.mf 66 | meta.inf.dir=${src.dir}/META-INF 67 | mkdist.disabled=false 68 | platform.active=default_platform 69 | run.classpath=\ 70 | ${javac.classpath}:\ 71 | ${build.classes.dir} 72 | # Space-separated list of JVM arguments used when running the project. 73 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 74 | # To set system properties for unit tests define test-sys-prop.name=value: 75 | run.jvmargs= 76 | run.test.classpath=\ 77 | ${javac.test.classpath}:\ 78 | ${build.test.classes.dir} 79 | source.encoding=UTF-8 80 | src.dir=src 81 | test.src.dir=test 82 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | ForUML 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/edu/ua/front/1380762678_001_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/1380762678_001_01.png -------------------------------------------------------------------------------- /src/edu/ua/front/1380762803_001_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/1380762803_001_05.png -------------------------------------------------------------------------------- /src/edu/ua/front/1380762935_001_39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/1380762935_001_39.png -------------------------------------------------------------------------------- /src/edu/ua/front/1380763165_001_52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/1380763165_001_52.gif -------------------------------------------------------------------------------- /src/edu/ua/front/1380763299_001_37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/1380763299_001_37.gif -------------------------------------------------------------------------------- /src/edu/ua/front/1hqic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/1hqic.png -------------------------------------------------------------------------------- /src/edu/ua/front/About.form: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /src/edu/ua/front/About.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | package edu.ua.front; 31 | 32 | import javax.swing.JFrame; 33 | 34 | public class About extends javax.swing.JFrame { 35 | 36 | /** 37 | * Creates new form About 38 | */ 39 | public About() { 40 | initComponents(); 41 | this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); 42 | } 43 | 44 | /** 45 | * This method is called from within the constructor to initialize the form. 46 | * WARNING: Do NOT modify this code. The content of this method is always 47 | * regenerated by the Form Editor. 48 | */ 49 | @SuppressWarnings("unchecked") 50 | // //GEN-BEGIN:initComponents 51 | private void initComponents() { 52 | 53 | jPanel1 = new javax.swing.JPanel(); 54 | jButton1 = new javax.swing.JButton(); 55 | jPanel2 = new javax.swing.JPanel(); 56 | jLabel2 = new javax.swing.JLabel(); 57 | jLabel3 = new javax.swing.JLabel(); 58 | jLabel4 = new javax.swing.JLabel(); 59 | 60 | setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); 61 | 62 | jPanel1.setBackground(new java.awt.Color(204, 204, 204)); 63 | 64 | jButton1.setBackground(java.awt.SystemColor.controlShadow); 65 | jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/edu/ua/front/gear-logo 2.png"))); // NOI18N 66 | jButton1.setBorder(null); 67 | 68 | org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); 69 | jPanel1.setLayout(jPanel1Layout); 70 | jPanel1Layout.setHorizontalGroup( 71 | jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 72 | .add(jPanel1Layout.createSequentialGroup() 73 | .addContainerGap() 74 | .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE) 75 | .addContainerGap()) 76 | ); 77 | jPanel1Layout.setVerticalGroup( 78 | jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 79 | .add(jPanel1Layout.createSequentialGroup() 80 | .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 319, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 81 | .add(0, 0, Short.MAX_VALUE)) 82 | ); 83 | 84 | jPanel2.setBackground(new java.awt.Color(255, 255, 255)); 85 | 86 | jLabel2.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N 87 | jLabel2.setForeground(new java.awt.Color(102, 0, 0)); 88 | jLabel2.setText("Version: 1.0.0"); 89 | 90 | jLabel3.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N 91 | jLabel3.setForeground(new java.awt.Color(153, 0, 0)); 92 | jLabel3.setText("http://aziz.students.cs.ua.edu"); 93 | 94 | jLabel4.setFont(new java.awt.Font("Lucida Grande", 1, 13)); // NOI18N 95 | jLabel4.setForeground(new java.awt.Color(153, 0, 0)); 96 | jLabel4.setText("e-mail: aziz.nantha@gmail.com"); 97 | 98 | org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); 99 | jPanel2.setLayout(jPanel2Layout); 100 | jPanel2Layout.setHorizontalGroup( 101 | jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 102 | .add(jPanel2Layout.createSequentialGroup() 103 | .addContainerGap() 104 | .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) 105 | .add(jLabel2) 106 | .add(jLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 107 | .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 108 | .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 109 | ); 110 | jPanel2Layout.setVerticalGroup( 111 | jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 112 | .add(jPanel2Layout.createSequentialGroup() 113 | .add(15, 15, 15) 114 | .add(jLabel2) 115 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 116 | .add(jLabel3) 117 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 118 | .add(jLabel4) 119 | .addContainerGap(15, Short.MAX_VALUE)) 120 | ); 121 | 122 | org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); 123 | getContentPane().setLayout(layout); 124 | layout.setHorizontalGroup( 125 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 126 | .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 127 | .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 128 | ); 129 | layout.setVerticalGroup( 130 | layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 131 | .add(layout.createSequentialGroup() 132 | .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 133 | .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 134 | .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 135 | ); 136 | 137 | pack(); 138 | }// //GEN-END:initComponents 139 | 140 | /** 141 | * @param args the command line arguments 142 | */ 143 | public static void main(String args[]) { 144 | /* 145 | * Set the Nimbus look and feel 146 | */ 147 | // 148 | /* 149 | * If Nimbus (introduced in Java SE 6) is not available, stay with the 150 | * default look and feel. For details see 151 | * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 152 | */ 153 | try { 154 | for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { 155 | if ("Nimbus".equals(info.getName())) { 156 | javax.swing.UIManager.setLookAndFeel(info.getClassName()); 157 | break; 158 | } 159 | } 160 | } catch (ClassNotFoundException ex) { 161 | java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 162 | } catch (InstantiationException ex) { 163 | java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 164 | } catch (IllegalAccessException ex) { 165 | java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 166 | } catch (javax.swing.UnsupportedLookAndFeelException ex) { 167 | java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); 168 | } 169 | // 170 | 171 | /* 172 | * Create and display the form 173 | */ 174 | java.awt.EventQueue.invokeLater(new Runnable() { 175 | public void run() { 176 | new About().setVisible(true); 177 | } 178 | }); 179 | } 180 | // Variables declaration - do not modify//GEN-BEGIN:variables 181 | private javax.swing.JButton jButton1; 182 | private javax.swing.JLabel jLabel2; 183 | private javax.swing.JLabel jLabel3; 184 | private javax.swing.JLabel jLabel4; 185 | private javax.swing.JPanel jPanel1; 186 | private javax.swing.JPanel jPanel2; 187 | // End of variables declaration//GEN-END:variables 188 | } 189 | -------------------------------------------------------------------------------- /src/edu/ua/front/DragListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.front; 30 | 31 | import java.awt.datatransfer.DataFlavor; 32 | import java.awt.datatransfer.Transferable; 33 | import java.awt.dnd.DnDConstants; 34 | import java.awt.dnd.DropTargetDragEvent; 35 | import java.awt.dnd.DropTargetDropEvent; 36 | import java.awt.dnd.DropTargetEvent; 37 | import java.awt.dnd.DropTargetListener; 38 | import java.io.BufferedReader; 39 | import java.io.File; 40 | import java.io.FileReader; 41 | import java.io.IOException; 42 | import java.io.InputStream; 43 | import java.io.InputStreamReader; 44 | import java.util.ArrayList; 45 | import java.util.List; 46 | import javax.swing.DefaultListModel; 47 | import javax.swing.JFileChooser; 48 | import javax.swing.JList; 49 | import javax.swing.JTextArea; 50 | 51 | public class DragListener implements DropTargetListener { 52 | 53 | JTextArea ta = new JTextArea(); 54 | JList fl = new JList(); 55 | 56 | public DragListener(JTextArea f, JList fileList) { 57 | ta = f; 58 | fl = fileList; 59 | 60 | } 61 | 62 | public void dragEnter(DropTargetDragEvent dtde) { 63 | System.out.println("Drag Enter"); 64 | } 65 | 66 | public void dragExit(DropTargetEvent dte) { 67 | System.out.println("Drag Exit"); 68 | } 69 | 70 | public void dragOver(DropTargetDragEvent dtde) { 71 | System.out.println("Drag Over"); 72 | } 73 | 74 | public void dropActionChanged(DropTargetDragEvent dtde) { 75 | System.out.println("Drop Action Changed"); 76 | } 77 | 78 | public void drop(DropTargetDropEvent dtde) { 79 | try { 80 | // Ok, get the dropped object and try to figure out what it is 81 | Transferable tr = dtde.getTransferable(); 82 | DataFlavor[] flavors = tr.getTransferDataFlavors(); 83 | for (int i = 0; i < flavors.length; i++) { 84 | System.out.println("Possible flavor: " + flavors[i].getMimeType()); 85 | // Check for file lists specifically 86 | if (flavors[i].isFlavorJavaFileListType()) { 87 | // Great! Accept copy drops... 88 | dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); 89 | ta.setText("Successful file list drop.\n\n"); 90 | 91 | DefaultListModel listModel = new DefaultListModel(); 92 | 93 | 94 | // And add the list of file names to our text area 95 | java.util.List list = (java.util.List) tr.getTransferData(flavors[i]); 96 | System.out.println("Total Files::" + list.size()); 97 | for (int j = 0; j < list.size(); j++) { 98 | ta.append(list.get(j) + "\n"); 99 | 100 | //check file or folder 101 | if(list.get(j).toString().endsWith(".f90")){ 102 | listModel.addElement(list.get(j)); 103 | 104 | }else{ 105 | 106 | Filewalker fw = new Filewalker(); 107 | 108 | ArrayList listPathfile = fw.walk(list.get(j).toString()); 109 | 110 | for (int k = 0; k < listPathfile.size(); k++) { 111 | listModel.addElement(listPathfile.get(k)+ "\n"); 112 | } 113 | 114 | } 115 | 116 | } 117 | 118 | this.fl.setModel(listModel); 119 | 120 | 121 | // If we made it this far, everything worked. 122 | dtde.dropComplete(true); 123 | return; 124 | } // Ok, is it another Java object? 125 | else if (flavors[i].isFlavorSerializedObjectType()) { 126 | dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); 127 | ta.setText("Successful text drop.\n\n"); 128 | Object o = tr.getTransferData(flavors[i]); 129 | ta.append("Object: " + o); 130 | dtde.dropComplete(true); 131 | return; 132 | } // How about an input stream? 133 | else if (flavors[i].isRepresentationClassInputStream()) { 134 | dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE); 135 | ta.setText("Successful text drop.\n\n"); 136 | ta.read(new InputStreamReader( 137 | (InputStream) tr.getTransferData(flavors[i])), 138 | "from system clipboard"); 139 | dtde.dropComplete(true); 140 | return; 141 | } 142 | } 143 | // Hmm, the user must not have dropped a file list 144 | System.out.println("Drop failed: " + dtde); 145 | dtde.rejectDrop(); 146 | } catch (Exception e) { 147 | e.printStackTrace(); 148 | dtde.rejectDrop(); 149 | } 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /src/edu/ua/front/ExtensionFileFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.front; 30 | 31 | import java.io.File; 32 | import javax.swing.filechooser.FileFilter; 33 | 34 | public class ExtensionFileFilter extends FileFilter { 35 | 36 | String description; 37 | String extensions[]; 38 | 39 | public ExtensionFileFilter(String description, String extension) { 40 | this(description, new String[]{extension}); 41 | } 42 | 43 | public ExtensionFileFilter(String description, String extensions[]) { 44 | if (description == null) { 45 | this.description = extensions[0]; 46 | } else { 47 | this.description = description; 48 | } 49 | this.extensions = (String[]) extensions.clone(); 50 | toLower(this.extensions); 51 | } 52 | 53 | private void toLower(String array[]) { 54 | for (int i = 0, n = array.length; i < n; i++) { 55 | array[i] = array[i].toLowerCase(); 56 | } 57 | } 58 | 59 | public String getDescription() { 60 | return description; 61 | } 62 | 63 | public boolean accept(File file) { 64 | if (file.isDirectory()) { 65 | return true; 66 | } else { 67 | String path = file.getAbsolutePath().toLowerCase(); 68 | for (int i = 0, n = extensions.length; i < n; i++) { 69 | String extension = extensions[i]; 70 | if ((path.endsWith(extension) && (path.charAt(path.length() - extension.length() - 1)) == '.')) { 71 | return true; 72 | } 73 | } 74 | } 75 | return false; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/edu/ua/front/Filewalker.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.front; 30 | 31 | import java.io.File; 32 | import java.util.ArrayList; 33 | 34 | class Filewalker { 35 | // public void walk( String path ) { 36 | // 37 | // File root = new File( path ); 38 | // File[] list = root.listFiles(); 39 | // 40 | // if (list == null) return; 41 | // 42 | // for ( File f : list ) { 43 | // if ( f.isDirectory() ) { 44 | // walk( f.getAbsolutePath() ); 45 | // System.out.println( "Dir:" + f.getAbsoluteFile() ); 46 | // } 47 | // else { 48 | // System.out.println( "File:" + f.getAbsoluteFile() ); 49 | // } 50 | // } 51 | // } 52 | 53 | ArrayList listPathfile = new ArrayList(); 54 | 55 | public ArrayList walk(String path) { 56 | 57 | File dir = new File(path); 58 | File[] list = dir.listFiles(); 59 | 60 | if (list == null) { 61 | return walk(path); 62 | } 63 | if (dir.exists()) { 64 | 65 | for (File f : list) { 66 | if (f.isDirectory()) { 67 | walk(f.getAbsolutePath()); 68 | System.out.println( "Dir:" + f.getAbsoluteFile() ); 69 | } else if (!f.isDirectory() && f.getName().endsWith(".f90")) { 70 | listPathfile.add(f.getAbsoluteFile().toString()); 71 | System.out.println( "File:" + f.getAbsoluteFile() ); 72 | } 73 | } 74 | } 75 | return listPathfile; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/edu/ua/front/Gear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/Gear.png -------------------------------------------------------------------------------- /src/edu/ua/front/Generator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.front; 30 | 31 | import edu.ua.node.UMLNode; 32 | import java.io.BufferedWriter; 33 | import java.io.FileWriter; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | import edu.ua.util.DataWriter; 36 | import edu.ua.util.Fortran2XMI; 37 | 38 | public class Generator { 39 | 40 | private String outputPath = ""; 41 | 42 | public void setOutput(String path) { 43 | outputPath = path; 44 | } 45 | 46 | public String getOutput() { 47 | return outputPath; 48 | } 49 | 50 | public void generate(UMLNode contentNode) { 51 | try { 52 | String fileName = outputPath; 53 | AttributesImpl attributes = new AttributesImpl(); 54 | String documentName = ""; 55 | BufferedWriter writer = new BufferedWriter(new FileWriter(fileName)); 56 | DataWriter xmlWriter = new DataWriter(writer); 57 | xmlWriter.setIndentStep(2); 58 | xmlWriter.startDocument(); 59 | Fortran2XMI fortran2xmi = new Fortran2XMI(xmlWriter); 60 | // create an XMI header 61 | attributes.clear(); 62 | attributes.addAttribute("", "xmi.version", "", "", "1.1"); 63 | attributes.addAttribute("", "xmlns:UML", "", "", "org.omg/standards/UML"); 64 | xmlWriter.startElement("", "XMI", "", attributes); 65 | // create the XMI header in the XML file 66 | fortran2xmi.serializeHeader(documentName); 67 | //ContentNode contentNode = new ContentNode(); 68 | // serialize the UML model into the XML file 69 | fortran2xmi.serialzeNode(contentNode); 70 | xmlWriter.endElement("XMI"); 71 | xmlWriter.endDocument(); 72 | } catch (Exception ex) { 73 | ex.printStackTrace(); 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /src/edu/ua/front/add1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/add1.png -------------------------------------------------------------------------------- /src/edu/ua/front/add2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/add2.png -------------------------------------------------------------------------------- /src/edu/ua/front/add3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/add3.png -------------------------------------------------------------------------------- /src/edu/ua/front/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/file.png -------------------------------------------------------------------------------- /src/edu/ua/front/frameGUI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/frameGUI.png -------------------------------------------------------------------------------- /src/edu/ua/front/gear-logo 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/gear-logo 2.png -------------------------------------------------------------------------------- /src/edu/ua/front/gear-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/gear-logo.png -------------------------------------------------------------------------------- /src/edu/ua/front/generate1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/generate1.png -------------------------------------------------------------------------------- /src/edu/ua/front/generate2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/generate2.png -------------------------------------------------------------------------------- /src/edu/ua/front/generate3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/generate3.png -------------------------------------------------------------------------------- /src/edu/ua/front/remove1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/remove1.png -------------------------------------------------------------------------------- /src/edu/ua/front/remove2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/remove2.png -------------------------------------------------------------------------------- /src/edu/ua/front/remove3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/remove3.png -------------------------------------------------------------------------------- /src/edu/ua/front/reset1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/reset1.png -------------------------------------------------------------------------------- /src/edu/ua/front/reset2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/reset2.png -------------------------------------------------------------------------------- /src/edu/ua/front/reset3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/reset3.png -------------------------------------------------------------------------------- /src/edu/ua/front/save1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/save1.png -------------------------------------------------------------------------------- /src/edu/ua/front/save2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/save2.png -------------------------------------------------------------------------------- /src/edu/ua/front/save3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/save3.png -------------------------------------------------------------------------------- /src/edu/ua/front/view1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/view1.png -------------------------------------------------------------------------------- /src/edu/ua/front/view2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/view2.png -------------------------------------------------------------------------------- /src/edu/ua/front/view3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t2time/ForUML/bb00f19dd33bf4dd9e3629054926d3e623dcc080/src/edu/ua/front/view3.png -------------------------------------------------------------------------------- /src/edu/ua/meta/ClassMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.meta; 30 | 31 | import edu.ua.util.UIDGenerator; 32 | import java.util.*; 33 | 34 | public class ClassMeta { 35 | 36 | private String filename = ""; 37 | private String classname = ""; 38 | private ArrayList compositeNames = new ArrayList(); 39 | private ArrayList functions = new ArrayList(); 40 | private ArrayList subroutine = new ArrayList(); 41 | private ArrayList uselists = new ArrayList(); 42 | private ArrayList variables = new ArrayList(); 43 | private ArrayList compositelists = new ArrayList(); 44 | private ArrayList subroutine2 = new ArrayList(); 45 | private ArrayList functionNames = new ArrayList(); 46 | // private ArrayList tmpSubroutine = new ArrayList(); 47 | private Hashtable tmpSubroutine = new Hashtable(); 48 | private ArrayList tmpSubroutineName = new ArrayList(); 49 | private int currentVariable = 0; 50 | private ArrayList usedClassNames = new ArrayList(); 51 | private String id = Long.toString(this.hashCode()); 52 | 53 | public String getId() { 54 | 55 | String uid = UIDGenerator.hashCode(classname); 56 | return uid; 57 | } 58 | 59 | public void setId(String id) { 60 | this.id = id; 61 | } 62 | 63 | public void addCompositeNames(String a) { 64 | this.compositeNames.add(a); 65 | } 66 | 67 | public ArrayList getCompositenames() { 68 | return compositeNames; 69 | } 70 | 71 | public void addVariables(VariableMeta v) { 72 | variables.add(v); 73 | } 74 | 75 | public ArrayList getVariables() { 76 | return variables; 77 | } 78 | 79 | public void addFunctions(FunctionMeta f) { 80 | functions.add(f); 81 | } 82 | 83 | public ArrayList getFunctions() { 84 | return this.functions; 85 | } 86 | 87 | public void addSubroutine2(SubroutineMeta s) { 88 | if (!functionNames.contains(s.getName())) { 89 | this.subroutine2.add(s); 90 | functionNames.add(s.getName()); 91 | 92 | } 93 | } 94 | 95 | public void addSubroutine(SubroutineMeta s) { 96 | this.subroutine.add(s); 97 | } 98 | 99 | public void addTempSubroutine(SubroutineMeta s){ 100 | 101 | 102 | if(!this.tmpSubroutine.containsKey(s.getName().toLowerCase())){ 103 | 104 | this.tmpSubroutine.put(s.getName().toLowerCase(), s); 105 | } 106 | } 107 | 108 | public SubroutineMeta getSubroutineTempMeta(String methodName){ 109 | 110 | if(this.tmpSubroutine.containsKey(methodName.toLowerCase())){ 111 | 112 | return (SubroutineMeta) this.tmpSubroutine.get(methodName.toLowerCase()); 113 | }else{ 114 | return null; 115 | } 116 | 117 | } 118 | 119 | public void changeStereoType(String methodName, String stereoType){ 120 | for(int i=0; i< this.subroutine2.size();i++){ 121 | if(((SubroutineMeta)this.subroutine2.get(i)).getName().equalsIgnoreCase(methodName)){ 122 | ((SubroutineMeta)this.subroutine2.get(i)).setStereoType(stereoType); 123 | break; 124 | } 125 | } 126 | } 127 | 128 | public ArrayList getSubroutine2() { 129 | return this.subroutine2; 130 | 131 | } 132 | 133 | public ArrayList getSubroutine() { 134 | return this.subroutine; 135 | } 136 | 137 | public void addComposites(ClassMeta cl) { 138 | compositelists.add(cl); 139 | } 140 | 141 | public void addUses(ClassMeta cl) { 142 | if(!usedClassNames.contains(cl.getClassname())){ 143 | usedClassNames.add(cl.getClassname()); 144 | uselists.add(cl); 145 | } 146 | } 147 | 148 | public ArrayList getComposites() { 149 | return this.compositelists; 150 | } 151 | 152 | public ArrayList getUses() { 153 | return this.uselists; 154 | } 155 | 156 | public String getClassname() { 157 | return classname; 158 | } 159 | 160 | public String getFilename() { 161 | return filename; 162 | } 163 | 164 | public void setClassname(String classname) { 165 | this.classname = classname; 166 | } 167 | 168 | public void setFilename(String filename) { 169 | this.filename = filename; 170 | } 171 | 172 | public VariableMeta getNextVariable() { 173 | VariableMeta var = null; 174 | if (currentVariable < variables.size()) { 175 | var = (VariableMeta) variables.get(currentVariable); 176 | currentVariable++; 177 | } 178 | return var; 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /src/edu/ua/meta/FunctionMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.meta; 30 | 31 | import java.util.*; 32 | 33 | public class FunctionMeta { 34 | 35 | private String name; 36 | private String returnType = ""; 37 | private ArrayList parameters = new ArrayList(); 38 | int currentParam = 0; 39 | 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | public String getName() { 45 | return this.name; 46 | } 47 | 48 | public void setReturnType(String name) { 49 | this.returnType = name; 50 | } 51 | 52 | public String getReturnType() { 53 | return this.returnType; 54 | } 55 | 56 | public void addParameters(ParameterMeta param) { 57 | parameters.add(param); 58 | } 59 | 60 | public ArrayList getParameters() { 61 | return this.parameters; 62 | } 63 | 64 | public ParameterMeta getNextParameter() { 65 | ParameterMeta ret = null; 66 | 67 | if (parameters.size() > currentParam) { 68 | ret = (ParameterMeta) parameters.get(currentParam); 69 | currentParam++; 70 | } 71 | return ret; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/edu/ua/meta/ParameterMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.meta; 30 | 31 | public class ParameterMeta { 32 | 33 | String name = ""; 34 | String type = ""; 35 | String direction = ""; 36 | 37 | public void setName(String name) { 38 | this.name = name; 39 | } 40 | 41 | public void setType(String type) { 42 | this.type = type; 43 | } 44 | 45 | public String getName() { 46 | return name; 47 | } 48 | 49 | public String getType() { 50 | return type; 51 | } 52 | 53 | public void setDirection(int di){ 54 | 55 | if(di == 602){ 56 | this.direction = "inout"; 57 | }else if(di == 600){ 58 | this.direction = "in"; 59 | }else{ 60 | this.direction = "out"; 61 | } 62 | } 63 | 64 | public String getDirection(){ 65 | return this.direction; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/edu/ua/meta/SubroutineMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.meta; 30 | 31 | import java.util.*; 32 | 33 | public class SubroutineMeta { 34 | 35 | private String name; 36 | private ArrayList parameters = new ArrayList(); 37 | private int currentParam = 0; 38 | private String stereoType = null; 39 | 40 | public void setName(String name) { 41 | this.name = name; 42 | 43 | } 44 | 45 | public String getName() { 46 | return this.name; 47 | } 48 | 49 | public void addParameters(ParameterMeta param) { 50 | parameters.add(param); 51 | 52 | } 53 | 54 | public ArrayList getParameters() { 55 | return this.parameters; 56 | } 57 | 58 | public ParameterMeta getNextParameter() { 59 | ParameterMeta ret = null; 60 | 61 | if (parameters.size() > currentParam) { 62 | ret = (ParameterMeta) parameters.get(currentParam); 63 | currentParam++; 64 | } 65 | return ret; 66 | } 67 | 68 | public void setStereoType(String stereo){ 69 | this.stereoType = stereo; 70 | } 71 | 72 | public String getStereoType(){ 73 | return this.stereoType; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/edu/ua/meta/VariableMeta.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.meta; 30 | 31 | public class VariableMeta { 32 | 33 | private String type = ""; 34 | private String name = ""; 35 | private String stereotype = null; 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public String getType() { 42 | return type; 43 | } 44 | 45 | public String getStereoType() 46 | { 47 | return stereotype; 48 | } 49 | 50 | public void setName(String name) { 51 | this.name = name; 52 | 53 | } 54 | 55 | public void setType(String type) { 56 | this.type = type; 57 | } 58 | 59 | public void setStereoType(String stereo){ 60 | this.stereotype = stereo; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/edu/ua/meta/ViewFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.meta; 30 | 31 | public class ViewFactory { 32 | 33 | private static ViewMeta meta; 34 | 35 | public static ViewMeta getViewMeta() { 36 | if (meta == null) { 37 | meta = new ViewMeta(); 38 | } 39 | return meta; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/edu/ua/node/AbstractionNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class AbstractionNode extends UMLNode { 37 | 38 | private String name = ""; 39 | private List nodes = new ArrayList(); 40 | 41 | public void addNode(UMLNode node) { 42 | nodes.add(node); 43 | } 44 | 45 | @Override 46 | public String getName() { 47 | return "UML:Abstraction"; 48 | } 49 | 50 | @Override 51 | public List getChildren() { 52 | return nodes; 53 | } 54 | 55 | @Override 56 | public int getChildCount() { 57 | return nodes.size(); 58 | } 59 | 60 | @Override 61 | public Attributes getAttributes() { 62 | AttributesImpl attributes = new AttributesImpl(); 63 | attributes.addAttribute("", "xmi.id", "", "", Long.toString(this.hashCode())); 64 | return attributes; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/edu/ua/node/AssociationConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class AssociationConnection extends UMLNode { 37 | 38 | List connections = new ArrayList(); 39 | 40 | @Override 41 | public String getName() { 42 | return "UML:Association.connection"; 43 | } 44 | 45 | @Override 46 | public List getChildren() { 47 | return connections; 48 | } 49 | 50 | @Override 51 | public int getChildCount() { 52 | return 2; 53 | } 54 | 55 | public void addConenection(AssociationEndNodeComposite src, AssociationEndNodeComposite des) { 56 | connections.add(src); 57 | connections.add(des); 58 | 59 | } 60 | 61 | @Override 62 | public Attributes getAttributes() { 63 | AttributesImpl attributes = new AttributesImpl(); 64 | return attributes; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/edu/ua/node/AssociationConnectionNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import edu.ua.util.UIDGenerator; 32 | import java.util.ArrayList; 33 | import java.util.List; 34 | import org.xml.sax.Attributes; 35 | import org.xml.sax.helpers.AttributesImpl; 36 | 37 | public class AssociationConnectionNode extends UMLNode { 38 | 39 | String name = ""; 40 | List child = new ArrayList(); 41 | 42 | @Override 43 | public String getName() { 44 | return "UML:Association"; 45 | } 46 | 47 | public void addChildren(UMLNode node) { 48 | child.add(node); 49 | } 50 | 51 | @Override 52 | public List getChildren() { 53 | return child; 54 | } 55 | 56 | @Override 57 | public int getChildCount() { 58 | return child.size(); 59 | } 60 | 61 | @Override 62 | public Attributes getAttributes() { 63 | AttributesImpl attributes = new AttributesImpl(); 64 | attributes.addAttribute("", "xmi.id", "", "", "" + UIDGenerator.getRandom()); 65 | attributes.addAttribute("", "name", "", "", ""); 66 | attributes.addAttribute("", "isSpecification", "", "", "false"); 67 | attributes.addAttribute("", "isRoot", "", "", "false"); 68 | attributes.addAttribute("", "isLeaf", "", "", "false"); 69 | attributes.addAttribute("", "isAbstract", "", "", "false"); 70 | attributes.addAttribute("", "isNavigable", "", "", "true"); 71 | return attributes; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/edu/ua/node/AssociationEndNodeComposite.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import edu.ua.util.UIDGenerator; 32 | import java.util.ArrayList; 33 | import java.util.List; 34 | import org.xml.sax.Attributes; 35 | import org.xml.sax.helpers.AttributesImpl; 36 | 37 | public class AssociationEndNodeComposite extends UMLNode { 38 | 39 | String name = ""; 40 | String aggregation = "composite"; 41 | List child = new ArrayList(); 42 | String id = ""; 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:AssociationEnd"; 47 | } 48 | 49 | public void setId(String id) { 50 | this.id = id; 51 | } 52 | 53 | @Override 54 | public List getChildren() { 55 | 56 | return child; 57 | } 58 | 59 | public void addChild(UMLNode node) { 60 | child.add(node); 61 | } 62 | 63 | @Override 64 | public int getChildCount() { 65 | return child.size(); 66 | } 67 | 68 | public void setAgrregation(String agrregation) { 69 | aggregation = agrregation; 70 | } 71 | 72 | @Override 73 | public Attributes getAttributes() { 74 | AttributesImpl attributes = new AttributesImpl(); 75 | attributes.addAttribute("", "xmi.id", "", "", "" + UIDGenerator.getRandom()); 76 | attributes.addAttribute("", "visibility", "", "", "public"); 77 | attributes.addAttribute("", "isSpecification", "", "", "false"); 78 | attributes.addAttribute("", "isNavigable", "", "", "true"); 79 | attributes.addAttribute("", "ordering", "", "", "unordered"); 80 | attributes.addAttribute("", "aggregation", "", "", aggregation); 81 | attributes.addAttribute("", "targetScope", "", "", "instance"); 82 | attributes.addAttribute("", "changeability", "", "", "changeable"); 83 | return attributes; 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/edu/ua/node/AssociationEndNodeNone.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import edu.ua.util.UIDGenerator; 32 | import java.util.ArrayList; 33 | import java.util.List; 34 | import org.xml.sax.Attributes; 35 | import org.xml.sax.helpers.AttributesImpl; 36 | 37 | public class AssociationEndNodeNone extends UMLNode { 38 | 39 | String name = ""; 40 | 41 | @Override 42 | public String getName() { 43 | return "UML:AssociationEnd"; 44 | } 45 | 46 | @Override 47 | public List getChildren() { 48 | List child = new ArrayList(); 49 | return child; 50 | } 51 | 52 | @Override 53 | public int getChildCount() { 54 | return 0; 55 | } 56 | 57 | @Override 58 | public Attributes getAttributes() { 59 | AttributesImpl attributes = new AttributesImpl(); 60 | attributes.addAttribute("", "xmi.id", "", "", "" + UIDGenerator.getRandom()); 61 | attributes.addAttribute("", "visibility", "", "", "public"); 62 | attributes.addAttribute("", "isSpecification", "", "", "false"); 63 | attributes.addAttribute("", "isNavigable", "", "", "true"); 64 | attributes.addAttribute("", "ordering", "", "", "unordered"); 65 | attributes.addAttribute("", "aggregation", "", "", "none"); 66 | attributes.addAttribute("", "targetScope", "", "", "instance"); 67 | attributes.addAttribute("", "changeability", "", "", "changeable"); 68 | return attributes; 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/edu/ua/node/AssociationEndParticipant.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class AssociationEndParticipant extends UMLNode { 37 | 38 | List child = new ArrayList(); 39 | 40 | @Override 41 | public String getName() { 42 | return "UML:AssociationEnd.participant"; 43 | } 44 | 45 | public void addChild(UMLNode node) { 46 | child.add(node); 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return child; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return child.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/AttributeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class AttributeNode extends UMLNode { 36 | 37 | private String name = ""; 38 | private String visibility = "public"; 39 | private List nodes = new ArrayList(); 40 | 41 | public void addNode(UMLNode node) { 42 | nodes.add(node); 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | @Override 50 | public String getName() { 51 | return "UML:Attribute"; 52 | } 53 | 54 | @Override 55 | public List getChildren() { 56 | return nodes; 57 | } 58 | 59 | @Override 60 | public int getChildCount() { 61 | return nodes.size(); 62 | } 63 | 64 | @Override 65 | public org.xml.sax.Attributes getAttributes() { 66 | AttributesImpl attributes = new AttributesImpl(); 67 | attributes.addAttribute("", "xmi.id", "", "", Long.toString(this.hashCode())); 68 | attributes.addAttribute("", "name", "", "", name); 69 | attributes.addAttribute("", "visibility", "", "", "public"); 70 | attributes.addAttribute("", "ownerScope", "", "", "instance"); 71 | attributes.addAttribute("", "changeability", "", "", "changeable"); 72 | attributes.addAttribute("", "targetScope", "", "", "instance"); 73 | attributes.addAttribute("", "isSpecification", "", "", "false"); 74 | return attributes; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/edu/ua/node/BehavioralFeatureNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class BehavioralFeatureNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:BehavioralFeature.parameter"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public org.xml.sax.Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/ClassNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class ClassNode extends UMLNode { 37 | 38 | private String name = ""; 39 | private String visibility = "Public"; 40 | private List child = new ArrayList(); 41 | ClassifierFeatureNode featureNode = new ClassifierFeatureNode(); 42 | private String id = ""; 43 | 44 | public String getId() { 45 | return id; 46 | } 47 | 48 | public void setId(String id) { 49 | this.id = id; 50 | } 51 | 52 | public ClassNode() { 53 | child.add(featureNode); 54 | } 55 | 56 | public void setName(String name) { 57 | this.name = name; 58 | } 59 | 60 | public void addVariable(UMLNode node) { 61 | featureNode.addNode(node); 62 | } 63 | 64 | public void addFunction(UMLNode node) { 65 | featureNode.addNode(node); 66 | } 67 | 68 | public void addSubroutine(UMLNode node) { 69 | featureNode.addNode(node); 70 | } 71 | 72 | public void addUses(UMLNode node) { 73 | child.add(node); 74 | } 75 | 76 | public void addComposites(UMLNode node) { 77 | child.add(node); 78 | } 79 | 80 | @Override 81 | public String getName() { 82 | // return this.name; 83 | return "UML:Class"; 84 | } 85 | 86 | @Override 87 | public List getChildren() { 88 | return child; 89 | } 90 | 91 | @Override 92 | public int getChildCount() { 93 | return child.size(); 94 | } 95 | 96 | @Override 97 | public Attributes getAttributes() { 98 | AttributesImpl attributes = new AttributesImpl(); 99 | attributes.addAttribute("", "xmi.id", "", "", id); 100 | attributes.addAttribute("", "name", "", "", this.name); 101 | attributes.addAttribute("", "visibility", "", "", this.visibility); 102 | attributes.addAttribute("", "isSpecification", "", "", "false"); 103 | attributes.addAttribute("", "isRoot", "", "", "false"); 104 | attributes.addAttribute("", "isLeaf", "", "", "false"); 105 | attributes.addAttribute("", "isAbstract", "", "", "false"); 106 | attributes.addAttribute("", "isActive", "", "", "false"); 107 | return attributes; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/edu/ua/node/ClassRefNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class ClassRefNode extends UMLNode { 36 | 37 | private List nodes = new ArrayList(); 38 | private String id = ""; 39 | 40 | public ClassRefNode() { 41 | id = Long.toString(this.hashCode()); 42 | } 43 | 44 | public String getId() { 45 | return id; 46 | } 47 | 48 | public void setId(String id) { 49 | this.id = id; 50 | } 51 | 52 | public void addNode(UMLNode node) { 53 | nodes.add(node); 54 | } 55 | 56 | @Override 57 | public String getName() { 58 | return "UML:Class"; 59 | } 60 | 61 | @Override 62 | public List getChildren() { 63 | return nodes; 64 | } 65 | 66 | @Override 67 | public int getChildCount() { 68 | return nodes.size(); 69 | } 70 | 71 | @Override 72 | public org.xml.sax.Attributes getAttributes() { 73 | AttributesImpl attributes = new AttributesImpl(); 74 | attributes.addAttribute("", "xmi.idref", "", "", id); 75 | return attributes; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/edu/ua/node/ClassifierFeatureNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class ClassifierFeatureNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:Classifier.feature"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl atb = new AttributesImpl(); 62 | return atb; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/ContentNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | 37 | public class ContentNode extends UMLNode { 38 | 39 | private List nodes = new ArrayList(); 40 | private NamespaceNode ns = new NamespaceNode(); 41 | 42 | @Override 43 | public String getName() { 44 | return "XMI.content"; 45 | } 46 | 47 | @Override 48 | public List getChildren() { 49 | return nodes; 50 | } 51 | 52 | public void addNode(UMLNode node) { 53 | nodes.add(node); 54 | 55 | } 56 | 57 | @Override 58 | public int getChildCount() { 59 | return nodes.size(); 60 | } 61 | 62 | @Override 63 | public Attributes getAttributes() { 64 | AttributesImpl attributes = new AttributesImpl(); 65 | return attributes; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/edu/ua/node/DataTypeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class DataTypeNode extends UMLNode { 36 | 37 | private List nodes = new ArrayList(); 38 | private String type = ""; 39 | private String id = ""; 40 | //private String hrefex = ""; 41 | 42 | public String getType() { 43 | return type; 44 | } 45 | 46 | public void setType(String type) { 47 | this.type = type; 48 | //hrefex = TypeConverter.getHref(type); 49 | 50 | } 51 | 52 | public void setId(String id) 53 | { 54 | this.id = id; 55 | } 56 | 57 | public String getId(){ 58 | return this.id; 59 | } 60 | 61 | public void addNode(UMLNode node) { 62 | nodes.add(node); 63 | } 64 | 65 | @Override 66 | public String getName() { 67 | return "UML:DataType"; 68 | } 69 | 70 | @Override 71 | public List getChildren() { 72 | return nodes; 73 | } 74 | 75 | @Override 76 | public int getChildCount() { 77 | return nodes.size(); 78 | } 79 | 80 | @Override 81 | public org.xml.sax.Attributes getAttributes() { 82 | AttributesImpl attributes = new AttributesImpl(); 83 | //attributes.addAttribute("", "href", "", "", "http://argouml.org/profiles/uml14/default-uml14.xmi#-84-17--56-5-43645a83:11466542d86:-8000:000000000000087C"); 84 | attributes.addAttribute("", "xmi.id", "", "", id); 85 | attributes.addAttribute("", "name", "", "", this.type); 86 | attributes.addAttribute("", "isSpecification", "", "", "false"); 87 | attributes.addAttribute("", "isRoot", "", "", "false"); 88 | attributes.addAttribute("", "isLeaf", "", "", "false"); 89 | attributes.addAttribute("", "isAbstract", "", "", "false"); 90 | return attributes; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/edu/ua/node/DependencyClientNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class DependencyClientNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | @Override 41 | public String getName() { 42 | return "UML:Dependency.client"; 43 | } 44 | 45 | public void addNode(UMLNode n) { 46 | nodes.add(n); 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/DependencySupplierNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class DependencySupplierNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode n) { 41 | nodes.add(n); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "Dependency.supplier"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/FunctionNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class FunctionNode extends UMLNode { 37 | 38 | private String name = ""; 39 | private String visibility = "public"; 40 | private String returnType = ""; 41 | private List parameters = new ArrayList(); 42 | 43 | public void setName(String name) { 44 | this.name = name; 45 | } 46 | 47 | public void setReturnType(String returnType) { 48 | this.returnType = returnType; 49 | } 50 | 51 | public String getReturnType() { 52 | return returnType; 53 | } 54 | 55 | public void addParameter(UMLNode node) { 56 | parameters.add(node); 57 | } 58 | 59 | @Override 60 | public String getName() { 61 | return "UML:Operation"; 62 | } 63 | 64 | @Override 65 | public List getChildren() { 66 | return parameters; 67 | } 68 | 69 | @Override 70 | public int getChildCount() { 71 | return parameters.size(); 72 | } 73 | 74 | @Override 75 | public Attributes getAttributes() { 76 | AttributesImpl attributes = new AttributesImpl(); 77 | attributes.addAttribute("", "name", "", "", this.name); 78 | //attributes.addAttribute("", "type", "","", this.returnType); 79 | attributes.addAttribute("", "visibility", "", "", this.visibility); 80 | attributes.addAttribute("", "isSpecification", "", "", "false"); 81 | attributes.addAttribute("", "ownerScoep", "", "", "instance"); 82 | attributes.addAttribute("", "isQuery", "", "", "false"); 83 | attributes.addAttribute("", "concurency", "", "", "sequential"); 84 | attributes.addAttribute("", "isRoot", "", "", "false"); 85 | attributes.addAttribute("", "isLeaf", "", "", "false"); 86 | attributes.addAttribute("", "isAbstract", "", "", "false"); 87 | 88 | 89 | 90 | return attributes; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/edu/ua/node/GeneralizableElementNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class GeneralizableElementNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:GeneralizableElement.generalization"; 47 | 48 | } 49 | 50 | @Override 51 | public List getChildren() { 52 | return nodes; 53 | } 54 | 55 | @Override 56 | public int getChildCount() { 57 | return nodes.size(); 58 | } 59 | 60 | @Override 61 | public org.xml.sax.Attributes getAttributes() { 62 | AttributesImpl attributes = new AttributesImpl(); 63 | 64 | return attributes; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/edu/ua/node/GeneralizationChildNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class GeneralizationChildNode extends UMLNode { 36 | 37 | private List nodes = new ArrayList(); 38 | 39 | public void addNode(UMLNode node) { 40 | nodes.add(node); 41 | } 42 | 43 | @Override 44 | public String getName() { 45 | return "UML:Generalization.child"; 46 | } 47 | 48 | @Override 49 | public List getChildren() { 50 | return nodes; 51 | } 52 | 53 | @Override 54 | public int getChildCount() { 55 | return nodes.size(); 56 | } 57 | 58 | @Override 59 | public org.xml.sax.Attributes getAttributes() { 60 | AttributesImpl attributes = new AttributesImpl(); 61 | 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/GeneralizationEntryNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class GeneralizationEntryNode extends UMLNode { 36 | 37 | private List nodes = new ArrayList(); 38 | private String id = ""; 39 | 40 | public GeneralizationEntryNode() { 41 | id = Long.toString(this.hashCode()); 42 | } 43 | 44 | public void addNode(UMLNode node) { 45 | nodes.add(node); 46 | } 47 | 48 | public void setId(String id) { 49 | this.id = id; 50 | } 51 | 52 | public String getId() { 53 | return Long.toString(this.hashCode()); 54 | } 55 | 56 | @Override 57 | public String getName() { 58 | return "UML:Generalization"; 59 | } 60 | 61 | @Override 62 | public List getChildren() { 63 | return nodes; 64 | } 65 | 66 | @Override 67 | public int getChildCount() { 68 | return nodes.size(); 69 | } 70 | 71 | @Override 72 | public org.xml.sax.Attributes getAttributes() { 73 | AttributesImpl attributes = new AttributesImpl(); 74 | attributes.addAttribute("", "xmi.id", "", "", id); 75 | return attributes; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/edu/ua/node/GeneralizationNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class GeneralizationNode extends UMLNode{ 36 | 37 | private List nodes = new ArrayList(); 38 | private String id = ""; 39 | 40 | private String child = ""; 41 | private String parent = ""; 42 | 43 | 44 | public void setChildClass(String cls){ 45 | child = cls; 46 | } 47 | 48 | public String getChildClass(){ 49 | return child; 50 | } 51 | 52 | public void setParentClass(String cls){ 53 | parent = cls; 54 | } 55 | 56 | public String getParentClass(){ 57 | return parent; 58 | } 59 | 60 | public GeneralizationNode(){ 61 | id = Long.toString(this.hashCode()); 62 | } 63 | 64 | public void addNode(UMLNode node){ 65 | nodes.add(node); 66 | } 67 | 68 | public void setId(String id){ 69 | this.id = id; 70 | } 71 | 72 | public String getId(){ 73 | return Long.toString(this.hashCode()); 74 | } 75 | 76 | @Override 77 | public String getName() { 78 | return "UML:Generalization"; 79 | } 80 | 81 | @Override 82 | public List getChildren() { 83 | return nodes; 84 | } 85 | 86 | @Override 87 | public int getChildCount() { 88 | return nodes.size(); 89 | } 90 | 91 | @Override 92 | public org.xml.sax.Attributes getAttributes() { 93 | AttributesImpl attributes = new AttributesImpl(); 94 | attributes.addAttribute("", "xmi.idref", "", "", id); 95 | return attributes; 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /src/edu/ua/node/GeneralizationParentNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class GeneralizationParentNode extends UMLNode { 36 | 37 | private List nodes = new ArrayList(); 38 | 39 | public void addNode(UMLNode node) { 40 | nodes.add(node); 41 | } 42 | 43 | @Override 44 | public String getName() { 45 | return "UML:Generalization.parent"; 46 | } 47 | 48 | @Override 49 | public List getChildren() { 50 | return nodes; 51 | } 52 | 53 | @Override 54 | public int getChildCount() { 55 | return nodes.size(); 56 | } 57 | 58 | @Override 59 | public org.xml.sax.Attributes getAttributes() { 60 | AttributesImpl attributes = new AttributesImpl(); 61 | 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/InterfaceNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | 37 | public class InterfaceNode extends UMLNode { 38 | 39 | private String name = ""; 40 | private List node = new ArrayList(); 41 | private String id = ""; 42 | 43 | public String getId() { 44 | return id; 45 | } 46 | 47 | public void setId(String id) { 48 | this.id = id; 49 | } 50 | 51 | public void addNode(UMLNode n) { 52 | node.add(n); 53 | } 54 | 55 | @Override 56 | public String getName() { 57 | return "UML:Interface"; 58 | } 59 | 60 | @Override 61 | public List getChildren() { 62 | return node; 63 | } 64 | 65 | @Override 66 | public int getChildCount() { 67 | return node.size(); 68 | } 69 | 70 | @Override 71 | public Attributes getAttributes() { 72 | AttributesImpl attributes = new AttributesImpl(); 73 | attributes.addAttribute("", "xmi.id", "", "", id); 74 | attributes.addAttribute("", "name", "", "", this.name); 75 | attributes.addAttribute("", "visibility", "", "", "public"); 76 | attributes.addAttribute("", "isSpecification", "", "", "false"); 77 | attributes.addAttribute("", "isRoot", "", "", "false"); 78 | attributes.addAttribute("", "isLeaf", "", "", "false"); 79 | attributes.addAttribute("", "isAbstract", "", "", "false"); 80 | return attributes; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/edu/ua/node/InterfaceRefNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class InterfaceRefNode extends UMLNode { 37 | 38 | private String id = ""; 39 | private List node = new ArrayList(); 40 | 41 | public InterfaceRefNode() { 42 | id = Long.toString(this.hashCode()); 43 | } 44 | 45 | public void addNodes(UMLNode n) { 46 | node.add(n); 47 | } 48 | 49 | @Override 50 | public String getName() { 51 | return "UML:Interface"; 52 | } 53 | 54 | @Override 55 | public List getChildren() { 56 | return node; 57 | } 58 | 59 | @Override 60 | public int getChildCount() { 61 | return node.size(); 62 | } 63 | 64 | @Override 65 | public Attributes getAttributes() { 66 | AttributesImpl attributes = new AttributesImpl(); 67 | attributes.addAttribute("", "xmi.idref", "", "", id); 68 | return attributes; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/edu/ua/node/ModelNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class ModelNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:Model"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | 62 | AttributesImpl attributes = new AttributesImpl(); 63 | attributes.addAttribute("", "xmi.id", "", "", Long.toString(this.hashCode())); 64 | attributes.addAttribute("", "isSpecification", "", "", "false"); 65 | attributes.addAttribute("", "isRoot", "", "", "false"); 66 | attributes.addAttribute("", "isLeaf", "", "", "false"); 67 | attributes.addAttribute("", "isAbstract", "", "", "false"); 68 | return attributes; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/edu/ua/node/ModelStereotype.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | package edu.ua.node; 31 | 32 | import java.util.ArrayList; 33 | import java.util.List; 34 | import org.xml.sax.Attributes; 35 | import org.xml.sax.helpers.AttributesImpl; 36 | 37 | 38 | public class ModelStereotype extends UMLNode{ 39 | 40 | private List nodes = new ArrayList(); 41 | 42 | @Override 43 | public String getName() { 44 | return "UML:ModelElement.stereotype"; 45 | } 46 | 47 | public void addNodes(UMLNode n) { 48 | nodes.add(n); 49 | } 50 | 51 | @Override 52 | public List getChildren() { 53 | return nodes; 54 | } 55 | 56 | @Override 57 | public int getChildCount() { 58 | return nodes.size(); 59 | } 60 | 61 | @Override 62 | public Attributes getAttributes() { 63 | AttributesImpl attributes = new AttributesImpl(); 64 | return attributes; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/edu/ua/node/MultiplicityNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class MultiplicityNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:Multiplicity"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | attributes.addAttribute("", "xmi.id", "", "", Long.toString(this.hashCode())); 63 | return attributes; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/edu/ua/node/MultiplicityRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class MultiplicityRange extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNodes(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:MultiplicityRange"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | List list = new ArrayList(); 52 | return list; 53 | } 54 | 55 | @Override 56 | public int getChildCount() { 57 | return nodes.size(); 58 | } 59 | 60 | @Override 61 | public Attributes getAttributes() { 62 | AttributesImpl attributes = new AttributesImpl(); 63 | attributes.addAttribute("", "xmi.id", "", "", Long.toString(this.hashCode())); 64 | attributes.addAttribute("", "lower", "", "", "1"); 65 | attributes.addAttribute("", "upper", "", "", "1"); 66 | return attributes; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/edu/ua/node/MultiplicityRangeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class MultiplicityRangeNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:Multiplicity.range"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/NamespaceNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class NamespaceNode extends UMLNode { 37 | 38 | private List cls = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | cls.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:Namespace.ownedElement"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return cls; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return cls.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl atb = new AttributesImpl(); 62 | return atb; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/ParameterDataTypeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class ParameterDataTypeNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:DataType"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | attributes.addAttribute("", "href", "", "", Long.toString(this.hashCode())); 63 | return attributes; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/edu/ua/node/ParameterNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class ParameterNode extends UMLNode { 37 | 38 | public String name = ""; 39 | public String type = ""; 40 | public String visibility = "public"; 41 | public String kind = ""; 42 | private List nodes = new ArrayList(); 43 | 44 | public void addNode(UMLNode node) { 45 | nodes.add(node); 46 | } 47 | 48 | public String getKind() { 49 | return kind; 50 | } 51 | 52 | public void setKind(String kind) { 53 | this.kind = kind; 54 | } 55 | 56 | public void setName(String name) { 57 | this.name = name; 58 | } 59 | 60 | public void setType(String type) { 61 | this.type = type; 62 | } 63 | 64 | public String getType() { 65 | return this.type; 66 | } 67 | 68 | @Override 69 | public String getName() { 70 | return "UML:Parameter"; 71 | } 72 | 73 | @Override 74 | public List getChildren() { 75 | return nodes; 76 | } 77 | 78 | @Override 79 | public int getChildCount() { 80 | return nodes.size(); 81 | } 82 | 83 | @Override 84 | public Attributes getAttributes() { 85 | AttributesImpl attributes = new AttributesImpl(); 86 | attributes.addAttribute("", "xmi.id", "", "", Long.toString(this.hashCode())); 87 | attributes.addAttribute("", "name", "", "", this.name); 88 | attributes.addAttribute("", "isSpecification", "", "", "false"); 89 | attributes.addAttribute("", "kind", "", "", this.kind); 90 | return attributes; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/edu/ua/node/ParameterTypeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | 37 | public class ParameterTypeNode extends UMLNode { 38 | 39 | private List nodes = new ArrayList(); 40 | 41 | public void addNode(UMLNode node) { 42 | nodes.add(node); 43 | } 44 | 45 | @Override 46 | public String getName() { 47 | return "UML:Parameter.type"; 48 | } 49 | 50 | @Override 51 | public List getChildren() { 52 | return nodes; 53 | } 54 | 55 | @Override 56 | public int getChildCount() { 57 | return nodes.size(); 58 | } 59 | 60 | @Override 61 | public Attributes getAttributes() { 62 | AttributesImpl attributes = new AttributesImpl(); 63 | return attributes; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/edu/ua/node/StereoBaseClassNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class StereoBaseClassNode extends UMLNode { 37 | 38 | private List node = new ArrayList(); 39 | 40 | public void addNodes(UMLNode n) { 41 | node.add(n); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:Stereotype.baseClass"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return node; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return node.size(); 57 | } 58 | 59 | public String getText(){ 60 | return "Attribute"; 61 | } 62 | 63 | @Override 64 | public Attributes getAttributes() { 65 | AttributesImpl attributes = new AttributesImpl(); 66 | 67 | return attributes; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/edu/ua/node/StereotypeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class StereotypeNode extends UMLNode { 37 | 38 | private List node = new ArrayList(); 39 | private String name = ""; 40 | private String id = ""; 41 | 42 | public String getId() { 43 | return id; 44 | } 45 | 46 | public void setId(String id) { 47 | this.id = id; 48 | } 49 | 50 | public void addNodes(UMLNode n) { 51 | node.add(n); 52 | } 53 | 54 | @Override 55 | public String getName() { 56 | return "UML:Stereotype"; 57 | } 58 | 59 | public void setName(String name){ 60 | this.name = name; 61 | } 62 | 63 | @Override 64 | public List getChildren() { 65 | return node; 66 | } 67 | 68 | @Override 69 | public int getChildCount() { 70 | return node.size(); 71 | } 72 | 73 | @Override 74 | public Attributes getAttributes() { 75 | AttributesImpl attributes = new AttributesImpl(); 76 | attributes.addAttribute("", "xmi.id", "", "", this.id); 77 | attributes.addAttribute("", "name", "", "", this.name); 78 | attributes.addAttribute("", "isSpecification", "", "", "false"); 79 | attributes.addAttribute("", "isRoot", "", "", "false"); 80 | attributes.addAttribute("", "isLeaf", "", "", "false"); 81 | attributes.addAttribute("", "isAbstract", "", "", "false"); 82 | return attributes; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/edu/ua/node/StereotypeRefNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | package edu.ua.node; 31 | 32 | import java.util.ArrayList; 33 | import java.util.List; 34 | import org.xml.sax.Attributes; 35 | import org.xml.sax.helpers.AttributesImpl; 36 | 37 | 38 | public class StereotypeRefNode extends UMLNode{ 39 | 40 | 41 | private List nodes = new ArrayList(); 42 | private String id = ""; 43 | 44 | public String getId() { 45 | return id; 46 | } 47 | 48 | public void setId(String id) { 49 | this.id = id; 50 | } 51 | 52 | @Override 53 | public String getName() { 54 | return "UML:Stereotype"; 55 | } 56 | 57 | @Override 58 | public List getChildren() { 59 | return nodes; 60 | } 61 | 62 | @Override 63 | public int getChildCount() { 64 | return nodes.size(); 65 | } 66 | 67 | @Override 68 | public Attributes getAttributes() { 69 | AttributesImpl attributes = new AttributesImpl(); 70 | attributes.addAttribute("", "xmi.idref", "", "", id); 71 | return attributes; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/edu/ua/node/StructuralFeatureMultiNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class StructuralFeatureMultiNode extends UMLNode { 37 | 38 | private List nodes = new ArrayList(); 39 | 40 | public void addNode(UMLNode node) { 41 | nodes.add(node); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UML:StructuralFeature.multiplicity"; 47 | } 48 | 49 | @Override 50 | public List getChildren() { 51 | return nodes; 52 | } 53 | 54 | @Override 55 | public int getChildCount() { 56 | return nodes.size(); 57 | } 58 | 59 | @Override 60 | public Attributes getAttributes() { 61 | AttributesImpl attributes = new AttributesImpl(); 62 | return attributes; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/edu/ua/node/StructuralFeatureTypeNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.helpers.AttributesImpl; 34 | 35 | public class StructuralFeatureTypeNode extends UMLNode { 36 | 37 | private List nodes = new ArrayList(); 38 | 39 | public void addNode(UMLNode node) { 40 | nodes.add(node); 41 | } 42 | 43 | @Override 44 | public String getName() { 45 | return "UML:StructuralFeature.type"; 46 | } 47 | 48 | @Override 49 | public List getChildren() { 50 | return nodes; 51 | } 52 | 53 | @Override 54 | public int getChildCount() { 55 | return nodes.size(); 56 | } 57 | 58 | @Override 59 | public org.xml.sax.Attributes getAttributes() { 60 | AttributesImpl attributes = new AttributesImpl(); 61 | return attributes; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/edu/ua/node/SubroutineNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | import org.xml.sax.Attributes; 34 | import org.xml.sax.helpers.AttributesImpl; 35 | 36 | public class SubroutineNode extends UMLNode { 37 | 38 | private String name = ""; 39 | private String visibility = "public"; 40 | private List parameters = new ArrayList(); 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | public void addParameters(UMLNode node) { 47 | parameters.add(node); 48 | } 49 | 50 | @Override 51 | public String getName() { 52 | return "UML:Operation"; 53 | } 54 | 55 | @Override 56 | public List getChildren() { 57 | return parameters; 58 | } 59 | 60 | @Override 61 | public int getChildCount() { 62 | return parameters.size(); 63 | } 64 | 65 | @Override 66 | public Attributes getAttributes() { 67 | AttributesImpl attributes = new AttributesImpl(); 68 | attributes.addAttribute("", "name", "", "", this.name); 69 | attributes.addAttribute("", "type", "", "", "void"); 70 | attributes.addAttribute("", "visibility", "", "", this.visibility); 71 | attributes.addAttribute("", "isSpecification", "", "", "false"); 72 | attributes.addAttribute("", "ownerScoep", "", "", "instance"); 73 | attributes.addAttribute("", "isQuery", "", "", "false"); 74 | attributes.addAttribute("", "concurency", "", "", "sequential"); 75 | attributes.addAttribute("", "isRoot", "", "", "false"); 76 | attributes.addAttribute("", "isLeaf", "", "", "false"); 77 | attributes.addAttribute("", "isAbstract", "", "", "false"); 78 | return attributes; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/edu/ua/node/UMLNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.node; 30 | 31 | import java.util.List; 32 | import org.xml.sax.Attributes; 33 | 34 | 35 | public abstract class UMLNode { 36 | 37 | public abstract String getName(); 38 | 39 | public abstract List getChildren(); 40 | 41 | public abstract int getChildCount(); 42 | 43 | public String getText() { 44 | return null; 45 | } 46 | 47 | public abstract Attributes getAttributes(); 48 | } 49 | -------------------------------------------------------------------------------- /src/edu/ua/util/DataWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | import java.io.Writer; 32 | import java.util.Stack; 33 | 34 | import org.xml.sax.Attributes; 35 | import org.xml.sax.SAXException; 36 | import org.xml.sax.XMLReader; 37 | 38 | 39 | public class DataWriter extends XMLWriter { 40 | 41 | private final static Object SEEN_NOTHING = new Object(); 42 | private final static Object SEEN_ELEMENT = new Object(); 43 | private final static Object SEEN_DATA = new Object(); 44 | 45 | // Internal state. 46 | private Object state = SEEN_NOTHING; 47 | private Stack stateStack = new Stack(); 48 | private int indentStep = 0; 49 | private int depth = 0; 50 | 51 | 52 | /** 53 | * Create a new data writer for standard output. 54 | */ 55 | public DataWriter() { 56 | super(); 57 | } 58 | 59 | /** 60 | * Create a new data writer for standard output. 61 | * 62 | *

Use the XMLReader provided as the source of events.

63 | * 64 | * @param xmlreader The parent in the filter chain. 65 | */ 66 | public DataWriter(XMLReader xmlreader) { 67 | super(xmlreader); 68 | } 69 | 70 | /** 71 | * Create a new data writer for the specified output. 72 | * 73 | * @param writer The character stream where the XML document will be written. 74 | */ 75 | public DataWriter(Writer writer) { 76 | super(writer); 77 | } 78 | 79 | /** 80 | * Create a new data writer for the specified output.

Use the XMLReader 81 | * provided as the source of events.

82 | * 83 | * @param xmlreader The parent in the filter chain. 84 | * @param writer The character stream where the XML document will be written. 85 | */ 86 | public DataWriter(XMLReader xmlreader, Writer writer) { 87 | super(xmlreader, writer); 88 | } 89 | 90 | // Accessors and setters. 91 | /** 92 | * Return the current indent step. 93 | * 94 | *

Return the current indent step: each start tag will be indented by this 95 | * number of spaces times the number of ancestors that the element has.

96 | * 97 | * @return The number of spaces in each indentation step, or 0 or less for no 98 | * indentation. 99 | * @see #setIndentStep 100 | */ 101 | public int getIndentStep() { 102 | return indentStep; 103 | } 104 | 105 | /** 106 | * Set the current indent step. 107 | * 108 | * @param indentStep The new indent step (0 or less for no indentation). 109 | * @see #getIndentStep 110 | */ 111 | public void setIndentStep(int indentStep) { 112 | this.indentStep = indentStep; 113 | } 114 | 115 | /** 116 | * Reset the writer so that it can be reused. 117 | * 118 | *

This method is especially useful if the writer failed with an exception 119 | * the last time through.

120 | * 121 | * @see com.megginson.sax.XMLWriter#reset 122 | */ 123 | public void reset() { 124 | depth = 0; 125 | state = SEEN_NOTHING; 126 | stateStack = new Stack(); 127 | super.reset(); 128 | } 129 | 130 | /** 131 | * Write a start tag. 132 | * 133 | *

Each tag will begin on a new line, and will be indented by the current 134 | * indent step times the number of ancestors that the element has.

135 | * 136 | *

The newline and indentation will be passed on down the filter chain 137 | * through regular characters events.

138 | * 139 | * @param uri The element's Namespace URI. 140 | * @param localName The element's local name. 141 | * @param qName The element's qualified (prefixed) name. 142 | * @param atts The element's attribute list. 143 | * @exception org.xml.sax.SAXException If there is an error writing the start 144 | * tag, or if a filter further down the chain raises an exception. 145 | * @see XMLWriter#startElement(String, String, String, Attributes) 146 | */ 147 | public void startElement(String uri, String localName, 148 | String qName, Attributes atts) throws SAXException { 149 | stateStack.push(SEEN_ELEMENT); 150 | state = SEEN_NOTHING; 151 | if (depth > 0) { 152 | super.characters(LINE_SEPARATOR); 153 | } 154 | doIndent(); 155 | super.startElement(uri, localName, qName, atts); 156 | depth++; 157 | } 158 | 159 | /** 160 | * Write an end tag. 161 | * 162 | *

If the element has contained other elements, the tag will appear 163 | * indented on a new line; otherwise, it will appear immediately following 164 | * whatever came before.

165 | * 166 | *

The newline and indentation will be passed on down the filter chain 167 | * through regular characters events.

168 | * 169 | * @param uri The element's Namespace URI. 170 | * @param localName The element's local name. 171 | * @param qName The element's qualified (prefixed) name. 172 | * @exception org.xml.sax.SAXException If there is an error writing the end 173 | * tag, or if a filter further down the chain raises an exception. 174 | * @see XMLWriter#endElement(String, String, String) 175 | */ 176 | public void endElement(String uri, String localName, String qName) 177 | throws SAXException { 178 | depth--; 179 | if (state == SEEN_ELEMENT) { 180 | super.characters(LINE_SEPARATOR); 181 | doIndent(); 182 | } 183 | super.endElement(uri, localName, qName); 184 | state = stateStack.pop(); 185 | } 186 | 187 | /** 188 | * Write a empty element tag. 189 | * 190 | *

Each tag will appear on a new line, and will be indented by the current 191 | * indent step times the number of ancestors that the element has.

192 | * 193 | *

The newline and indentation will be passed on down the filter chain 194 | * through regular characters events.

195 | * 196 | * @param uri The element's Namespace URI. 197 | * @param localName The element's local name. 198 | * @param qName The element's qualified (prefixed) name. 199 | * @param atts The element's attribute list. 200 | * @exception org.xml.sax.SAXException If there is an error writing the empty 201 | * tag, or if a filter further down the chain raises an exception. 202 | * @see XMLWriter#emptyElement(String, String, String, Attributes) 203 | */ 204 | public void emptyElement(String uri, String localName, 205 | String qName, Attributes atts) throws SAXException { 206 | state = SEEN_ELEMENT; 207 | if (depth > 0) { 208 | super.characters(LINE_SEPARATOR); 209 | } 210 | doIndent(); 211 | super.emptyElement(uri, localName, qName, atts); 212 | } 213 | 214 | /** 215 | * Write a sequence of characters. 216 | * 217 | * @param ch The characters to write. 218 | * @param start The starting position in the array. 219 | * @param length The number of characters to use. 220 | * @exception org.xml.sax.SAXException If there is an error writing the 221 | * characters, or if a filter further down the chain raises an exception. 222 | * @see XMLWriter#characters(char[], int, int) 223 | */ 224 | public void characters(char ch[], int start, int length) 225 | throws SAXException { 226 | state = SEEN_DATA; 227 | super.characters(ch, start, length); 228 | } 229 | 230 | /** 231 | * Print indentation for the current level. 232 | * 233 | * @exception org.xml.sax.SAXException If there is an error writing the 234 | * indentation characters, or if a filter further down the chain raises an 235 | * exception. 236 | */ 237 | private void doIndent() throws SAXException { 238 | if (indentStep > 0 && depth > 0) { 239 | int n = indentStep * depth; 240 | char ch[] = new char[n]; 241 | for (int i = 0; i < n; i++) { 242 | ch[i] = ' '; 243 | } 244 | characters(ch, 0, n); 245 | } 246 | } 247 | 248 | } -------------------------------------------------------------------------------- /src/edu/ua/util/Fortran2XMI.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | import edu.ua.node.UMLNode; 32 | import java.util.List; 33 | import java.util.ListIterator; 34 | import java.util.ResourceBundle; 35 | import org.xml.sax.Attributes; 36 | import org.xml.sax.SAXException; 37 | import org.xml.sax.helpers.AttributesImpl; 38 | 39 | public class Fortran2XMI { 40 | 41 | private XMLWriter xmlWriter; 42 | private ResourceBundle resource; 43 | private ResourceBundle model2UMLNodeReserouce; 44 | 45 | public Fortran2XMI(XMLWriter xmlWriter) { 46 | this.xmlWriter = xmlWriter; 47 | } 48 | 49 | public void serializeHeader(String documentName) throws SAXException { 50 | AttributesImpl attributes = new AttributesImpl(); 51 | xmlWriter.startElement("", "XMI.header", "", attributes); 52 | 53 | attributes.addAttribute("", "name", "", "", "UML"); 54 | attributes.addAttribute("", "version", "", "", "1.3"); 55 | attributes.addAttribute("", "href", "", "", "UML.xml"); 56 | 57 | xmlWriter.startElement("", "XMI.metaModel", "", attributes); 58 | 59 | xmlWriter.endElement("XMI.metaModel"); 60 | 61 | attributes.clear(); 62 | attributes.addAttribute("", "name", "", "", documentName); 63 | attributes.addAttribute("", "version", "", "", "1"); 64 | attributes.addAttribute("", "href", "", "", documentName); 65 | 66 | xmlWriter.startElement("", "XMI.model", "", attributes); 67 | xmlWriter.endElement("XMI.model"); 68 | xmlWriter.endElement("XMI.header"); 69 | } 70 | 71 | public void serialzeNode(UMLNode node) throws SAXException { 72 | String elementName; 73 | List children; 74 | ListIterator iterator; 75 | String childElementName = null; 76 | elementName = node.getName(); 77 | Attributes attributes = node.getAttributes(); 78 | xmlWriter.startElement("", elementName, "", attributes); 79 | children = node.getChildren(); 80 | iterator = children.listIterator(); 81 | while (iterator.hasNext()) { 82 | 83 | Object object = iterator.next(); 84 | UMLNode childNode = (UMLNode) object; 85 | 86 | if (childNode.getChildCount() != 0) { 87 | serialzeNode(childNode); 88 | } else { 89 | childElementName = childNode.getName(); 90 | attributes = childNode.getAttributes(); 91 | xmlWriter.startElement("", childElementName, "", attributes); 92 | xmlWriter.endElement(childElementName); 93 | } 94 | } 95 | xmlWriter.endElement(elementName); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/edu/ua/util/FortranParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | import edu.ua.fortran.FortranLexer; 32 | import org.antlr.runtime.*; 33 | 34 | import java.util.HashMap; 35 | 36 | public abstract class FortranParser extends Parser implements IFortranParser { 37 | 38 | /* Provide action objects to implement the AST. These are singleton objects. */ 39 | public static IFortranParserAction action = null; 40 | protected static IFortranParserAction nullAction = new FortranParserActionNull(null, null, null); 41 | FortranParser delegate = null; 42 | public String filename; 43 | public String pathname; 44 | 45 | boolean has_error_occurred = false; 46 | 47 | public FortranParser(TokenStream input, RecognizerSharedState state) { 48 | super(input, state); 49 | 50 | // TODO - see if the size has to increase with new F2008 rules 51 | state.ruleMemo = new HashMap[489 + 1]; 52 | } 53 | 54 | public void initialize(FortranParser delegate, IFortranParserAction action, 55 | String filename, String path) { 56 | this.delegate = delegate; 57 | this.filename = filename; 58 | this.pathname = path; 59 | 60 | // if (FortranParser.action != null) FortranParser.action = action; 61 | FortranParser.action = action; 62 | } 63 | 64 | public boolean hasErrorOccurred() { 65 | return delegate.has_error_occurred; 66 | } 67 | 68 | public void reportError(RecognitionException re) { 69 | super.reportError(re); 70 | 71 | // Change action class to FortranParserActionNull so that actions are no 72 | // longer called. This will allow error handling to be done by ANTLR 73 | // only. 74 | // 75 | this.action = nullAction; 76 | 77 | delegate.has_error_occurred = true; 78 | 79 | String header = getErrorHeader(re); 80 | String msg = super.getErrorMessage(re, this.getTokenNames()); 81 | GlobalErrorException.setError(header+" "+msg); 82 | GlobalErrorException.setHasError(true); 83 | //System.out.println("REPORT ERROR :"+header+"-- "+msg); 84 | } 85 | 86 | public IFortranParserAction getAction() { 87 | return action; 88 | } 89 | 90 | public void main_program() throws RecognitionException { 91 | delegate.main_program(); 92 | } 93 | 94 | /* TODO - implement, needed by FortranParserAction */ 95 | public Token getRightIToken() { 96 | return null; 97 | } 98 | 99 | /* TODO - implement, may be needed by FortranParserAction */ 100 | public Token getRhsIToken(int i) { 101 | return null; 102 | } 103 | 104 | /** 105 | * Check for include and end of file. T_INCLUDE is not in the grammar so this 106 | * method must be called after every statement (and initially at the beginning 107 | * of program unit file). 108 | */ 109 | public void checkForInclude() { 110 | 111 | // consume bare T_EOS 112 | while (input.LA(1) == FortranLexer.T_EOS) { 113 | input.consume(); 114 | } 115 | 116 | if (input.LA(1) == FortranLexer.T_INCLUDE) { 117 | String files[]; 118 | input.consume(); // consume T_INCLUDE 119 | 120 | // get include filename from token stream 121 | files = input.LT(1).getText().split(":"); 122 | action.start_of_file(files[0], files[1]); 123 | input.consume(); // consume T_INCLUDE_NAME 124 | 125 | // check for empty include file (no statements) 126 | if (input.LA(1) == FortranLexer.T_EOF) { 127 | Token tk = input.LT(1); 128 | input.consume(); 129 | 130 | files = tk.getText().split(":"); 131 | action.end_of_file(files[0], files[1]); 132 | } 133 | 134 | // include acts like a statement so need to see if another include follows 135 | checkForInclude(); 136 | } else if (input.LA(1) == FortranLexer.T_EOF) { 137 | Token tk = input.LT(1); 138 | String[] files = tk.getText().split(":"); 139 | input.consume(); 140 | action.end_of_file(files[0], files[1]); 141 | // unwind T_EOFs for include files containing includes 142 | checkForInclude(); 143 | } 144 | } 145 | } // end FortranParser 146 | -------------------------------------------------------------------------------- /src/edu/ua/util/FortranParserActionFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | package edu.ua.util; 31 | 32 | import java.lang.reflect.Constructor; 33 | 34 | public class FortranParserActionFactory { 35 | 36 | public static IFortranParserAction newAction(String[] args, IFortranParser parser, String kind, String filename) { 37 | IFortranParserAction action = null; 38 | // Look up the class name. Could be FortranParserActionPrint, or 39 | // FortranParserActionNull, or maybe something else. 40 | try { 41 | Constructor[] cons = Class.forName(kind).getDeclaredConstructors(); 42 | for (int i = 0; i < cons.length; i++) { 43 | Class[] types = cons[i].getParameterTypes(); 44 | if (types.length == 3 45 | & types[0] == String[].class 46 | & types[1] == IFortranParser.class 47 | & types[2] == java.lang.String.class) { 48 | Object[] actionArgs = {args, parser, filename}; 49 | action = (IFortranParserAction) cons[i].newInstance(actionArgs); 50 | break; 51 | } 52 | } 53 | } catch (Exception e) { 54 | System.out.println(e); 55 | } 56 | return action; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/edu/ua/util/FortranToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | import org.antlr.runtime.*; 32 | 33 | public class FortranToken extends CommonToken { 34 | 35 | protected String whiteText = ""; 36 | 37 | public FortranToken(CharStream input, int type, int channel, 38 | int start, int stop) { 39 | super(input, type, channel, start, stop); 40 | } 41 | 42 | public FortranToken(int type) { 43 | super(type); 44 | // this.input = input; 45 | } 46 | 47 | // public FortranToken(int type, String text, CharStream input) { 48 | public FortranToken(int type, String text) { 49 | super(type, text); 50 | // this.input = input; 51 | } 52 | 53 | // public FortranToken(Token token, CharStream input) { 54 | public FortranToken(Token token) { 55 | super(token); 56 | // this.input = input; 57 | } 58 | 59 | public String getWhiteText() { 60 | return whiteText; 61 | } 62 | 63 | public void setWhiteText(String text) { 64 | whiteText = text == null ? "" : text; 65 | } 66 | 67 | public FortranStream getInput() { 68 | return (FortranStream) this.input; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/edu/ua/util/GlobalErrorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | public class GlobalErrorException { 32 | private static String error_message = null; 33 | private static boolean error = false; 34 | 35 | public static void setError(String msg){ 36 | error_message = msg; 37 | } 38 | 39 | public static String getError() 40 | { 41 | return error_message; 42 | } 43 | 44 | public static void setHasError(boolean err){ 45 | error = true; 46 | } 47 | 48 | public static boolean hasError(){ 49 | return error; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/edu/ua/util/IActionEnums.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | /** 32 | * This file replaces integers with enums. It was getting to be a problem 33 | * passing enums from java to C. 34 | */ 35 | public interface IActionEnums { 36 | 37 | 38 | static final public int LiteralConstantBase = 0; 39 | static final public int KindParamBase = 100; 40 | static final public int KindSelectorBase = 200; 41 | static final public int KindLenParamBase = 300; 42 | static final public int IntrinsicTypeSpecBase = 400; 43 | static final public int DeclarationTypeSpecBase = 500; 44 | static final public int IntentSpecBase = 600; 45 | static final public int ArraySpecElementBase = 700; 46 | static final public int AttrSpecBase = 800; 47 | static final public int BindingStatementTypeBase = 900; 48 | static final public int ComponentDefTypeBase = 1000; 49 | static final public int TypeParamOrCompDefBase = 1100; 50 | static final public int TypeAttrSpecBase = 1200; 51 | static final public int ComponentAttrSpecBase = 1300; 52 | static final public int ProcComponentAttrSpecBase = 1400; 53 | static final public int GenericSpecBase = 1500; 54 | static final public int DTIOGenericSpecBase = 1600; 55 | static final public int DoConstructBase = 1700; 56 | // And here are the "enums" 57 | // 58 | static final public int LiteralConstant_int_literal_constant = 59 | LiteralConstantBase + 0; 60 | static final public int LiteralConstant_real_literal_constant = 61 | LiteralConstantBase + 1; 62 | static final public int LiteralConstant_complex_literal_constant = 63 | LiteralConstantBase + 2; 64 | static final public int LiteralConstant_logical_literal_constant = 65 | LiteralConstantBase + 3; 66 | static final public int LiteralConstant_char_literal_constant = 67 | LiteralConstantBase + 4; 68 | static final public int LiteralConstant_boz_literal_constant = 69 | LiteralConstantBase + 5; 70 | static final public int KindParam_none = KindParamBase + 0; 71 | static final public int KindParam_literal = KindParamBase + 1; 72 | static final public int KindParam_id = KindParamBase + 2; 73 | static final public int KindSelector_none = KindSelectorBase + 0; 74 | static final public int KindSelector_expression = KindSelectorBase + 1; 75 | static final public int KindLenParam_none = KindLenParamBase + 0; 76 | static final public int KindLenParam_kind = KindLenParamBase + 1; 77 | static final public int KindLenParam_len = KindLenParamBase + 2; 78 | static final public int IntrinsicTypeSpec_INTEGER = 79 | IntrinsicTypeSpecBase + 0; 80 | static final public int IntrinsicTypeSpec_REAL = 81 | IntrinsicTypeSpecBase + 1; 82 | static final public int IntrinsicTypeSpec_DOUBLEPRECISION = 83 | IntrinsicTypeSpecBase + 2; 84 | static final public int IntrinsicTypeSpec_DOUBLECOMPLEX = 85 | IntrinsicTypeSpecBase + 3; 86 | static final public int IntrinsicTypeSpec_COMPLEX = 87 | IntrinsicTypeSpecBase + 4; 88 | static final public int IntrinsicTypeSpec_CHARACTER = 89 | IntrinsicTypeSpecBase + 5; 90 | static final public int IntrinsicTypeSpec_LOGICAL = 91 | IntrinsicTypeSpecBase + 6; 92 | //--------------------------------------------- 93 | // Rice intrinsic types 94 | //--------------------------------------------- 95 | static final public int IntrinsicTypeSpec_TEAM = 96 | IntrinsicTypeSpecBase + 7; 97 | //(1/13/2010) for now CrayPointer is used for AST only 98 | static final public int IntrinsicTypeSpec_CRAYPOINTER = 99 | IntrinsicTypeSpecBase + 8; 100 | static final public int IntrinsicTypeSpec_EVENT = 101 | IntrinsicTypeSpecBase + 9; 102 | static final public int IntrinsicTypeSpec_TOPOLOGY = 103 | IntrinsicTypeSpecBase + 10; 104 | static final public int IntrinsicTypeSpec_LOCK = 105 | IntrinsicTypeSpecBase + 11; 106 | static final public int IntrinsicTypeSpec_LOCKSET = 107 | IntrinsicTypeSpecBase + 12; 108 | static final public int DeclarationTypeSpec_INTRINSIC = 109 | DeclarationTypeSpecBase + 0; 110 | static final public int DeclarationTypeSpec_TYPE = 111 | DeclarationTypeSpecBase + 1; 112 | static final public int DeclarationTypeSpec_CLASS = 113 | DeclarationTypeSpecBase + 2; 114 | static final public int DeclarationTypeSpec_unlimited = 115 | DeclarationTypeSpecBase + 3; 116 | static final public int IntentSpec_IN = IntentSpecBase + 0; 117 | static final public int IntentSpec_OUT = IntentSpecBase + 1; 118 | static final public int IntentSpec_INOUT = IntentSpecBase + 2; 119 | static final public int ArraySpecElement_expr = 120 | ArraySpecElementBase + 0; 121 | static final public int ArraySpecElement_expr_colon = 122 | ArraySpecElementBase + 1; 123 | static final public int ArraySpecElement_expr_colon_expr = 124 | ArraySpecElementBase + 2; 125 | static final public int ArraySpecElement_expr_colon_asterisk = 126 | ArraySpecElementBase + 3; 127 | static final public int ArraySpecElement_asterisk = 128 | ArraySpecElementBase + 4; 129 | static final public int ArraySpecElement_colon = 130 | ArraySpecElementBase + 5; 131 | static final public int AttrSpec_none = AttrSpecBase + 0; 132 | static final public int AttrSpec_access = AttrSpecBase + 1; 133 | static final public int AttrSpec_language_binding = AttrSpecBase + 2; 134 | static final public int AttrSpec_PUBLIC = AttrSpecBase + 3; 135 | static final public int AttrSpec_PRIVATE = AttrSpecBase + 4; 136 | static final public int AttrSpec_ALLOCATABLE = AttrSpecBase + 5; 137 | static final public int AttrSpec_ASYNCHRONOUS = AttrSpecBase + 6; 138 | static final public int AttrSpec_CODIMENSION = AttrSpecBase + 7; 139 | static final public int AttrSpec_CONTIGUOUS = AttrSpecBase + 8; 140 | static final public int AttrSpec_DIMENSION = AttrSpecBase + 9; 141 | static final public int AttrSpec_EXTERNAL = AttrSpecBase + 10; 142 | static final public int AttrSpec_INTENT = AttrSpecBase + 11; 143 | static final public int AttrSpec_INTRINSIC = AttrSpecBase + 12; 144 | static final public int AttrSpec_BINDC = AttrSpecBase + 13; 145 | static final public int AttrSpec_OPTIONAL = AttrSpecBase + 14; 146 | static final public int AttrSpec_PARAMETER = AttrSpecBase + 15; 147 | static final public int AttrSpec_POINTER = AttrSpecBase + 16; 148 | static final public int AttrSpec_PROTECTED = AttrSpecBase + 17; 149 | static final public int AttrSpec_SAVE = AttrSpecBase + 18; 150 | static final public int AttrSpec_TARGET = AttrSpecBase + 19; 151 | static final public int AttrSpec_VALUE = AttrSpecBase + 20; 152 | static final public int AttrSpec_VOLATILE = AttrSpecBase + 21; 153 | static final public int AttrSpec_PASS = AttrSpecBase + 22; 154 | static final public int AttrSpec_NOPASS = AttrSpecBase + 23; 155 | static final public int AttrSpec_NON_OVERRIDABLE = AttrSpecBase + 24; 156 | static final public int AttrSpec_DEFERRED = AttrSpecBase + 25; 157 | // TODO are T_KIND and T_LEN correct? 158 | static final public int AttrSpec_KIND = AttrSpecBase + 26; 159 | static final public int AttrSpec_LEN = AttrSpecBase + 27; 160 | //--------------------------------------------- 161 | // Rice attributes 162 | static final public int AttrSpec_COARRAY = AttrSpecBase + 28; 163 | static final public int AttrSpec_COPOINTER = AttrSpecBase + 29; 164 | static final public int AttrSpec_COTARGET = AttrSpecBase + 30; 165 | //--------------------------------------------- 166 | static final public int BindingStatementType_specific = 167 | BindingStatementTypeBase + 0; 168 | static final public int BindingStatementType_generic = 169 | BindingStatementTypeBase + 1; 170 | static final public int BindingStatementType_final = 171 | BindingStatementTypeBase + 2; 172 | static final public int ComponentDefType_data = ComponentDefTypeBase + 0; 173 | static final public int ComponentDefType_procedure = ComponentDefTypeBase + 1; 174 | static final public int DoConstruct_concurrent = DoConstructBase + 0; 175 | static final public int DoConstruct_variable = DoConstructBase + 1; 176 | static final public int DoConstruct_while = DoConstructBase + 2; 177 | static final public int TypeParamOrCompDef_typeParam = 178 | TypeParamOrCompDefBase + 0; 179 | static final public int TypeParamOrCompDef_compDef = 180 | TypeParamOrCompDefBase + 1; 181 | static final public int TypeAttrSpec_access_spec = TypeAttrSpecBase + 0; 182 | static final public int TypeAttrSpec_extends = TypeAttrSpecBase + 1; 183 | static final public int TypeAttrSpec_abstract = TypeAttrSpecBase + 2; 184 | static final public int TypeAttrSpec_bind = TypeAttrSpecBase + 3; 185 | static final public int ComponentAttrSpec_access_spec = 186 | ComponentAttrSpecBase + 0; 187 | static final public int ComponentAttrSpec_allocatable = 188 | ComponentAttrSpecBase + 1; 189 | static final public int ComponentAttrSpec_codimension = 190 | ComponentAttrSpecBase + 2; 191 | static final public int ComponentAttrSpec_contiguous = 192 | ComponentAttrSpecBase + 3; 193 | static final public int ComponentAttrSpec_dimension = 194 | ComponentAttrSpecBase + 4; 195 | static final public int ComponentAttrSpec_pointer = 196 | ComponentAttrSpecBase + 5; 197 | static final public int ComponentAttrSpec_kind = 198 | ComponentAttrSpecBase + 6; 199 | static final public int ComponentAttrSpec_len = 200 | ComponentAttrSpecBase + 7; 201 | static final public int ProcComponentAttrSpec_pointer = 202 | ProcComponentAttrSpecBase + 0; 203 | static final public int ProcComponentAttrSpec_pass = 204 | ProcComponentAttrSpecBase + 1; 205 | static final public int ProcComponentAttrSpec_nopass = 206 | ProcComponentAttrSpecBase + 2; 207 | static final public int ProcComponentAttrSpec_access_spec = 208 | ProcComponentAttrSpecBase + 3; 209 | static final public int GenericSpec_generic_name = 210 | GenericSpecBase + 0; 211 | static final public int GenericSpec_OPERATOR = 212 | GenericSpecBase + 1; 213 | static final public int GenericSpec_ASSIGNMENT = 214 | GenericSpecBase + 2; 215 | static final public int GenericSpec_dtio_generic_spec = 216 | GenericSpecBase + 3; 217 | static final public int DTIOGenericSpec_READ_FORMATTED = 218 | DTIOGenericSpecBase + 0; 219 | static final public int DTIOGenericSpec_READ_UNFORMATTED = 220 | DTIOGenericSpecBase + 1; 221 | static final public int DTIOGenericSpec_WRITE_FORMATTED = 222 | DTIOGenericSpecBase + 2; 223 | static final public int DTIOGenericSpec_WRITE_UNFORMATTED = 224 | DTIOGenericSpecBase + 3; 225 | } 226 | -------------------------------------------------------------------------------- /src/edu/ua/util/IFortranParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | import org.antlr.runtime.RecognitionException; 32 | 33 | public abstract interface IFortranParser { 34 | 35 | public void initialize(String[] args, String kind, String filename, String path); 36 | 37 | public void main_program() throws RecognitionException; 38 | 39 | public void module() throws RecognitionException; 40 | 41 | public void submodule() throws RecognitionException; 42 | 43 | public void block_data() throws RecognitionException; 44 | 45 | public void subroutine_subprogram() throws RecognitionException; 46 | 47 | public void ext_function_subprogram() throws RecognitionException; 48 | 49 | public IFortranParserAction getAction(); 50 | 51 | public boolean hasErrorOccurred(); 52 | 53 | public void reportError(RecognitionException re); 54 | 55 | public void checkForInclude(); 56 | 57 | public void eofAction(); 58 | } 59 | -------------------------------------------------------------------------------- /src/edu/ua/util/TypeConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | import java.io.IOException; 32 | import java.io.InputStream; 33 | import java.util.Properties; 34 | 35 | public class TypeConverter { 36 | 37 | public static final String TYPE_PROP_FILE = "typeconfig.properties"; 38 | private static Properties prop = null; 39 | 40 | public static String getHref(String t) { 41 | InputStream is = null; 42 | String ret = ""; 43 | try { 44 | is = TypeConverter.class.getResourceAsStream(TYPE_PROP_FILE); 45 | prop = new Properties(); 46 | prop.load(is); 47 | ret = prop.getProperty(t.toUpperCase()); 48 | } catch (IOException ex) { 49 | ex.printStackTrace(); 50 | } finally { 51 | try { 52 | is.close(); 53 | } catch (IOException ex) { 54 | } 55 | } 56 | return ret; 57 | } 58 | } -------------------------------------------------------------------------------- /src/edu/ua/util/UIDGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016, Aziz Nanthaamornphong and Anawat Leathongkum 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are 5 | permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of 8 | conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of 11 | conditions and the following disclaimer in the documentation and/or other materials 12 | provided with the distribution. 13 | 14 | 3. Neither the names of the copyright holders nor the names of its contributors may be 15 | used to endorse or promote products derived from this software without specific prior 16 | written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 22 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | package edu.ua.util; 30 | 31 | import java.util.Date; 32 | import java.util.Random; 33 | 34 | public class UIDGenerator { 35 | 36 | public static String hashCode(String a) { 37 | StringBuilder builder = new StringBuilder(); 38 | for (int i = 0; i < a.length(); i++) { 39 | char c = a.charAt(i); 40 | int n = (int) c; 41 | builder.append(n); 42 | } 43 | return builder.toString(); 44 | } 45 | 46 | public static int getRandom() { 47 | Random rand = new Random(); 48 | return rand.nextInt(); 49 | } 50 | 51 | public static String getLongTime(){ 52 | Date d = new Date(); 53 | return d.getTime()+"-"+ getRandom(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/edu/ua/util/typeconfig.properties: -------------------------------------------------------------------------------- 1 | CHARACTER = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000001 2 | INTEGER = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000002 3 | REAL = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000003 4 | REAL*8 = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000004 5 | COMPLEX = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000005 6 | LOGICAL = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000006 7 | PARAMETER = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000007 8 | POINTER = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000008 9 | TYPE = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000009 10 | DEFAULT = -84-17--56-5-43645a83:11466542d86:-8000:FORTRAN000000001 --------------------------------------------------------------------------------