Merge branch 'master' of github.com:openrocket/openrocket
This commit is contained in:
commit
95a0b41d23
47
.gitignore
vendored
47
.gitignore
vendored
@ -40,3 +40,50 @@
|
||||
|
||||
/swing/build
|
||||
/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
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
||||
openrocket
|
||||
22
.idea/compiler.xml
generated
Normal file
22
.idea/compiler.xml
generated
Normal 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
3
.idea/copyright/profiles_settings.xml
generated
Normal file
@ -0,0 +1,3 @@
|
||||
<component name="CopyrightManager">
|
||||
<settings default="" />
|
||||
</component>
|
||||
4
.idea/encodings.xml
generated
Normal file
4
.idea/encodings.xml
generated
Normal 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
266
.idea/misc.xml
generated
Normal 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="<template>" 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
10
.idea/modules.xml
generated
Normal 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
5
.idea/scopes/scope_settings.xml
generated
Normal 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
190
core/OpenRocket Core.iml
Normal 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>
|
||||
@ -258,6 +258,7 @@ pref.dlg.tab.Design = Design
|
||||
pref.dlg.tab.Simulation = Simulation
|
||||
pref.dlg.tab.Launch = Launch
|
||||
pref.dlg.tab.Miscellaneousoptions = Miscellaneous options
|
||||
pref.dlg.lbl.RockSimWarning = Show warning when saving in RockSim format
|
||||
|
||||
pref.dlg.tab.Graphics = Graphics
|
||||
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.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
|
||||
StorageOptChooser.lbl.Simdatatostore = Simulated data to store:
|
||||
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.desc = Create a new rocket design
|
||||
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...
|
||||
BasicFrame.item.Openrecentrocketdesign = Open a recent rocket design
|
||||
main.menu.file.openExample = Open example...
|
||||
BasicFrame.item.Openexamplerocketdesign = Open an example rocket design
|
||||
main.menu.file.openRecent.desc = Open a recent rocket design
|
||||
main.menu.file.openExample = Open Example...
|
||||
main.menu.file.openExample.desc = Open an example rocket design
|
||||
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...
|
||||
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.desc = Print or save as PDF the parts list and fin templates
|
||||
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
|
||||
BasicFrame.item.Quitprogram = Quit the program
|
||||
main.menu.file.quit.desc = Quit the program
|
||||
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.edit = Edit
|
||||
BasicFrame.menu.Rocketedt = Rocket editing
|
||||
main.menu.edit.desc = Rocket editing
|
||||
main.menu.edit.undo = Undo
|
||||
main.menu.edit.undo.desc = Undo the previous operation
|
||||
main.menu.edit.redo = Redo
|
||||
@ -1518,8 +1530,8 @@ TCurveMotor.ttip.emptyMass = Empty mass:
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = Length
|
||||
RocketInfo.lengthLine.maxdiameter = , max. diameter
|
||||
RocketInfo.massText1 = Mass with motors
|
||||
RocketInfo.massText2 = Mass with no motors
|
||||
RocketInfo.massWithMotors = Mass with motors
|
||||
RocketInfo.massWithoutMotors = Mass with no motors
|
||||
RocketInfo.at = at M=
|
||||
RocketInfo.cgText = CG:
|
||||
RocketInfo.cpText = CP:
|
||||
|
||||
@ -1222,8 +1222,8 @@ TCurveMotorCol.LENGTH = D
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = Délka
|
||||
RocketInfo.lengthLine.maxdiameter = , max. prumer
|
||||
RocketInfo.massText1 = Hmotnost s motory
|
||||
RocketInfo.massText2 = Hmotnost bez motoru
|
||||
RocketInfo.massWithMotors = Hmotnost s motory
|
||||
RocketInfo.massWithoutMotors = Hmotnost bez motoru
|
||||
RocketInfo.at = v M=
|
||||
RocketInfo.cgText = Te\u017Eí\u0161te:
|
||||
RocketInfo.cpText = Centrum tlaku:
|
||||
|
||||
@ -1281,8 +1281,8 @@ TCurveMotorCol.LENGTH = L
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = Länge
|
||||
RocketInfo.lengthLine.maxdiameter = , max. Durchmesser
|
||||
RocketInfo.massText1 = Masse mit Motoren
|
||||
RocketInfo.massText2 = Masse ohne Motoren
|
||||
RocketInfo.massWithMotors = Masse mit Motoren
|
||||
RocketInfo.massWithoutMotors = Masse ohne Motoren
|
||||
RocketInfo.at = bei M=
|
||||
RocketInfo.cgText = CG:
|
||||
RocketInfo.cpText = CP:
|
||||
|
||||
@ -887,8 +887,8 @@ RocketInfo.cpText = CP:
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = Longitud:
|
||||
RocketInfo.lengthLine.maxdiameter = , Di\u00e1metro m\u00e1ximo:
|
||||
RocketInfo.massText1 = Masa con motores:
|
||||
RocketInfo.massText2 = Masa sin motores:
|
||||
RocketInfo.massWithMotors = Masa con motores:
|
||||
RocketInfo.massWithoutMotors = Masa sin motores:
|
||||
RocketInfo.stabText = Estabilidad:
|
||||
RocketInfo.velocityValue = N/A
|
||||
|
||||
|
||||
@ -878,8 +878,8 @@ RocketInfo.cpText = CP:
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = Longueur
|
||||
RocketInfo.lengthLine.maxdiameter = , diam\u00E8tre max.
|
||||
RocketInfo.massText1 = Masse avec moteurs
|
||||
RocketInfo.massText2 = Masse sans moteurs
|
||||
RocketInfo.massWithMotors = Masse avec moteurs
|
||||
RocketInfo.massWithoutMotors = Masse sans moteurs
|
||||
RocketInfo.stabText = Stabilit\u00E9:
|
||||
RocketInfo.velocityValue = N/A
|
||||
|
||||
|
||||
@ -1285,8 +1285,8 @@ TCurveMotorCol.LENGTH = Lunghezza
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = Lunghezza
|
||||
RocketInfo.lengthLine.maxdiameter = , max. diametro
|
||||
RocketInfo.massText1 = Massa CON motori
|
||||
RocketInfo.massText2 = Massa SENZA motori
|
||||
RocketInfo.massWithMotors = Massa CON motori
|
||||
RocketInfo.massWithoutMotors = Massa SENZA motori
|
||||
RocketInfo.at = a M=
|
||||
RocketInfo.cgText = CG:
|
||||
RocketInfo.cpText = CP:
|
||||
|
||||
@ -1343,8 +1343,8 @@ TCurveMotor.ttip.emptyMass = \u7A7A\u865A\u8CEA\u91CF\uFF1A
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = \u9577\u3055
|
||||
RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84
|
||||
RocketInfo.massText1 = \u30E2\u30FC\u30BF\u30FC\u8FBC\u307F\u91CD\u91CF
|
||||
RocketInfo.massText2 = \u30E2\u30FC\u30BF\u30FC\u7121\u3057\u91CD\u91CF
|
||||
RocketInfo.massWithMotors = \u30E2\u30FC\u30BF\u30FC\u8FBC\u307F\u91CD\u91CF
|
||||
RocketInfo.massWithoutMotors = \u30E2\u30FC\u30BF\u30FC\u7121\u3057\u91CD\u91CF
|
||||
RocketInfo.at = at M=
|
||||
RocketInfo.cgText = CG:
|
||||
RocketInfo.cpText = CP:
|
||||
|
||||
@ -1226,8 +1226,8 @@
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = D\u0142ugo\u015B\u0107
|
||||
RocketInfo.lengthLine.maxdiameter = , maks. \u015Brednica
|
||||
RocketInfo.massText1 = Masa z silnikami
|
||||
RocketInfo.massText2 = Masa bez silników
|
||||
RocketInfo.massWithMotors = Masa z silnikami
|
||||
RocketInfo.massWithoutMotors = Masa bez silników
|
||||
RocketInfo.at = przy M
|
||||
RocketInfo.cgText = \u015AC:
|
||||
RocketInfo.cpText = \u015AP:
|
||||
|
||||
@ -862,8 +862,8 @@ RocketInfo.cpText = CP:
|
||||
# RocketInfo
|
||||
RocketInfo.lengthLine.Length = Tamanho
|
||||
RocketInfo.lengthLine.maxdiameter = , di\u00e2metro m\u00e1x.
|
||||
RocketInfo.massText1 = Massa com motores
|
||||
RocketInfo.massText2 = Massa sem motores
|
||||
RocketInfo.massWithMotors = Massa com motores
|
||||
RocketInfo.massWithoutMotors = Massa sem motores
|
||||
RocketInfo.stabText = Estabilidade:
|
||||
RocketInfo.velocityValue = N/D
|
||||
|
||||
|
||||
@ -1435,8 +1435,8 @@ TCurveMotor.ttip.emptyMass = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = \u0414\u043b\u0438\u043d\u0430
|
||||
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.massText2 = \u041c\u0430\u0441\u0441\u0430 \u0431\u0435\u0437 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439
|
||||
RocketInfo.massWithMotors = \u041c\u0430\u0441\u0441\u0430 \u0441 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f\u043c\u0438
|
||||
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.cgText = \u0426\u0422:
|
||||
RocketInfo.cpText = \u0426\u0414:
|
||||
@ -1891,4 +1891,4 @@ SeparationSelectionDialog.opt.override = \u0418\u0437\u043c\u0435\u043d\u0438\u0
|
||||
|
||||
MotorConfigurationPanel.description = <b>\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0438 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u0434\u043b\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u043b\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.</b><br> <em>\u041a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439:</em> \u0423\u043a\u0430\u0436\u0438\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439.<br> <em>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439:</em> \u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0438 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u0436\u0438\u0433\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f.
|
||||
|
||||
MotorDescriptionSubstitutor.description = \u0414\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438
|
||||
MotorDescriptionSubstitutor.description = \u0414\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438
|
||||
|
||||
@ -1440,8 +1440,8 @@ TCurveMotor.ttip.emptyMass = Empty mass:
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = Length
|
||||
RocketInfo.lengthLine.maxdiameter = , max. diameter
|
||||
RocketInfo.massText1 = Mass with motors
|
||||
RocketInfo.massText2 = Mass with no motors
|
||||
RocketInfo.massWithMotors = Mass with motors
|
||||
RocketInfo.massWithoutMotors = Mass with no motors
|
||||
RocketInfo.at = at M=
|
||||
RocketInfo.cgText = CG:
|
||||
RocketInfo.cpText = CP:
|
||||
|
||||
@ -952,8 +952,8 @@ RocketInfo.cpText = CP(\u538B\u5FC3):
|
||||
! RocketInfo
|
||||
RocketInfo.lengthLine.Length = \u957F\u5EA6
|
||||
RocketInfo.lengthLine.maxdiameter = , \u6700\u5927\u76F4\u5F84
|
||||
RocketInfo.massText1 = \u542B\u53D1\u52A8\u673A\u7684\u603B\u8D28\u91CF
|
||||
RocketInfo.massText2 = \u4E0D\u542B\u53D1\u52A8\u673A\u7684\u51C0\u8D28\u91CF
|
||||
RocketInfo.massWithMotors = \u542B\u53D1\u52A8\u673A\u7684\u603B\u8D28\u91CF
|
||||
RocketInfo.massWithoutMotors = \u4E0D\u542B\u53D1\u52A8\u673A\u7684\u51C0\u8D28\u91CF
|
||||
RocketInfo.stabText = \u7A33\u5B9A\u6027:
|
||||
RocketInfo.velocityValue = N/A
|
||||
|
||||
|
||||
@ -4,9 +4,15 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
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.Simulation;
|
||||
import net.sf.openrocket.document.StorageOptions;
|
||||
import net.sf.openrocket.document.StorageOptions.FileType;
|
||||
import net.sf.openrocket.file.AbstractRocketLoader;
|
||||
import net.sf.openrocket.file.DocumentLoadingContext;
|
||||
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.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.
|
||||
@ -70,7 +71,7 @@ public class OpenRocketLoader extends AbstractRocketLoader {
|
||||
List<Double> list = branch.get(FlightDataType.TYPE_TIME);
|
||||
if (list == null)
|
||||
continue;
|
||||
|
||||
|
||||
double previousTime = Double.NaN;
|
||||
for (double time : list) {
|
||||
if (time - previousTime < timeSkip)
|
||||
@ -81,6 +82,7 @@ public class OpenRocketLoader extends AbstractRocketLoader {
|
||||
timeSkip = Math.rint(timeSkip * 100) / 100;
|
||||
doc.getDefaultStorageOptions().setSimulationTimeSkip(timeSkip);
|
||||
doc.getDefaultStorageOptions().setExplicitlySet(false);
|
||||
doc.getDefaultStorageOptions().setFileType(FileType.OPENROCKET);
|
||||
|
||||
// Call simulation extensions
|
||||
for (Simulation sim : doc.getSimulations()) {
|
||||
|
||||
@ -6,14 +6,15 @@ package net.sf.openrocket.file.rocksim.importt;
|
||||
import java.io.IOException;
|
||||
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.DocumentLoadingContext;
|
||||
import net.sf.openrocket.file.RocketLoadException;
|
||||
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
|
||||
* 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().clearUndo();
|
||||
context.getOpenRocketDocument().getDefaultStorageOptions().setFileType(FileType.ROCKSIM);
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ public abstract class Preferences implements ChangeSource {
|
||||
// Node names
|
||||
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 SHOW_ROCKSIM_FORMAT_WARNING = "SHOW_ROCKSIM_FORMAT_WARNING";
|
||||
|
||||
//Preferences related to 3D graphics
|
||||
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);
|
||||
}
|
||||
|
||||
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() {
|
||||
return Application.getPreferences().getChoice(Preferences.DEFAULT_MACH_NUMBER, 0.9, 0.3);
|
||||
}
|
||||
@ -533,7 +542,7 @@ public abstract class Preferences implements ChangeSource {
|
||||
String color = get("componentColors", c, StaticFieldHolder.DEFAULT_COLORS);
|
||||
if (color == null)
|
||||
return Color.BLACK;
|
||||
|
||||
|
||||
Color clr = parseColor(color);
|
||||
if (clr != null) {
|
||||
return clr;
|
||||
@ -584,7 +593,7 @@ public abstract class Preferences implements ChangeSource {
|
||||
public Material getDefaultComponentMaterial(
|
||||
Class<? extends RocketComponent> componentClass,
|
||||
Material.Type type) {
|
||||
|
||||
|
||||
String material = get("componentMaterials", componentClass, null);
|
||||
if (material != null) {
|
||||
try {
|
||||
@ -613,7 +622,7 @@ public abstract class Preferences implements ChangeSource {
|
||||
*/
|
||||
public void setDefaultComponentMaterial(
|
||||
Class<? extends RocketComponent> componentClass, Material material) {
|
||||
|
||||
|
||||
putString("componentMaterials", componentClass.getSimpleName(),
|
||||
material == null ? null : material.toStorableString());
|
||||
}
|
||||
@ -689,7 +698,7 @@ public abstract class Preferences implements ChangeSource {
|
||||
protected String get(String directory,
|
||||
Class<? extends RocketComponent> componentClass,
|
||||
Map<Class<?>, String> defaultMap) {
|
||||
|
||||
|
||||
// Search preferences
|
||||
Class<?> c = componentClass;
|
||||
while (c != null && RocketComponent.class.isAssignableFrom(c)) {
|
||||
@ -701,7 +710,7 @@ public abstract class Preferences implements ChangeSource {
|
||||
|
||||
if (defaultMap == null)
|
||||
return null;
|
||||
|
||||
|
||||
// Search defaults
|
||||
c = componentClass;
|
||||
while (RocketComponent.class.isAssignableFrom(c)) {
|
||||
@ -736,12 +745,14 @@ public abstract class Preferences implements ChangeSource {
|
||||
*/
|
||||
|
||||
private static final HashMap<Class<?>, String> DEFAULT_LINE_STYLES = new HashMap<Class<?>, String>();
|
||||
|
||||
static {
|
||||
DEFAULT_LINE_STYLES.put(RocketComponent.class, LineStyle.SOLID.name());
|
||||
DEFAULT_LINE_STYLES.put(MassObject.class, LineStyle.DASHED.name());
|
||||
}
|
||||
|
||||
private static final HashMap<Class<?>, String> DEFAULT_COLORS = new HashMap<Class<?>, String>();
|
||||
|
||||
static {
|
||||
DEFAULT_COLORS.put(BodyComponent.class, "0,0,240");
|
||||
DEFAULT_COLORS.put(TubeFinSet.class, "0,0,200");
|
||||
|
||||
83
lib-test/OpenRocket Test Libraries.iml
Normal file
83
lib-test/OpenRocket Test Libraries.iml
Normal 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
210
swing/OpenRocket Swing.iml
Normal 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>
|
||||
@ -208,6 +208,30 @@ public class GeneralPreferencesPanel extends PreferencesPanel {
|
||||
}
|
||||
});
|
||||
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");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ public class RocketInfo implements FigureElement {
|
||||
private double cg = 0, cp = 0;
|
||||
private double length = 0, diameter = 0;
|
||||
private double mass = 0;
|
||||
private double massWithoutMotors = 0;
|
||||
private double aoa = Double.NaN, theta = Double.NaN, mach = Application.getPreferences().getDefaultMach();
|
||||
|
||||
private WarningSet warnings = null;
|
||||
@ -108,10 +109,14 @@ public class RocketInfo implements FigureElement {
|
||||
public void setDiameter(double diameter) {
|
||||
this.diameter = diameter;
|
||||
}
|
||||
|
||||
|
||||
public void setMass(double mass) {
|
||||
this.mass = mass;
|
||||
}
|
||||
|
||||
public void setMassWithoutMotors(double mass) {
|
||||
this.massWithoutMotors = mass;
|
||||
}
|
||||
|
||||
public void setWarnings(WarningSet warnings) {
|
||||
this.warnings = warnings.clone();
|
||||
@ -150,24 +155,28 @@ public class RocketInfo implements FigureElement {
|
||||
trans.get("RocketInfo.lengthLine.maxdiameter") +" " +
|
||||
UnitGroup.UNITS_LENGTH.getDefaultUnit().toStringUnit(diameter));
|
||||
|
||||
String massText;
|
||||
if (configuration.hasMotors())
|
||||
//// 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);
|
||||
|
||||
GlyphVector massLine = createText(massText);
|
||||
String massTextWithMotors;
|
||||
String massTextWithoutMotors;
|
||||
|
||||
/// Mass with no motors
|
||||
massTextWithoutMotors = trans.get("RocketInfo.massWithoutMotors") +" ";
|
||||
massTextWithoutMotors += UnitGroup.UNITS_MASS.getDefaultUnit().toStringUnit(massWithoutMotors);
|
||||
|
||||
GlyphVector massLineWithoutMotors = createText(massTextWithoutMotors);
|
||||
|
||||
|
||||
g2.setColor(Color.BLACK);
|
||||
|
||||
g2.drawGlyphVector(name, x1, y1);
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
package net.sf.openrocket.gui;
|
||||
package net.sf.openrocket.gui.main;
|
||||
|
||||
import java.awt.Window;
|
||||
import java.awt.event.ActionEvent;
|
||||
113
swing/src/net/sf/openrocket/gui/main/SaveAsFileChooser.java
Normal file
113
swing/src/net/sf/openrocket/gui/main/SaveAsFileChooser.java
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package net.sf.openrocket.gui;
|
||||
package net.sf.openrocket.gui.main;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@ -652,6 +652,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
||||
extraText.setLength(length);
|
||||
extraText.setDiameter(diameter);
|
||||
extraText.setMass(cg.weight);
|
||||
extraText.setMassWithoutMotors( massCalculator.getCG( configuration, MassCalcType.NO_MOTORS ).weight );
|
||||
extraText.setWarnings(warnings);
|
||||
|
||||
|
||||
|
||||
@ -117,7 +117,9 @@ public final class FileHelper {
|
||||
* @return the resulting file
|
||||
*/
|
||||
public static File forceExtension(File original, String extension) {
|
||||
|
||||
if ( original == null ) {
|
||||
return null;
|
||||
}
|
||||
if (!original.getName().toLowerCase(Locale.ENGLISH).endsWith(extension.toLowerCase(Locale.ENGLISH))) {
|
||||
log.debug("File name does not contain extension, adding '" + extension + "'");
|
||||
String name = original.getAbsolutePath();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user