diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index 30d1c6259..c935ef6c8 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -2034,6 +2034,7 @@ PhotoFrame.fileFilter.png = PNG Image PhotoFrame.menu.edit.copy = Copy Image PhotoFrame.menu.edit.copy.desc = Copy image to clipboard PhotoFrame.menu.edit.settings = Photo Settings +PhotoFrame.menu.edit.unk = Unknown Setting PhotoFrame.menu.window = Window PhotoFrame.menu.window.size = Size PhotoFrame.menu.window.size.portrait = {0} Portrait diff --git a/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java b/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java index e6bba6cda..7cc1caacd 100644 --- a/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java +++ b/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoFrame.java @@ -206,7 +206,7 @@ public class PhotoFrame extends JFrame { menu = new JMenu(trans.get("main.menu.edit")); menu.setMnemonic(KeyEvent.VK_E); // // Rocket editing - menu.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.menu.Rocketedt")); + menu.getAccessibleContext().setAccessibleDescription(trans.get("PhotoFrame.menu.edit.unk")); menubar.add(menu); Action action = new AbstractAction(trans.get("PhotoFrame.menu.edit.copy")) { diff --git a/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoPanel.java b/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoPanel.java index 039ce8004..c4dbdea91 100644 --- a/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoPanel.java +++ b/swing/src/net/sf/openrocket/gui/figure3d/photo/PhotoPanel.java @@ -45,6 +45,7 @@ import net.sf.openrocket.gui.figure3d.TextureCache; import net.sf.openrocket.gui.figure3d.photo.exhaust.FlameRenderer; import net.sf.openrocket.gui.main.Splash; import net.sf.openrocket.motor.Motor; +import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfigurationId; import net.sf.openrocket.rocketcomponent.MotorMount; @@ -95,16 +96,6 @@ public class PhotoPanel extends JPanel implements GLEventListener { rr = new RealisticRenderer(doc); rr.init(drawable); - doc.getDefaultConfiguration().addChangeListener( - new StateChangeListener() { - @Override - public void stateChanged(EventObject e) { - log.debug("Repainting on config state change"); - needUpdate = true; - PhotoPanel.this.repaint(); - } - }); - doc.addDocumentChangeListener(new DocumentChangeListener() { @Override public void documentChanged(DocumentChangeEvent event) { @@ -422,33 +413,31 @@ public class PhotoPanel extends JPanel implements GLEventListener { final FlightConfigurationId motorID = configuration.getFlightConfigurationID(); - final Iterator iter = configuration.getActiveComponents().iterator(); + + final Iterator iter = configuration.getActiveMotors().iterator(); while( iter.hasNext()){ - RocketComponent comp = iter.next(); - if( comp instanceof MotorMount){ - - final MotorMount mount = (MotorMount) comp; - int curStageNumber = comp.getStageNumber(); + MotorConfiguration curConfig = iter.next(); + final MotorMount mount = curConfig.getMount(); + int curStageNumber = ((RocketComponent)mount).getStageNumber(); - //If this mount is not in currentStage continue on to the next one. - if( curStageNumber != bottomStageNumber ){ - continue; - } - - final Motor motor = mount.getMotorInstance(motorID).getMotor(); - final double length = motor.getLength(); + //If this mount is not in currentStage continue on to the next one. + if( curStageNumber != bottomStageNumber ){ + continue; + } + + final Motor motor = mount.getMotorInstance(motorID).getMotor(); + final double length = motor.getLength(); - Coordinate[] position = ((RocketComponent) mount) - .toAbsolute(new Coordinate(((RocketComponent) mount) - .getLength() + mount.getMotorOverhang() - length)); - - for (int i = 0; i < position.length; i++) { - gl.glPushMatrix(); - gl.glTranslated(position[i].x + motor.getLength(), - position[i].y, position[i].z); - FlameRenderer.drawExhaust(gl, p, motor); - gl.glPopMatrix(); - } + Coordinate[] position = ((RocketComponent) mount) + .toAbsolute(new Coordinate(((RocketComponent) mount) + .getLength() + mount.getMotorOverhang() - length)); + + for (int i = 0; i < position.length; i++) { + gl.glPushMatrix(); + gl.glTranslated(position[i].x + motor.getLength(), + position[i].y, position[i].z); + FlameRenderer.drawExhaust(gl, p, motor); + gl.glPopMatrix(); } }