diff --git a/.travis.yml b/.travis.yml index a8fef4513..896490ce5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,6 @@ addons: packages: - ant-optional jdk: - - openjdk7 + - openjdk8 script: - "ant -buildfile build.xml clean check jar unittest" diff --git a/core/.settings/org.eclipse.jdt.core.prefs b/core/.settings/org.eclipse.jdt.core.prefs index 7008edd88..7fb07d275 100644 --- a/core/.settings/org.eclipse.jdt.core.prefs +++ b/core/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -71,7 +71,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 diff --git a/core/build.xml b/core/build.xml index f04b037eb..27a1b4ecc 100644 --- a/core/build.xml +++ b/core/build.xml @@ -55,7 +55,7 @@ Compiling main classes - + diff --git a/core/resources/l10n/messages.properties b/core/resources/l10n/messages.properties index b3fe35573..23ec515b3 100644 --- a/core/resources/l10n/messages.properties +++ b/core/resources/l10n/messages.properties @@ -37,7 +37,6 @@ RocketActions.EditAct.Edit = Edit RocketActions.EditAct.ttip.Edit = Edit the selected component. RocketActions.NewStageAct.Newstage = New stage RocketActions.NewStageAct.ttip.Newstage = Add a new stage to the rocket design. -RocketActions.ActBoosterstage = Booster stage RocketActions.MoveUpAct.Moveup = Move up RocketActions.MoveUpAct.ttip.Moveup = Move this component upwards. RocketActions.MoveDownAct.Movedown = Move down @@ -335,7 +334,7 @@ generalprefs.lbl.languageEffect = The language will change the next time you sta ! Simulation edit dialog simedtdlg.but.runsimulation = Run simulation simedtdlg.but.resettodefault = Reset to default -simedtdlg.but.savedefault = Save as default +simedtdlg.but.savedefault = Save as default simedtdlg.but.add = Add simedtdlg.but.remove = Remove simedtdlg.title.Editsim = Edit simulation @@ -823,9 +822,6 @@ RocketCfg.lbl.Comments = Comments: RocketCfg.lbl.Revisionhistory = Revision history: RocketCfg.lbl.Material = Material: -! ShockCordConfig -ShockCordCfg.lbl.Shockcordlength = Shock cord length: - ! RocketComponentConfig RocketCompCfg.lbl.Componentname = Component name: RocketCompCfg.ttip.Thecomponentname = The component name. @@ -1037,13 +1033,11 @@ NoseConeCfg.tab.ttip.Shoulder = Shoulder properties ! ParachuteConfig ParachuteCfg.lbl.Canopy = Canopy: ParachuteCfg.lbl.Diameter = Diameter: -ParachuteCfg.lbl.Material = Material: ParachuteCfg.combo.MaterialModel = The component material affects the weight of the component. ParachuteCfg.lbl.longA1 = Drag coefficient CD: ParachuteCfg.lbl.longB1 = The drag coefficient relative to the total area of the parachute.
ParachuteCfg.lbl.longB2 = A larger drag coefficient yields a slowed descent rate. ParachuteCfg.lbl.longB3 = A typical value for parachutes is 0.8. -ParachuteCfg.but.Reset = Reset ParachuteCfg.lbl.Shroudlines = Shroud lines: ParachuteCfg.lbl.Numberoflines = Number of lines: ParachuteCfg.lbl.Linelength = Line length: @@ -1571,7 +1565,7 @@ FlightEvent.Type.GROUND_HIT = Ground hit FlightEvent.Type.SIMULATION_END = Simulation end FlightEvent.Type.ALTITUDE = Altitude change FlightEvent.Type.TUMBLE = Tumbling -FlightEvent.Type.EXCEPTION = Exception +FlightEvent.Type.EXCEPTION = Exception ! ThrustCurveMotorColumns TCurveMotorCol.MANUFACTURER = Manufacturer diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 651e24296..b1a394e31 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -463,10 +463,11 @@ public class FlightConfiguration implements FlightConfigurableParameter Compiling main classes - + diff --git a/swing/resources/datafiles/presets/system.ser b/swing/resources/datafiles/presets/system.ser index 5342b5a8d..33648114c 100644 Binary files a/swing/resources/datafiles/presets/system.ser and b/swing/resources/datafiles/presets/system.ser differ diff --git a/swing/src/net/sf/openrocket/gui/dialogs/DebugLogDialog.java b/swing/src/net/sf/openrocket/gui/dialogs/DebugLogDialog.java index a6863e369..6ee7a95bc 100644 --- a/swing/src/net/sf/openrocket/gui/dialogs/DebugLogDialog.java +++ b/swing/src/net/sf/openrocket/gui/dialogs/DebugLogDialog.java @@ -169,13 +169,7 @@ public class DebugLogDialog extends JDialog { @Override public void actionPerformed(ActionEvent e) { boolean isActive = ((JCheckBox)e.getSource()).isSelected(); - log.info(" toggled to: "+isActive ); - bottomPanel.setEnabled(isActive); - if(isActive) { - split.setDividerLocation(0.5); - }else { - split.setDividerLocation(1.0); - } + enableDetailsPanel( isActive); } }); @@ -460,6 +454,17 @@ public class DebugLogDialog extends JDialog { } } } + + private void enableDetailsPanel(final boolean isActive){ + bottomPanel.setEnabled(isActive); + if(isActive){ + split.setDividerLocation(0.5); + split.setBottomComponent(bottomPanel); + }else { + split.setBottomComponent(null); + split.setDividerLocation(1.0); + } + } /** diff --git a/swing/src/net/sf/openrocket/gui/main/RocketActions.java b/swing/src/net/sf/openrocket/gui/main/RocketActions.java index baeab86b1..828c8ceae 100644 --- a/swing/src/net/sf/openrocket/gui/main/RocketActions.java +++ b/swing/src/net/sf/openrocket/gui/main/RocketActions.java @@ -619,8 +619,7 @@ public class RocketActions { ComponentConfigDialog.hideDialog(); RocketComponent stage = new AxialStage(); - //// Booster stage - stage.setName(trans.get("RocketActions.ActBoosterstage")); + //// Add stage document.addUndoPosition("Add stage"); rocket.addChild(stage); diff --git a/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java b/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java index 42cf6de1f..f5cb45ed3 100644 --- a/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java +++ b/swing/src/net/sf/openrocket/gui/main/flightconfigpanel/FlightConfigurationPanel.java @@ -64,6 +64,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe //// Motor tabs motorConfigurationPanel = new MotorConfigurationPanel(this, rocket); tabs.add(trans.get("edtmotorconfdlg.lbl.Motortab"), motorConfigurationPanel); + //// Recovery tab recoveryConfigurationPanel = new RecoveryConfigurationPanel(this, rocket); tabs.add(trans.get("edtmotorconfdlg.lbl.Recoverytab"), recoveryConfigurationPanel); @@ -76,7 +77,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe newConfButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - addConfiguration(); + addOrCopyConfiguration(false); configurationChanged(); } @@ -108,7 +109,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe copyConfButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - copyConfiguration(); + addOrCopyConfiguration(true); configurationChanged(); } }); @@ -118,37 +119,46 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe this.add(tabs, "spanx, grow, wrap rel"); } - - private void addConfiguration() { - FlightConfigurationId newId = new FlightConfigurationId(); - FlightConfiguration newConfig = new FlightConfiguration( rocket, newId ); - rocket.setFlightConfiguration( newId, newConfig); - // Create a new simulation for this configuration. - createSimulationForNewConfiguration( newId ); - - configurationChanged(); - } - - private void copyConfiguration() { - FlightConfigurationId oldId = this.motorConfigurationPanel.getSelectedConfigurationId(); - FlightConfiguration oldConfig = rocket.getFlightConfiguration(oldId); + /** + * either create or copy configuration + * set new configuration as current + * create simulation for new configuration + */ + private void addOrCopyConfiguration(boolean copy) { + FlightConfiguration newConfig; + FlightConfigurationId newId; - FlightConfigurationId newId = new FlightConfigurationId(); - FlightConfiguration newConfig = oldConfig.copy( newId); + // create or copy configuration + if (copy) { + FlightConfigurationId oldId = this.motorConfigurationPanel.getSelectedConfigurationId(); + FlightConfiguration oldConfig = rocket.getFlightConfiguration(oldId); - for (RocketComponent c : rocket) { - if (c instanceof FlightConfigurableComponent) { - ((FlightConfigurableComponent) c).copyFlightConfiguration(oldId, newId); + newConfig = oldConfig.copy(null); + newId = newConfig.getId(); + + for (RocketComponent c : rocket) { + if (c instanceof FlightConfigurableComponent) { + ((FlightConfigurableComponent) c).copyFlightConfiguration(oldId, newId); + } } + } else { + newConfig = new FlightConfiguration(rocket, null); + newId = newConfig.getId(); } - rocket.setFlightConfiguration( newId, newConfig); + // associate configuration with Id and select it + rocket.setFlightConfiguration(newId, newConfig); + rocket.setSelectedConfiguration(newId); - // Create a new simulation for this configuration. - createSimulationForNewConfiguration( newId); + // create simulation for configuration + Simulation newSim = new Simulation(rocket); - configurationChanged(); + OpenRocketDocument doc = BasicFrame.findDocument(rocket); + if (doc != null) { + newSim.setName(doc.getNextSimulationName()); + doc.addSimulation(newSim); + } } private void renameConfiguration() { @@ -164,18 +174,6 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe configurationChanged(); } - /** - * prereq - assumes that the new configuration has been set as the default configuration. - */ - private void createSimulationForNewConfiguration( final FlightConfigurationId fcid ) { - Simulation newSim = new Simulation(rocket); - OpenRocketDocument doc = BasicFrame.findDocument(rocket); - if (doc != null) { - newSim.setName(doc.getNextSimulationName()); - doc.addSimulation(newSim); - } - } - private void configurationChanged() { motorConfigurationPanel.fireTableDataChanged(); recoveryConfigurationPanel.fireTableDataChanged();