├── .gitignore ├── LICENSE ├── README.adoc ├── build.bat ├── presentations └── welstead-openvsp3plugin.pdf └── src └── main └── java └── openvsp3plugin ├── DesignVariable.java ├── DesignVariableGroup.java ├── DesignVariableTableCell.java ├── JavaFXUI.fxml ├── JavaFXUI.java ├── Logger.java ├── ModelCenterPlugin.java ├── ModelCenterPluginInfo.java ├── ModelCenterWrapper.java ├── OpenMDAO.java ├── OpenVSP3File.java ├── OpenVSP3Plugin.java ├── PluginState.java ├── SwingDialog.java └── XPathUtil.java /.gitignore: -------------------------------------------------------------------------------- 1 | # Gradle. 2 | .gradle/ 3 | /build/ 4 | 5 | # IntelliJ. 6 | .idea/ 7 | *.iml 8 | *.ipr 9 | *.iws 10 | 11 | # Netbeans 12 | /nbproject/ 13 | /build/ 14 | /dist/ 15 | 16 | # Eclipse 17 | .settings/ 18 | .project 19 | .classpath 20 | 21 | # build.bat 22 | manifest2.mf 23 | 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = OpenVSP3Plugin 2 | A plugin to run OpenVSP in a MDAO frameworks. 3 | 4 | == What is OpenVSP? 5 | 6 | Open Vehicle Sketch Pad (OpenVSP) is a parametric aircraft geometry tool. 7 | OpenVSP allows the user to create a 3D model of an aircraft defined by common engineering parameters. 8 | This model can be processed into formats suitable for engineering analysis.footnoteref:[openvsporg, from www.openvsp.org/learn.shtml] 9 | 10 | The predecessors to OpenVSP have been developed by J.R. Gloudemans and others for NASA since the early 1990's. 11 | On January 10 2012, OpenVSP was released as an open source project under the NASA Open Source Agreement (NOSA) version 1.3.footnoteref:[openvsporg] 12 | 13 | == What is the OpenVPS3Plugin? 14 | 15 | The OpenVSP3Plugin is a JAVA software tool that allows for the interface between OpenVSP and an analysis framework such as *Phoenix Integration's ModelCenter* or the NASA developed *OpenMDAO* software. 16 | The OpenVSP3Plugin is designed to work on any computer desktop platform (Mac, Linux, and Windows) that has a local installation of JAVA. 17 | 18 | .[big]#The OpenVSP3Plugin performs three main functions:# 19 | 1. Parse an OpenVSP v. 3 file 20 | 2. Auto-generate an OpenVSP script and a design (.des) file 21 | 3. Execute OpenVSP with the auto-generated script and apply user selected design variables in the design file. (ModelCenter only) 22 | 23 | The user selects the design variables written in the design file through the interactive graphical user interface. 24 | 25 | == Build 26 | 27 | To build the OpenVSP3Plugin, edit the build.bat file and run it. 28 | Edit the build.bat file and set *JDK_HOME* to the path of your JAVA installation. 29 | If you have *ModelCenter* installed set *MC_INSTALL* to the path of your *ModelCenter* installation. 30 | 31 | 32 | [source,options-"nowrap"] 33 | ---- 34 | :: JDK_HOME is required and must point to an installed JDK 35 | set "JDK_HOME=C:/Program Files/Java/jdk1.8.0_151" 36 | 37 | :: MC_INSTALL is optional but required to use the plugin with ModelCenter 38 | :: Comment this line if you don't have ModelCenter 39 | ::set "MC_INSTALL=C:/Program Files/Phoenix Integration/ModelCenter 12.0" 40 | ---- 41 | 42 | == Prebuilt releases (OpenVSP3Plugin.jar) 43 | 44 | Prebuilt releases will be built using the latest source code and JAVA 8 JDK and ModelCenter 12 interfaces 45 | 46 | == Installation 47 | 48 | There is no custom installer for the OpenVSP3Plugin, it must be done by hand. + 49 | The OpenVSP3Plugin uses 2 environment variables: 50 | 51 | `*OpenVSP_EXE* (__Required__)`:: This needs to be set to the path of the OpenVSP executable (vsp.exe) that the plugin will use. 52 | `*TMP* (__ModelCenter only__)`:: (probably already set on your machine) Is used to create temporary folders in which OpenVSP is executed, and the output files are parsed. 53 | 54 | == OpenMDAO 55 | 56 | To use the OpenVSP3Plugin in an OpenMDAO environment simply execute the OpenVSP3Plugin.jar file. 57 | This can be accomplished by running the following command: + 58 | `java -jar OpenVSP3Plugin.jar` 59 | 60 | In this mode all temporary files are written to the current working directory. 61 | 62 | == ModelCenter 63 | 64 | See ModelCenter help on installing plugins and "registrationless plugins". 65 | 66 | OpenVSP3Plugin logging can be viewed in the ModelCenter JAVA Console. 67 | Open the "Preferences" dialog, `Tools->Preferences...`, select the `Java Plug-Ins` tab, 68 | and check the `Show Java Console` checkbox. 69 | 70 | == Documentation 71 | 72 | A presentation on how to use the OpenVSP3Plugin is located here: 73 | link:presentations/welstead-openvsp3plugin.pdf[OpenVSP Workshop 2017 OpenVSP3Plugin] 74 | 75 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | 3 | :: JDK_HOME is required and must point to an installed JDK 4 | set "JDK_HOME=C:/Program Files/Java/jdk1.8.0_151" 5 | 6 | :: MC_INSTALL is optional but required to use the plugin with ModelCenter 7 | :: Comment this line if you don't have ModelCenter 8 | ::set "MC_INSTALL=C:/Program Files/Phoenix Integration/ModelCenter 12.0" 9 | 10 | :: tool paths 11 | set JAVAC_EXE=%JDK_HOME%/bin/javac.exe 12 | set JAR_EXE=%JDK_HOME%/bin/jar.exe 13 | 14 | :: directories match Netbeans file structure but can be changed 15 | set CLASSDIR=build\classes 16 | set JARDIR=dist 17 | 18 | :: recreate temp directory for class files 19 | rmdir %CLASSDIR% /s /q 20 | md %CLASSDIR% 21 | 22 | :: ModelCenterPlugin.java and ModelCenterPluginInfo are only used if ModelCenter is installed 23 | if "%MC_INSTALL%"=="" goto buildOpenMDAOPlugin 24 | 25 | echo Compiling for ModelCenter/OpenMDAO jar 26 | "%JAVAC_EXE%" -Xlint -cp "%MC_INSTALL%/ModelCenter.jar;%MC_INSTALL%/log4j-1.2.15.jar" -d %CLASSDIR% src/main/java/openvsp3plugin/*.java 27 | goto buildJar 28 | 29 | :buildOpenMDAOPlugin 30 | 31 | echo Compiling for OpenMDAO only jar 32 | "%JAVAC_EXE%" -d %CLASSDIR% src/main/java/openvsp3plugin/DesignVariable.java src/main/java/openvsp3plugin/DesignVariableGroup.java src/main/java/openvsp3plugin/DesignVariableTableCell.java src/main/java/openvsp3plugin/JavaFXUI.java src/main/java/openvsp3plugin/Logger.java src/main/java/openvsp3plugin/OpenMDAO.java src/main/java/openvsp3plugin/OpenVSP3File.java src/main/java/openvsp3plugin/OpenVSP3Plugin.java src/main/java/openvsp3plugin/PluginState.java src/main/java/openvsp3plugin/SwingDialog.java src/main/java/openvsp3plugin/XPathUtil.java 33 | 34 | :buildJar 35 | 36 | echo Building jar 37 | :: Create manifest 38 | echo Manifest-Version: 1.0 > manifest2.mf 39 | echo Main-Class: openvsp3plugin.OpenMDAO >> manifest2.mf 40 | :: create directory for jar file 41 | md %JARDIR% 42 | :: create jar file 43 | "%JAR_EXE%" -cfm %JARDIR%/OpenVSP3Plugin.jar manifest2.mf -C %CLASSDIR% . -C src/main/java openvsp3plugin/JavaFXUI.fxml 44 | 45 | echo Done building OpenVSP3Plugin.jar 46 | %COMSPEC% /C exit /B %ERRORLEVEL% 47 | pause 48 | -------------------------------------------------------------------------------- /presentations/welstead-openvsp3plugin.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nasa/OpenVSP3Plugin/116249eda2abf8df5a739060064fe409580b473f/presentations/welstead-openvsp3plugin.pdf -------------------------------------------------------------------------------- /src/main/java/openvsp3plugin/DesignVariable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 United States Government as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * 5 | * All Rights Reserved. 6 | * 7 | * The OpenVSP3Plugin platform is licensed under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package openvsp3plugin; 19 | 20 | import javafx.beans.property.SimpleBooleanProperty; 21 | import javafx.beans.property.SimpleStringProperty; 22 | 23 | /** 24 | * This class represents a design variable and is used as the type of the TableView. 25 | * It has the OpenVSP container, group, variable name, 26 | * the 11 character OpenVSP ID (ID="UZNTPYGVPBJ"), and the value string. 27 | * The XPath, state, and checked properties are use by the plugin. 28 | */ 29 | public class DesignVariable { 30 | 31 | final private SimpleStringProperty container; 32 | final private SimpleStringProperty group; 33 | final private SimpleStringProperty name; 34 | final private SimpleStringProperty id; 35 | final private SimpleStringProperty value; 36 | final private SimpleStringProperty xpath; 37 | final private SimpleStringProperty state; 38 | final private SimpleStringProperty vspValue; 39 | final private SimpleBooleanProperty checked; 40 | final private String fullName; 41 | 42 | public DesignVariable(DesignVariable dv) { 43 | this.container = new SimpleStringProperty(dv.container.get()); 44 | this.group = new SimpleStringProperty(dv.group.get()); 45 | this.name = new SimpleStringProperty(dv.name.get()); 46 | this.id = new SimpleStringProperty(dv.id.get()); 47 | this.value = new SimpleStringProperty(dv.value.get()); 48 | this.xpath = new SimpleStringProperty(dv.xpath.get()); 49 | this.state = new SimpleStringProperty(dv.state.get()); 50 | this.vspValue = new SimpleStringProperty(dv.vspValue.get()); 51 | this.checked = new SimpleBooleanProperty(dv.checked.get()); 52 | this.fullName = dv.fullName; 53 | } 54 | 55 | public DesignVariable(String container, String group, String name, String id, String value) { 56 | this.container = new SimpleStringProperty(container); 57 | this.group = new SimpleStringProperty(group); 58 | this.name = new SimpleStringProperty(name); 59 | this.id = new SimpleStringProperty(id); 60 | this.value = new SimpleStringProperty(value); 61 | this.xpath = new SimpleStringProperty(""); 62 | this.state = new SimpleStringProperty("Input"); 63 | this.vspValue = new SimpleStringProperty(); 64 | this.checked = new SimpleBooleanProperty(false); 65 | this.fullName = container + ":" + group + ":" + name; 66 | } 67 | 68 | // The property getters allow automatic table updating. 69 | public SimpleStringProperty containerProperty() { 70 | return container; 71 | } 72 | 73 | public SimpleStringProperty groupProperty() { 74 | return group; 75 | } 76 | 77 | public SimpleStringProperty nameProperty() { 78 | return name; 79 | } 80 | 81 | public SimpleStringProperty idProperty() { 82 | return id; 83 | } 84 | 85 | public SimpleStringProperty valueProperty() { 86 | return value; 87 | } 88 | 89 | public SimpleStringProperty xpathProperty() { 90 | return xpath; 91 | } 92 | 93 | public SimpleStringProperty stateProperty() { 94 | return state; 95 | } 96 | 97 | public SimpleStringProperty vspValueProperty() { 98 | return vspValue; 99 | } 100 | 101 | public SimpleBooleanProperty checkedProperty() { 102 | return checked; 103 | } 104 | 105 | public String getContainer() { 106 | return container.get(); 107 | } 108 | 109 | public String getGroup() { 110 | return group.get(); 111 | } 112 | 113 | public String getName() { 114 | return name.get(); 115 | } 116 | 117 | public String getId() { 118 | return id.get(); 119 | } 120 | 121 | public String getValue() { 122 | return value.get(); 123 | } 124 | 125 | public String getVspValue() { 126 | return vspValue.get(); 127 | } 128 | 129 | public void setVspValue(String value) { 130 | vspValue.set(value); 131 | } 132 | 133 | public String getXPath() { 134 | return xpath.get(); 135 | } 136 | 137 | public void setXPath(String newXPath) { 138 | xpath.set(newXPath); 139 | } 140 | 141 | public boolean isChecked() { 142 | return checked.get(); 143 | } 144 | 145 | public boolean isOutput() { 146 | return !state.get().equals("Input"); 147 | } 148 | 149 | public String getState() { 150 | return state.get(); 151 | } 152 | 153 | public void setState(String state) { 154 | this.state.set(state); 155 | } 156 | 157 | public void toggleState() { 158 | switch (getState()) { 159 | case "Input": 160 | setState("MCOutput"); 161 | checked.set(true); 162 | break; 163 | case "MCOutput": 164 | setState("Input"); 165 | checked.set(true); 166 | break; 167 | } 168 | } 169 | 170 | public String getFullName() { 171 | return fullName; 172 | } 173 | 174 | public String getModelCenterName(boolean flatNames, boolean addID, boolean groupOutputs) { 175 | String mcname; 176 | String sep = "."; 177 | String pre = ""; 178 | if (groupOutputs) { 179 | if (isOutput()) pre = "Output" + sep; 180 | else pre = "Input" + sep; 181 | } 182 | if (flatNames) sep = "_"; 183 | if (getContainer().equals(getGroup())) { 184 | mcname = pre + getContainer() + sep + getName(); 185 | } else { 186 | mcname = pre + getContainer() + sep + getGroup() + sep + getName(); 187 | } 188 | if (addID) mcname += "_" + getId(); 189 | return mcname; 190 | } 191 | 192 | public String toDesString() { 193 | return String.format("%s:%s: %s", getId(), getFullName(), getValue()); 194 | } 195 | 196 | public String toDesString(String newValue) { 197 | return String.format("%s:%s: %s", getId(), getFullName(), newValue); 198 | } 199 | 200 | public String toXDDMString() { 201 | return String.format(" ", 202 | getFullName(), getValue(), getId()); 203 | } 204 | 205 | public String toStateString() { 206 | return String.format(" ", 207 | getFullName(), getValue(), getId(), getState(), getXPath()); 208 | } 209 | 210 | public String toFullString() { 211 | return getName() + " " + getValue() + " " + isChecked(); 212 | } 213 | 214 | @Override 215 | public String toString() { 216 | return getName() + " " + getValue(); 217 | } 218 | } 219 | -------------------------------------------------------------------------------- /src/main/java/openvsp3plugin/DesignVariableGroup.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 United States Government as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * 5 | * All Rights Reserved. 6 | * 7 | * The OpenVSP3Plugin platform is licensed under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package openvsp3plugin; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | /** 24 | * This class is a container for DesignVariables and is used as the type of the TreeView. 25 | * 26 | */ 27 | public class DesignVariableGroup { 28 | 29 | final private String name; 30 | final private List designVariables = new ArrayList(); 31 | 32 | public DesignVariableGroup(String name) { 33 | this.name = name; 34 | } 35 | 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public List getDesignVariables() { 42 | return designVariables; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return name; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/openvsp3plugin/DesignVariableTableCell.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2017 United States Government as represented by the 3 | * Administrator of the National Aeronautics and Space Administration. 4 | * 5 | * All Rights Reserved. 6 | * 7 | * The OpenVSP3Plugin platform is licensed under the Apache License, Version 2.0 8 | * (the "License"); you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | * License for the specific language governing permissions and limitations 15 | * under the License. 16 | */ 17 | 18 | package openvsp3plugin; 19 | 20 | import javafx.scene.control.TableCell; 21 | import javafx.scene.control.TableRow; 22 | import javafx.scene.control.TableView; 23 | import javafx.scene.paint.Color; 24 | 25 | /** 26 | * Special TableCell to implement the Input/Output coloring in the table 27 | */ 28 | public class DesignVariableTableCell extends TableCell { 29 | 30 | @Override 31 | @SuppressWarnings("unchecked") 32 | protected void updateItem(String item, boolean empty) { 33 | super.updateItem(item, empty); 34 | if (!empty) { 35 | TableView tv = getTableView(); 36 | TableRow tr = getTableRow(); 37 | if ((tv != null) && (tr != null)) { 38 | if (tv.getItems().get(getTableRow().getIndex()).isOutput()) { 39 | setTextFill(Color.BLUE); 40 | } else if (tv.getItems().get(getTableRow().getIndex()).getValue().equals("INVALID")) { 41 | setTextFill(Color.ORANGE); 42 | } else { 43 | setTextFill(Color.GREEN); 44 | } 45 | } else { 46 | setTextFill(Color.YELLOW); 47 | } 48 | setText(item); 49 | } else { 50 | setText(""); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/openvsp3plugin/JavaFXUI.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | 48 | 56 | 57 | 58 | 59 | 60 | 61 |