Merge branch 'master' of github.com:openrocket/openrocket

This commit is contained in:
Wes Cravens 2016-03-25 19:10:36 -05:00
commit 95a0b41d23
34 changed files with 1519 additions and 459 deletions

47
.gitignore vendored
View File

@ -40,3 +40,50 @@
/swing/build /swing/build
/swing/tmp /swing/tmp
# IntelliJ
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

1
.idea/.name generated Normal file
View File

@ -0,0 +1 @@
openrocket

22
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

3
.idea/copyright/profiles_settings.xml generated Normal file
View File

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

4
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>

266
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
<component name="CopyrightManager" default="" />
<component name="DaemonCodeAnalyzer">
<disable_hints />
</component>
<component name="DependencyValidationManager">
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</component>
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Class structure</id>
</State>
<State>
<id>Code maturity issues</id>
</State>
<State>
<id>Java language level migration aids</id>
</State>
<State>
<id>Javadoc issues</id>
</State>
<State>
<id>Performance issues</id>
</State>
<State>
<id>Portability issues</id>
</State>
<State>
<id>Probable bugs</id>
</State>
<State>
<id>Resource management issues</id>
</State>
<State>
<id>TestNG</id>
</State>
<State>
<id>Threading issues</id>
</State>
</expanded-state>
<selected-state>
<State>
<id>Abstraction issues</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectModuleManager">
<modules />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PropertiesComponent">
<property name="GoToClass.includeLibraries" value="false" />
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
<property name="GoToFile.includeJavaFiles" value="false" />
<property name="MemberChooser.sorted" value="false" />
<property name="MemberChooser.showClasses" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" />
<property name="options.lastSelected" value="Template Data Languages" />
<property name="options.splitter.main.proportions" value="0.3" />
<property name="options.splitter.details.proportions" value="0.2" />
<property name="options.searchVisible" value="true" />
<property name="project.structure.last.edited" value="SDKs" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.0" />
</component>
<component name="RunManager">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
<option name="HTML_FILE_NAME" />
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<option name="VM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="moduleWithDependencies" />
</option>
<envs />
<patterns />
<method />
</configuration>
<list size="0" />
<configuration name="&lt;template&gt;" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<option name="myTodoPanelSettings">
<TodoPanelSettings />
</option>
</component>
<component name="masterDetails">
<states>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

10
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/core/OpenRocket Core.iml" filepath="$PROJECT_DIR$/core/OpenRocket Core.iml" />
<module fileurl="file://$PROJECT_DIR$/swing/OpenRocket Swing.iml" filepath="$PROJECT_DIR$/swing/OpenRocket Swing.iml" />
<module fileurl="file://$PROJECT_DIR$/lib-test/OpenRocket Test Libraries.iml" filepath="$PROJECT_DIR$/lib-test/OpenRocket Test Libraries.iml" />
</modules>
</component>
</project>

5
.idea/scopes/scope_settings.xml generated Normal file
View File

@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

190
core/OpenRocket Core.iml Normal file
View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/lib-extra/RXTXcomm.jar!/" />
<libelement value="file://$MODULE_DIR$/resources" />
<libelement value="jar://$MODULE_DIR$/lib/opencsv-2.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/guice-3.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/guice-multibindings-3.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/javax.inject.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/aopalliance.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/slf4j-api-1.7.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/annotation-detector-3.0.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/../lib-test/hamcrest-core-1.3.0RC1.jar!/" />
<libelement value="jar://$MODULE_DIR$/../lib-test/hamcrest-library-1.3.0RC1.jar!/" />
<libelement value="jar://$MODULE_DIR$/../lib-test/jmock-2.6.0-RC2.jar!/" />
<libelement value="jar://$MODULE_DIR$/../lib-test/jmock-junit4-2.6.0-RC2.jar!/" />
<libelement value="jar://$MODULE_DIR$/../lib-test/junit-dep-4.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/../lib-test/test-plugin.jar!/" />
<libelement value="jar://$MODULE_DIR$/../lib-test/uispec4j-2.3-jdk16.jar!/" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
<src_folder value="file://$MODULE_DIR$/src-extra" expected_position="1" />
<src_folder value="file://$MODULE_DIR$/test" expected_position="2" />
</src_description>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src-extra" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library">
<library name="RXTXcomm.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib-extra/RXTXcomm.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="resources">
<CLASSES>
<root url="file://$MODULE_DIR$/resources" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="opencsv-2.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/opencsv-2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="guice-3.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/guice-3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="guice-multibindings-3.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/guice-multibindings-3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="javax.inject.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/javax.inject.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="aopalliance.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/aopalliance.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="slf4j-api-1.7.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/slf4j-api-1.7.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="annotation-detector-3.0.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/annotation-detector-3.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-core-1.3.0RC1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib-test/hamcrest-core-1.3.0RC1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-library-1.3.0RC1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib-test/hamcrest-library-1.3.0RC1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jmock-2.6.0-RC2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib-test/jmock-2.6.0-RC2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jmock-junit4-2.6.0-RC2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib-test/jmock-junit4-2.6.0-RC2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="junit-dep-4.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib-test/junit-dep-4.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="test-plugin.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib-test/test-plugin.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="uispec4j-2.3-jdk16.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib-test/uispec4j-2.3-jdk16.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/logback-classic-1.0.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View File

@ -258,6 +258,7 @@ pref.dlg.tab.Design = Design
pref.dlg.tab.Simulation = Simulation pref.dlg.tab.Simulation = Simulation
pref.dlg.tab.Launch = Launch pref.dlg.tab.Launch = Launch
pref.dlg.tab.Miscellaneousoptions = Miscellaneous options pref.dlg.tab.Miscellaneousoptions = Miscellaneous options
pref.dlg.lbl.RockSimWarning = Show warning when saving in RockSim format
pref.dlg.tab.Graphics = Graphics pref.dlg.tab.Graphics = Graphics
pref.dlg.lbl.DecalEditor = Graphics Editor pref.dlg.lbl.DecalEditor = Graphics Editor
@ -1134,6 +1135,13 @@ FinsetCfg.ttip.Finfillets1 = <HTML>Adds the predicted mass of fin fillets to the
FinsetCfg.ttip.Finfillets2 = Assumes the fillet is concave and tangent to the body tube and fin.<br> FinsetCfg.ttip.Finfillets2 = Assumes the fillet is concave and tangent to the body tube and fin.<br>
FinsetCfg.ttip.Finfillets3 = Zero radius will give no fillet. FinsetCfg.ttip.Finfillets3 = Zero radius will give no fillet.
! Save RKT Warning Dialog
SaveRktWarningDialog.txt1=Exporting to RockSim file format does not support all features of OpenRocket.
SaveRktWarningDialog.donotshow=Do not show this dialog again
saveAs.openrocket.title=Save as OpenRocket ork file
saveAs.rocksim.title=Export as RockSim rkt file
! StorageOptionChooser ! StorageOptionChooser
StorageOptChooser.lbl.Simdatatostore = Simulated data to store: StorageOptChooser.lbl.Simdatatostore = Simulated data to store:
StorageOptChooser.rdbut.Allsimdata = All simulated data StorageOptChooser.rdbut.Allsimdata = All simulated data
@ -1201,26 +1209,30 @@ main.menu.file.desc = File-handling related tasks
main.menu.file.new = New main.menu.file.new = New
main.menu.file.new.desc = Create a new rocket design main.menu.file.new.desc = Create a new rocket design
main.menu.file.open = Open... main.menu.file.open = Open...
BasicFrame.item.Openrocketdesign = Open a rocket design main.menu.file.open.desc = Open a rocket design
main.menu.file.openRecent = Open Recent... main.menu.file.openRecent = Open Recent...
BasicFrame.item.Openrecentrocketdesign = Open a recent rocket design main.menu.file.openRecent.desc = Open a recent rocket design
main.menu.file.openExample = Open example... main.menu.file.openExample = Open Example...
BasicFrame.item.Openexamplerocketdesign = Open an example rocket design main.menu.file.openExample.desc = Open an example rocket design
main.menu.file.save = Save main.menu.file.save = Save
BasicFrame.item.SavecurRocketdesign = Save the current rocket design main.menu.file.save.desc = Save the current rocket design
main.menu.file.saveAs = Save as... main.menu.file.saveAs = Save as...
BasicFrame.item.SavecurRocketdesnewfile = Save the current rocket design to a new file main.menu.file.saveAs.desc = Save the current rocket design to a new file
main.menu.file.import = Import...
main.menu.file.import.desc = Import model from RockSim rkt file
main.menu.file.export = Export...
main.menu.file.export.desc = Export model to RockSim rkt file
main.menu.file.print = Print / Export PDF... main.menu.file.print = Print / Export PDF...
main.menu.file.print.desc = Print or save as PDF the parts list and fin templates main.menu.file.print.desc = Print or save as PDF the parts list and fin templates
main.menu.file.close = Close main.menu.file.close = Close
BasicFrame.item.Closedesign = Close the current rocket design main.menu.file.close.desc = Close the current rocket design
main.menu.file.quit = Quit main.menu.file.quit = Quit
BasicFrame.item.Quitprogram = Quit the program main.menu.file.quit.desc = Quit the program
main.menu.file.exportDecal = Export Decal main.menu.file.exportDecal = Export Decal
main.menu.file.exportDecal.desc = Export a decal from the current rocket design to a file for editing. main.menu.file.exportDecal.desc = Export a decal from the current rocket design to a file for editing.
main.menu.edit = Edit main.menu.edit = Edit
BasicFrame.menu.Rocketedt = Rocket editing main.menu.edit.desc = Rocket editing
main.menu.edit.undo = Undo main.menu.edit.undo = Undo
main.menu.edit.undo.desc = Undo the previous operation main.menu.edit.undo.desc = Undo the previous operation
main.menu.edit.redo = Redo main.menu.edit.redo = Redo
@ -1518,8 +1530,8 @@ TCurveMotor.ttip.emptyMass = Empty mass:
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = Length RocketInfo.lengthLine.Length = Length
RocketInfo.lengthLine.maxdiameter = , max. diameter RocketInfo.lengthLine.maxdiameter = , max. diameter
RocketInfo.massText1 = Mass with motors RocketInfo.massWithMotors = Mass with motors
RocketInfo.massText2 = Mass with no motors RocketInfo.massWithoutMotors = Mass with no motors
RocketInfo.at = at M= RocketInfo.at = at M=
RocketInfo.cgText = CG: RocketInfo.cgText = CG:
RocketInfo.cpText = CP: RocketInfo.cpText = CP:

View File

@ -1222,8 +1222,8 @@ TCurveMotorCol.LENGTH = D
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = Délka RocketInfo.lengthLine.Length = Délka
RocketInfo.lengthLine.maxdiameter = , max. prumer RocketInfo.lengthLine.maxdiameter = , max. prumer
RocketInfo.massText1 = Hmotnost s motory RocketInfo.massWithMotors = Hmotnost s motory
RocketInfo.massText2 = Hmotnost bez motoru RocketInfo.massWithoutMotors = Hmotnost bez motoru
RocketInfo.at = v M= RocketInfo.at = v M=
RocketInfo.cgText = Te\u017Eí\u0161te: RocketInfo.cgText = Te\u017Eí\u0161te:
RocketInfo.cpText = Centrum tlaku: RocketInfo.cpText = Centrum tlaku:

View File

@ -1281,8 +1281,8 @@ TCurveMotorCol.LENGTH = L
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = Länge RocketInfo.lengthLine.Length = Länge
RocketInfo.lengthLine.maxdiameter = , max. Durchmesser RocketInfo.lengthLine.maxdiameter = , max. Durchmesser
RocketInfo.massText1 = Masse mit Motoren RocketInfo.massWithMotors = Masse mit Motoren
RocketInfo.massText2 = Masse ohne Motoren RocketInfo.massWithoutMotors = Masse ohne Motoren
RocketInfo.at = bei M= RocketInfo.at = bei M=
RocketInfo.cgText = CG: RocketInfo.cgText = CG:
RocketInfo.cpText = CP: RocketInfo.cpText = CP:

View File

@ -887,8 +887,8 @@ RocketInfo.cpText = CP:
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = Longitud: RocketInfo.lengthLine.Length = Longitud:
RocketInfo.lengthLine.maxdiameter = , Di\u00e1metro m\u00e1ximo: RocketInfo.lengthLine.maxdiameter = , Di\u00e1metro m\u00e1ximo:
RocketInfo.massText1 = Masa con motores: RocketInfo.massWithMotors = Masa con motores:
RocketInfo.massText2 = Masa sin motores: RocketInfo.massWithoutMotors = Masa sin motores:
RocketInfo.stabText = Estabilidad: RocketInfo.stabText = Estabilidad:
RocketInfo.velocityValue = N/A RocketInfo.velocityValue = N/A

View File

@ -878,8 +878,8 @@ RocketInfo.cpText = CP:
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = Longueur RocketInfo.lengthLine.Length = Longueur
RocketInfo.lengthLine.maxdiameter = , diam\u00E8tre max. RocketInfo.lengthLine.maxdiameter = , diam\u00E8tre max.
RocketInfo.massText1 = Masse avec moteurs RocketInfo.massWithMotors = Masse avec moteurs
RocketInfo.massText2 = Masse sans moteurs RocketInfo.massWithoutMotors = Masse sans moteurs
RocketInfo.stabText = Stabilit\u00E9: RocketInfo.stabText = Stabilit\u00E9:
RocketInfo.velocityValue = N/A RocketInfo.velocityValue = N/A

View File

@ -1285,8 +1285,8 @@ TCurveMotorCol.LENGTH = Lunghezza
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = Lunghezza RocketInfo.lengthLine.Length = Lunghezza
RocketInfo.lengthLine.maxdiameter = , max. diametro RocketInfo.lengthLine.maxdiameter = , max. diametro
RocketInfo.massText1 = Massa CON motori RocketInfo.massWithMotors = Massa CON motori
RocketInfo.massText2 = Massa SENZA motori RocketInfo.massWithoutMotors = Massa SENZA motori
RocketInfo.at = a M= RocketInfo.at = a M=
RocketInfo.cgText = CG: RocketInfo.cgText = CG:
RocketInfo.cpText = CP: RocketInfo.cpText = CP:

View File

@ -1343,8 +1343,8 @@ TCurveMotor.ttip.emptyMass = \u7A7A\u865A\u8CEA\u91CF\uFF1A
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = \u9577\u3055 RocketInfo.lengthLine.Length = \u9577\u3055
RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84 RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84
RocketInfo.massText1 = \u30E2\u30FC\u30BF\u30FC\u8FBC\u307F\u91CD\u91CF RocketInfo.massWithMotors = \u30E2\u30FC\u30BF\u30FC\u8FBC\u307F\u91CD\u91CF
RocketInfo.massText2 = \u30E2\u30FC\u30BF\u30FC\u7121\u3057\u91CD\u91CF RocketInfo.massWithoutMotors = \u30E2\u30FC\u30BF\u30FC\u7121\u3057\u91CD\u91CF
RocketInfo.at = at M= RocketInfo.at = at M=
RocketInfo.cgText = CG: RocketInfo.cgText = CG:
RocketInfo.cpText = CP: RocketInfo.cpText = CP:

View File

@ -1226,8 +1226,8 @@
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = D\u0142ugo\u015B\u0107 RocketInfo.lengthLine.Length = D\u0142ugo\u015B\u0107
RocketInfo.lengthLine.maxdiameter = , maks. \u015Brednica RocketInfo.lengthLine.maxdiameter = , maks. \u015Brednica
RocketInfo.massText1 = Masa z silnikami RocketInfo.massWithMotors = Masa z silnikami
RocketInfo.massText2 = Masa bez silników RocketInfo.massWithoutMotors = Masa bez silników
RocketInfo.at = przy M RocketInfo.at = przy M
RocketInfo.cgText = \u015AC: RocketInfo.cgText = \u015AC:
RocketInfo.cpText = \u015AP: RocketInfo.cpText = \u015AP:

View File

@ -862,8 +862,8 @@ RocketInfo.cpText = CP:
# RocketInfo # RocketInfo
RocketInfo.lengthLine.Length = Tamanho RocketInfo.lengthLine.Length = Tamanho
RocketInfo.lengthLine.maxdiameter = , di\u00e2metro m\u00e1x. RocketInfo.lengthLine.maxdiameter = , di\u00e2metro m\u00e1x.
RocketInfo.massText1 = Massa com motores RocketInfo.massWithMotors = Massa com motores
RocketInfo.massText2 = Massa sem motores RocketInfo.massWithoutMotors = Massa sem motores
RocketInfo.stabText = Estabilidade: RocketInfo.stabText = Estabilidade:
RocketInfo.velocityValue = N/D RocketInfo.velocityValue = N/D

View File

@ -1435,8 +1435,8 @@ TCurveMotor.ttip.emptyMass = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = \u0414\u043b\u0438\u043d\u0430 RocketInfo.lengthLine.Length = \u0414\u043b\u0438\u043d\u0430
RocketInfo.lengthLine.maxdiameter = , \u043c\u0430\u043a\u0441. \u0434\u0438\u0430\u043c\u0435\u0442\u0440 RocketInfo.lengthLine.maxdiameter = , \u043c\u0430\u043a\u0441. \u0434\u0438\u0430\u043c\u0435\u0442\u0440
RocketInfo.massText1 = \u041c\u0430\u0441\u0441\u0430 \u0441 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438 RocketInfo.massWithMotors = \u041c\u0430\u0441\u0441\u0430 \u0441 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438
RocketInfo.massText2 = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 RocketInfo.massWithoutMotors = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439
RocketInfo.at = \u041f\u0440\u0438 M RocketInfo.at = \u041f\u0440\u0438 M
RocketInfo.cgText = \u0426\u0422: RocketInfo.cgText = \u0426\u0422:
RocketInfo.cpText = \u0426\u0414: RocketInfo.cpText = \u0426\u0414:

View File

@ -1440,8 +1440,8 @@ TCurveMotor.ttip.emptyMass = Empty mass:
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = Length RocketInfo.lengthLine.Length = Length
RocketInfo.lengthLine.maxdiameter = , max. diameter RocketInfo.lengthLine.maxdiameter = , max. diameter
RocketInfo.massText1 = Mass with motors RocketInfo.massWithMotors = Mass with motors
RocketInfo.massText2 = Mass with no motors RocketInfo.massWithoutMotors = Mass with no motors
RocketInfo.at = at M= RocketInfo.at = at M=
RocketInfo.cgText = CG: RocketInfo.cgText = CG:
RocketInfo.cpText = CP: RocketInfo.cpText = CP:

View File

@ -952,8 +952,8 @@ RocketInfo.cpText = CP(\u538B\u5FC3):
! RocketInfo ! RocketInfo
RocketInfo.lengthLine.Length = \u957F\u5EA6 RocketInfo.lengthLine.Length = \u957F\u5EA6
RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84 RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84
RocketInfo.massText1 = \u542B\u53D1\u52A8\u673A\u7684\u603B\u8D28\u91CF RocketInfo.massWithMotors = \u542B\u53D1\u52A8\u673A\u7684\u603B\u8D28\u91CF
RocketInfo.massText2 = \u4E0D\u542B\u53D1\u52A8\u673A\u7684\u51C0\u8D28\u91CF RocketInfo.massWithoutMotors = \u4E0D\u542B\u53D1\u52A8\u673A\u7684\u51C0\u8D28\u91CF
RocketInfo.stabText = \u7A33\u5B9A\u6027: RocketInfo.stabText = \u7A33\u5B9A\u6027:
RocketInfo.velocityValue = N/A RocketInfo.velocityValue = N/A

View File

@ -4,9 +4,15 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.List; import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import net.sf.openrocket.document.OpenRocketDocument; import net.sf.openrocket.document.OpenRocketDocument;
import net.sf.openrocket.document.Simulation; import net.sf.openrocket.document.Simulation;
import net.sf.openrocket.document.StorageOptions; import net.sf.openrocket.document.StorageOptions;
import net.sf.openrocket.document.StorageOptions.FileType;
import net.sf.openrocket.file.AbstractRocketLoader; import net.sf.openrocket.file.AbstractRocketLoader;
import net.sf.openrocket.file.DocumentLoadingContext; import net.sf.openrocket.file.DocumentLoadingContext;
import net.sf.openrocket.file.RocketLoadException; import net.sf.openrocket.file.RocketLoadException;
@ -15,11 +21,6 @@ import net.sf.openrocket.simulation.FlightDataBranch;
import net.sf.openrocket.simulation.FlightDataType; import net.sf.openrocket.simulation.FlightDataType;
import net.sf.openrocket.simulation.extension.SimulationExtension; import net.sf.openrocket.simulation.extension.SimulationExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/** /**
* Class that loads a rocket definition from an OpenRocket rocket file. * Class that loads a rocket definition from an OpenRocket rocket file.
@ -81,6 +82,7 @@ public class OpenRocketLoader extends AbstractRocketLoader {
timeSkip = Math.rint(timeSkip * 100) / 100; timeSkip = Math.rint(timeSkip * 100) / 100;
doc.getDefaultStorageOptions().setSimulationTimeSkip(timeSkip); doc.getDefaultStorageOptions().setSimulationTimeSkip(timeSkip);
doc.getDefaultStorageOptions().setExplicitlySet(false); doc.getDefaultStorageOptions().setExplicitlySet(false);
doc.getDefaultStorageOptions().setFileType(FileType.OPENROCKET);
// Call simulation extensions // Call simulation extensions
for (Simulation sim : doc.getSimulations()) { for (Simulation sim : doc.getSimulations()) {

View File

@ -6,14 +6,15 @@ package net.sf.openrocket.file.rocksim.importt;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import net.sf.openrocket.document.StorageOptions.FileType;
import net.sf.openrocket.file.AbstractRocketLoader; import net.sf.openrocket.file.AbstractRocketLoader;
import net.sf.openrocket.file.DocumentLoadingContext; import net.sf.openrocket.file.DocumentLoadingContext;
import net.sf.openrocket.file.RocketLoadException; import net.sf.openrocket.file.RocketLoadException;
import net.sf.openrocket.file.simplesax.SimpleSAX; import net.sf.openrocket.file.simplesax.SimpleSAX;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/** /**
* This class is the main entry point for Rocksim design file imported to OpenRocket. Currently only Rocksim v9 * This class is the main entry point for Rocksim design file imported to OpenRocket. Currently only Rocksim v9
* file formats are supported, although it is possible that v8 formats will work for most components. * file formats are supported, although it is possible that v8 formats will work for most components.
@ -52,5 +53,6 @@ public class RocksimLoader extends AbstractRocketLoader {
context.getOpenRocketDocument().setFile(null); context.getOpenRocketDocument().setFile(null);
context.getOpenRocketDocument().clearUndo(); context.getOpenRocketDocument().clearUndo();
context.getOpenRocketDocument().getDefaultStorageOptions().setFileType(FileType.ROCKSIM);
} }
} }

View File

@ -61,6 +61,7 @@ public abstract class Preferences implements ChangeSource {
// Node names // Node names
public static final String PREFERRED_THRUST_CURVE_MOTOR_NODE = "preferredThrustCurveMotors"; public static final String PREFERRED_THRUST_CURVE_MOTOR_NODE = "preferredThrustCurveMotors";
private static final String AUTO_OPEN_LAST_DESIGN = "AUTO_OPEN_LAST_DESIGN"; private static final String AUTO_OPEN_LAST_DESIGN = "AUTO_OPEN_LAST_DESIGN";
private static final String SHOW_ROCKSIM_FORMAT_WARNING = "SHOW_ROCKSIM_FORMAT_WARNING";
//Preferences related to 3D graphics //Preferences related to 3D graphics
public static final String OPENGL_ENABLED = "OpenGL_Is_Enabled"; public static final String OPENGL_ENABLED = "OpenGL_Is_Enabled";
@ -162,6 +163,14 @@ public abstract class Preferences implements ChangeSource {
this.putBoolean(LAUNCH_INTO_WIND, check); this.putBoolean(LAUNCH_INTO_WIND, check);
} }
public final boolean getShowRockSimFormatWarning() {
return this.getBoolean(SHOW_ROCKSIM_FORMAT_WARNING, true);
}
public final void setShowRockSimFormatWarning(boolean check) {
this.putBoolean(SHOW_ROCKSIM_FORMAT_WARNING, check);
}
public final double getDefaultMach() { public final double getDefaultMach() {
return Application.getPreferences().getChoice(Preferences.DEFAULT_MACH_NUMBER, 0.9, 0.3); return Application.getPreferences().getChoice(Preferences.DEFAULT_MACH_NUMBER, 0.9, 0.3);
} }
@ -736,12 +745,14 @@ public abstract class Preferences implements ChangeSource {
*/ */
private static final HashMap<Class<?>, String> DEFAULT_LINE_STYLES = new HashMap<Class<?>, String>(); private static final HashMap<Class<?>, String> DEFAULT_LINE_STYLES = new HashMap<Class<?>, String>();
static { static {
DEFAULT_LINE_STYLES.put(RocketComponent.class, LineStyle.SOLID.name()); DEFAULT_LINE_STYLES.put(RocketComponent.class, LineStyle.SOLID.name());
DEFAULT_LINE_STYLES.put(MassObject.class, LineStyle.DASHED.name()); DEFAULT_LINE_STYLES.put(MassObject.class, LineStyle.DASHED.name());
} }
private static final HashMap<Class<?>, String> DEFAULT_COLORS = new HashMap<Class<?>, String>(); private static final HashMap<Class<?>, String> DEFAULT_COLORS = new HashMap<Class<?>, String>();
static { static {
DEFAULT_COLORS.put(BodyComponent.class, "0,0,240"); DEFAULT_COLORS.put(BodyComponent.class, "0,0,240");
DEFAULT_COLORS.put(TubeFinSet.class, "0,0,200"); DEFAULT_COLORS.put(TubeFinSet.class, "0,0,200");

View File

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/hamcrest-core-1.3.0RC1.jar!/" />
<libelement value="jar://$MODULE_DIR$/hamcrest-library-1.3.0RC1.jar!/" />
<libelement value="jar://$MODULE_DIR$/jmock-2.6.0-RC2.jar!/" />
<libelement value="jar://$MODULE_DIR$/jmock-junit4-2.6.0-RC2.jar!/" />
<libelement value="jar://$MODULE_DIR$/junit-dep-4.8.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/test-plugin.jar!/" />
<libelement value="jar://$MODULE_DIR$/uispec4j-2.3-jdk16.jar!/" />
<src_description expected_position="0" />
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="hamcrest-core-1.3.0RC1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/hamcrest-core-1.3.0RC1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="hamcrest-library-1.3.0RC1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/hamcrest-library-1.3.0RC1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jmock-2.6.0-RC2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/jmock-2.6.0-RC2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jmock-junit4-2.6.0-RC2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/jmock-junit4-2.6.0-RC2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="junit-dep-4.8.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/junit-dep-4.8.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="test-plugin.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/test-plugin.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="uispec4j-2.3-jdk16.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/uispec4j-2.3-jdk16.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="inheritedJdk" />
</component>
</module>

210
swing/OpenRocket Swing.iml Normal file
View File

@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/lib/jogl/jogl-all.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/iText-5.0.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jcommon-1.0.18.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jfreechart-1.0.15.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/OrangeExtensions-1.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jogl/gluegen-rt.jar!/" />
<libelement value="jar://$MODULE_DIR$/../core/lib/slf4j-api-1.7.5.jar!/" />
<libelement value="jar://$MODULE_DIR$/../core/lib/aopalliance.jar!/" />
<libelement value="jar://$MODULE_DIR$/../core/lib/guice-3.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/../core/lib/guice-multibindings-3.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/../core/lib/javax.inject.jar!/" />
<libelement value="jar://$MODULE_DIR$/../core/lib/opencsv-2.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/logback-classic-1.0.12.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/logback-core-1.0.12.jar!/" />
<libelement value="file://$MODULE_DIR$/../core/resources" />
<libelement value="file://$MODULE_DIR$/resources" />
<libelement value="jar://$MODULE_DIR$/../core/lib/annotation-detector-3.0.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/miglayout-4.0-swing.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/rsyntaxtextarea-2.5.6.jar!/" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="module-library">
<library name="jogl-all.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jogl/jogl-all.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="iText-5.0.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/iText-5.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jcommon-1.0.18.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jcommon-1.0.18.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="jfreechart-1.0.15.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jfreechart-1.0.15.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="OrangeExtensions-1.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/OrangeExtensions-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="gluegen-rt.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jogl/gluegen-rt.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="OpenRocket Core" />
<orderEntry type="module-library">
<library name="slf4j-api-1.7.5.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../core/lib/slf4j-api-1.7.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="aopalliance.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../core/lib/aopalliance.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="guice-3.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../core/lib/guice-3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="guice-multibindings-3.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../core/lib/guice-multibindings-3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="javax.inject.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../core/lib/javax.inject.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="opencsv-2.3.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../core/lib/opencsv-2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="logback-classic-1.0.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/logback-classic-1.0.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="logback-core-1.0.12.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/logback-core-1.0.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="resources">
<CLASSES>
<root url="file://$MODULE_DIR$/../core/resources" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="resources">
<CLASSES>
<root url="file://$MODULE_DIR$/resources" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="annotation-detector-3.0.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/../core/lib/annotation-detector-3.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="miglayout-4.0-swing.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/miglayout-4.0-swing.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/reference/miglayout-4.0-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="rsyntaxtextarea-2.5.6.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/rsyntaxtextarea-2.5.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

View File

@ -208,6 +208,30 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
} }
}); });
this.add(button, "right, wrap"); this.add(button, "right, wrap");
//// Open most recent file on startup
final JCheckBox openRecentOnStartupBox = new JCheckBox(trans.get("pref.dlg.but.openlast"));
openRecentOnStartupBox.setSelected(preferences.isAutoOpenLastDesignOnStartupEnabled());
openRecentOnStartupBox.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
preferences.setAutoOpenLastDesignOnStartup(openRecentOnStartupBox.isSelected());
}
});
this.add(openRecentOnStartupBox,"spanx, wrap");
//// Save RockSim Format warning dialog
final JCheckBox rocksimWarningDialogBox = new JCheckBox(trans.get("pref.dlg.lbl.RockSimWarning"));
rocksimWarningDialogBox.setSelected(preferences.getShowRockSimFormatWarning());
rocksimWarningDialogBox.addActionListener( new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
preferences.setShowRockSimFormatWarning(rocksimWarningDialogBox.isSelected());
}
});
this.add(rocksimWarningDialogBox,"spanx, wrap");
} }

View File

@ -47,6 +47,7 @@ public class RocketInfo implements FigureElement {
private double cg = 0, cp = 0; private double cg = 0, cp = 0;
private double length = 0, diameter = 0; private double length = 0, diameter = 0;
private double mass = 0; private double mass = 0;
private double massWithoutMotors = 0;
private double aoa = Double.NaN, theta = Double.NaN, mach = Application.getPreferences().getDefaultMach(); private double aoa = Double.NaN, theta = Double.NaN, mach = Application.getPreferences().getDefaultMach();
private WarningSet warnings = null; private WarningSet warnings = null;
@ -113,6 +114,10 @@ public class RocketInfo implements FigureElement {
this.mass = mass; this.mass = mass;
} }
public void setMassWithoutMotors(double mass) {
this.massWithoutMotors = mass;
}
public void setWarnings(WarningSet warnings) { public void setWarnings(WarningSet warnings) {
this.warnings = warnings.clone(); this.warnings = warnings.clone();
} }
@ -150,24 +155,28 @@ public class RocketInfo implements FigureElement {
trans.get("RocketInfo.lengthLine.maxdiameter") +" " + trans.get("RocketInfo.lengthLine.maxdiameter") +" " +
UnitGroup.UNITS_LENGTH.getDefaultUnit().toStringUnit(diameter)); UnitGroup.UNITS_LENGTH.getDefaultUnit().toStringUnit(diameter));
String massText; String massTextWithMotors;
if (configuration.hasMotors()) String massTextWithoutMotors;
//// Mass with motors
massText = trans.get("RocketInfo.massText1") +" ";
else
//// Mass with no motors
massText = trans.get("RocketInfo.massText2") +" ";
massText += UnitGroup.UNITS_MASS.getDefaultUnit().toStringUnit(mass); /// Mass with no motors
massTextWithoutMotors = trans.get("RocketInfo.massWithoutMotors") +" ";
GlyphVector massLine = createText(massText); massTextWithoutMotors += UnitGroup.UNITS_MASS.getDefaultUnit().toStringUnit(massWithoutMotors);
GlyphVector massLineWithoutMotors = createText(massTextWithoutMotors);
g2.setColor(Color.BLACK); g2.setColor(Color.BLACK);
g2.drawGlyphVector(name, x1, y1); g2.drawGlyphVector(name, x1, y1);
g2.drawGlyphVector(lengthLine, x1, y1+line); g2.drawGlyphVector(lengthLine, x1, y1+line);
g2.drawGlyphVector(massLine, x1, y1+2*line); g2.drawGlyphVector(massLineWithoutMotors, x1, y1+2*line);
if( configuration.hasMotors() ) {
//// Mass with motors
massTextWithMotors = trans.get("RocketInfo.massWithMotors") + " ";
massTextWithMotors += UnitGroup.UNITS_MASS.getDefaultUnit().toStringUnit(mass);
GlyphVector massLineWithMotors = createText(massTextWithMotors);
g2.drawGlyphVector(massLineWithMotors, x1, y1+3*line);
}
} }

View File

@ -12,8 +12,6 @@ import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@ -33,6 +31,7 @@ import javax.swing.Action;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.InputMap; import javax.swing.InputMap;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
@ -54,22 +53,25 @@ import javax.swing.ScrollPaneConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.border.BevelBorder; import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeSelectionListener;
import javax.swing.event.ChangeEvent;
import javax.swing.tree.DefaultTreeSelectionModel; import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
import net.sf.openrocket.aerodynamics.WarningSet; import net.sf.openrocket.aerodynamics.WarningSet;
import net.sf.openrocket.document.OpenRocketDocument; import net.sf.openrocket.document.OpenRocketDocument;
import net.sf.openrocket.document.OpenRocketDocumentFactory; import net.sf.openrocket.document.OpenRocketDocumentFactory;
import net.sf.openrocket.document.StorageOptions; import net.sf.openrocket.document.StorageOptions;
import net.sf.openrocket.document.StorageOptions.FileType;
import net.sf.openrocket.file.GeneralRocketSaver; import net.sf.openrocket.file.GeneralRocketSaver;
import net.sf.openrocket.file.RocketLoadException; import net.sf.openrocket.file.RocketLoadException;
import net.sf.openrocket.gui.ExportDecalDialog; import net.sf.openrocket.gui.components.StyledLabel;
import net.sf.openrocket.gui.StorageOptionChooser;
import net.sf.openrocket.gui.configdialog.ComponentConfigDialog; import net.sf.openrocket.gui.configdialog.ComponentConfigDialog;
import net.sf.openrocket.gui.customexpression.CustomExpressionDialog; import net.sf.openrocket.gui.customexpression.CustomExpressionDialog;
import net.sf.openrocket.gui.dialogs.AboutDialog; import net.sf.openrocket.gui.dialogs.AboutDialog;
@ -94,7 +96,6 @@ import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.gui.util.Icons; import net.sf.openrocket.gui.util.Icons;
import net.sf.openrocket.gui.util.OpenFileWorker; import net.sf.openrocket.gui.util.OpenFileWorker;
import net.sf.openrocket.gui.util.SaveFileWorker; import net.sf.openrocket.gui.util.SaveFileWorker;
import net.sf.openrocket.gui.util.SimpleFileFilter;
import net.sf.openrocket.gui.util.SwingPreferences; import net.sf.openrocket.gui.util.SwingPreferences;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.logging.Markers; import net.sf.openrocket.logging.Markers;
@ -103,6 +104,7 @@ import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
import net.sf.openrocket.startup.Preferences;
import net.sf.openrocket.util.BugException; import net.sf.openrocket.util.BugException;
import net.sf.openrocket.util.MemoryManagement; import net.sf.openrocket.util.MemoryManagement;
import net.sf.openrocket.util.MemoryManagement.MemoryData; import net.sf.openrocket.util.MemoryManagement.MemoryData;
@ -111,15 +113,13 @@ import net.sf.openrocket.util.StateChangeListener;
import net.sf.openrocket.util.TestRockets; import net.sf.openrocket.util.TestRockets;
import net.sf.openrocket.utils.ComponentPresetEditor; import net.sf.openrocket.utils.ComponentPresetEditor;
import org.slf4j.Logger; public class BasicFrame extends JFrame {
import org.slf4j.LoggerFactory;
public class BasicFrame extends JFrame implements PropertyChangeListener {
private static final Logger log = LoggerFactory.getLogger(BasicFrame.class); private static final Logger log = LoggerFactory.getLogger(BasicFrame.class);
private static final GeneralRocketSaver ROCKET_SAVER = new GeneralRocketSaver(); private static final GeneralRocketSaver ROCKET_SAVER = new GeneralRocketSaver();
private static final Translator trans = Application.getTranslator(); private static final Translator trans = Application.getTranslator();
private static final Preferences prefs = Application.getPreferences();
private static final int SHORTCUT_KEY = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); private static final int SHORTCUT_KEY = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
@ -141,8 +141,6 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
*/ */
private boolean replaceable = false; private boolean replaceable = false;
private final OpenRocketDocument document; private final OpenRocketDocument document;
private final Rocket rocket; private final Rocket rocket;
@ -429,7 +427,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
item = new JMenuItem(trans.get("main.menu.file.open"), KeyEvent.VK_O); item = new JMenuItem(trans.get("main.menu.file.open"), KeyEvent.VK_O);
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, SHORTCUT_KEY)); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, SHORTCUT_KEY));
//// Open a rocket design //// Open a rocket design
item.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.item.Openrocketdesign")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.open.desc"));
item.setIcon(Icons.FILE_OPEN); item.setIcon(Icons.FILE_OPEN);
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
@Override @Override
@ -442,13 +440,13 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
//// Open Recent... //// Open Recent...
item = new MRUDesignFileAction(trans.get("main.menu.file.openRecent"), this); item = new MRUDesignFileAction(trans.get("main.menu.file.openRecent"), this);
item.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.item.Openrecentrocketdesign")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.openRecent.desc"));
item.setIcon(Icons.FILE_OPEN); item.setIcon(Icons.FILE_OPEN);
menu.add(item); menu.add(item);
//// Open example... //// Open example...
item = new ExampleDesignFileAction(trans.get("main.menu.file.openExample"), this); item = new ExampleDesignFileAction(trans.get("main.menu.file.openExample"), this);
item.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.item.Openexamplerocketdesign")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.openExample.desc"));
item.setIcon(Icons.FILE_OPEN_EXAMPLE); item.setIcon(Icons.FILE_OPEN_EXAMPLE);
menu.add(item); menu.add(item);
@ -458,7 +456,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
item = new JMenuItem(trans.get("main.menu.file.save"), KeyEvent.VK_S); item = new JMenuItem(trans.get("main.menu.file.save"), KeyEvent.VK_S);
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, SHORTCUT_KEY)); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, SHORTCUT_KEY));
//// Save the current rocket design //// Save the current rocket design
item.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.item.SavecurRocketdesign")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.save.desc"));
item.setIcon(Icons.FILE_SAVE); item.setIcon(Icons.FILE_SAVE);
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
@Override @Override
@ -474,7 +472,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
SHORTCUT_KEY | ActionEvent.SHIFT_MASK)); SHORTCUT_KEY | ActionEvent.SHIFT_MASK));
//// Save the current rocket design to a new file //// Save the current rocket design to a new file
item.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.item.SavecurRocketdesnewfile")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.saveAs.desc"));
item.setIcon(Icons.FILE_SAVE_AS); item.setIcon(Icons.FILE_SAVE_AS);
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
@Override @Override
@ -485,6 +483,31 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
}); });
menu.add(item); menu.add(item);
menu.addSeparator();
//// Import Rocksim
item = new JMenuItem(trans.get("main.menu.file.import"));
item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.import.desc"));
item.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
log.info(Markers.USER_MARKER, "Import... selected");
importAction();
}
});
menu.add(item);
//// Export Rocksim
item = new JMenuItem(trans.get("main.menu.file.export"));
item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.export.desc"));
item.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
log.info(Markers.USER_MARKER, "Export... selected");
exportAction();
}
});
menu.add(item);
//// Export decal... //// Export decal...
item = new JMenuItem(trans.get("main.menu.file.exportDecal")); item = new JMenuItem(trans.get("main.menu.file.exportDecal"));
@ -530,7 +553,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
item = new JMenuItem(trans.get("main.menu.file.close"), KeyEvent.VK_C); item = new JMenuItem(trans.get("main.menu.file.close"), KeyEvent.VK_C);
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, SHORTCUT_KEY)); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, SHORTCUT_KEY));
//// Close the current rocket design //// Close the current rocket design
item.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.item.Closedesign")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.close.desc"));
item.setIcon(Icons.FILE_CLOSE); item.setIcon(Icons.FILE_CLOSE);
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
@Override @Override
@ -547,7 +570,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
item = new JMenuItem(trans.get("main.menu.file.quit"), KeyEvent.VK_Q); item = new JMenuItem(trans.get("main.menu.file.quit"), KeyEvent.VK_Q);
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, SHORTCUT_KEY)); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, SHORTCUT_KEY));
//// Quit the program //// Quit the program
item.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.item.Quitprogram")); item.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.file.quit.desc"));
item.setIcon(Icons.FILE_QUIT); item.setIcon(Icons.FILE_QUIT);
item.addActionListener(new ActionListener() { item.addActionListener(new ActionListener() {
@Override @Override
@ -564,7 +587,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
menu = new JMenu(trans.get("main.menu.edit")); menu = new JMenu(trans.get("main.menu.edit"));
menu.setMnemonic(KeyEvent.VK_E); menu.setMnemonic(KeyEvent.VK_E);
//// Rocket editing //// Rocket editing
menu.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.menu.Rocketedt")); menu.getAccessibleContext().setAccessibleDescription(trans.get("main.menu.edit.desc"));
menubar.add(menu); menubar.add(menu);
@ -822,9 +845,9 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
new Object[] { new Object[] {
"The 'Debug' menu includes actions for testing and debugging " + "The 'Debug' menu includes actions for testing and debugging " +
"OpenRocket.", " ", "OpenRocket.", " ",
"The menu is made visible by defining the system property " + "The menu is made visible by defining the system property " +
"'openrocket.debug.menu' when starting OpenRocket.", "'openrocket.debug.menu' when starting OpenRocket.",
"It should not be visible by default." }, "It should not be visible by default." },
"Debug menu", JOptionPane.INFORMATION_MESSAGE); "Debug menu", JOptionPane.INFORMATION_MESSAGE);
} }
}); });
@ -845,7 +868,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
}, "Generate random test rocket", JOptionPane.DEFAULT_OPTION, }, "Generate random test rocket", JOptionPane.DEFAULT_OPTION,
JOptionPane.QUESTION_MESSAGE, null, new Object[] { JOptionPane.QUESTION_MESSAGE, null, new Object[] {
"Random", "OK" "Random", "OK"
}, "OK"); }, "OK");
Rocket r; Rocket r;
if (sel == 0) { if (sel == 0) {
@ -914,7 +937,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
if (o == null) if (o == null)
continue; continue;
sb.append("Age ").append(System.currentTimeMillis() - data.getRegistrationTime()) sb.append("Age ").append(System.currentTimeMillis() - data.getRegistrationTime())
.append(" ms: ").append(o).append('\n'); .append(" ms: ").append(o).append('\n');
count++; count++;
// Explicitly null the strong reference to avoid possibility of invisible references // Explicitly null the strong reference to avoid possibility of invisible references
o = null; o = null;
@ -1067,8 +1090,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
chooser.addChoosableFileFilter(FileHelper.ALL_DESIGNS_FILTER); chooser.addChoosableFileFilter(FileHelper.ALL_DESIGNS_FILTER);
chooser.addChoosableFileFilter(FileHelper.OPENROCKET_DESIGN_FILTER); chooser.addChoosableFileFilter(FileHelper.OPENROCKET_DESIGN_FILTER);
chooser.addChoosableFileFilter(FileHelper.ROCKSIM_DESIGN_FILTER); chooser.setFileFilter(FileHelper.OPENROCKET_DESIGN_FILTER);
chooser.setFileFilter(FileHelper.ALL_DESIGNS_FILTER);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setMultiSelectionEnabled(true); chooser.setMultiSelectionEnabled(true);
@ -1093,6 +1115,37 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
} }
} }
private void importAction() {
JFileChooser chooser = new JFileChooser();
chooser.addChoosableFileFilter(FileHelper.ALL_DESIGNS_FILTER);
chooser.addChoosableFileFilter(FileHelper.ROCKSIM_DESIGN_FILTER);
chooser.setFileFilter(FileHelper.ROCKSIM_DESIGN_FILTER);
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setMultiSelectionEnabled(true);
chooser.setCurrentDirectory(((SwingPreferences) Application.getPreferences()).getDefaultDirectory());
int option = chooser.showOpenDialog(this);
if (option != JFileChooser.APPROVE_OPTION) {
log.info(Markers.USER_MARKER, "Decided not to open files, option=" + option);
return;
}
((SwingPreferences) Application.getPreferences()).setDefaultDirectory(chooser.getCurrentDirectory());
File[] files = chooser.getSelectedFiles();
log.info(Markers.USER_MARKER, "Opening files " + Arrays.toString(files));
for (File file : files) {
log.info("Opening file: " + file);
if (open(file, this)) {
MRUDesignFile opts = MRUDesignFile.getInstance();
opts.addFile(file.getAbsolutePath());
}
}
}
void closeIfReplaceable() { void closeIfReplaceable() {
// Close previous window if replacing // Close previous window if replacing
if (replaceable && document.isSaved()) { if (replaceable && document.isSaved()) {
@ -1207,7 +1260,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
JOptionPane.showMessageDialog(parent, JOptionPane.showMessageDialog(parent,
"Unable to open file '" + displayName + "': " "Unable to open file '" + displayName + "': "
+ cause.getMessage(), + cause.getMessage(),
"Error opening file", JOptionPane.ERROR_MESSAGE); "Error opening file", JOptionPane.ERROR_MESSAGE);
return false; return false;
} else { } else {
@ -1235,7 +1288,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
trans.get("BasicFrame.WarningDialog.txt1") + " " + displayName + ".", trans.get("BasicFrame.WarningDialog.txt1") + " " + displayName + ".",
//// Some design features may not have been loaded correctly. //// Some design features may not have been loaded correctly.
trans.get("BasicFrame.WarningDialog.txt2") trans.get("BasicFrame.WarningDialog.txt2")
}, },
//// Warnings while opening file //// Warnings while opening file
trans.get("BasicFrame.WarningDialog.title"), warnings); trans.get("BasicFrame.WarningDialog.title"), warnings);
} }
@ -1265,88 +1318,29 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
*/ */
private boolean saveAction() { private boolean saveAction() {
File file = document.getFile(); File file = document.getFile();
if (file == null) { if (file == null || document.getDefaultStorageOptions().getFileType().equals(FileType.ROCKSIM)) {
log.info("Document does not contain file, opening save as dialog instead"); log.info("Document does not contain file, opening save as dialog instead");
return saveAsAction(); return saveAsAction();
} }
log.info("Saving document to " + file); log.info("Saving document to " + file);
if (FileHelper.ROCKSIM_DESIGN_FILTER.accept(file)) { return saveAsOpenRocket(file);
return saveAsRocksim(file);
}
return saveAs(file);
} }
private static String oldFileName=null;
public void propertyChange(PropertyChangeEvent event){
if( JFileChooser.SELECTED_FILE_CHANGED_PROPERTY == event.getPropertyName()){
if(null != event.getOldValue()){
BasicFrame.oldFileName = ((File)event.getOldValue()).getName();
}
return;
}else if(JFileChooser.FILE_FILTER_CHANGED_PROPERTY == event.getPropertyName()){
JFileChooser chooser = (JFileChooser)event.getSource();
SimpleFileFilter filter = (SimpleFileFilter)(chooser.getFileFilter());
String desiredExtension = filter.getExtensions()[0];
if( null == BasicFrame.oldFileName){
return;
}
String thisFileName = BasicFrame.oldFileName;
if ( filter.accept( new File(thisFileName))){
// nop
return;
}else{
String[] splitResults = thisFileName.split("\\.");
if(0 < splitResults.length){
thisFileName = splitResults[0];
}
chooser.setSelectedFile(new File( thisFileName+desiredExtension));
return;
}
}
}
/** /**
* "Save As" action. * "Export" action.
*
* Never should a .rkt file contain an OpenRocket content, or an .ork file contain a Rocksim design. Regardless of
* what extension the user has chosen, it would violate the Principle of Least Astonishment to do otherwise
* (and we want to make doing the wrong thing really hard to do). So always force the appropriate extension.
*
* This can result in some odd looking filenames (MyDesign.rkt.ork, MyDesign.rkt.ork.rkt, etc.) if the user is
* not paying attention, but the user can control that by modifying the filename in the dialog.
* *
* @return true if the file was saved, false otherwise * @return true if the file was saved, false otherwise
*/ */
private boolean saveAsAction() { private boolean exportAction() {
File file = null; File file = null;
StorageOptionChooser storageChooser = final SaveAsFileChooser chooser = SaveAsFileChooser.build(document, FileType.ROCKSIM);
new StorageOptionChooser(document, document.getDefaultStorageOptions());
final JFileChooser chooser = new JFileChooser();
chooser.setAcceptAllFileFilterUsed(false);
chooser.addChoosableFileFilter(FileHelper.OPENROCKET_DESIGN_FILTER);
chooser.addChoosableFileFilter(FileHelper.ROCKSIM_DESIGN_FILTER);
chooser.addPropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, this);
chooser.addPropertyChangeListener(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY, this);
chooser.addPropertyChangeListener(JFileChooser.SELECTED_FILES_CHANGED_PROPERTY, this);
//Force the file filter to match the file extension that was opened. Will default to OR if the file is null.
if (FileHelper.ROCKSIM_DESIGN_FILTER.accept(document.getFile())) {
chooser.setFileFilter(FileHelper.ROCKSIM_DESIGN_FILTER);
}
else {
chooser.setFileFilter(FileHelper.OPENROCKET_DESIGN_FILTER);
}
chooser.setCurrentDirectory(((SwingPreferences) Application.getPreferences()).getDefaultDirectory());
chooser.setAccessory(storageChooser);
if (document.getFile() != null) {
chooser.setSelectedFile(document.getFile());
}
int option = chooser.showSaveDialog(BasicFrame.this); int option = chooser.showSaveDialog(BasicFrame.this);
if (option != JFileChooser.APPROVE_OPTION) { if (option != JFileChooser.APPROVE_OPTION) {
log.info(Markers.USER_MARKER, "User decided not to save, option=" + option); log.info(Markers.USER_MARKER, "User decided not to save, option=" + option);
return false; return false;
@ -1359,20 +1353,12 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
} }
((SwingPreferences) Application.getPreferences()).setDefaultDirectory(chooser.getCurrentDirectory()); ((SwingPreferences) Application.getPreferences()).setDefaultDirectory(chooser.getCurrentDirectory());
storageChooser.storeOptions(document.getDefaultStorageOptions());
if (chooser.getFileFilter().equals(FileHelper.ROCKSIM_DESIGN_FILTER)) { file = FileHelper.forceExtension(file, "ork");
if (FileHelper.confirmWrite(file, this) ) {
return saveAsRocksim(file); return saveAsRocksim(file);
} }
else { return false;
file = FileHelper.forceExtension(file, "ork");
boolean result = FileHelper.confirmWrite(file, this) && saveAs(file);
if (result) {
MRUDesignFile opts = MRUDesignFile.getInstance();
opts.addFile(file.getAbsolutePath());
}
return result;
}
} }
/** /**
@ -1383,7 +1369,31 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
* @return true if the file was written * @return true if the file was written
*/ */
private boolean saveAsRocksim(File file) { private boolean saveAsRocksim(File file) {
file = FileHelper.forceExtension(file, "rkt"); if ( prefs.getShowRockSimFormatWarning() ) {
// Show Rocksim format warning
JPanel panel = new JPanel(new MigLayout());
panel.add(new StyledLabel(trans.get("SaveRktWarningDialog.txt1")), "wrap");
final JCheckBox check = new JCheckBox(trans.get("SaveRktWarningDialog.donotshow"));
check.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
prefs.setShowRockSimFormatWarning(!check.isSelected());
}
});
panel.add(check);
int sel = JOptionPane.showOptionDialog(null,
panel,
"", // title
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.WARNING_MESSAGE,
null, // icon
null, // options
null // default option
);
if ( sel == 1 ) {
return false;
}
}
if (!FileHelper.confirmWrite(file, this)) { if (!FileHelper.confirmWrite(file, this)) {
return false; return false;
} }
@ -1399,6 +1409,41 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
} }
} }
/**
* "Save As" action.
*
* @return true if the file was saved, false otherwise
*/
private boolean saveAsAction() {
File file = null;
final SaveAsFileChooser chooser = SaveAsFileChooser.build(document, FileType.OPENROCKET);
int option = chooser.showSaveDialog(BasicFrame.this);
if (option != JFileChooser.APPROVE_OPTION) {
log.info(Markers.USER_MARKER, "User decided not to save, option=" + option);
return false;
}
file = chooser.getSelectedFile();
if (file == null) {
log.info(Markers.USER_MARKER, "User did not select a file");
return false;
}
((SwingPreferences) Application.getPreferences()).setDefaultDirectory(chooser.getCurrentDirectory());
chooser.storeOptions(document.getDefaultStorageOptions());
file = FileHelper.forceExtension(file, "ork");
boolean result = FileHelper.confirmWrite(file, this) && saveAsOpenRocket(file);
if (result) {
MRUDesignFile opts = MRUDesignFile.getInstance();
opts.addFile(file.getAbsolutePath());
}
return result;
}
/** /**
* Perform the writing of the design to the given file in OpenRocket format. * Perform the writing of the design to the given file in OpenRocket format.
* *
@ -1406,9 +1451,9 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
* *
* @return true if the file was written * @return true if the file was written
*/ */
private boolean saveAs(File file) { private boolean saveAsOpenRocket(File file) {
file = FileHelper.forceExtension(file, "ork");
log.info("Saving document as " + file); log.info("Saving document as " + file);
boolean saved = false;
if (!StorageOptionChooser.verifyStorageOptions(document, this)) { if (!StorageOptionChooser.verifyStorageOptions(document, this)) {
// User cancelled the dialog // User cancelled the dialog
@ -1416,7 +1461,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
return false; return false;
} }
document.getDefaultStorageOptions().setFileType(FileType.OPENROCKET);
SaveFileWorker worker = new SaveFileWorker(document, file, ROCKET_SAVER); SaveFileWorker worker = new SaveFileWorker(document, file, ROCKET_SAVER);
if (!SwingWorkerDialog.runWorker(this, "Saving file", if (!SwingWorkerDialog.runWorker(this, "Saving file",
@ -1432,8 +1477,8 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
worker.get(); worker.get();
document.setFile(file); document.setFile(file);
document.setSaved(true); document.setSaved(true);
saved = true;
setTitle(); setTitle();
return true;
} catch (ExecutionException e) { } catch (ExecutionException e) {
Throwable cause = e.getCause(); Throwable cause = e.getCause();
@ -1452,7 +1497,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
throw new BugException("EDT was interrupted", e); throw new BugException("EDT was interrupted", e);
} }
return saved; return false;
} }
@ -1462,8 +1507,8 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
ComponentConfigDialog.hideDialog(); ComponentConfigDialog.hideDialog();
int result = JOptionPane.showConfirmDialog(this, int result = JOptionPane.showConfirmDialog(this,
trans.get("BasicFrame.dlg.lbl1") + rocket.getName() + trans.get("BasicFrame.dlg.lbl1") + rocket.getName() +
trans.get("BasicFrame.dlg.lbl2") + " " + trans.get("BasicFrame.dlg.lbl2") + " " +
trans.get("BasicFrame.dlg.lbl3"), trans.get("BasicFrame.dlg.lbl3"),
trans.get("BasicFrame.dlg.title"), JOptionPane.YES_NO_CANCEL_OPTION, trans.get("BasicFrame.dlg.title"), JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE); JOptionPane.QUESTION_MESSAGE);
if (result == JOptionPane.YES_OPTION) { if (result == JOptionPane.YES_OPTION) {
@ -1504,10 +1549,7 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
public void printAction() { public void printAction() {
Double rotation = rocketpanel.getFigure().getRotation(); double rotation = rocketpanel.getFigure().getRotation();
if (rotation == null) {
rotation = 0d;
}
new PrintDialog(this, document, rotation).setVisible(true); new PrintDialog(this, document, rotation).setVisible(true);
} }
@ -1599,22 +1641,23 @@ public class BasicFrame extends JFrame implements PropertyChangeListener {
} }
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
JTabbedPane tabSource = (JTabbedPane) e.getSource(); JTabbedPane tabSource = (JTabbedPane) e.getSource();
String tab = tabSource.getTitleAt(tabSource.getSelectedIndex()); String tab = tabSource.getTitleAt(tabSource.getSelectedIndex());
if (tab.equals(trans.get("BasicFrame.tab.Flightsim"))) { if (tab.equals(trans.get("BasicFrame.tab.Flightsim"))) {
simulationPanel.activating(); simulationPanel.activating();
} }
} }
} }
class BasicFrame_changeAdapter implements javax.swing.event.ChangeListener { class BasicFrame_changeAdapter implements javax.swing.event.ChangeListener {
BasicFrame adaptee; BasicFrame adaptee;
BasicFrame_changeAdapter(BasicFrame adaptee) { BasicFrame_changeAdapter(BasicFrame adaptee) {
this.adaptee = adaptee; this.adaptee = adaptee;
} }
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
adaptee.stateChanged(e); adaptee.stateChanged(e);
} }
} }

View File

@ -1,4 +1,4 @@
package net.sf.openrocket.gui; package net.sf.openrocket.gui.main;
import java.awt.Window; import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;

View File

@ -0,0 +1,113 @@
package net.sf.openrocket.gui.main;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import javax.swing.JFileChooser;
import net.sf.openrocket.document.OpenRocketDocument;
import net.sf.openrocket.document.StorageOptions;
import net.sf.openrocket.document.StorageOptions.FileType;
import net.sf.openrocket.gui.util.FileHelper;
import net.sf.openrocket.gui.util.SimpleFileFilter;
import net.sf.openrocket.gui.util.SwingPreferences;
import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.startup.Application;
public class SaveAsFileChooser extends JFileChooser {
private final FileType type;
private final OpenRocketDocument document;
private final StorageOptionChooser storageChooser;
private static final Translator trans = Application.getTranslator();
public static SaveAsFileChooser build( OpenRocketDocument document, FileType type ) {
return new SaveAsFileChooser(document,type);
}
private SaveAsFileChooser( OpenRocketDocument document, FileType type ) {
this.document = document;
this.type = type;
this.setAcceptAllFileFilterUsed(true);
File defaultFilename = document.getFile();
switch( type ) {
default:
case OPENROCKET:
defaultFilename = FileHelper.forceExtension(defaultFilename,"ork");
this.setDialogTitle(trans.get("saveAs.openrocket.title"));
storageChooser = new StorageOptionChooser(document, document.getDefaultStorageOptions());
this.setAccessory(storageChooser);
this.addChoosableFileFilter(FileHelper.OPENROCKET_DESIGN_FILTER);
this.setFileFilter(FileHelper.OPENROCKET_DESIGN_FILTER);
break;
case ROCKSIM:
defaultFilename = FileHelper.forceExtension(defaultFilename,"rkt");
this.setDialogTitle(trans.get("saveAs.rocksim.title"));
storageChooser = null;
this.addChoosableFileFilter(FileHelper.ROCKSIM_DESIGN_FILTER);
this.setFileFilter(FileHelper.ROCKSIM_DESIGN_FILTER);
break;
}
final RememberFilenamePropertyListener listner = new RememberFilenamePropertyListener();
this.addPropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, listner);
this.addPropertyChangeListener(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY, listner);
this.addPropertyChangeListener(JFileChooser.SELECTED_FILES_CHANGED_PROPERTY, listner);
this.setCurrentDirectory(((SwingPreferences) Application.getPreferences()).getDefaultDirectory());
if (defaultFilename != null) {
this.setSelectedFile(defaultFilename);
}
}
public void storeOptions(StorageOptions opts) {
if ( storageChooser != null ) {
storageChooser.storeOptions(opts);
}
}
}
class RememberFilenamePropertyListener implements PropertyChangeListener {
private String oldFileName=null;
@Override
public void propertyChange(PropertyChangeEvent event){
if( JFileChooser.SELECTED_FILE_CHANGED_PROPERTY == event.getPropertyName()){
if(null != event.getOldValue()){
this.oldFileName = ((File)event.getOldValue()).getName();
}
return;
}else if(JFileChooser.FILE_FILTER_CHANGED_PROPERTY == event.getPropertyName()){
JFileChooser chooser = (JFileChooser)event.getSource();
SimpleFileFilter filter = (SimpleFileFilter)(chooser.getFileFilter());
String desiredExtension = filter.getExtensions()[0];
if( null == this.oldFileName){
return;
}
String thisFileName = this.oldFileName;
if ( filter.accept( new File(thisFileName))){
// nop
return;
}else{
String[] splitResults = thisFileName.split("\\.");
if(0 < splitResults.length){
thisFileName = splitResults[0];
}
chooser.setSelectedFile(new File( thisFileName+desiredExtension));
return;
}
}
}
}

View File

@ -1,4 +1,4 @@
package net.sf.openrocket.gui; package net.sf.openrocket.gui.main;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;

View File

@ -652,6 +652,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
extraText.setLength(length); extraText.setLength(length);
extraText.setDiameter(diameter); extraText.setDiameter(diameter);
extraText.setMass(cg.weight); extraText.setMass(cg.weight);
extraText.setMassWithoutMotors( massCalculator.getCG( configuration, MassCalcType.NO_MOTORS ).weight );
extraText.setWarnings(warnings); extraText.setWarnings(warnings);

View File

@ -117,7 +117,9 @@ public final class FileHelper {
* @return the resulting file * @return the resulting file
*/ */
public static File forceExtension(File original, String extension) { public static File forceExtension(File original, String extension) {
if ( original == null ) {
return null;
}
if (!original.getName().toLowerCase(Locale.ENGLISH).endsWith(extension.toLowerCase(Locale.ENGLISH))) { if (!original.getName().toLowerCase(Locale.ENGLISH).endsWith(extension.toLowerCase(Locale.ENGLISH))) {
log.debug("File name does not contain extension, adding '" + extension + "'"); log.debug("File name does not contain extension, adding '" + extension + "'");
String name = original.getAbsolutePath(); String name = original.getAbsolutePath();