diff --git a/core/resources/datafiles/thrustcurves/thrustcurves.ser b/core/resources/datafiles/thrustcurves/thrustcurves.ser index 6509ed02d..7be885d29 100644 Binary files a/core/resources/datafiles/thrustcurves/thrustcurves.ser and b/core/resources/datafiles/thrustcurves/thrustcurves.ser differ diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index 9e4a2782b..117978079 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -96,6 +96,7 @@ FileHelper.ALL_DESIGNS_FILTER = All rocket designs (*.ork; *.rkt) FileHelper.OPENROCKET_DESIGN_FILTER = OpenRocket designs (*.ork) FileHelper.ROCKSIM_DESIGN_FILTER = RockSim designs (*.rkt) FileHelper.OPEN_ROCKET_COMPONENT_FILTER = OpenRocket presets (*.orc) +FileHelper.PNG_FILTER = PNG image (*.png) FileHelper.IMAGES = Image files @@ -1273,6 +1274,7 @@ TCMotorSelPan.btn.close = Close ! PlotDialog PlotDialog.CheckBox.Showdatapoints = Show data points PlotDialog.lbl.Chart = left click drag to zoom area. mouse wheel to zoom. ctrl-mouse wheel to zoom x axis only. ctrl-left click drag to pan. right click drag to zoom dynamically. +PlotDialog.btn.exportImage = Export Image ComponentTree.ttip.massoverride = mass override ComponentTree.ttip.cgoverride = cg override diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 70f645ab1..8e65f29c7 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -64,6 +64,7 @@ public class FlightConfiguration implements FlightConfigurableParameter stages = new HashMap(); final protected HashMap motors = new HashMap(); final private Collection activeMotors = new ArrayList(); + final private InstanceMap activeInstances = new InstanceMap(); private int boundsModID = -1; private BoundingBox cachedBounds = new BoundingBox(); @@ -101,6 +102,7 @@ public class FlightConfiguration implements FlightConfigurableParameter instanceCoordinates = component.getComponentBounds(); for (InstanceContext context : contexts) { - /* - * If the instance is not active in the current context, then - * skip the bound calculations. This is mildly confusing since - * getActiveInstances() implies that it will only return the - * instances that are active, but it returns all instances and - * the context indicates if it is active or not. - */ - if (!context.active) { - continue; - } - Collection transformedCoords = new ArrayList<>(instanceCoordinates); // mutating. Transforms coordinates in place. context.transform.transform(instanceCoordinates); diff --git a/core/src/net/sf/openrocket/rocketcomponent/FreeformFinSet.java b/core/src/net/sf/openrocket/rocketcomponent/FreeformFinSet.java index 284f70550..b0fe74cea 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FreeformFinSet.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FreeformFinSet.java @@ -296,7 +296,8 @@ public class FreeformFinSet extends FinSet { if (c.y > max) max = c.y; } - return max; + + return max - Math.min(points.get(points.size() - 1).y, 0); } @Override diff --git a/core/src/net/sf/openrocket/rocketcomponent/InstanceContext.java b/core/src/net/sf/openrocket/rocketcomponent/InstanceContext.java index 2e7da00f9..e781182c8 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/InstanceContext.java +++ b/core/src/net/sf/openrocket/rocketcomponent/InstanceContext.java @@ -26,9 +26,8 @@ public class InstanceContext { return component.hashCode(); } - public InstanceContext(final RocketComponent _component, final boolean _active, final int _instanceNumber, final Transformation _transform) { + public InstanceContext(final RocketComponent _component, final int _instanceNumber, final Transformation _transform) { component = _component; - active = _active; instanceNumber = _instanceNumber; transform = _transform; @@ -48,7 +47,6 @@ public class InstanceContext { // ==== public ==== final public RocketComponent component; - final public boolean active; final public int instanceNumber; final public Transformation transform; diff --git a/core/src/net/sf/openrocket/rocketcomponent/InstanceMap.java b/core/src/net/sf/openrocket/rocketcomponent/InstanceMap.java index 36cc79e8a..1538e69aa 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/InstanceMap.java +++ b/core/src/net/sf/openrocket/rocketcomponent/InstanceMap.java @@ -34,7 +34,7 @@ public class InstanceMap extends HashMap()); } - final InstanceContext context = new InstanceContext(component, active, number, xform); + final InstanceContext context = new InstanceContext(component, number, xform); get(key).add(context); } diff --git a/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java index 31ee0c893..d7ef82824 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/StageSeparationConfiguration.java @@ -98,7 +98,7 @@ public class StageSeparationConfiguration implements FlightConfigurableParameter private static final Translator trans = Application.getTranslator(); - private SeparationEvent separationEvent = SeparationEvent.UPPER_IGNITION; + private SeparationEvent separationEvent = SeparationEvent.EJECTION; private double separationDelay = 0; private final List configListeners = new LinkedList<>(); diff --git a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java index e128cae5f..69fdf3d3d 100644 --- a/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java +++ b/core/src/net/sf/openrocket/simulation/BasicEventSimulationEngine.java @@ -425,24 +425,28 @@ public class BasicEventSimulationEngine implements SimulationEngine { } case STAGE_SEPARATION: { - // Record the event. - currentStatus.getFlightData().addEvent(event); - RocketComponent boosterStage = event.getSource(); final int stageNumber = boosterStage.getStageNumber(); - - // Mark the status as having dropped the booster - currentStatus.getConfiguration().clearStage( stageNumber); - - // Prepare the simulation branch - SimulationStatus boosterStatus = new SimulationStatus(currentStatus); - boosterStatus.setFlightData(new FlightDataBranch(boosterStage.getName(), FlightDataType.TYPE_TIME)); - // Mark the booster status as only having the booster. - boosterStatus.getConfiguration().setOnlyStage(stageNumber); - toSimulate.push(boosterStatus); - log.info(String.format("==>> @ %g; from Branch: %s ---- Branching: %s ---- \n", - currentStatus.getSimulationTime(), - currentStatus.getFlightData().getBranchName(), boosterStatus.getFlightData().getBranchName())); + + if (currentStatus.getConfiguration().isStageActive(stageNumber-1)) { + // Record the event. + currentStatus.getFlightData().addEvent(event); + + // Mark the status as having dropped the booster + currentStatus.getConfiguration().clearStage( stageNumber); + + // Prepare the simulation branch + SimulationStatus boosterStatus = new SimulationStatus(currentStatus); + boosterStatus.setFlightData(new FlightDataBranch(boosterStage.getName(), FlightDataType.TYPE_TIME)); + // Mark the booster status as only having the booster. + boosterStatus.getConfiguration().setOnlyStage(stageNumber); + toSimulate.push(boosterStatus); + log.info(String.format("==>> @ %g; from Branch: %s ---- Branching: %s ---- \n", + currentStatus.getSimulationTime(), + currentStatus.getFlightData().getBranchName(), boosterStatus.getFlightData().getBranchName())); + } else { + log.debug("upper stage is not active; not performing separation"); + } break; } diff --git a/core/src/net/sf/openrocket/util/TestRockets.java b/core/src/net/sf/openrocket/util/TestRockets.java index cf61a013a..632b36a63 100644 --- a/core/src/net/sf/openrocket/util/TestRockets.java +++ b/core/src/net/sf/openrocket/util/TestRockets.java @@ -66,7 +66,6 @@ import net.sf.openrocket.simulation.listeners.SimulationListener; import net.sf.openrocket.startup.Application; public class TestRockets { - public final static FlightConfigurationId TEST_FCID_0 = new FlightConfigurationId("d010716e-ce0e-469d-ae46-190f3653ebbf"); public final static FlightConfigurationId TEST_FCID_1 = new FlightConfigurationId("f41bee5b-ebb8-4d92-bce7-53001577a313"); public final static FlightConfigurationId TEST_FCID_2 = new FlightConfigurationId("3e8d1280-53c2-4234-89a7-de215ef5cd69"); @@ -1705,30 +1704,32 @@ public class TestRockets { // find the body and fins final InstanceMap imap = rocket.getSelectedConfiguration().getActiveInstances(); - for(Map.Entry> entry: imap.entrySet() ) { - RocketComponent c = entry.getKey(); + RocketComponent c = null; + for(Map.Entry> entry: imap.entrySet() ) { + c = entry.getKey(); if (c instanceof TrapezoidFinSet) { - final TrapezoidFinSet fins = (TrapezoidFinSet) c; - final BodyTube body = (BodyTube) fins.getParent(); - body.removeChild(fins); - - // create a PodSet to hook the fins to - PodSet podset = new PodSet(); - podset.setInstanceCount(fins.getFinCount()); - - body.addChild(podset); - - // put a phantom body tube on the pods - BodyTube podBody = new BodyTube(fins.getRootChord(), 0); - podBody.setName("Pod Body"); - podset.addChild(podBody); - - // change the number of fins to 1 and put the revised - // finset on the podbody - fins.setFinCount(1); - podBody.addChild(fins); + break; } } + final TrapezoidFinSet fins = (TrapezoidFinSet) c; + final BodyTube body = (BodyTube) fins.getParent(); + body.removeChild(fins); + + // create a PodSet to hook the fins to + PodSet podset = new PodSet(); + podset.setInstanceCount(fins.getFinCount()); + + body.addChild(podset); + + // put a phantom body tube on the pods + BodyTube podBody = new BodyTube(fins.getRootChord(), 0); + podBody.setName("Pod Body"); + podset.addChild(podBody); + + // change the number of fins to 1 and put the revised + // finset on the podbody + fins.setFinCount(1); + podBody.addChild(fins); return rocket; } diff --git a/swing/resources-src/datafiles/components b/swing/resources-src/datafiles/components index 52e1e2c08..8304c0fd3 160000 --- a/swing/resources-src/datafiles/components +++ b/swing/resources-src/datafiles/components @@ -1 +1 @@ -Subproject commit 52e1e2c0800ebf62fd0e9cecd69aaaed6cddf80e +Subproject commit 8304c0fd3dc80d65c40af4da83268ec1b32931d6 diff --git a/swing/src/net/sf/openrocket/gui/adaptors/TransitionShapeModel.java b/swing/src/net/sf/openrocket/gui/adaptors/TransitionShapeModel.java new file mode 100644 index 000000000..51b02201e --- /dev/null +++ b/swing/src/net/sf/openrocket/gui/adaptors/TransitionShapeModel.java @@ -0,0 +1,64 @@ +package net.sf.openrocket.gui.adaptors; + +import net.sf.openrocket.rocketcomponent.ComponentChangeEvent; +import net.sf.openrocket.rocketcomponent.ComponentChangeListener; +import net.sf.openrocket.rocketcomponent.RocketComponent; +import net.sf.openrocket.rocketcomponent.Transition; + +import javax.swing.AbstractListModel; +import javax.swing.ComboBoxModel; + +public class TransitionShapeModel extends AbstractListModel + implements ComboBoxModel, ComponentChangeListener { + private final RocketComponent component; + private final Transition.Shape[] typeList = Transition.Shape.values(); + private Transition.Shape previousType; + + public TransitionShapeModel(RocketComponent component) { + this.component = component; + if (component instanceof Transition) { + previousType = ((Transition) component).getType(); + setSelectedItem(previousType); + component.addComponentChangeListener(this); + } + } + + @Override + public void setSelectedItem(Object item) { + if (!(component instanceof Transition) || !(item instanceof Transition.Shape)) { + return; + } + + ((Transition) component).setType((Transition.Shape) item); + } + + @Override + public Object getSelectedItem() { + if (component instanceof Transition) { + return ((Transition) component).getType(); + } + return null; + } + + @Override + public int getSize() { + return typeList.length; + } + + @Override + public Transition.Shape getElementAt(int index) { + return typeList[index]; + } + + @Override + public void componentChanged(ComponentChangeEvent e) { + if (!(component instanceof Transition)) { + return; + } + + if (previousType != ((Transition) component).getType()) { + previousType = ((Transition) component).getType(); + fireContentsChanged(this, 0, 0); + } + } +} diff --git a/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java index 6be83867e..d7c2975cb 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/NoseConeConfig.java @@ -16,6 +16,7 @@ import net.sf.openrocket.document.OpenRocketDocument; import net.sf.openrocket.gui.SpinnerEditor; import net.sf.openrocket.gui.adaptors.BooleanModel; import net.sf.openrocket.gui.adaptors.DoubleModel; +import net.sf.openrocket.gui.adaptors.TransitionShapeModel; import net.sf.openrocket.gui.components.BasicSlider; import net.sf.openrocket.gui.components.DescriptionArea; import net.sf.openrocket.gui.components.UnitSelector; @@ -52,18 +53,15 @@ public class NoseConeConfig extends RocketComponentConfig { {//// Nose cone shape: panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Noseconeshape"))); - Transition.Shape selected = ((NoseCone) component).getType(); - Transition.Shape[] typeList = Transition.Shape.values(); - - final JComboBox typeBox = new JComboBox(typeList); + final JComboBox typeBox = new JComboBox<>(new TransitionShapeModel(c)); typeBox.setEditable(false); - typeBox.setSelectedItem(selected); typeBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Transition.Shape s = (Transition.Shape) typeBox.getSelectedItem(); - ((NoseCone) component).setType(s); - description.setText(PREDESC + s.getNoseConeDescription()); + if (s != null) { + description.setText(PREDESC + s.getNoseConeDescription()); + } updateEnabled(); } }); diff --git a/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java b/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java index d41945b5c..35a44bcdf 100644 --- a/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java +++ b/swing/src/net/sf/openrocket/gui/configdialog/TransitionConfig.java @@ -15,6 +15,7 @@ import net.sf.openrocket.document.OpenRocketDocument; import net.sf.openrocket.gui.SpinnerEditor; import net.sf.openrocket.gui.adaptors.BooleanModel; import net.sf.openrocket.gui.adaptors.DoubleModel; +import net.sf.openrocket.gui.adaptors.TransitionShapeModel; import net.sf.openrocket.gui.components.BasicSlider; import net.sf.openrocket.gui.components.DescriptionArea; import net.sf.openrocket.gui.components.UnitSelector; @@ -54,18 +55,15 @@ public class TransitionConfig extends RocketComponentConfig { //// Transition shape: panel.add(new JLabel(trans.get("TransitionCfg.lbl.Transitionshape"))); - Transition.Shape selected = ((Transition) component).getType(); - Transition.Shape[] typeList = Transition.Shape.values(); - - typeBox = new JComboBox(typeList); + typeBox = new JComboBox<>(new TransitionShapeModel(c)); typeBox.setEditable(false); - typeBox.setSelectedItem(selected); typeBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { Transition.Shape s = (Transition.Shape) typeBox.getSelectedItem(); - ((Transition) component).setType(s); - description.setText(PREDESC + s.getTransitionDescription()); + if (s != null) { + description.setText(PREDESC + s.getTransitionDescription()); + } updateEnabled(); } }); diff --git a/swing/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java b/swing/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java index c6aef258e..d144ef2c5 100644 --- a/swing/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java +++ b/swing/src/net/sf/openrocket/gui/figure3d/RocketRenderer.java @@ -85,21 +85,19 @@ public abstract class RocketRenderer { if (ignore != null && ignore.contains(comp)) continue; - if( geom.active ) { - final int hashCode = comp.hashCode(); - - selectionMap.put(hashCode, comp); - - gl.glColor4ub((byte) ((hashCode >> 24) & 0xFF), // red channel (LSB) - (byte) ((hashCode >> 16) & 0xFF), // green channel - (byte) ((hashCode >> 8) & 0xFF), // blue channel - (byte) ((hashCode) & 0xFF)); // alpha channel (MSB) - - if (isDrawnTransparent(comp)) { - geom.render(gl, Surface.INSIDE); - } else { - geom.render(gl, Surface.ALL); - } + final int hashCode = comp.hashCode(); + + selectionMap.put(hashCode, comp); + + gl.glColor4ub((byte) ((hashCode >> 24) & 0xFF), // red channel (LSB) + (byte) ((hashCode >> 16) & 0xFF), // green channel + (byte) ((hashCode >> 8) & 0xFF), // blue channel + (byte) ((hashCode) & 0xFF)); // alpha channel (MSB) + + if (isDrawnTransparent(comp)) { + geom.render(gl, Surface.INSIDE); + } else { + geom.render(gl, Surface.ALL); } } @@ -186,7 +184,6 @@ public abstract class RocketRenderer { for(InstanceContext context: contextList ) { Geometry instanceGeometry = cr.getComponentGeometry( comp, context.transform ); - instanceGeometry.active = context.active; treeGeometry.add( instanceGeometry ); } } @@ -196,19 +193,15 @@ public abstract class RocketRenderer { private void renderTree( GL2 gl, final Collection geometryList){ //cycle through opaque components first, then transparent to preserve proper depth testing for(Geometry geom: geometryList ) { - if( geom.active ) { - //if not transparent - if( !isDrawnTransparent( (RocketComponent)geom.obj) ){ - renderComponent(gl, geom, 1.0f); - } + //if not transparent + if( !isDrawnTransparent( (RocketComponent)geom.obj) ){ + renderComponent(gl, geom, 1.0f); } } for(Geometry geom: geometryList ) { - if( geom.active ) { - if( isDrawnTransparent( (RocketComponent)geom.obj) ){ - // Draw T&T front faces blended, without depth test - renderComponent(gl, geom, 0.2f); - } + if( isDrawnTransparent( (RocketComponent)geom.obj) ){ + // Draw T&T front faces blended, without depth test + renderComponent(gl, geom, 0.2f); } } } diff --git a/swing/src/net/sf/openrocket/gui/figure3d/geometry/Geometry.java b/swing/src/net/sf/openrocket/gui/figure3d/geometry/Geometry.java index 4c4b9df62..41554e575 100644 --- a/swing/src/net/sf/openrocket/gui/figure3d/geometry/Geometry.java +++ b/swing/src/net/sf/openrocket/gui/figure3d/geometry/Geometry.java @@ -25,8 +25,6 @@ public abstract class Geometry { public final Object obj; public final Transformation transform; - public boolean active; - public abstract void render(GL2 gl, Surface which ); private Geometry() { diff --git a/swing/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java b/swing/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java index d2d322a8b..ffcaec72f 100644 --- a/swing/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java +++ b/swing/src/net/sf/openrocket/gui/plot/SimulationPlotDialog.java @@ -3,29 +3,37 @@ package net.sf.openrocket.gui.plot; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.ComponentAdapter; +import java.awt.event.ComponentEvent; import java.awt.event.InputEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.io.File; import java.util.ArrayList; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JDialog; +import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JPanel; import net.miginfocom.swing.MigLayout; import net.sf.openrocket.document.Simulation; import net.sf.openrocket.gui.components.StyledLabel; +import net.sf.openrocket.gui.util.FileHelper; import net.sf.openrocket.gui.util.GUIUtil; import net.sf.openrocket.gui.util.Icons; +import net.sf.openrocket.gui.util.SwingPreferences; import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Preferences; import net.sf.openrocket.gui.widgets.SelectColorButton; import org.jfree.chart.ChartPanel; +import org.jfree.chart.ChartUtilities; +import org.jfree.chart.JFreeChart; /** * Dialog that shows a plot of a simulation results based on user options. @@ -50,7 +58,14 @@ public class SimulationPlotDialog extends JDialog { this.add(panel); final ChartPanel chartPanel = new SimulationChart(myPlot.getJFreeChart()); + final JFreeChart jChart = myPlot.getJFreeChart(); panel.add(chartPanel, "grow, wrap 20lp"); + + // Ensures normal aspect-ratio of chart elements when resizing the panel + chartPanel.setMinimumDrawWidth(0); + chartPanel.setMaximumDrawWidth(Integer.MAX_VALUE); + chartPanel.setMinimumDrawHeight(0); + chartPanel.setMaximumDrawHeight(Integer.MAX_VALUE); //// Description text JLabel label = new StyledLabel(trans.get("PlotDialog.lbl.Chart"), -2); @@ -108,6 +123,16 @@ public class SimulationPlotDialog extends JDialog { } }); panel.add(button, "gapleft rel"); + + //// Print chart button + button = new SelectColorButton(trans.get("PlotDialog.btn.exportImage")); + button.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + doPngExport(chartPanel,jChart); + } + }); + panel.add(button, "gapleft rel"); //// Add series selection box ArrayList stages = new ArrayList(); @@ -141,16 +166,43 @@ public class SimulationPlotDialog extends JDialog { } }); panel.add(button, "right"); - this.setLocationByPlatform(true); this.pack(); GUIUtil.setDisposableDialogOptions(this, button); GUIUtil.rememberWindowSize(this); } - - - + + private boolean doPngExport(ChartPanel chartPanel, JFreeChart chart){ + JFileChooser chooser = new JFileChooser(); + chooser.setAcceptAllFileFilterUsed(false); + chooser.setFileFilter(FileHelper.PNG_FILTER); + chooser.setCurrentDirectory(((SwingPreferences) Application.getPreferences()).getDefaultDirectory()); + + //// Ensures No Problems When Choosing File + if (chooser.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) + return false; + + File file = chooser.getSelectedFile(); + if (file == null) + return false; + + file = FileHelper.forceExtension(file, "png"); + if (!FileHelper.confirmWrite(file, this)) { + return false; + } + + //// Uses JFreeChart Built In PNG Export Method + try{ + ChartUtilities.saveChartAsPNG(file, chart, chartPanel.getWidth(), chartPanel.getHeight()); + } catch(Exception e){ + return false; + } + + return true; + } + + /** * Static method that shows a plot with the specified parameters. * diff --git a/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java b/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java index ab3330a0b..5275d8ad0 100644 --- a/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java +++ b/swing/src/net/sf/openrocket/gui/scalefigure/RocketFigure.java @@ -378,11 +378,7 @@ public class RocketFigure extends AbstractScaleFigure { for(InstanceContext context: contextList ) { final Transformation currentTransform = this.axialRotation.applyTransformation(context.transform); - - // generate shape for this component, if active - if( context.active ) { - allShapes = addThisShape( allShapes, this.currentViewType, comp, currentTransform); - } + allShapes = addThisShape( allShapes, this.currentViewType, comp, currentTransform); } } } diff --git a/swing/src/net/sf/openrocket/gui/util/FileHelper.java b/swing/src/net/sf/openrocket/gui/util/FileHelper.java index c88b99a58..96d8234f4 100644 --- a/swing/src/net/sf/openrocket/gui/util/FileHelper.java +++ b/swing/src/net/sf/openrocket/gui/util/FileHelper.java @@ -56,6 +56,10 @@ public final class FileHelper { public static final FileFilter CSV_FILTER = new SimpleFileFilter(trans.get("FileHelper.CSV_FILTER"), ".csv"); + /** File filter for PNG files (*.png) */ + public static final FileFilter PNG_FILTER = + new SimpleFileFilter(trans.get("FileHelper.PNG_FILTER"), ".png"); +