Merge pull request #1762 from SiboVG/issue-1761
[#1761] Fix Transition/Nose cone shape parameter resetting
This commit is contained in:
commit
3f55f5c67d
@ -257,7 +257,8 @@ public class Transition extends SymmetricComponent implements InsideColorCompone
|
|||||||
if (type == null) {
|
if (type == null) {
|
||||||
throw new IllegalArgumentException("setType called with null argument");
|
throw new IllegalArgumentException("setType called with null argument");
|
||||||
}
|
}
|
||||||
if ((this.type == type) && (this.clipped == type.isClippable()) && (this.shapeParameter == type.defaultParameter()))
|
|
||||||
|
if (this.type == type)
|
||||||
return;
|
return;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.clipped = type.isClippable();
|
this.clipped = type.isClippable();
|
||||||
@ -687,6 +688,8 @@ public class Transition extends SymmetricComponent implements InsideColorCompone
|
|||||||
if ( preset.has(ComponentPreset.SHAPE) ) {
|
if ( preset.has(ComponentPreset.SHAPE) ) {
|
||||||
Shape s = preset.get(ComponentPreset.SHAPE);
|
Shape s = preset.get(ComponentPreset.SHAPE);
|
||||||
this.setType(s);
|
this.setType(s);
|
||||||
|
this.setClipped(s.canClip);
|
||||||
|
this.setShapeParameter(s.defaultParameter());
|
||||||
}
|
}
|
||||||
if ( preset.has(ComponentPreset.AFT_OUTER_DIAMETER) ) {
|
if ( preset.has(ComponentPreset.AFT_OUTER_DIAMETER) ) {
|
||||||
double outerDiameter = preset.get(ComponentPreset.AFT_OUTER_DIAMETER);
|
double outerDiameter = preset.get(ComponentPreset.AFT_OUTER_DIAMETER);
|
||||||
|
@ -78,13 +78,13 @@ public class TransitionConfig extends RocketComponentConfig {
|
|||||||
checkbox.setToolTipText(trans.get("TransitionCfg.checkbox.Clipped.ttip"));
|
checkbox.setToolTipText(trans.get("TransitionCfg.checkbox.Clipped.ttip"));
|
||||||
panel.add(checkbox, "wrap");
|
panel.add(checkbox, "wrap");
|
||||||
order.add(checkbox);
|
order.add(checkbox);
|
||||||
|
|
||||||
//// Shape parameter:
|
|
||||||
this.shapeLabel = new JLabel(trans.get("TransitionCfg.lbl.Shapeparam"));
|
|
||||||
panel.add(shapeLabel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
//// Shape parameter:
|
||||||
|
this.shapeLabel = new JLabel(trans.get("TransitionCfg.lbl.Shapeparam"));
|
||||||
|
panel.add(shapeLabel);
|
||||||
|
|
||||||
final DoubleModel shapeModel = new DoubleModel(component, "ShapeParameter");
|
final DoubleModel shapeModel = new DoubleModel(component, "ShapeParameter");
|
||||||
|
|
||||||
this.shapeSpinner = new JSpinner(shapeModel.getSpinnerModel());
|
this.shapeSpinner = new JSpinner(shapeModel.getSpinnerModel());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user