fixed extra capitalization of FlightConfigurationId

This commit is contained in:
Daniel_M_Williams 2015-12-16 20:19:32 -05:00
parent c3b2316cbf
commit b6c30a59ba
57 changed files with 209 additions and 209 deletions

View File

@ -22,7 +22,7 @@ import net.sf.openrocket.logging.Markers;
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent; import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
import net.sf.openrocket.rocketcomponent.ComponentChangeListener; import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.simulation.FlightDataType; import net.sf.openrocket.simulation.FlightDataType;
@ -252,7 +252,7 @@ public class OpenRocketDocument implements ComponentChangeListener {
public void addSimulation(Simulation simulation) { public void addSimulation(Simulation simulation) {
simulations.add(simulation); simulations.add(simulation);
FlightConfigurationID simId = simulation.getId(); FlightConfigurationId simId = simulation.getId();
if( !rocket.containsFlightConfigurationID( simId )){ if( !rocket.containsFlightConfigurationID( simId )){
rocket.createFlightConfiguration(simId); rocket.createFlightConfiguration(simId);
} }
@ -275,7 +275,7 @@ public class OpenRocketDocument implements ComponentChangeListener {
return simulation; return simulation;
} }
public void removeFlightConfigurationAndSimulations(FlightConfigurationID configId) { public void removeFlightConfigurationAndSimulations(FlightConfigurationId configId) {
if (configId == null) { if (configId == null) {
return; return;
} }

View File

@ -15,7 +15,7 @@ import net.sf.openrocket.formatting.RocketDescriptor;
import net.sf.openrocket.masscalc.MassCalculator; import net.sf.openrocket.masscalc.MassCalculator;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.simulation.BasicEventSimulationEngine; import net.sf.openrocket.simulation.BasicEventSimulationEngine;
import net.sf.openrocket.simulation.DefaultSimulationOptionFactory; import net.sf.openrocket.simulation.DefaultSimulationOptionFactory;
@ -116,7 +116,7 @@ public class Simulation implements ChangeSource, Cloneable {
DefaultSimulationOptionFactory f = Application.getInjector().getInstance(DefaultSimulationOptionFactory.class); DefaultSimulationOptionFactory f = Application.getInjector().getInstance(DefaultSimulationOptionFactory.class);
options.copyConditionsFrom(f.getDefault()); options.copyConditionsFrom(f.getDefault());
FlightConfigurationID fcid = rocket.getDefaultConfiguration().getFlightConfigurationID(); FlightConfigurationId fcid = rocket.getDefaultConfiguration().getFlightConfigurationID();
options.setFlightConfigurationId(fcid); options.setFlightConfigurationId(fcid);
options.addChangeListener(new ConditionListener()); options.addChangeListener(new ConditionListener());
} }
@ -174,7 +174,7 @@ public class Simulation implements ChangeSource, Cloneable {
return rocket; return rocket;
} }
public FlightConfigurationID getId(){ public FlightConfigurationId getId(){
return this.options.getFlightConfigurationId(); return this.options.getFlightConfigurationId();
} }

View File

@ -23,7 +23,7 @@ import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
import net.sf.openrocket.rocketcomponent.FinSet; import net.sf.openrocket.rocketcomponent.FinSet;
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent; import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.ParallelStage; import net.sf.openrocket.rocketcomponent.ParallelStage;
import net.sf.openrocket.rocketcomponent.PodSet; import net.sf.openrocket.rocketcomponent.PodSet;

View File

@ -12,7 +12,7 @@ import net.sf.openrocket.file.simplesax.ElementHandler;
import net.sf.openrocket.file.simplesax.PlainTextHandler; import net.sf.openrocket.file.simplesax.PlainTextHandler;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.RecoveryDevice; import net.sf.openrocket.rocketcomponent.RecoveryDevice;
class DeploymentConfigurationHandler extends AbstractElementHandler { class DeploymentConfigurationHandler extends AbstractElementHandler {
@ -73,7 +73,7 @@ class DeploymentConfigurationHandler extends AbstractElementHandler {
@Override @Override
public void endHandler(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException { public void endHandler(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {
FlightConfigurationID configId = new FlightConfigurationID(attributes.get("configid")); FlightConfigurationId configId = new FlightConfigurationId(attributes.get("configid"));
DeploymentConfiguration def = recoveryDevice.getDeploymentConfigurations().getDefault(); DeploymentConfiguration def = recoveryDevice.getDeploymentConfigurations().getDefault();
recoveryDevice.getDeploymentConfigurations().set(configId, getConfiguration(def)); recoveryDevice.getDeploymentConfigurations().set(configId, getConfiguration(def));
} }

View File

@ -11,7 +11,7 @@ import net.sf.openrocket.file.simplesax.AbstractElementHandler;
import net.sf.openrocket.file.simplesax.ElementHandler; import net.sf.openrocket.file.simplesax.ElementHandler;
import net.sf.openrocket.file.simplesax.PlainTextHandler; import net.sf.openrocket.file.simplesax.PlainTextHandler;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet; import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
@ -50,7 +50,7 @@ class MotorConfigurationHandler extends AbstractElementHandler {
public void endHandler(String element, HashMap<String, String> attributes, public void endHandler(String element, HashMap<String, String> attributes,
String content, WarningSet warnings) throws SAXException { String content, WarningSet warnings) throws SAXException {
FlightConfigurationID fcid = new FlightConfigurationID(attributes.remove("configid")); FlightConfigurationId fcid = new FlightConfigurationId(attributes.remove("configid"));
if (!fcid.isValid()) { if (!fcid.isValid()) {
warnings.add(Warning.FILE_INVALID_PARAMETER); warnings.add(Warning.FILE_INVALID_PARAMETER);
return; return;

View File

@ -13,7 +13,7 @@ import net.sf.openrocket.file.simplesax.PlainTextHandler;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.motor.MotorInstanceId; import net.sf.openrocket.motor.MotorInstanceId;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.IgnitionEvent; import net.sf.openrocket.rocketcomponent.IgnitionEvent;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
@ -66,7 +66,7 @@ class MotorMountHandler extends AbstractElementHandler {
if (element.equals("motor")) { if (element.equals("motor")) {
// yes, this is confirmed to be the FLIGHT config id == motor instance id. // yes, this is confirmed to be the FLIGHT config id == motor instance id.
FlightConfigurationID fcid = new FlightConfigurationID(attributes.get("configid")); FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));
if (!fcid.isValid()) { if (!fcid.isValid()) {
warnings.add(Warning.fromString("Illegal motor specification, ignoring.")); warnings.add(Warning.fromString("Illegal motor specification, ignoring."));
return; return;
@ -89,7 +89,7 @@ class MotorMountHandler extends AbstractElementHandler {
} }
if (element.equals("ignitionconfiguration")) { if (element.equals("ignitionconfiguration")) {
FlightConfigurationID fcid = new FlightConfigurationID(attributes.get("configid")); FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));
if ( ! fcid.isValid()){ if ( ! fcid.isValid()){
warnings.add(Warning.fromString("Illegal motor specification, ignoring.")); warnings.add(Warning.fromString("Illegal motor specification, ignoring."));
return; return;

View File

@ -7,7 +7,7 @@ import net.sf.openrocket.file.DocumentLoadingContext;
import net.sf.openrocket.file.simplesax.AbstractElementHandler; import net.sf.openrocket.file.simplesax.AbstractElementHandler;
import net.sf.openrocket.file.simplesax.ElementHandler; import net.sf.openrocket.file.simplesax.ElementHandler;
import net.sf.openrocket.file.simplesax.PlainTextHandler; import net.sf.openrocket.file.simplesax.PlainTextHandler;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.simulation.SimulationOptions; import net.sf.openrocket.simulation.SimulationOptions;
import net.sf.openrocket.util.GeodeticComputationStrategy; import net.sf.openrocket.util.GeodeticComputationStrategy;
@ -51,7 +51,7 @@ class SimulationConditionsHandler extends AbstractElementHandler {
if (element.equals("configid")) { if (element.equals("configid")) {
// the ID constructor is designed to always return a valid value // the ID constructor is designed to always return a valid value
FlightConfigurationID idToSet= new FlightConfigurationID(content); FlightConfigurationId idToSet= new FlightConfigurationId(content);
conditions.setFlightConfigurationId(idToSet); conditions.setFlightConfigurationId(idToSet);
} else if (element.equals("launchrodlength")) { } else if (element.equals("launchrodlength")) {
if (Double.isNaN(d)) { if (Double.isNaN(d)) {

View File

@ -11,7 +11,7 @@ import net.sf.openrocket.file.simplesax.AbstractElementHandler;
import net.sf.openrocket.file.simplesax.ElementHandler; import net.sf.openrocket.file.simplesax.ElementHandler;
import net.sf.openrocket.file.simplesax.PlainTextHandler; import net.sf.openrocket.file.simplesax.PlainTextHandler;
import net.sf.openrocket.rocketcomponent.AxialStage; import net.sf.openrocket.rocketcomponent.AxialStage;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration; import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration.SeparationEvent; import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration.SeparationEvent;
@ -67,7 +67,7 @@ class StageSeparationConfigurationHandler extends AbstractElementHandler {
@Override @Override
public void endHandler(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException { public void endHandler(String element, HashMap<String, String> attributes, String content, WarningSet warnings) throws SAXException {
FlightConfigurationID fcid = new FlightConfigurationID(attributes.get("configid")); FlightConfigurationId fcid = new FlightConfigurationId(attributes.get("configid"));
StageSeparationConfiguration sepConfig = stage.getSeparationConfigurations().get(fcid); StageSeparationConfiguration sepConfig = stage.getSeparationConfigurations().get(fcid);
// copy and update to the file-read values // copy and update to the file-read values

View File

@ -7,7 +7,7 @@ import java.util.Locale;
import net.sf.openrocket.rocketcomponent.AxialStage; import net.sf.openrocket.rocketcomponent.AxialStage;
import net.sf.openrocket.rocketcomponent.ParallelStage; import net.sf.openrocket.rocketcomponent.ParallelStage;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration; import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
@ -52,7 +52,7 @@ public class AxialStageSaver extends ComponentAssemblySaver {
// is null and means "default". // is null and means "default".
for (FlightConfiguration curConfig : rocket.getConfigSet()){ for (FlightConfiguration curConfig : rocket.getConfigSet()){
FlightConfigurationID fcid = curConfig.getFlightConfigurationID(); FlightConfigurationId fcid = curConfig.getFlightConfigurationID();
if (fcid == null) { if (fcid == null) {
continue; continue;
} }

View File

@ -6,7 +6,7 @@ import java.util.Locale;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet; import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
import net.sf.openrocket.rocketcomponent.RecoveryDevice; import net.sf.openrocket.rocketcomponent.RecoveryDevice;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
@ -38,7 +38,7 @@ public class RecoveryDeviceSaver extends MassObjectSaver {
// DEBUG // DEBUG
FlightConfigurableParameterSet<FlightConfiguration> configList = rocket.getConfigSet(); FlightConfigurableParameterSet<FlightConfiguration> configList = rocket.getConfigSet();
for (FlightConfigurationID fcid : configList.getSortedConfigurationIDs()) { for (FlightConfigurationId fcid : configList.getSortedConfigurationIDs()) {
//System.err.println("checking FlightConfiguration:"+fcid.getShortKey()+ " save?"); //System.err.println("checking FlightConfiguration:"+fcid.getShortKey()+ " save?");
if (dev.getDeploymentConfigurations().isDefault(fcid)) { if (dev.getDeploymentConfigurations().isDefault(fcid)) {

View File

@ -16,7 +16,7 @@ import net.sf.openrocket.motor.ThrustCurveMotor;
import net.sf.openrocket.preset.ComponentPreset; import net.sf.openrocket.preset.ComponentPreset;
import net.sf.openrocket.rocketcomponent.Clusterable; import net.sf.openrocket.rocketcomponent.Clusterable;
import net.sf.openrocket.rocketcomponent.ComponentAssembly; import net.sf.openrocket.rocketcomponent.ComponentAssembly;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Instanceable; import net.sf.openrocket.rocketcomponent.Instanceable;
import net.sf.openrocket.rocketcomponent.LineInstanceable; import net.sf.openrocket.rocketcomponent.LineInstanceable;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
@ -190,7 +190,7 @@ public class RocketComponentSaver {
elements.add(" <ignitiondelay>" + defaultInstance.getIgnitionDelay() + "</ignitiondelay>"); elements.add(" <ignitiondelay>" + defaultInstance.getIgnitionDelay() + "</ignitiondelay>");
elements.add(" <overhang>" + mount.getMotorOverhang() + "</overhang>"); elements.add(" <overhang>" + mount.getMotorOverhang() + "</overhang>");
for( FlightConfigurationID fcid : rkt.getSortedConfigurationIDs()){ for( FlightConfigurationId fcid : rkt.getSortedConfigurationIDs()){
MotorConfiguration motorInstance = mount.getMotorInstance(fcid); MotorConfiguration motorInstance = mount.getMotorInstance(fcid);
// Nothing is stored if no motor loaded // Nothing is stored if no motor loaded

View File

@ -5,7 +5,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet; import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
import net.sf.openrocket.rocketcomponent.ReferenceType; import net.sf.openrocket.rocketcomponent.ReferenceType;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
@ -44,7 +44,7 @@ public class RocketSaver extends RocketComponentSaver {
// Motor configurations // Motor configurations
FlightConfigurableParameterSet<FlightConfiguration> allConfigs = rocket.getConfigSet(); FlightConfigurableParameterSet<FlightConfiguration> allConfigs = rocket.getConfigSet();
for (FlightConfigurationID fcid : allConfigs.getSortedConfigurationIDs()) { for (FlightConfigurationId fcid : allConfigs.getSortedConfigurationIDs()) {
FlightConfiguration flightConfig = allConfigs.get(fcid); FlightConfiguration flightConfig = allConfigs.get(fcid);
if (fcid == null) if (fcid == null)
continue; continue;

View File

@ -13,7 +13,7 @@ import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.plugin.Plugin; import net.sf.openrocket.plugin.Plugin;
import net.sf.openrocket.rocketcomponent.AxialStage; import net.sf.openrocket.rocketcomponent.AxialStage;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
@ -33,7 +33,7 @@ public class MotorDescriptionSubstitutor implements RocketSubstitutor {
} }
@Override @Override
public String substitute(String str, Rocket rocket, FlightConfigurationID configId) { public String substitute(String str, Rocket rocket, FlightConfigurationId configId) {
String description = getMotorConfigurationDescription(rocket, configId); String description = getMotorConfigurationDescription(rocket, configId);
return str.replace(SUBSTITUTION, description); return str.replace(SUBSTITUTION, description);
} }
@ -47,7 +47,7 @@ public class MotorDescriptionSubstitutor implements RocketSubstitutor {
public String getMotorConfigurationDescription(Rocket rocket, FlightConfigurationID fcid) { public String getMotorConfigurationDescription(Rocket rocket, FlightConfigurationId fcid) {
String name; String name;
int motorCount = 0; int motorCount = 0;

View File

@ -1,6 +1,6 @@
package net.sf.openrocket.formatting; package net.sf.openrocket.formatting;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
/** /**
@ -14,13 +14,13 @@ public interface RocketDescriptor {
* of the rocket. This uses the default flight configuration name * of the rocket. This uses the default flight configuration name
* as the basis. * as the basis.
*/ */
public String format(Rocket rocket, FlightConfigurationID configId); public String format(Rocket rocket, FlightConfigurationId configId);
/** /**
* Return a string describing a particular flight configuration * Return a string describing a particular flight configuration
* of the rocket. This uses a custom-provided name as the basis. * of the rocket. This uses a custom-provided name as the basis.
*/ */
public String format(String name, Rocket rocket, FlightConfigurationID configId); public String format(String name, Rocket rocket, FlightConfigurationId configId);
} }

View File

@ -4,7 +4,7 @@ import java.util.Set;
import com.google.inject.Inject; import com.google.inject.Inject;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
public class RocketDescriptorImpl implements RocketDescriptor { public class RocketDescriptorImpl implements RocketDescriptor {
@ -13,13 +13,13 @@ public class RocketDescriptorImpl implements RocketDescriptor {
private Set<RocketSubstitutor> substitutors; private Set<RocketSubstitutor> substitutors;
@Override @Override
public String format(final Rocket rocket, final FlightConfigurationID configId) { public String format(final Rocket rocket, final FlightConfigurationId configId) {
String name = rocket.getFlightConfiguration(configId).getName(); String name = rocket.getFlightConfiguration(configId).getName();
return format(name, rocket, configId); return format(name, rocket, configId);
} }
@Override @Override
public String format(String name, final Rocket rocket, final FlightConfigurationID configId) { public String format(String name, final Rocket rocket, final FlightConfigurationId configId) {
for (RocketSubstitutor s : substitutors) { for (RocketSubstitutor s : substitutors) {
while (s.containsSubstitution(name)) { while (s.containsSubstitution(name)) {
name = s.substitute(name, rocket, configId); name = s.substitute(name, rocket, configId);

View File

@ -3,7 +3,7 @@ package net.sf.openrocket.formatting;
import java.util.Map; import java.util.Map;
import net.sf.openrocket.plugin.Plugin; import net.sf.openrocket.plugin.Plugin;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
/** /**
@ -14,7 +14,7 @@ public interface RocketSubstitutor {
public boolean containsSubstitution(String str); public boolean containsSubstitution(String str);
public String substitute(String str, Rocket rocket, FlightConfigurationID configId); public String substitute(String str, Rocket rocket, FlightConfigurationId configId);
public Map<String, String> getDescriptions(); public Map<String, String> getDescriptions();

View File

@ -1,7 +1,7 @@
package net.sf.openrocket.motor; package net.sf.openrocket.motor;
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent; import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet; import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
@ -40,7 +40,7 @@ public class MotorConfigurationSet extends FlightConfigurableParameterSet<MotorC
MotorConfiguration emptyInstance = this.getDefault(); MotorConfiguration emptyInstance = this.getDefault();
buffer.append(" >> (["+emptyInstance.toString()+"]= @ "+ emptyInstance.getIgnitionEvent().name +" +"+emptyInstance.getIgnitionDelay()+"sec )\n"); buffer.append(" >> (["+emptyInstance.toString()+"]= @ "+ emptyInstance.getIgnitionEvent().name +" +"+emptyInstance.getIgnitionDelay()+"sec )\n");
for( FlightConfigurationID loopFCID : this.map.keySet()){ for( FlightConfigurationId loopFCID : this.map.keySet()){
String shortKey = loopFCID.toShortKey(); String shortKey = loopFCID.toShortKey();
MotorConfiguration curInstance = this.map.get(loopFCID); MotorConfiguration curInstance = this.map.get(loopFCID);

View File

@ -73,7 +73,7 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC
} }
@Override @Override
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) { public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
separations.cloneFlightConfiguration(oldConfigId, newConfigId); separations.cloneFlightConfiguration(oldConfigId, newConfigId);
} }

View File

@ -369,12 +369,12 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
} }
@Override @Override
public MotorConfiguration getMotorInstance( final FlightConfigurationID fcid){ public MotorConfiguration getMotorInstance( final FlightConfigurationId fcid){
return this.motors.get(fcid); return this.motors.get(fcid);
} }
@Override @Override
public void setMotorInstance(final FlightConfigurationID fcid, final MotorConfiguration newMotorInstance){ public void setMotorInstance(final FlightConfigurationId fcid, final MotorConfiguration newMotorInstance){
if((null == newMotorInstance)){ if((null == newMotorInstance)){
this.motors.set( fcid, null); this.motors.set( fcid, null);
}else{ }else{
@ -400,7 +400,7 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
} }
@Override @Override
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) { public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
motors.cloneFlightConfiguration(oldConfigId, newConfigId); motors.cloneFlightConfiguration(oldConfigId, newConfigId);
} }
@ -450,7 +450,7 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
@Override @Override
public Coordinate getMotorPosition(FlightConfigurationID id) { public Coordinate getMotorPosition(FlightConfigurationId id) {
Motor motor = this.motors.get(id).getMotor(); Motor motor = this.motors.get(id).getMotor();
if (motor == null) { if (motor == null) {
throw new IllegalArgumentException("No motor with id " + id + " defined."); throw new IllegalArgumentException("No motor with id " + id + " defined.");

View File

@ -41,7 +41,7 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
* @param id the flight configuration ID * @param id the flight configuration ID
* @return the parameter to use (never null) * @return the parameter to use (never null)
*/ */
public E get(FlightConfigurationID id); public E get(FlightConfigurationId id);
/** /**
* Return the parameter value for the provided flight configuration ID. * Return the parameter value for the provided flight configuration ID.
@ -51,7 +51,7 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
* @param value the parameter to find * @param value the parameter to find
* @return the flight configuration ID * @return the flight configuration ID
*/ */
public FlightConfigurationID get(E value); public FlightConfigurationId get(E value);
/** /**
* Set the parameter value for the provided flight configuration ID. * Set the parameter value for the provided flight configuration ID.
@ -60,13 +60,13 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
* @param id the flight configuration ID * @param id the flight configuration ID
* @param value the parameter value (null not allowed) * @param value the parameter value (null not allowed)
*/ */
public void set(FlightConfigurationID id, E value); public void set(FlightConfigurationId id, E value);
/** /**
* *
* @return a sorted list of all the contained FlightConfigurationIDs * @return a sorted list of all the contained FlightConfigurationIDs
*/ */
public List<FlightConfigurationID> getSortedConfigurationIDs(); public List<FlightConfigurationId> getSortedConfigurationIDs();
/** /**
* Return whether a specific flight configuration ID is using the * Return whether a specific flight configuration ID is using the
@ -75,14 +75,14 @@ public interface FlightConfigurable<E extends ChangeSource> extends FlightConfig
* @param id the flight configuration ID * @param id the flight configuration ID
* @return whether the default is being used * @return whether the default is being used
*/ */
public boolean isDefault(FlightConfigurationID id); public boolean isDefault(FlightConfigurationId id);
/** /**
* Reset a specific flight configuration ID to use the default parameter value. * Reset a specific flight configuration ID to use the default parameter value.
* *
* @param id the flight configuration ID * @param id the flight configuration ID
*/ */
public void reset(FlightConfigurationID id); public void reset(FlightConfigurationId id);
/** /**
* Return the number of specific flight configurations other than the default. * Return the number of specific flight configurations other than the default.

View File

@ -14,6 +14,6 @@ public interface FlightConfigurableComponent {
* @param oldConfigId the old configuration ID * @param oldConfigId the old configuration ID
* @param newConfigId the new configuration ID * @param newConfigId the new configuration ID
*/ */
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId); public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId);
} }

View File

@ -20,7 +20,7 @@ import net.sf.openrocket.util.Utils;
public class FlightConfigurableParameterSet<E extends FlightConfigurableParameter<E>> implements FlightConfigurable<E> { public class FlightConfigurableParameterSet<E extends FlightConfigurableParameter<E>> implements FlightConfigurable<E> {
//private static final Logger log = LoggerFactory.getLogger(ParameterSet.class); //private static final Logger log = LoggerFactory.getLogger(ParameterSet.class);
protected final HashMap<FlightConfigurationID, E> map = new HashMap<FlightConfigurationID, E>(); protected final HashMap<FlightConfigurationId, E> map = new HashMap<FlightConfigurationId, E>();
protected E defaultValue; protected E defaultValue;
protected final RocketComponent component; protected final RocketComponent component;
@ -56,13 +56,13 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
this.eventType = eventType; this.eventType = eventType;
this.defaultValue= configSet.getDefault().clone(); this.defaultValue= configSet.getDefault().clone();
for (FlightConfigurationID key : configSet.map.keySet()) { for (FlightConfigurationId key : configSet.map.keySet()) {
E cloneConfig = configSet.map.get(key).clone(); E cloneConfig = configSet.map.get(key).clone();
this.map.put(key, cloneConfig); this.map.put(key, cloneConfig);
} }
} }
public boolean containsKey( final FlightConfigurationID fcid ){ public boolean containsKey( final FlightConfigurationId fcid ){
return this.map.containsKey(fcid); return this.map.containsKey(fcid);
} }
@ -94,12 +94,12 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
} }
@Override @Override
public FlightConfigurationID get(E testValue) { public FlightConfigurationId get(E testValue) {
if( null == testValue ){ if( null == testValue ){
return null; return null;
} }
for( Entry<FlightConfigurationID, E> curEntry : this.map.entrySet()){ for( Entry<FlightConfigurationId, E> curEntry : this.map.entrySet()){
FlightConfigurationID curKey = curEntry.getKey(); FlightConfigurationId curKey = curEntry.getKey();
E curValue = curEntry.getValue(); E curValue = curEntry.getValue();
if( testValue.equals(curValue)){ if( testValue.equals(curValue)){
@ -119,13 +119,13 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
+" than the stored values: "+index+"/"+this.map.size()); +" than the stored values: "+index+"/"+this.map.size());
} }
List<FlightConfigurationID> ids = this.getSortedConfigurationIDs(); List<FlightConfigurationId> ids = this.getSortedConfigurationIDs();
FlightConfigurationID selectedId = ids.get(index); FlightConfigurationId selectedId = ids.get(index);
return this.map.get(selectedId); return this.map.get(selectedId);
} }
@Override @Override
public E get(FlightConfigurationID id) { public E get(FlightConfigurationId id) {
if( id.hasError() ){ if( id.hasError() ){
throw new NullPointerException("Attempted to retrieve a parameter with an error key!"); throw new NullPointerException("Attempted to retrieve a parameter with an error key!");
} }
@ -139,8 +139,8 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
} }
@Override @Override
public List<FlightConfigurationID> getSortedConfigurationIDs(){ public List<FlightConfigurationId> getSortedConfigurationIDs(){
ArrayList<FlightConfigurationID> toReturn = new ArrayList<FlightConfigurationID>(); ArrayList<FlightConfigurationId> toReturn = new ArrayList<FlightConfigurationId>();
toReturn.addAll( this.map.keySet() ); toReturn.addAll( this.map.keySet() );
// Java 1.8: // Java 1.8:
@ -152,12 +152,12 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
return toReturn; return toReturn;
} }
public List<FlightConfigurationID> getIDs(){ public List<FlightConfigurationId> getIDs(){
return this.getSortedConfigurationIDs(); return this.getSortedConfigurationIDs();
} }
@Override @Override
public void set(FlightConfigurationID fcid, E nextValue) { public void set(FlightConfigurationId fcid, E nextValue) {
if ( nextValue == null) { if ( nextValue == null) {
// null value means to delete this fcid // null value means to delete this fcid
E previousValue = this.map.remove(fcid); E previousValue = this.map.remove(fcid);
@ -176,12 +176,12 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
} }
@Override @Override
public boolean isDefault( FlightConfigurationID fcid) { public boolean isDefault( FlightConfigurationId fcid) {
return ( this.getDefault() == this.map.get(fcid)); return ( this.getDefault() == this.map.get(fcid));
} }
@Override @Override
public void reset( FlightConfigurationID fcid) { public void reset( FlightConfigurationId fcid) {
if( fcid.isValid() ){ if( fcid.isValid() ){
set( fcid, null); set( fcid, null);
} }
@ -193,7 +193,7 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
@Override @Override
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) { public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
// clones the ENTRIES for the given fcid's. // clones the ENTRIES for the given fcid's.
E oldValue = this.get(oldConfigId); E oldValue = this.get(oldConfigId);
this.set(newConfigId, oldValue.clone()); this.set(newConfigId, oldValue.clone());
@ -226,7 +226,7 @@ public class FlightConfigurableParameterSet<E extends FlightConfigurableParamete
buf.append(String.format(" >> ParameterSet<%s> (%d configurations)\n", this.defaultValue.getClass().getSimpleName(), this.size() )); buf.append(String.format(" >> ParameterSet<%s> (%d configurations)\n", this.defaultValue.getClass().getSimpleName(), this.size() ));
buf.append(String.format(" >> [%s]= %s\n", "DEFAULT", this.getDefault().toString() )); buf.append(String.format(" >> [%s]= %s\n", "DEFAULT", this.getDefault().toString() ));
for( FlightConfigurationID loopFCID : this.getSortedConfigurationIDs()){ for( FlightConfigurationId loopFCID : this.getSortedConfigurationIDs()){
String shortKey = loopFCID.toShortKey(); String shortKey = loopFCID.toShortKey();
E inst = this.map.get(loopFCID); E inst = this.map.get(loopFCID);

View File

@ -37,7 +37,7 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
protected String configurationName; protected String configurationName;
protected final Rocket rocket; protected final Rocket rocket;
protected final FlightConfigurationID fcid; protected final FlightConfigurationId fcid;
protected static int instanceCount=0; protected static int instanceCount=0;
public final int instanceNumber; public final int instanceNumber;
@ -85,9 +85,9 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
* @param _fcid the ID this configuration should have. * @param _fcid the ID this configuration should have.
* @param rocket the rocket * @param rocket the rocket
*/ */
public FlightConfiguration(final Rocket rocket, final FlightConfigurationID _fcid ) { public FlightConfiguration(final Rocket rocket, final FlightConfigurationId _fcid ) {
if( null == _fcid){ if( null == _fcid){
this.fcid = new FlightConfigurationID(); this.fcid = new FlightConfigurationId();
}else{ }else{
this.fcid = _fcid; this.fcid = _fcid;
} }
@ -269,11 +269,11 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
return Math.PI * MathUtil.pow2(getReferenceLength() / 2); return Math.PI * MathUtil.pow2(getReferenceLength() / 2);
} }
public FlightConfigurationID getFlightConfigurationID() { public FlightConfigurationId getFlightConfigurationID() {
return fcid; return fcid;
} }
public FlightConfigurationID getId() { public FlightConfigurationId getId() {
return getFlightConfigurationID(); return getFlightConfigurationID();
} }

View File

@ -7,7 +7,7 @@ import java.util.UUID;
* It is intended to provide better visibility and traceability by more specific type safety -- this class replaces a * It is intended to provide better visibility and traceability by more specific type safety -- this class replaces a
* straight-up <code>String</code> Key in previous implementations. * straight-up <code>String</code> Key in previous implementations.
*/ */
public final class FlightConfigurationID implements Comparable<FlightConfigurationID> { public final class FlightConfigurationId implements Comparable<FlightConfigurationId> {
final public UUID key; final public UUID key;
private final static long DEFAULT_MOST_SIG_BITS = 0xF4F2F1F0; private final static long DEFAULT_MOST_SIG_BITS = 0xF4F2F1F0;
@ -15,14 +15,14 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
private final static String ERROR_KEY_NAME = "<Error_Key>"; private final static String ERROR_KEY_NAME = "<Error_Key>";
private final static UUID DEFAULT_VALUE_UUID = new UUID( DEFAULT_MOST_SIG_BITS, 5676); private final static UUID DEFAULT_VALUE_UUID = new UUID( DEFAULT_MOST_SIG_BITS, 5676);
public final static FlightConfigurationID ERROR_CONFIGURATION_FCID = new FlightConfigurationID( FlightConfigurationID.ERROR_CONFIGURATION_UUID); public final static FlightConfigurationId ERROR_CONFIGURATION_FCID = new FlightConfigurationId( FlightConfigurationId.ERROR_CONFIGURATION_UUID);
public final static FlightConfigurationID DEFAULT_VALUE_FCID = new FlightConfigurationID( FlightConfigurationID.DEFAULT_VALUE_UUID ); public final static FlightConfigurationId DEFAULT_VALUE_FCID = new FlightConfigurationId( FlightConfigurationId.DEFAULT_VALUE_UUID );
public FlightConfigurationID() { public FlightConfigurationId() {
this(UUID.randomUUID()); this(UUID.randomUUID());
} }
public FlightConfigurationID(final String _str) { public FlightConfigurationId(final String _str) {
UUID candidate; UUID candidate;
if(_str == null || "".equals(_str)){ if(_str == null || "".equals(_str)){
candidate = UUID.randomUUID(); candidate = UUID.randomUUID();
@ -36,9 +36,9 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
this.key = candidate; this.key = candidate;
} }
public FlightConfigurationID(final UUID _val) { public FlightConfigurationId(final UUID _val) {
if (null == _val){ if (null == _val){
this.key = FlightConfigurationID.ERROR_CONFIGURATION_UUID; this.key = FlightConfigurationId.ERROR_CONFIGURATION_UUID;
} else { } else {
this.key = _val; this.key = _val;
} }
@ -46,11 +46,11 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
@Override @Override
public boolean equals(Object anObject) { public boolean equals(Object anObject) {
if (!(anObject instanceof FlightConfigurationID)) { if (!(anObject instanceof FlightConfigurationId)) {
return false; return false;
} }
FlightConfigurationID otherFCID = (FlightConfigurationID) anObject; FlightConfigurationId otherFCID = (FlightConfigurationId) anObject;
return this.key.equals(otherFCID.key); return this.key.equals(otherFCID.key);
} }
@ -88,7 +88,7 @@ public final class FlightConfigurationID implements Comparable<FlightConfigurati
} }
@Override @Override
public int compareTo(FlightConfigurationID other) { public int compareTo(FlightConfigurationId other) {
return (this.key.compareTo( other.key)); return (this.key.compareTo( other.key));
} }

View File

@ -277,12 +277,12 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
} }
@Override @Override
public MotorConfiguration getMotorInstance( final FlightConfigurationID fcid){ public MotorConfiguration getMotorInstance( final FlightConfigurationId fcid){
return this.motors.get(fcid); return this.motors.get(fcid);
} }
@Override @Override
public void setMotorInstance(final FlightConfigurationID fcid, final MotorConfiguration newMotorInstance){ public void setMotorInstance(final FlightConfigurationId fcid, final MotorConfiguration newMotorInstance){
if((null == newMotorInstance)){ if((null == newMotorInstance)){
this.motors.set( fcid, null); this.motors.set( fcid, null);
}else{ }else{
@ -307,7 +307,7 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
} }
@Override @Override
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) { public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
motors.cloneFlightConfiguration(oldConfigId, newConfigId); motors.cloneFlightConfiguration(oldConfigId, newConfigId);
} }
@ -355,7 +355,7 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
} }
@Override @Override
public Coordinate getMotorPosition(FlightConfigurationID id) { public Coordinate getMotorPosition(FlightConfigurationId id) {
Motor motor = motors.get(id).getMotor(); Motor motor = motors.get(id).getMotor();
if (motor == null) { if (motor == null) {
throw new IllegalArgumentException("No motor with id " + id + " defined."); throw new IllegalArgumentException("No motor with id " + id + " defined.");
@ -412,7 +412,7 @@ public class InnerTube extends ThicknessRingComponent implements Clusterable, Ra
Coordinate[] relCoords = this.getInstanceOffsets(); Coordinate[] relCoords = this.getInstanceOffsets();
Coordinate[] absCoords = this.getLocations(); Coordinate[] absCoords = this.getLocations();
FlightConfigurationID curId = this.getRocket().getDefaultConfiguration().getFlightConfigurationID(); FlightConfigurationId curId = this.getRocket().getDefaultConfiguration().getFlightConfigurationID();
final int intanceCount = this.getInstanceCount(); final int intanceCount = this.getInstanceCount();
MotorConfiguration curInstance = this.motors.get(curId); MotorConfiguration curInstance = this.motors.get(curId);
if( curInstance.isEmpty() ){ if( curInstance.isEmpty() ){

View File

@ -59,14 +59,14 @@ public interface MotorMount extends ChangeSource, FlightConfigurableComponent {
* @param fcid id for which to return the motor (null retrieves the default) * @param fcid id for which to return the motor (null retrieves the default)
* @return requested motorInstance (which may also be the default motor instance) * @return requested motorInstance (which may also be the default motor instance)
*/ */
public MotorConfiguration getMotorInstance( final FlightConfigurationID fcid); public MotorConfiguration getMotorInstance( final FlightConfigurationId fcid);
/** /**
* *
* @param fcid index the supplied motor against this flight configuration * @param fcid index the supplied motor against this flight configuration
* @param newMotorInstance motor instance to store * @param newMotorInstance motor instance to store
*/ */
public void setMotorInstance(final FlightConfigurationID fcid, final MotorConfiguration newMotorInstance); public void setMotorInstance(final FlightConfigurationId fcid, final MotorConfiguration newMotorInstance);
/** /**
* Get the number of motors available for all flight configurations * Get the number of motors available for all flight configurations
@ -106,7 +106,7 @@ public interface MotorMount extends ChangeSource, FlightConfigurableComponent {
* @return the position of the motor relative to this component. * @return the position of the motor relative to this component.
* @throws IllegalArgumentException if a motor with the specified ID does not exist. * @throws IllegalArgumentException if a motor with the specified ID does not exist.
*/ */
public Coordinate getMotorPosition(FlightConfigurationID id); public Coordinate getMotorPosition(FlightConfigurationId id);
/** /**
* Development / Debug method. * Development / Debug method.

View File

@ -81,7 +81,7 @@ public class ParallelStage extends AxialStage implements FlightConfigurableCompo
} }
@Override @Override
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) { public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
this.separations.cloneFlightConfiguration(oldConfigId, newConfigId); this.separations.cloneFlightConfiguration(oldConfigId, newConfigId);
} }

View File

@ -90,7 +90,7 @@ public abstract class RecoveryDevice extends MassObject implements FlightConfigu
} }
@Override @Override
public void cloneFlightConfiguration(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) { public void cloneFlightConfiguration(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
deploymentConfigurations.cloneFlightConfiguration(oldConfigId, newConfigId); deploymentConfigurations.cloneFlightConfiguration(oldConfigId, newConfigId);
} }

View File

@ -534,7 +534,7 @@ public class Rocket extends RocketComponent {
return this.configSet.getDefault(); return this.configSet.getDefault();
} }
public FlightConfiguration createFlightConfiguration( final FlightConfigurationID fcid) { public FlightConfiguration createFlightConfiguration( final FlightConfigurationId fcid) {
checkState(); checkState();
if( fcid.hasError() ){ if( fcid.hasError() ){
throw new NullPointerException("Attempted to create a flightConfiguration from an error key!"); throw new NullPointerException("Attempted to create a flightConfiguration from an error key!");
@ -558,7 +558,7 @@ public class Rocket extends RocketComponent {
return this.configSet; return this.configSet;
} }
public List<FlightConfigurationID> getSortedConfigurationIDs(){ public List<FlightConfigurationId> getSortedConfigurationIDs(){
return configSet.getSortedConfigurationIDs(); return configSet.getSortedConfigurationIDs();
} }
@ -569,7 +569,7 @@ public class Rocket extends RocketComponent {
* *
* @param id the flight configuration ID to remove * @param id the flight configuration ID to remove
*/ */
public void removeFlightConfigurationID(FlightConfigurationID fcid) { public void removeFlightConfigurationID(FlightConfigurationId fcid) {
checkState(); checkState();
if( fcid.hasError() ){ if( fcid.hasError() ){
return; return;
@ -587,7 +587,7 @@ public class Rocket extends RocketComponent {
* @param id the configuration ID. * @param id the configuration ID.
* @return whether a motor configuration with that ID exists. * @return whether a motor configuration with that ID exists.
*/ */
public boolean containsFlightConfigurationID(FlightConfigurationID id) { public boolean containsFlightConfigurationID(FlightConfigurationId id) {
checkState(); checkState();
if( id.hasError() ){ if( id.hasError() ){
return false; return false;
@ -602,7 +602,7 @@ public class Rocket extends RocketComponent {
* @param id the FlightConfigurationID containing the motor (may be invalid). * @param id the FlightConfigurationID containing the motor (may be invalid).
* @return whether any motors are defined for it. * @return whether any motors are defined for it.
*/ */
public boolean hasMotors(FlightConfigurationID fcid) { public boolean hasMotors(FlightConfigurationId fcid) {
checkState(); checkState();
if( fcid.hasError() ){ if( fcid.hasError() ){
return false; return false;
@ -631,7 +631,7 @@ public class Rocket extends RocketComponent {
* @param id the flight configuration id * @param id the flight configuration id
* @return a FlightConfiguration instance * @return a FlightConfiguration instance
*/ */
public FlightConfiguration getFlightConfiguration(final FlightConfigurationID fcid) { public FlightConfiguration getFlightConfiguration(final FlightConfigurationId fcid) {
checkState(); checkState();
return this.createFlightConfiguration(fcid); return this.createFlightConfiguration(fcid);
} }
@ -648,7 +648,7 @@ public class Rocket extends RocketComponent {
} }
public void setDefaultConfiguration(final FlightConfigurationID fcid) { public void setDefaultConfiguration(final FlightConfigurationId fcid) {
checkState(); checkState();
if( fcid.hasError() ){ if( fcid.hasError() ){
@ -667,7 +667,7 @@ public class Rocket extends RocketComponent {
* @param id the flight configuration id * @param id the flight configuration id
* @param name the name for the flight configuration * @param name the name for the flight configuration
*/ */
public void setFlightConfiguration(final FlightConfigurationID fcid, FlightConfiguration newConfig) { public void setFlightConfiguration(final FlightConfigurationId fcid, FlightConfiguration newConfig) {
checkState(); checkState();
if( fcid.hasError() ){ if( fcid.hasError() ){
log.error("attempt to set a 'fcid = config' with a error fcid. Ignored.", new IllegalArgumentException("error id:"+fcid)); log.error("attempt to set a 'fcid = config' with a error fcid. Ignored.", new IllegalArgumentException("error id:"+fcid));

View File

@ -1,15 +1,15 @@
package net.sf.openrocket.rocketvisitors; package net.sf.openrocket.rocketvisitors;
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent; import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
public class CopyFlightConfigurationVisitor extends DepthFirstRecusiveVisitor<Void> { public class CopyFlightConfigurationVisitor extends DepthFirstRecusiveVisitor<Void> {
private final FlightConfigurationID oldConfigId; private final FlightConfigurationId oldConfigId;
private final FlightConfigurationID newConfigId; private final FlightConfigurationId newConfigId;
public CopyFlightConfigurationVisitor(FlightConfigurationID oldConfigId, FlightConfigurationID newConfigId) { public CopyFlightConfigurationVisitor(FlightConfigurationId oldConfigId, FlightConfigurationId newConfigId) {
super(); super();
this.oldConfigId = oldConfigId; this.oldConfigId = oldConfigId;
this.newConfigId = newConfigId; this.newConfigId = newConfigId;

View File

@ -15,7 +15,7 @@ import net.sf.openrocket.motor.MotorInstanceId;
import net.sf.openrocket.rocketcomponent.AxialStage; import net.sf.openrocket.rocketcomponent.AxialStage;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.IgnitionEvent; import net.sf.openrocket.rocketcomponent.IgnitionEvent;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.RecoveryDevice; import net.sf.openrocket.rocketcomponent.RecoveryDevice;
@ -55,7 +55,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
private SimulationStatus currentStatus; private SimulationStatus currentStatus;
private FlightConfigurationID fcid; private FlightConfigurationId fcid;
// this is just a list of simulation branches to // this is just a list of simulation branches to
Deque<SimulationStatus> toSimulate = new ArrayDeque<SimulationStatus>(); Deque<SimulationStatus> toSimulate = new ArrayDeque<SimulationStatus>();

View File

@ -9,7 +9,7 @@ import net.sf.openrocket.masscalc.MassCalculator;
import net.sf.openrocket.models.atmosphere.AtmosphericModel; import net.sf.openrocket.models.atmosphere.AtmosphericModel;
import net.sf.openrocket.models.gravity.GravityModel; import net.sf.openrocket.models.gravity.GravityModel;
import net.sf.openrocket.models.wind.WindModel; import net.sf.openrocket.models.wind.WindModel;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.simulation.listeners.SimulationListener; import net.sf.openrocket.simulation.listeners.SimulationListener;
import net.sf.openrocket.util.BugException; import net.sf.openrocket.util.BugException;
@ -28,7 +28,7 @@ import net.sf.openrocket.util.WorldCoordinate;
public class SimulationConditions implements Monitorable, Cloneable { public class SimulationConditions implements Monitorable, Cloneable {
private Rocket rocket; private Rocket rocket;
private FlightConfigurationID configId= null; private FlightConfigurationId configId= null;
private Simulation simulation; // The parent simulation private Simulation simulation; // The parent simulation
@ -115,15 +115,15 @@ public class SimulationConditions implements Monitorable, Cloneable {
} }
public FlightConfigurationID getMotorConfigurationID() { public FlightConfigurationId getMotorConfigurationID() {
return configId; return configId;
} }
public FlightConfigurationID getFlightConfigurationID() { public FlightConfigurationId getFlightConfigurationID() {
return configId; return configId;
} }
public void setFlightConfigurationID(FlightConfigurationID _fcid) { public void setFlightConfigurationID(FlightConfigurationId _fcid) {
this.configId = _fcid; this.configId = _fcid;
this.modID++; this.modID++;
} }

View File

@ -17,7 +17,7 @@ import net.sf.openrocket.models.atmosphere.ExtendedISAModel;
import net.sf.openrocket.models.gravity.GravityModel; import net.sf.openrocket.models.gravity.GravityModel;
import net.sf.openrocket.models.gravity.WGSGravityModel; import net.sf.openrocket.models.gravity.WGSGravityModel;
import net.sf.openrocket.models.wind.PinkNoiseWindModel; import net.sf.openrocket.models.wind.PinkNoiseWindModel;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
import net.sf.openrocket.startup.Preferences; import net.sf.openrocket.startup.Preferences;
@ -51,7 +51,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
protected final Preferences preferences = Application.getPreferences(); protected final Preferences preferences = Application.getPreferences();
private final Rocket rocket; private final Rocket rocket;
private FlightConfigurationID configId = new FlightConfigurationID(); private FlightConfigurationId configId = new FlightConfigurationId();
/* /*
* NOTE: When adding/modifying parameters, they must also be added to the * NOTE: When adding/modifying parameters, they must also be added to the
@ -100,11 +100,11 @@ public class SimulationOptions implements ChangeSource, Cloneable {
return rocket; return rocket;
} }
public FlightConfigurationID getFlightConfigurationId() { public FlightConfigurationId getFlightConfigurationId() {
return getId(); return getId();
} }
public FlightConfigurationID getId() { public FlightConfigurationId getId() {
return this.configId; return this.configId;
} }
@ -113,7 +113,7 @@ public class SimulationOptions implements ChangeSource, Cloneable {
* *
* @param id the configuration to set. * @param id the configuration to set.
*/ */
public void setFlightConfigurationId(FlightConfigurationID fcid) { public void setFlightConfigurationId(FlightConfigurationId fcid) {
if ( null == fcid ){ if ( null == fcid ){
throw new NullPointerException("Attempted to set a null Config id in simulation options. Not allowed!"); throw new NullPointerException("Attempted to set a null Config id in simulation options. Not allowed!");
}else if ( fcid.hasError() ){ }else if ( fcid.hasError() ){
@ -449,9 +449,9 @@ public class SimulationOptions implements ChangeSource, Cloneable {
MotorDescriptionSubstitutor formatter = Application.getInjector().getInstance(MotorDescriptionSubstitutor.class); MotorDescriptionSubstitutor formatter = Application.getInjector().getInstance(MotorDescriptionSubstitutor.class);
String motorDesc = formatter.getMotorConfigurationDescription(src.rocket, src.configId); String motorDesc = formatter.getMotorConfigurationDescription(src.rocket, src.configId);
FlightConfigurationID matchID = null; FlightConfigurationId matchID = null;
for (FlightConfigurationID fcid : this.rocket.getSortedConfigurationIDs()){ for (FlightConfigurationId fcid : this.rocket.getSortedConfigurationIDs()){
String motorDesc2 = formatter.getMotorConfigurationDescription(this.rocket, fcid); String motorDesc2 = formatter.getMotorConfigurationDescription(this.rocket, fcid);
if (motorDesc.equals(motorDesc2)) { if (motorDesc.equals(motorDesc2)) {
matchID = fcid; matchID = fcid;

View File

@ -31,7 +31,7 @@ import net.sf.openrocket.rocketcomponent.ExternalComponent;
import net.sf.openrocket.rocketcomponent.ExternalComponent.Finish; import net.sf.openrocket.rocketcomponent.ExternalComponent.Finish;
import net.sf.openrocket.rocketcomponent.FinSet.CrossSection; import net.sf.openrocket.rocketcomponent.FinSet.CrossSection;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.FreeformFinSet; import net.sf.openrocket.rocketcomponent.FreeformFinSet;
import net.sf.openrocket.rocketcomponent.IllegalFinPointException; import net.sf.openrocket.rocketcomponent.IllegalFinPointException;
import net.sf.openrocket.rocketcomponent.InnerTube; import net.sf.openrocket.rocketcomponent.InnerTube;
@ -465,7 +465,7 @@ public class TestRockets {
finset.setMaterial(material); finset.setMaterial(material);
FlightConfiguration config = rocket.getDefaultConfiguration(); FlightConfiguration config = rocket.getDefaultConfiguration();
FlightConfigurationID fcid = config.getFlightConfigurationID(); FlightConfigurationId fcid = config.getFlightConfigurationID();
ThrustCurveMotor motor = getTestMotor(); ThrustCurveMotor motor = getTestMotor();
MotorConfiguration instance = new MotorConfiguration(motor); MotorConfiguration instance = new MotorConfiguration(motor);
@ -810,7 +810,7 @@ public class TestRockets {
MotorConfiguration motorInstance = TestRockets.generateMotorInstance_M1350_75mm(); MotorConfiguration motorInstance = TestRockets.generateMotorInstance_M1350_75mm();
motorInstance.setID( new MotorInstanceId( coreBody.getName(), 1) ); motorInstance.setID( new MotorInstanceId( coreBody.getName(), 1) );
coreBody.setMotorMount( true); coreBody.setMotorMount( true);
FlightConfigurationID motorConfigId = config.getFlightConfigurationID(); FlightConfigurationId motorConfigId = config.getFlightConfigurationID();
coreBody.setMotorInstance( motorConfigId, motorInstance); coreBody.setMotorInstance( motorConfigId, motorInstance);
} }
@ -868,7 +868,7 @@ public class TestRockets {
boosterMotorTubes.setClusterScale(1.0); boosterMotorTubes.setClusterScale(1.0);
boosterBody.addChild( boosterMotorTubes); boosterBody.addChild( boosterMotorTubes);
FlightConfigurationID motorConfigId = config.getFlightConfigurationID(); FlightConfigurationId motorConfigId = config.getFlightConfigurationID();
MotorConfiguration motorInstance = TestRockets.generateMotorInstance_G77_29mm(); MotorConfiguration motorInstance = TestRockets.generateMotorInstance_G77_29mm();
motorInstance.setID( new MotorInstanceId( boosterMotorTubes.getName(), 1) ); motorInstance.setID( new MotorInstanceId( boosterMotorTubes.getName(), 1) );
boosterMotorTubes.setMotorInstance( motorConfigId, motorInstance); boosterMotorTubes.setMotorInstance( motorConfigId, motorInstance);
@ -964,7 +964,7 @@ public class TestRockets {
Rocket rocket = new Rocket(); Rocket rocket = new Rocket();
rocket.setName("v104_withMotorConfig"); rocket.setName("v104_withMotorConfig");
FlightConfiguration config = rocket.getDefaultConfiguration(); FlightConfiguration config = rocket.getDefaultConfiguration();
FlightConfigurationID fcid = config.getFlightConfigurationID(); FlightConfigurationId fcid = config.getFlightConfigurationID();
config.setName("F12X"); config.setName("F12X");
// make stage // make stage
@ -999,7 +999,7 @@ public class TestRockets {
Rocket rocket = new Rocket(); Rocket rocket = new Rocket();
rocket.setName("v104_withSimulationData"); rocket.setName("v104_withSimulationData");
FlightConfiguration config = rocket.getDefaultConfiguration(); FlightConfiguration config = rocket.getDefaultConfiguration();
FlightConfigurationID fcid = config.getFlightConfigurationID(); FlightConfigurationId fcid = config.getFlightConfigurationID();
config.setName("F12X"); config.setName("F12X");
// make stage // make stage
@ -1158,7 +1158,7 @@ public class TestRockets {
public static OpenRocketDocument makeTestRocket_v106_withMotorMountIgnitionConfig() { public static OpenRocketDocument makeTestRocket_v106_withMotorMountIgnitionConfig() {
Rocket rocket = new Rocket(); Rocket rocket = new Rocket();
rocket.setName("v106_withwithMotorMountIgnitionConfig"); rocket.setName("v106_withwithMotorMountIgnitionConfig");
FlightConfigurationID fcid = new FlightConfigurationID(); FlightConfigurationId fcid = new FlightConfigurationId();
// make stage // make stage
AxialStage stage = new AxialStage(); AxialStage stage = new AxialStage();
@ -1190,7 +1190,7 @@ public class TestRockets {
public static OpenRocketDocument makeTestRocket_v106_withRecoveryDeviceDeploymentConfig() { public static OpenRocketDocument makeTestRocket_v106_withRecoveryDeviceDeploymentConfig() {
Rocket rocket = new Rocket(); Rocket rocket = new Rocket();
rocket.setName("v106_withRecoveryDeviceDeploymentConfig"); rocket.setName("v106_withRecoveryDeviceDeploymentConfig");
FlightConfigurationID testFCID = new FlightConfigurationID("testParachute"); FlightConfigurationId testFCID = new FlightConfigurationId("testParachute");
// make stage // make stage
AxialStage stage = new AxialStage(); AxialStage stage = new AxialStage();
@ -1217,7 +1217,7 @@ public class TestRockets {
public static OpenRocketDocument makeTestRocket_v106_withStageSeparationConfig() { public static OpenRocketDocument makeTestRocket_v106_withStageSeparationConfig() {
Rocket rocket = new Rocket(); Rocket rocket = new Rocket();
rocket.setName("v106_withStageSeparationConfig"); rocket.setName("v106_withStageSeparationConfig");
FlightConfigurationID fcid = new FlightConfigurationID("3SecondDelay"); FlightConfigurationId fcid = new FlightConfigurationId("3SecondDelay");
// make 1st stage // make 1st stage
AxialStage stage1 = new AxialStage(); AxialStage stage1 = new AxialStage();
stage1.setName("Stage1"); stage1.setName("Stage1");

View File

@ -14,7 +14,7 @@ import net.sf.openrocket.ServicesForTesting;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.plugin.PluginModule; import net.sf.openrocket.plugin.PluginModule;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.InnerTube; import net.sf.openrocket.rocketcomponent.InnerTube;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -64,7 +64,7 @@ public class BarrowmanCalculatorTest {
public void testCPSimpleWithMotor() { public void testCPSimpleWithMotor() {
Rocket rkt = TestRockets.makeEstesAlphaIII(); Rocket rkt = TestRockets.makeEstesAlphaIII();
FlightConfiguration config = rkt.getDefaultConfiguration(); FlightConfiguration config = rkt.getDefaultConfiguration();
FlightConfigurationID fcid = config.getFlightConfigurationID(); FlightConfigurationId fcid = config.getFlightConfigurationID();
AerodynamicCalculator calc = new BarrowmanCalculator(); AerodynamicCalculator calc = new BarrowmanCalculator();
FlightConditions conditions = new FlightConditions(config); FlightConditions conditions = new FlightConditions(config);
WarningSet warnings = new WarningSet(); WarningSet warnings = new WarningSet();

View File

@ -10,7 +10,7 @@ import net.sf.openrocket.masscalc.MassCalculator.MassCalcType;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.rocketcomponent.ParallelStage; import net.sf.openrocket.rocketcomponent.ParallelStage;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.InnerTube; import net.sf.openrocket.rocketcomponent.InnerTube;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;

View File

@ -543,7 +543,7 @@ public class ConfigurationTest extends BaseTestCase {
public static Rocket makeTwoStageMotorRocket() { public static Rocket makeTwoStageMotorRocket() {
Rocket rocket = makeTwoStageTestRocket(); Rocket rocket = makeTwoStageTestRocket();
FlightConfigurationID fcid = rocket.getDefaultConfiguration().getId(); FlightConfigurationId fcid = rocket.getDefaultConfiguration().getId();
{ {
// public ThrustCurveMotor(Manufacturer manufacturer, String designation, String description, // public ThrustCurveMotor(Manufacturer manufacturer, String designation, String description,

View File

@ -12,7 +12,7 @@ import javax.swing.event.ListDataListener;
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent; import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameter; import net.sf.openrocket.rocketcomponent.FlightConfigurableParameter;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet; import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
import net.sf.openrocket.util.StateChangeListener; import net.sf.openrocket.util.StateChangeListener;
@ -29,7 +29,7 @@ public class ParameterSetModel<T extends FlightConfigurableParameter<T>> impleme
private Object selected; private Object selected;
private final FlightConfigurableParameterSet<T> sourceSet; private final FlightConfigurableParameterSet<T> sourceSet;
List<FlightConfigurationID> idList= new Vector<FlightConfigurationID>(); List<FlightConfigurationId> idList= new Vector<FlightConfigurationId>();
public ParameterSetModel(FlightConfigurableParameterSet<T> set ) { public ParameterSetModel(FlightConfigurableParameterSet<T> set ) {
this.sourceSet = set; this.sourceSet = set;
@ -41,7 +41,7 @@ public class ParameterSetModel<T extends FlightConfigurableParameter<T>> impleme
if((index < 0)||( index >= this.idList.size())){ if((index < 0)||( index >= this.idList.size())){
return sourceSet.getDefault(); return sourceSet.getDefault();
} }
FlightConfigurationID fcid = this.idList.get(index); FlightConfigurationId fcid = this.idList.get(index);
return this.sourceSet.get( fcid); return this.sourceSet.get( fcid);
} }

View File

@ -26,7 +26,7 @@ import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.RecoveryDevice; import net.sf.openrocket.rocketcomponent.RecoveryDevice;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -48,7 +48,7 @@ public class DeploymentSelectionDialog extends JDialog {
public DeploymentSelectionDialog(Window parent, final Rocket rocket, final RecoveryDevice component) { public DeploymentSelectionDialog(Window parent, final Rocket rocket, final RecoveryDevice component) {
super(parent, trans.get("edtmotorconfdlg.title.Selectdeploymentconf"), Dialog.ModalityType.APPLICATION_MODAL); super(parent, trans.get("edtmotorconfdlg.title.Selectdeploymentconf"), Dialog.ModalityType.APPLICATION_MODAL);
final FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID(); final FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
newConfiguration = component.getDeploymentConfigurations().get(id).clone(); newConfiguration = component.getDeploymentConfigurations().get(id).clone();

View File

@ -23,7 +23,7 @@ import net.sf.openrocket.gui.adaptors.EnumModel;
import net.sf.openrocket.gui.util.GUIUtil; import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.IgnitionEvent; import net.sf.openrocket.rocketcomponent.IgnitionEvent;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
@ -44,7 +44,7 @@ public class IgnitionSelectionDialog extends JDialog {
private IgnitionEvent startIgnitionEvent; private IgnitionEvent startIgnitionEvent;
private double startIgnitionDelay; private double startIgnitionDelay;
public IgnitionSelectionDialog(Window parent, final FlightConfigurationID curFCID, MotorMount _mount) { public IgnitionSelectionDialog(Window parent, final FlightConfigurationId curFCID, MotorMount _mount) {
super(parent, trans.get("edtmotorconfdlg.title.Selectignitionconf"), Dialog.ModalityType.APPLICATION_MODAL); super(parent, trans.get("edtmotorconfdlg.title.Selectignitionconf"), Dialog.ModalityType.APPLICATION_MODAL);
curMount = _mount; curMount = _mount;
curMotorInstance = curMount.getMotorInstance(curFCID); curMotorInstance = curMount.getMotorInstance(curFCID);

View File

@ -14,7 +14,7 @@ import javax.swing.JTextField;
import net.miginfocom.swing.MigLayout; import net.miginfocom.swing.MigLayout;
import net.sf.openrocket.gui.util.GUIUtil; import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -22,7 +22,7 @@ public class RenameConfigDialog extends JDialog {
private static final long serialVersionUID = -5423008694485357248L; private static final long serialVersionUID = -5423008694485357248L;
private static final Translator trans = Application.getTranslator(); private static final Translator trans = Application.getTranslator();
public RenameConfigDialog(final Window parent, final Rocket rocket, final FlightConfigurationID fcid) { public RenameConfigDialog(final Window parent, final Rocket rocket, final FlightConfigurationId fcid) {
super(parent, trans.get("RenameConfigDialog.title"), Dialog.ModalityType.APPLICATION_MODAL); super(parent, trans.get("RenameConfigDialog.title"), Dialog.ModalityType.APPLICATION_MODAL);
JPanel panel = new JPanel(new MigLayout("fill")); JPanel panel = new JPanel(new MigLayout("fill"));

View File

@ -22,7 +22,7 @@ import net.sf.openrocket.gui.adaptors.EnumModel;
import net.sf.openrocket.gui.util.GUIUtil; import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.AxialStage; import net.sf.openrocket.rocketcomponent.AxialStage;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet; import net.sf.openrocket.rocketcomponent.FlightConfigurableParameterSet;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration; import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
@ -42,7 +42,7 @@ public class SeparationSelectionDialog extends JDialog {
public SeparationSelectionDialog(Window parent, final Rocket rocket, final AxialStage stage) { public SeparationSelectionDialog(Window parent, final Rocket rocket, final AxialStage stage) {
super(parent, trans.get("edtmotorconfdlg.title.Selectseparationconf"), Dialog.ModalityType.APPLICATION_MODAL); super(parent, trans.get("edtmotorconfdlg.title.Selectseparationconf"), Dialog.ModalityType.APPLICATION_MODAL);
final FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID(); final FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
newConfiguration = stage.getSeparationConfigurations().get(id); newConfiguration = stage.getSeparationConfigurations().get(id);
if( stage.getSeparationConfigurations().isDefault( newConfiguration )){ if( stage.getSeparationConfigurations().isDefault( newConfiguration )){

View File

@ -17,7 +17,7 @@ import net.sf.openrocket.gui.dialogs.motor.thrustcurve.ThrustCurveMotorSelection
import net.sf.openrocket.gui.util.GUIUtil; import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -30,7 +30,7 @@ public class MotorChooserDialog extends JDialog implements CloseableDialog {
private boolean okClicked = false; private boolean okClicked = false;
private static final Translator trans = Application.getTranslator(); private static final Translator trans = Application.getTranslator();
public MotorChooserDialog(MotorMount mount, FlightConfigurationID currentConfigID, Window owner) { public MotorChooserDialog(MotorMount mount, FlightConfigurationId currentConfigID, Window owner) {
this(owner); this(owner);
setMotorMountAndConfig( currentConfigID, mount); setMotorMountAndConfig( currentConfigID, mount);
} }
@ -84,7 +84,7 @@ public class MotorChooserDialog extends JDialog implements CloseableDialog {
selectionPanel.setCloseableDialog(this); selectionPanel.setCloseableDialog(this);
} }
public void setMotorMountAndConfig( FlightConfigurationID _fcid, MotorMount _mount ) { public void setMotorMountAndConfig( FlightConfigurationId _fcid, MotorMount _mount ) {
selectionPanel.setMotorMountAndConfig( _fcid, _mount ); selectionPanel.setMotorMountAndConfig( _fcid, _mount );
} }

View File

@ -56,7 +56,7 @@ import net.sf.openrocket.motor.Manufacturer;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.motor.ThrustCurveMotor; import net.sf.openrocket.motor.ThrustCurveMotor;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
import net.sf.openrocket.util.BugException; import net.sf.openrocket.util.BugException;
@ -98,7 +98,7 @@ public class ThrustCurveMotorSelectionPanel extends JPanel implements MotorSelec
private ThrustCurveMotorSet selectedMotorSet; private ThrustCurveMotorSet selectedMotorSet;
private double selectedDelay; private double selectedDelay;
public ThrustCurveMotorSelectionPanel( final FlightConfigurationID fcid, MotorMount mount ) { public ThrustCurveMotorSelectionPanel( final FlightConfigurationId fcid, MotorMount mount ) {
this(); this();
setMotorMountAndConfig( fcid, mount ); setMotorMountAndConfig( fcid, mount );
@ -311,7 +311,7 @@ public class ThrustCurveMotorSelectionPanel extends JPanel implements MotorSelec
} }
public void setMotorMountAndConfig( final FlightConfigurationID _fcid, MotorMount mountToEdit ) { public void setMotorMountAndConfig( final FlightConfigurationId _fcid, MotorMount mountToEdit ) {
if ( null == _fcid ){ if ( null == _fcid ){
throw new NullPointerException(" attempted to set mount with a null FCID. bug. "); throw new NullPointerException(" attempted to set mount with a null FCID. bug. ");
}else if ( null == mountToEdit ){ }else if ( null == mountToEdit ){

View File

@ -89,7 +89,7 @@ import net.sf.openrocket.optimization.rocketoptimization.goals.MinimizationGoal;
import net.sf.openrocket.optimization.rocketoptimization.goals.ValueSeekGoal; import net.sf.openrocket.optimization.rocketoptimization.goals.ValueSeekGoal;
import net.sf.openrocket.optimization.services.OptimizationServiceHelper; import net.sf.openrocket.optimization.services.OptimizationServiceHelper;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -954,14 +954,14 @@ public class GeneralOptimizationDialog extends JDialog {
for (Simulation s : documentCopy.getSimulations()) { for (Simulation s : documentCopy.getSimulations()) {
//FlightConfigurationID id = s.getConfiguration().getFlightConfigurationID(); //FlightConfigurationID id = s.getConfiguration().getFlightConfigurationID();
FlightConfigurationID id = new FlightConfigurationID( "stub id value - General Optimizer"); FlightConfigurationId id = new FlightConfigurationId( "stub id value - General Optimizer");
String name = createSimulationName(s.getName(), descriptor.format(rocket, id)); String name = createSimulationName(s.getName(), descriptor.format(rocket, id));
simulations.add(new Named<Simulation>(s, name)); simulations.add(new Named<Simulation>(s, name));
} }
for (FlightConfiguration config : rocket.getConfigSet()) { for (FlightConfiguration config : rocket.getConfigSet()) {
FlightConfigurationID fcid = config.getFlightConfigurationID(); FlightConfigurationId fcid = config.getFlightConfigurationID();
if ( fcid == null) { if ( fcid == null) {
throw new NullPointerException(" flightconfiguration has a null id... bug."); throw new NullPointerException(" flightconfiguration has a null id... bug.");
} }
@ -1164,7 +1164,7 @@ public class GeneralOptimizationDialog extends JDialog {
} }
// Update the active configuration // Update the active configuration
FlightConfigurationID fcid = getSelectedSimulation().getOptions().getId(); FlightConfigurationId fcid = getSelectedSimulation().getOptions().getId();
getSelectedSimulation().getRocket().setDefaultConfiguration(fcid); getSelectedSimulation().getRocket().setDefaultConfiguration(fcid);
updating = false; updating = false;

View File

@ -20,7 +20,7 @@ import net.sf.openrocket.gui.figure3d.geometry.Geometry.Surface;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.util.Coordinate; import net.sf.openrocket.util.Coordinate;
@ -166,7 +166,7 @@ public abstract class RocketRenderer {
} }
private void renderMotors(GL2 gl, FlightConfiguration configuration) { private void renderMotors(GL2 gl, FlightConfiguration configuration) {
FlightConfigurationID motorID = configuration.getFlightConfigurationID(); FlightConfigurationId motorID = configuration.getFlightConfigurationID();
// for( RocketComponent comp : configuration.getActiveComponents()){ // for( RocketComponent comp : configuration.getActiveComponents()){
// if( comp instanceof MotorMount){ // if( comp instanceof MotorMount){

View File

@ -46,7 +46,7 @@ import net.sf.openrocket.gui.figure3d.photo.exhaust.FlameRenderer;
import net.sf.openrocket.gui.main.Splash; import net.sf.openrocket.gui.main.Splash;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -419,7 +419,7 @@ public class PhotoPanel extends JPanel implements GLEventListener {
//final int currentStageNumber = configuration.getActiveStages()[configuration.getActiveStages().length-1]; //final int currentStageNumber = configuration.getActiveStages()[configuration.getActiveStages().length-1];
//final AxialStage currentStage = (AxialStage)configuration.getRocket().getChild( bottomStageNumber); //final AxialStage currentStage = (AxialStage)configuration.getRocket().getChild( bottomStageNumber);
final FlightConfigurationID motorID = configuration.getFlightConfigurationID(); final FlightConfigurationId motorID = configuration.getFlightConfigurationID();
final Iterator<RocketComponent> iter = configuration.getActiveComponents().iterator(); final Iterator<RocketComponent> iter = configuration.getActiveComponents().iterator();

View File

@ -49,7 +49,7 @@ import net.sf.openrocket.gui.simulation.SimulationWarningDialog;
import net.sf.openrocket.gui.util.Icons; import net.sf.openrocket.gui.util.Icons;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent; import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
import net.sf.openrocket.rocketcomponent.ComponentChangeListener; import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
@ -341,7 +341,7 @@ public class SimulationPanel extends JPanel {
} }
Rocket rkt = document.getRocket(); Rocket rkt = document.getRocket();
FlightConfigurationID fcid = document.getSimulation(row).getId(); FlightConfigurationId fcid = document.getSimulation(row).getId();
return descriptor.format( rkt, fcid); return descriptor.format( rkt, fcid);
} }

View File

@ -22,7 +22,7 @@ import net.sf.openrocket.formatting.RocketDescriptor;
import net.sf.openrocket.gui.util.GUIUtil; import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent; import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
import net.sf.openrocket.util.Pair; import net.sf.openrocket.util.Pair;
@ -64,8 +64,8 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
protected abstract void updateButtonState(); protected abstract void updateButtonState();
protected final void synchronizeConfigurationSelection() { protected final void synchronizeConfigurationSelection() {
FlightConfigurationID defaultFCID = rocket.getDefaultConfiguration().getFlightConfigurationID(); FlightConfigurationId defaultFCID = rocket.getDefaultConfiguration().getFlightConfigurationID();
FlightConfigurationID selectedFCID = getSelectedConfigurationId(); FlightConfigurationId selectedFCID = getSelectedConfigurationId();
if ( selectedFCID == null ) { if ( selectedFCID == null ) {
// need to unselect // need to unselect
@ -78,9 +78,9 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
col = (table.getColumnCount() > 1) ? 1 : 0; col = (table.getColumnCount() > 1) ? 1 : 0;
} }
java.util.List<FlightConfigurationID> ids = rocket.getSortedConfigurationIDs(); java.util.List<FlightConfigurationId> ids = rocket.getSortedConfigurationIDs();
for( int rowNum = 0; rowNum < table.getRowCount(); rowNum++ ) { for( int rowNum = 0; rowNum < table.getRowCount(); rowNum++ ) {
FlightConfigurationID rowFCID = ids.get(rowNum ); FlightConfigurationId rowFCID = ids.get(rowNum );
if ( rowFCID.equals(selectedFCID) ) { if ( rowFCID.equals(selectedFCID) ) {
table.changeSelection(rowNum, col, true, false); table.changeSelection(rowNum, col, true, false);
break; break;
@ -146,7 +146,7 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
return null; return null;
} }
protected FlightConfigurationID getSelectedConfigurationId() { protected FlightConfigurationId getSelectedConfigurationId() {
int col = table.convertColumnIndexToModel(table.getSelectedColumn()); int col = table.convertColumnIndexToModel(table.getSelectedColumn());
int row = table.convertRowIndexToModel(table.getSelectedRow()); int row = table.convertRowIndexToModel(table.getSelectedRow());
if ( row < 0 || col < 0 || row >= table.getRowCount() || col >= table.getColumnCount() ) { if ( row < 0 || col < 0 || row >= table.getRowCount() || col >= table.getColumnCount() ) {
@ -154,13 +154,13 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
} }
Object tableValue = table.getModel().getValueAt(row, col); Object tableValue = table.getModel().getValueAt(row, col);
if ( tableValue instanceof Pair ) { if ( tableValue instanceof Pair ) {
Pair<FlightConfigurationID,T> selectedComponent = (Pair<FlightConfigurationID,T>) tableValue; Pair<FlightConfigurationId,T> selectedComponent = (Pair<FlightConfigurationId,T>) tableValue;
FlightConfigurationID fcid = selectedComponent.getU(); FlightConfigurationId fcid = selectedComponent.getU();
return fcid; return fcid;
} else if ( tableValue instanceof FlightConfigurationID ){ } else if ( tableValue instanceof FlightConfigurationId ){
return (FlightConfigurationID) tableValue; return (FlightConfigurationId) tableValue;
} }
return FlightConfigurationID.ERROR_CONFIGURATION_FCID; return FlightConfigurationId.ERROR_CONFIGURATION_FCID;
} }
protected abstract class FlightConfigurableCellRenderer extends DefaultTableCellRenderer { protected abstract class FlightConfigurableCellRenderer extends DefaultTableCellRenderer {
@ -174,17 +174,17 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
column = table.convertColumnIndexToModel(column); column = table.convertColumnIndexToModel(column);
switch (column) { switch (column) {
case 0: { case 0: {
label.setText(descriptor.format(rocket, (FlightConfigurationID) value)); label.setText(descriptor.format(rocket, (FlightConfigurationId) value));
regular(label); regular(label);
setSelected(label, table, isSelected, hasFocus); setSelected(label, table, isSelected, hasFocus);
return label; return label;
} }
default: { default: {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Pair<FlightConfigurationID, T> v = (Pair<FlightConfigurationID, T>) value; Pair<FlightConfigurationId, T> v = (Pair<FlightConfigurationId, T>) value;
if(v!=null){ if(v!=null){
FlightConfigurationID fcid = v.getU(); FlightConfigurationId fcid = v.getU();
T component = v.getV(); T component = v.getV();
label = format(component, fcid, label ); label = format(component, fcid, label );
} }
@ -224,7 +224,7 @@ public abstract class FlightConfigurablePanel<T extends FlightConfigurableCompon
label.setForeground(Color.BLACK); label.setForeground(Color.BLACK);
} }
protected abstract JLabel format( T component, FlightConfigurationID configId, JLabel label ); protected abstract JLabel format( T component, FlightConfigurationId configId, JLabel label );
} }

View File

@ -11,7 +11,7 @@ import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent; import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
import net.sf.openrocket.rocketcomponent.ComponentChangeListener; import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent; import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -25,7 +25,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
protected final Rocket rocket; protected final Rocket rocket;
protected final Class<T> clazz; protected final Class<T> clazz;
private final List<T> components = new ArrayList<T>(); private final List<T> components = new ArrayList<T>();
private List<FlightConfigurationID> ids = new Vector<FlightConfigurationID>(); private List<FlightConfigurationId> ids = new Vector<FlightConfigurationId>();
public FlightConfigurableTableModel(Class<T> clazz, Rocket rocket) { public FlightConfigurableTableModel(Class<T> clazz, Rocket rocket) {
super(); super();
@ -75,7 +75,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
@Override @Override
public Object getValueAt(int row, int column) { public Object getValueAt(int row, int column) {
FlightConfigurationID fcid = getConfigurationID(row); FlightConfigurationId fcid = getConfigurationID(row);
switch (column) { switch (column) {
case 0: { case 0: {
@ -84,7 +84,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
default: { default: {
int index = column - 1; int index = column - 1;
T d = components.get(index); T d = components.get(index);
return new Pair<FlightConfigurationID, T>(fcid, d); return new Pair<FlightConfigurationId, T>(fcid, d);
} }
} }
} }
@ -104,7 +104,7 @@ public class FlightConfigurableTableModel<T extends FlightConfigurableComponent>
} }
} }
private FlightConfigurationID getConfigurationID(int rowNum) { private FlightConfigurationId getConfigurationID(int rowNum) {
if( rocket.getConfigurationCount() != (ids.size() ) ){ if( rocket.getConfigurationCount() != (ids.size() ) ){
this.ids = rocket.getSortedConfigurationIDs(); this.ids = rocket.getSortedConfigurationIDs();
} }

View File

@ -17,7 +17,7 @@ import net.sf.openrocket.gui.main.BasicFrame;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent; import net.sf.openrocket.rocketcomponent.FlightConfigurableComponent;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.RecoveryDevice; import net.sf.openrocket.rocketcomponent.RecoveryDevice;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
@ -123,7 +123,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
} }
private void addConfiguration() { private void addConfiguration() {
FlightConfigurationID newFCID = new FlightConfigurationID(); FlightConfigurationId newFCID = new FlightConfigurationId();
FlightConfiguration newConfig = new FlightConfiguration( rocket, newFCID ); FlightConfiguration newConfig = new FlightConfiguration( rocket, newFCID );
rocket.setFlightConfiguration(newFCID, newConfig); rocket.setFlightConfiguration(newFCID, newConfig);
@ -137,8 +137,8 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
private void copyConfiguration() { private void copyConfiguration() {
FlightConfiguration oldConfig = rocket.getDefaultConfiguration(); FlightConfiguration oldConfig = rocket.getDefaultConfiguration();
FlightConfiguration newConfig = oldConfig.clone(); FlightConfiguration newConfig = oldConfig.clone();
FlightConfigurationID oldId = oldConfig.getFlightConfigurationID(); FlightConfigurationId oldId = oldConfig.getFlightConfigurationID();
FlightConfigurationID newId = newConfig.getFlightConfigurationID(); FlightConfigurationId newId = newConfig.getFlightConfigurationID();
for (RocketComponent c : rocket) { for (RocketComponent c : rocket) {
if (c instanceof FlightConfigurableComponent) { if (c instanceof FlightConfigurableComponent) {
@ -155,12 +155,12 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
} }
private void renameConfiguration() { private void renameConfiguration() {
FlightConfigurationID currentId = this.motorConfigurationPanel.getSelectedConfigurationId(); FlightConfigurationId currentId = this.motorConfigurationPanel.getSelectedConfigurationId();
new RenameConfigDialog(SwingUtilities.getWindowAncestor(this), rocket, currentId).setVisible(true); new RenameConfigDialog(SwingUtilities.getWindowAncestor(this), rocket, currentId).setVisible(true);
} }
private void removeConfiguration() { private void removeConfiguration() {
FlightConfigurationID currentId = this.motorConfigurationPanel.getSelectedConfigurationId(); FlightConfigurationId currentId = this.motorConfigurationPanel.getSelectedConfigurationId();
if (currentId == null) if (currentId == null)
return; return;
document.removeFlightConfigurationAndSimulations(currentId); document.removeFlightConfigurationAndSimulations(currentId);
@ -185,7 +185,7 @@ public class FlightConfigurationPanel extends JPanel implements StateChangeListe
} }
private void updateButtonState() { private void updateButtonState() {
FlightConfigurationID currentId = rocket.getDefaultConfiguration().getFlightConfigurationID(); FlightConfigurationId currentId = rocket.getDefaultConfiguration().getFlightConfigurationID();
// Enable the remove/rename/copy buttons only when a configuration is selected. // Enable the remove/rename/copy buttons only when a configuration is selected.
removeConfButton.setEnabled(currentId.isValid()); removeConfButton.setEnabled(currentId.isValid());
renameConfButton.setEnabled(currentId.isValid()); renameConfButton.setEnabled(currentId.isValid());

View File

@ -27,7 +27,7 @@ import net.sf.openrocket.gui.dialogs.flightconfiguration.MotorMountConfiguration
import net.sf.openrocket.gui.dialogs.motor.MotorChooserDialog; import net.sf.openrocket.gui.dialogs.motor.MotorChooserDialog;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.motor.MotorConfiguration; import net.sf.openrocket.motor.MotorConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.IgnitionEvent; import net.sf.openrocket.rocketcomponent.IgnitionEvent;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
@ -199,7 +199,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
private void selectMotor() { private void selectMotor() {
MotorMount curMount = getSelectedComponent(); MotorMount curMount = getSelectedComponent();
FlightConfigurationID fcid= getSelectedConfigurationId(); FlightConfigurationId fcid= getSelectedConfigurationId();
if ( (null == fcid )||( null == curMount )){ if ( (null == fcid )||( null == curMount )){
return; return;
} }
@ -226,7 +226,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
private void removeMotor() { private void removeMotor() {
MotorMount curMount = getSelectedComponent(); MotorMount curMount = getSelectedComponent();
FlightConfigurationID fcid= getSelectedConfigurationId(); FlightConfigurationId fcid= getSelectedConfigurationId();
if ( (null == fcid )||( null == curMount )){ if ( (null == fcid )||( null == curMount )){
return; return;
} }
@ -238,7 +238,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
private void selectIgnition() { private void selectIgnition() {
MotorMount curMount = getSelectedComponent(); MotorMount curMount = getSelectedComponent();
FlightConfigurationID fcid= getSelectedConfigurationId(); FlightConfigurationId fcid= getSelectedConfigurationId();
if ( (null == fcid )||( null == curMount )){ if ( (null == fcid )||( null == curMount )){
return; return;
} }
@ -256,7 +256,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
private void resetIgnition() { private void resetIgnition() {
MotorMount curMount = getSelectedComponent(); MotorMount curMount = getSelectedComponent();
FlightConfigurationID fcid= getSelectedConfigurationId(); FlightConfigurationId fcid= getSelectedConfigurationId();
if ( (null == fcid )||( null == curMount )){ if ( (null == fcid )||( null == curMount )){
return; return;
} }
@ -272,7 +272,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
private static final long serialVersionUID = -7462331042920067984L; private static final long serialVersionUID = -7462331042920067984L;
@Override @Override
protected JLabel format( MotorMount mount, FlightConfigurationID configId, JLabel l ) { protected JLabel format( MotorMount mount, FlightConfigurationId configId, JLabel l ) {
JLabel label = new JLabel(); JLabel label = new JLabel();
label.setLayout(new BoxLayout(label, BoxLayout.X_AXIS)); label.setLayout(new BoxLayout(label, BoxLayout.X_AXIS));
@ -307,7 +307,7 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
return str; return str;
} }
private JLabel getIgnitionEventString(FlightConfigurationID id, MotorMount mount) { private JLabel getIgnitionEventString(FlightConfigurationId id, MotorMount mount) {
MotorConfiguration defInstance = mount.getDefaultMotorInstance(); MotorConfiguration defInstance = mount.getDefaultMotorInstance();
MotorConfiguration curInstance = mount.getMotorInstance(id); MotorConfiguration curInstance = mount.getMotorInstance(id);

View File

@ -18,7 +18,7 @@ import net.sf.openrocket.gui.dialogs.flightconfiguration.DeploymentSelectionDial
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration;
import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent; import net.sf.openrocket.rocketcomponent.DeploymentConfiguration.DeployEvent;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.RecoveryDevice; import net.sf.openrocket.rocketcomponent.RecoveryDevice;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -102,7 +102,7 @@ public class RecoveryConfigurationPanel extends FlightConfigurablePanel<Recovery
if (c == null) { if (c == null) {
return; return;
} }
FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID(); FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
c.getDeploymentConfigurations().reset(id); c.getDeploymentConfigurations().reset(id);
fireTableDataChanged(); fireTableDataChanged();
} }
@ -116,7 +116,7 @@ public class RecoveryConfigurationPanel extends FlightConfigurablePanel<Recovery
class RecoveryTableCellRenderer extends FlightConfigurablePanel<RecoveryDevice>.FlightConfigurableCellRenderer { class RecoveryTableCellRenderer extends FlightConfigurablePanel<RecoveryDevice>.FlightConfigurableCellRenderer {
@Override @Override
protected JLabel format(RecoveryDevice recovery, FlightConfigurationID configId, JLabel label) { protected JLabel format(RecoveryDevice recovery, FlightConfigurationId configId, JLabel label) {
DeploymentConfiguration deployConfig = recovery.getDeploymentConfigurations().get(configId); DeploymentConfiguration deployConfig = recovery.getDeploymentConfigurations().get(configId);
String spec = getDeploymentSpecification(deployConfig); String spec = getDeploymentSpecification(deployConfig);
label.setText(spec); label.setText(spec);

View File

@ -17,7 +17,7 @@ import net.sf.openrocket.formatting.RocketDescriptor;
import net.sf.openrocket.gui.dialogs.flightconfiguration.SeparationSelectionDialog; import net.sf.openrocket.gui.dialogs.flightconfiguration.SeparationSelectionDialog;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.AxialStage; import net.sf.openrocket.rocketcomponent.AxialStage;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration; import net.sf.openrocket.rocketcomponent.StageSeparationConfiguration;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -111,7 +111,7 @@ public class SeparationConfigurationPanel extends FlightConfigurablePanel<AxialS
} }
// why? // why?
FlightConfigurationID id = rocket.getDefaultConfiguration().getFlightConfigurationID(); FlightConfigurationId id = rocket.getDefaultConfiguration().getFlightConfigurationID();
stage.getSeparationConfigurations().reset(id); stage.getSeparationConfigurations().reset(id);
fireTableDataChanged(); fireTableDataChanged();
@ -126,7 +126,7 @@ public class SeparationConfigurationPanel extends FlightConfigurablePanel<AxialS
private static final long serialVersionUID = -7066580803931938686L; private static final long serialVersionUID = -7066580803931938686L;
@Override @Override
protected JLabel format(AxialStage stage, FlightConfigurationID configId, JLabel label) { protected JLabel format(AxialStage stage, FlightConfigurationId configId, JLabel label) {
StageSeparationConfiguration sepConfig = stage.getSeparationConfigurations().get(configId); StageSeparationConfiguration sepConfig = stage.getSeparationConfigurations().get(configId);
String spec = getSeparationSpecification(sepConfig); String spec = getSeparationSpecification(sepConfig);
label.setText(spec); label.setText(spec);

View File

@ -32,7 +32,7 @@ import net.sf.openrocket.masscalc.MassCalculator.MassCalcType;
import net.sf.openrocket.motor.Motor; import net.sf.openrocket.motor.Motor;
import net.sf.openrocket.rocketcomponent.AxialStage; import net.sf.openrocket.rocketcomponent.AxialStage;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.MotorMount; import net.sf.openrocket.rocketcomponent.MotorMount;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
@ -226,7 +226,7 @@ public class DesignReport {
int motorNumber = 0; int motorNumber = 0;
for( FlightConfiguration curConfig : rocket.getConfigSet()){ for( FlightConfiguration curConfig : rocket.getConfigSet()){
FlightConfigurationID fcid = curConfig.getFlightConfigurationID(); FlightConfigurationId fcid = curConfig.getFlightConfigurationID();
PdfPTable parent = new PdfPTable(2); PdfPTable parent = new PdfPTable(2);
parent.setWidthPercentage(100); parent.setWidthPercentage(100);
@ -308,7 +308,7 @@ public class DesignReport {
* @param motorId the motor ID to output * @param motorId the motor ID to output
* @param parent the parent to which the motor data will be added * @param parent the parent to which the motor data will be added
*/ */
private void addMotorData(Rocket rocket, FlightConfigurationID motorId, final PdfPTable parent) { private void addMotorData(Rocket rocket, FlightConfigurationId motorId, final PdfPTable parent) {
PdfPTable motorTable = new PdfPTable(8); PdfPTable motorTable = new PdfPTable(8);
motorTable.setWidthPercentage(68); motorTable.setWidthPercentage(68);
@ -443,7 +443,7 @@ public class DesignReport {
* @param parent the parent to which the simulation flight data will be added * @param parent the parent to which the simulation flight data will be added
* @param leading the number of points for the leading * @param leading the number of points for the leading
*/ */
private void addFlightData(final FlightData flight, final Rocket theRocket, final FlightConfigurationID motorId, final PdfPTable parent, int leading) { private void addFlightData(final FlightData flight, final Rocket theRocket, final FlightConfigurationId motorId, final PdfPTable parent, int leading) {
// Output the flight data // Output the flight data
if (flight != null) { if (flight != null) {
@ -509,7 +509,7 @@ public class DesignReport {
* *
* @return the flight data from the simulation for the specified motor id, or null if not found * @return the flight data from the simulation for the specified motor id, or null if not found
*/ */
private FlightData findSimulation(final FlightConfigurationID motorId, List<Simulation> simulations) { private FlightData findSimulation(final FlightConfigurationId motorId, List<Simulation> simulations) {
// Perform flight simulation // Perform flight simulation
FlightData flight = null; FlightData flight = null;
try { try {

View File

@ -58,7 +58,7 @@ import net.sf.openrocket.masscalc.MassCalculator.MassCalcType;
import net.sf.openrocket.rocketcomponent.ComponentChangeEvent; import net.sf.openrocket.rocketcomponent.ComponentChangeEvent;
import net.sf.openrocket.rocketcomponent.ComponentChangeListener; import net.sf.openrocket.rocketcomponent.ComponentChangeListener;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.rocketcomponent.Rocket; import net.sf.openrocket.rocketcomponent.Rocket;
import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.RocketComponent;
import net.sf.openrocket.rocketcomponent.SymmetricComponent; import net.sf.openrocket.rocketcomponent.SymmetricComponent;
@ -141,7 +141,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
// The functional ID of the rocket that was simulated // The functional ID of the rocket that was simulated
private int flightDataFunctionalID = -1; private int flightDataFunctionalID = -1;
private FlightConfigurationID flightDataMotorID = null; private FlightConfigurationId flightDataMotorID = null;
private SimulationWorker backgroundSimulationWorker = null; private SimulationWorker backgroundSimulationWorker = null;
@ -316,7 +316,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
Object source = ae.getSource(); Object source = ae.getSource();
if( source instanceof JComboBox ){ if( source instanceof JComboBox ){
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
JComboBox<FlightConfigurationID> box = (JComboBox<FlightConfigurationID>) source; JComboBox<FlightConfigurationId> box = (JComboBox<FlightConfigurationId>) source;
FlightConfiguration newConfig = (FlightConfiguration)box.getSelectedItem(); FlightConfiguration newConfig = (FlightConfiguration)box.getSelectedItem();
document.getRocket().getConfigSet().setDefault( newConfig); document.getRocket().getConfigSet().setDefault( newConfig);
updateExtras(); updateExtras();

View File

@ -25,7 +25,7 @@ import net.sf.openrocket.gui.adaptors.ParameterSetModel;
import net.sf.openrocket.gui.util.GUIUtil; import net.sf.openrocket.gui.util.GUIUtil;
import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.l10n.Translator;
import net.sf.openrocket.rocketcomponent.FlightConfiguration; import net.sf.openrocket.rocketcomponent.FlightConfiguration;
import net.sf.openrocket.rocketcomponent.FlightConfigurationID; import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
import net.sf.openrocket.simulation.SimulationOptions; import net.sf.openrocket.simulation.SimulationOptions;
import net.sf.openrocket.simulation.extension.SimulationExtension; import net.sf.openrocket.simulation.extension.SimulationExtension;
import net.sf.openrocket.startup.Application; import net.sf.openrocket.startup.Application;
@ -160,7 +160,7 @@ public class SimulationEditDialog extends JDialog {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
FlightConfiguration config = (FlightConfiguration) configCombo.getSelectedItem(); FlightConfiguration config = (FlightConfiguration) configCombo.getSelectedItem();
FlightConfigurationID id = config.getFlightConfigurationID(); FlightConfigurationId id = config.getFlightConfigurationID();
conditions.setFlightConfigurationId( id ); conditions.setFlightConfigurationId( id );
} }
}); });