From 793c7dd3bb6bb88c2de76e33df3e04edad28e186 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Sat, 27 Apr 2013 20:59:36 -0500 Subject: [PATCH 1/3] Prevent NPEs by disabling the Export menu item when no decals are on the model. Also have the Edit button in AppearancePanel be enabled only by the addition of an image on the AppearanceBuilder. --- .../openrocket/gui/configdialog/AppearancePanel.java | 2 +- core/src/net/sf/openrocket/gui/main/BasicFrame.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/net/sf/openrocket/gui/configdialog/AppearancePanel.java b/core/src/net/sf/openrocket/gui/configdialog/AppearancePanel.java index 485a8d70b..459750cd2 100644 --- a/core/src/net/sf/openrocket/gui/configdialog/AppearancePanel.java +++ b/core/src/net/sf/openrocket/gui/configdialog/AppearancePanel.java @@ -257,6 +257,7 @@ public class AppearancePanel extends JPanel { add(p, "span 3, growx, wrap"); final JButton editBtn = new JButton(trans.get("AppearanceCfg.but.edit")); editBtn.setEnabled(ab.getImage() != null); + // Enable the editBtn only when the appearance builder has an Image assigned to it. ab.addChangeListener(new StateChangeListener() { @Override public void stateChanged(EventObject e) { @@ -275,7 +276,6 @@ public class AppearancePanel extends JPanel { } }); - mDefault.addEnableComponent(editBtn, false); p.add(editBtn); } diff --git a/core/src/net/sf/openrocket/gui/main/BasicFrame.java b/core/src/net/sf/openrocket/gui/main/BasicFrame.java index 0609ec8c6..ea48da24a 100644 --- a/core/src/net/sf/openrocket/gui/main/BasicFrame.java +++ b/core/src/net/sf/openrocket/gui/main/BasicFrame.java @@ -22,6 +22,7 @@ import java.net.URL; import java.net.URLDecoder; import java.util.ArrayList; import java.util.Arrays; +import java.util.EventObject; import java.util.LinkedList; import java.util.List; import java.util.concurrent.ExecutionException; @@ -101,6 +102,7 @@ import net.sf.openrocket.util.BugException; import net.sf.openrocket.util.MemoryManagement; import net.sf.openrocket.util.MemoryManagement.MemoryData; import net.sf.openrocket.util.Reflection; +import net.sf.openrocket.util.StateChangeListener; import net.sf.openrocket.util.TestRockets; public class BasicFrame extends JFrame { @@ -477,6 +479,16 @@ public class BasicFrame extends JFrame { exportDecalAction(); } }); + item.setEnabled(document.getDecalList().size() > 0); + final JMenuItem exportMenuItem = item; + document.getRocket().addChangeListener(new StateChangeListener() { + + @Override + public void stateChanged(EventObject e) { + exportMenuItem.setEnabled(document.getDecalList().size() > 0); + } + + }); menu.add(item); From fee17f38781bcee025c43da19f916122dc7d78fe Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Sat, 27 Apr 2013 21:23:16 -0500 Subject: [PATCH 2/3] Added release notes from changelog. --- core/ReleaseNotes | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/core/ReleaseNotes b/core/ReleaseNotes index ffdfdf7ec..77a34eaab 100644 --- a/core/ReleaseNotes +++ b/core/ReleaseNotes @@ -1,3 +1,30 @@ +OpenRocket 13.04 (2013-04-28): +-------------------------------- + +New Features: + + * Added support for decals on rockets. Added two new 3d views - 3d finished and 3d unfinshed. Added support to export and + apply decals (images) to rocket components. Added ability to launch external graphics editor to edit decals and monitor + file for writes to update the rocket view. + * Added simulation of tumble recovery based on experimentation done by Sampo Niskane. This is particularly useful + for low power staged flights. + * Extended "motor configuration" concept to cover more properties. The concept was renamed "Flight Configuration" and + allows the user to override stage separation, recovery deployment, and motor ignition per flight configuration. + These configurations are stored in the ork file with each component. If no override is specified then the user specified + default is used (set in the component edit dialog). The flight configuration dialog was reworked to make it more + usable. The user selects the configuration in a drop down with buttons for "add", "delete" and "rename". After selecting + the configuration, the tabbed area below allows the user to change the configuration for this simulation. + * Allow simulation of stages without a motor. Users in the past have attempted to simulate separate recovery of payload + and booster by tricking OpenRocket using a dummy motor with trivial thrust curve. Now the user does not need to do this. + There is an example of this provided in TARC Payloader.ork and Boosted Dart.ork + * Simulate recovery of boosters. The simulation engine will create new FlightDataBranches for each stage after + separation. The data for the boosters begins at t=separation. The simulation plot allows the user to select + which stage's data to show (or all). + * Modified the zoom and pan controls in the simulation plot. Added zoom in, out, and reset buttons. Added + scroll with mouse wheel. If the alt key is used with either of these, only the domain is zoomed. Richard + contributed a more logical mouse controlled zoom - right click and drag will zoom (either domain, range or both). + + OpenRocket 12.09.1 (2012-06-28): -------------------------------- From d2822b5fc6717bdcf6afe19055d2e35b10203516 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Sun, 28 Apr 2013 18:15:38 -0500 Subject: [PATCH 3/3] Added two localization keys - appearance tab, and rocket panel, view type. --- core/resources/l10n/messages.properties | 3 ++- .../gui/configdialog/RocketComponentConfig.java | 10 +++++----- .../net/sf/openrocket/gui/scalefigure/RocketPanel.java | 4 +--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index f561dd63f..ee56cba34 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -54,7 +54,7 @@ RocketPanel.FigTypeAct.Unfinished = 3D Unfinished RocketPanel.lbl.Flightcfg = Flight configuration: RocketPanel.but.FlightcfgEdit = Edit RocketPanel.lbl.infoMessage = Click to select    Shift+click to select other    Double-click to edit    Click+drag to move - +RocketPanel.lbl.ViewType = View Type: ! BasicFrame BasicFrame.tab.Rocketdesign = Rocket design @@ -766,6 +766,7 @@ RocketCompCfg.tab.Figure = Figure RocketCompCfg.tab.Figstyleopt = Figure style options RocketCompCfg.tab.Comment = Comment RocketCompCfg.tab.Specifyacomment = Specify a comment for the component +RocketCompCfg.tab.Appearance = Appearance RocketCompCfg.lbl.Mass = Mass: RocketCompCfg.lbl.Componentmass = Component mass: RocketCompCfg.lbl.overriddento = (overridden to diff --git a/core/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java b/core/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java index 2e8a2a59d..02b59f507 100644 --- a/core/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java +++ b/core/src/net/sf/openrocket/gui/configdialog/RocketComponentConfig.java @@ -64,7 +64,7 @@ public class RocketComponentConfig extends JPanel { protected final JTextField componentNameField; protected JTextArea commentTextArea; private final TextFieldListener textFieldListener; - + private JPanel buttonPanel; private JLabel infoLabel; @@ -106,10 +106,10 @@ public class RocketComponentConfig extends JPanel { tabbedPane.addTab(trans.get("RocketCompCfg.tab.Override"), null, overrideTab(), trans.get("RocketCompCfg.tab.MassandCGoverride")); if (component.isMassive()) - - //// Appearance options - tabbedPane.addTab("Appearance", null, new AppearancePanel(document,component), - "Appearance Tool Tip"); + + //// Appearance options + tabbedPane.addTab(trans.get("RocketCompCfg.tab.Appearance"), null, new AppearancePanel(document, component), + "Appearance Tool Tip"); //// Comment and Specify a comment for the component tabbedPane.addTab(trans.get("RocketCompCfg.tab.Comment"), null, commentTab(), diff --git a/core/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java b/core/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java index e5ff449b9..f3326d7e1 100644 --- a/core/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java +++ b/core/src/net/sf/openrocket/gui/scalefigure/RocketPanel.java @@ -301,7 +301,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change } } }; - add(new JLabel("View Type:"), "spanx, split"); + add(new JLabel(trans.get("RocketPanel.lbl.ViewType")), "spanx, split"); add(new JComboBox(cm)); @@ -368,8 +368,6 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change addExtras(); } - - public RocketFigure getFigure() { return figure; }