diff --git a/core/src/net/sf/openrocket/rocketcomponent/ComponentAssembly.java b/core/src/net/sf/openrocket/rocketcomponent/ComponentAssembly.java index dac0541a8..ca18384fc 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/ComponentAssembly.java +++ b/core/src/net/sf/openrocket/rocketcomponent/ComponentAssembly.java @@ -181,10 +181,8 @@ public abstract class ComponentAssembly extends RocketComponent implements Axial public void updateBounds() { // currently only updates the length this.length = 0; - Iterator childIterator = this.getChildren().iterator(); - while (childIterator.hasNext()) { - RocketComponent curChild = childIterator.next(); - if(curChild.isAfter()){ + for (RocketComponent curChild : this.getChildren()) { + if (curChild.isAfter()) { this.length += curChild.getLength(); } } diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/ComponentAssemblyShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/ComponentAssemblyShapes.java index 5dd94d4d0..f6b2a5bcf 100644 --- a/swing/src/net/sf/openrocket/gui/rocketfigure/ComponentAssemblyShapes.java +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/ComponentAssemblyShapes.java @@ -6,6 +6,7 @@ import net.sf.openrocket.rocketcomponent.ParallelStage; import net.sf.openrocket.rocketcomponent.PodSet; import net.sf.openrocket.rocketcomponent.RocketComponent; import net.sf.openrocket.rocketcomponent.position.AxialMethod; +import net.sf.openrocket.rocketcomponent.position.RadiusMethod; import net.sf.openrocket.util.Color; import net.sf.openrocket.util.Transformation; @@ -30,8 +31,10 @@ public class ComponentAssemblyShapes extends RocketComponentShape { } // Correct the radius to be at the "reference point" dictated by the component's radius offset. - double boundingRadius = assembly.getBoundingRadius(); - correctedTransform = correctedTransform.applyTransformation(new Transformation(0, -boundingRadius, 0)); + if (assembly.getRadiusMethod() == RadiusMethod.RELATIVE) { + double boundingRadius = assembly.getBoundingRadius(); + correctedTransform = correctedTransform.applyTransformation(new Transformation(0, -boundingRadius, 0)); + } double markerRadius = getDisplayRadius(component); Shape[] s = EmptyShapes.getShapesSideWithSelectionSquare(correctedTransform, markerRadius); @@ -55,8 +58,11 @@ public class ComponentAssemblyShapes extends RocketComponentShape { ComponentAssembly assembly = (ComponentAssembly) component; // Correct the radius to be at the "reference point" dictated by the component's radius offset. - double boundingRadius = assembly.getBoundingRadius(); - Transformation correctedTransform = transformation.applyTransformation(new Transformation(0, -boundingRadius, 0)); + Transformation correctedTransform = transformation; + if (assembly.getRadiusMethod() == RadiusMethod.RELATIVE) { + double boundingRadius = assembly.getBoundingRadius(); + correctedTransform = correctedTransform.applyTransformation(new Transformation(0, -boundingRadius, 0)); + } double markerRadius = getDisplayRadius(component); Shape[] s = EmptyShapes.getShapesBackWithSelectionSquare(correctedTransform, markerRadius); diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/ParallelStageShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/ParallelStageShapes.java new file mode 100644 index 000000000..8c99ee9d7 --- /dev/null +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/ParallelStageShapes.java @@ -0,0 +1,5 @@ +package net.sf.openrocket.gui.rocketfigure; + +public class ParallelStageShapes extends ComponentAssemblyShapes { + // Everything is handled by the ComponentAssemblyShapes class. +} diff --git a/swing/src/net/sf/openrocket/gui/rocketfigure/PodSetShapes.java b/swing/src/net/sf/openrocket/gui/rocketfigure/PodSetShapes.java new file mode 100644 index 000000000..d1e391132 --- /dev/null +++ b/swing/src/net/sf/openrocket/gui/rocketfigure/PodSetShapes.java @@ -0,0 +1,5 @@ +package net.sf.openrocket.gui.rocketfigure; + +public class PodSetShapes extends ComponentAssemblyShapes { + // Everything is handled by the ComponentAssemblyShapes class. +}