diff --git a/core/resources-src/datafiles/openrocket-database b/core/resources-src/datafiles/openrocket-database index 93054dc2b..48eb2172d 160000 --- a/core/resources-src/datafiles/openrocket-database +++ b/core/resources-src/datafiles/openrocket-database @@ -1 +1 @@ -Subproject commit 93054dc2b40d5196433b1d91c636cee2e9dda424 +Subproject commit 48eb2172d58c0db6042bd847a782835df056b287 diff --git a/core/src/main/java/info/openrocket/core/file/configuration/XmlContainerElement.java b/core/src/main/java/info/openrocket/core/file/configuration/XmlContainerElement.java deleted file mode 100644 index 028408ecb..000000000 --- a/core/src/main/java/info/openrocket/core/file/configuration/XmlContainerElement.java +++ /dev/null @@ -1,23 +0,0 @@ -package info.openrocket.core.file.configuration; - -import java.util.ArrayList; -import java.util.List; - -public class XmlContainerElement extends XmlElement { - - private final ArrayList subelements = new ArrayList(); - - public XmlContainerElement(String name) { - super(name); - } - - public void addElement(XmlElement element) { - subelements.add(element); - } - - @SuppressWarnings("unchecked") - public List getElements() { - return (List) subelements.clone(); - } - -} diff --git a/core/src/main/java/info/openrocket/core/file/configuration/XmlContentElement.java b/core/src/main/java/info/openrocket/core/file/configuration/XmlContentElement.java deleted file mode 100644 index e6651d85c..000000000 --- a/core/src/main/java/info/openrocket/core/file/configuration/XmlContentElement.java +++ /dev/null @@ -1,27 +0,0 @@ -package info.openrocket.core.file.configuration; - -/** - * A simple XML element that contains textual content. - * - * @author Sampo Niskanen - */ -public class XmlContentElement extends XmlElement { - - private String content = ""; - - public XmlContentElement(String name) { - super(name); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - if (content == null) { - throw new IllegalArgumentException("XML content cannot be null"); - } - this.content = content; - } - -} diff --git a/core/src/main/java/info/openrocket/core/file/configuration/XmlElement.java b/core/src/main/java/info/openrocket/core/file/configuration/XmlElement.java deleted file mode 100644 index 4e9ee189b..000000000 --- a/core/src/main/java/info/openrocket/core/file/configuration/XmlElement.java +++ /dev/null @@ -1,43 +0,0 @@ -package info.openrocket.core.file.configuration; - -import java.util.HashMap; -import java.util.Map; - -/** - * A base simple XML element. A simple XML element can contain either other XML - * elements - * (XmlContainerElement) or textual content (XmlContentElement), but not both. - * - * @author Sampo Niskanen - */ -public abstract class XmlElement { - - private final String name; - private final HashMap attributes = new HashMap(); - - public XmlElement(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setAttribute(String key, String value) { - attributes.put(key, value); - } - - public void removeAttribute(String key) { - attributes.remove(key); - } - - public String getAttribute(String key) { - return attributes.get(key); - } - - @SuppressWarnings("unchecked") - public Map getAttributes() { - return (Map) attributes.clone(); - } - -} diff --git a/core/src/main/java/info/openrocket/core/simulation/FlightDataType.java b/core/src/main/java/info/openrocket/core/simulation/FlightDataType.java index ca15d8f98..df34e4718 100644 --- a/core/src/main/java/info/openrocket/core/simulation/FlightDataType.java +++ b/core/src/main/java/info/openrocket/core/simulation/FlightDataType.java @@ -392,14 +392,14 @@ public class FlightDataType implements Comparable { // if something has changed, then we need to remove the old one // otherwise, just return what we found if (!u.equals(type.getUnitGroup())) { - oldPriority = type.groupPriority; + oldPriority = type.priority; EXISTING_TYPES.remove(type); log.info("Unitgroup of type " + type.getName() + ", has changed from " + type.getUnitGroup().toString() + " to " + u.toString() + ". Removing old version."); } else if (!s.equals(type.getName())) { - oldPriority = type.groupPriority; + oldPriority = type.priority; EXISTING_TYPES.remove(type); log.info("Name of type " + type.getName() + ", has changed to " + s + ". Removing old version."); } else { @@ -459,7 +459,7 @@ public class FlightDataType implements Comparable { private final String symbol; private final UnitGroup units; private final FlightDataTypeGroup group; - private final int groupPriority; + private final int priority; private final int hashCode; private FlightDataType(String typeName, String symbol, UnitGroup units, FlightDataTypeGroup group, int priority) { @@ -471,7 +471,7 @@ public class FlightDataType implements Comparable { this.symbol = symbol; this.units = units; this.group = group; - this.groupPriority = priority; + this.priority = priority; this.hashCode = this.name.toLowerCase(Locale.ENGLISH).hashCode(); } @@ -492,7 +492,7 @@ public class FlightDataType implements Comparable { } public int getGroupPriority() { - return groupPriority; + return group.getPriority(); } @Override @@ -501,10 +501,10 @@ public class FlightDataType implements Comparable { } @Override - public boolean equals(Object other) { - if (!(other instanceof FlightDataType)) + public boolean equals(Object o) { + if (!(o instanceof FlightDataType)) return false; - return this.name.equalsIgnoreCase(((FlightDataType) other).name); + return this.compareTo((FlightDataType) o) == 0; } @Override @@ -514,8 +514,11 @@ public class FlightDataType implements Comparable { @Override public int compareTo(FlightDataType o) { - if (this.groupPriority != o.groupPriority) - return this.groupPriority - o.groupPriority; - return this.name.compareToIgnoreCase(o.name); + final int groupCompare = this.getGroup().compareTo(o.getGroup()); + if (groupCompare != 0) { + return groupCompare; + } + + return this.priority - o.priority; } } diff --git a/core/src/main/java/info/openrocket/core/simulation/FlightDataTypeGroup.java b/core/src/main/java/info/openrocket/core/simulation/FlightDataTypeGroup.java index f0a1fcf81..2db1af4eb 100644 --- a/core/src/main/java/info/openrocket/core/simulation/FlightDataTypeGroup.java +++ b/core/src/main/java/info/openrocket/core/simulation/FlightDataTypeGroup.java @@ -3,7 +3,7 @@ package info.openrocket.core.simulation; import info.openrocket.core.l10n.Translator; import info.openrocket.core.startup.Application; -public class FlightDataTypeGroup { +public class FlightDataTypeGroup implements Comparable { private static final Translator trans = Application.getTranslator(); public static final FlightDataTypeGroup TIME = new FlightDataTypeGroup(trans.get("FlightDataTypeGroup.GROUP_TIME"), 0); @@ -56,4 +56,16 @@ public class FlightDataTypeGroup { public String toString() { return getName(); } + + @Override + public boolean equals(Object o) { + if (!(o instanceof FlightDataTypeGroup)) + return false; + return this.compareTo((FlightDataTypeGroup) o) == 0; + } + + @Override + public int compareTo(FlightDataTypeGroup o) { + return this.priority - o.priority; + } } diff --git a/core/src/main/java/module-info.java b/core/src/main/java/module-info.java index 459e2c626..d2a8c328f 100644 --- a/core/src/main/java/module-info.java +++ b/core/src/main/java/module-info.java @@ -40,7 +40,6 @@ open module info.openrocket.core { exports info.openrocket.core.document.attachments; exports info.openrocket.core.document.events; exports info.openrocket.core.file; - exports info.openrocket.core.file.configuration; exports info.openrocket.core.file.iterator; exports info.openrocket.core.file.motor; exports info.openrocket.core.file.openrocket; @@ -106,4 +105,4 @@ open module info.openrocket.core { info.openrocket.core.optimization.services.DefaultOptimizableParameterService; provides info.openrocket.core.optimization.services.SimulationModifierService with info.openrocket.core.optimization.services.DefaultSimulationModifierService; -} \ No newline at end of file +} diff --git a/core/src/main/resources/datafiles/examples/Presets.ork b/core/src/main/resources/datafiles/examples/Presets.ork deleted file mode 100644 index 05407929f..000000000 Binary files a/core/src/main/resources/datafiles/examples/Presets.ork and /dev/null differ diff --git a/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser b/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser index 0819a2305..5a6859372 100644 Binary files a/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser and b/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser differ diff --git a/core/src/main/resources/l10n/messages.properties b/core/src/main/resources/l10n/messages.properties index 9e962b368..cc5be690d 100644 --- a/core/src/main/resources/l10n/messages.properties +++ b/core/src/main/resources/l10n/messages.properties @@ -343,8 +343,8 @@ pref.dlg.RockSimfiles = RockSim engine files (*.rse) pref.dlg.ZIParchives = ZIP archives (*.zip) pref.dlg.checkbox.Checkupdates = Always check for software updates at startup pref.dlg.checkbox.Checkupdates.ttip = Check for software updates every time you start up OpenRocket -pref.dlg.checkbox.CheckBetaupdates = Also check for beta releases -pref.dlg.checkbox.CheckBetaupdates.ttip = If checked, beta release updates are also notified. If unchecked, only official releases are considered. +pref.dlg.checkbox.CheckBetaupdates = Also check for pre-releases +pref.dlg.checkbox.CheckBetaupdates.ttip = If checked, pre-release (e.g. beta releases) updates are also notified. If unchecked, only official releases are considered. pref.dlg.ttip.Checkupdatesnow = Check for software updates now pref.dlg.lbl.Selectprefunits = Select your preferred units: pref.dlg.lbl.Rocketinfofontsize = Size of text in rocket design panel: @@ -493,13 +493,13 @@ simedtdlg.lbl.Length = Length: simedtdlg.lbl.ttip.Length = The length of the launch rod. simedtdlg.checkbox.Intowind = Always launch directly up-wind or down-wind simedtdlg.checkbox.ttip.Intowind1 = Makes the launch rod point into the wind.
-simedtdlg.checkbox.ttip.Intowind2 = A zero launchrod angle will point directly up.
-simedtdlg.checkbox.ttip.Intowind3 = A negative launchrod angle will launch with the wind.
If you uncheck this box you can point the launchrod any direction you please. +simedtdlg.checkbox.ttip.Intowind2 = A zero launch rod angle will point directly up (vertical).
+simedtdlg.checkbox.ttip.Intowind3 = A negative launch rod angle will launch with the wind.
simedtdlg.checkbox.ttip.Intowind4 = If you uncheck this box you can point the launchrod any direction you please. simedtdlg.lbl.Angle = Angle: -simedtdlg.lbl.ttip.Angle = The angle of the launch rod from vertical.
Positive angles point North of launch. +simedtdlg.lbl.ttip.Angle = The angle of the launch rod from vertical.
If set to always launch up-wind or down-wind, positive angles are up-wind, negative angles down-wind.
If set for a manual direction, positive angles towards the direction axis.
E.g. if direction is set to 90° (East of the wind), positive angles will point the launch rod East. Negative angles will point the rod West. simedtdlg.lbl.Direction = Direction: -simedtdlg.lbl.ttip.Direction1 = Direction of the launch rod relative to the wind.
+simedtdlg.lbl.ttip.Direction1 = Direction of the launch rod relative to the wind direction.
E.g. 90° is East of the wind direction.
simedtdlg.lbl.ttip.Direction2 = - simedtdlg.lbl.ttip.Direction3 = 0 is North. simedtdlg.border.Simopt = Simulator options diff --git a/swing/src/main/java/info/openrocket/swing/gui/dialogs/preferences/DesignPreferencesPanel.java b/swing/src/main/java/info/openrocket/swing/gui/dialogs/preferences/DesignPreferencesPanel.java index 918e821a9..4f4d0eea8 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/dialogs/preferences/DesignPreferencesPanel.java +++ b/swing/src/main/java/info/openrocket/swing/gui/dialogs/preferences/DesignPreferencesPanel.java @@ -76,19 +76,6 @@ public class DesignPreferencesPanel extends PreferencesPanel { spin.setEditor(new SpinnerEditor(spin)); this.add(spin, "wrap"); - final JCheckBox autoOpenDesignFile = new JCheckBox( - trans.get("pref.dlg.but.openlast")); - autoOpenDesignFile.setSelected(preferences - .isAutoOpenLastDesignOnStartupEnabled()); - autoOpenDesignFile.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - preferences.setAutoOpenLastDesignOnStartup(autoOpenDesignFile - .isSelected()); - } - }); - this.add(autoOpenDesignFile, "wrap, growx, span 2"); - // // Always open leftmost tab when opening a component edit dialog final JCheckBox alwaysOpenLeftmostTab = new JCheckBox( trans.get("pref.dlg.checkbox.AlwaysOpenLeftmost")); diff --git a/swing/src/main/java/info/openrocket/swing/gui/main/ExampleDesignFileAction.java b/swing/src/main/java/info/openrocket/swing/gui/main/ExampleDesignFileAction.java index 09def07fc..565a1d83e 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/main/ExampleDesignFileAction.java +++ b/swing/src/main/java/info/openrocket/swing/gui/main/ExampleDesignFileAction.java @@ -46,7 +46,6 @@ public final class ExampleDesignFileAction extends JMenu { "Pods--powered with recovery deployment", null, // Examples demonstrating customized functionality - "Presets", "Simulation extensions", "Simulation scripting" }; diff --git a/swing/src/main/java/info/openrocket/swing/gui/simulation/SimulationExportPanel.java b/swing/src/main/java/info/openrocket/swing/gui/simulation/SimulationExportPanel.java index 9522e24fc..ad8c156c0 100644 --- a/swing/src/main/java/info/openrocket/swing/gui/simulation/SimulationExportPanel.java +++ b/swing/src/main/java/info/openrocket/swing/gui/simulation/SimulationExportPanel.java @@ -89,7 +89,7 @@ public class SimulationExportPanel extends JPanel { branch = data.getBranch(0); types = branch.getTypes(); - + selected = new boolean[types.length]; units = new Unit[types.length]; for (int i = 0; i < types.length; i++) {