Merge pull request #455 from teyrana/fix_events
Address Some Instances of Issue #329: Connect more UI elements to their component's events
This commit is contained in:
commit
b466b39db0
@ -50,9 +50,9 @@ public class BodyTubeConfig extends RocketComponentConfig {
|
|||||||
//// Body tube diameter
|
//// Body tube diameter
|
||||||
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Outerdiameter")));
|
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Outerdiameter")));
|
||||||
|
|
||||||
DoubleModel od = new DoubleModel(component, "OuterRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
// Diameter = 2*Radius
|
// Diameter = 2*Radius
|
||||||
|
final DoubleModel od = new DoubleModel(component, "OuterRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
component.addChangeListener(od);
|
||||||
spin = new JSpinner(od.getSpinnerModel());
|
spin = new JSpinner(od.getSpinnerModel());
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
spin.setEditor(new SpinnerEditor(spin));
|
||||||
panel.add(spin, "growx");
|
panel.add(spin, "growx");
|
||||||
@ -60,38 +60,38 @@ public class BodyTubeConfig extends RocketComponentConfig {
|
|||||||
panel.add(new UnitSelector(od), "growx");
|
panel.add(new UnitSelector(od), "growx");
|
||||||
panel.add(new BasicSlider(od.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
panel.add(new BasicSlider(od.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
||||||
|
|
||||||
JCheckBox check = new JCheckBox(od.getAutomaticAction());
|
|
||||||
//// Automatic
|
//// Automatic
|
||||||
|
javax.swing.Action outerAutoAction = od.getAutomaticAction();
|
||||||
|
JCheckBox check = new JCheckBox(outerAutoAction);
|
||||||
check.setText(trans.get("BodyTubecfg.checkbox.Automatic"));
|
check.setText(trans.get("BodyTubecfg.checkbox.Automatic"));
|
||||||
panel.add(check, "skip, span 2, wrap");
|
panel.add(check, "skip, span 2, wrap");
|
||||||
|
|
||||||
|
|
||||||
//// Inner diameter
|
//// Inner diameter
|
||||||
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Innerdiameter")));
|
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Innerdiameter")));
|
||||||
|
|
||||||
// Diameter = 2*Radius
|
// Diameter = 2*Radius
|
||||||
DoubleModel m = new DoubleModel(component, "InnerRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
final DoubleModel innerRadiusModel = new DoubleModel(component, "InnerRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
component.addChangeListener(innerRadiusModel);
|
||||||
|
|
||||||
|
spin = new JSpinner(innerRadiusModel.getSpinnerModel());
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
spin.setEditor(new SpinnerEditor(spin));
|
||||||
panel.add(spin, "growx");
|
panel.add(spin, "growx");
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
panel.add(new UnitSelector(innerRadiusModel), "growx");
|
||||||
panel.add(new BasicSlider(m.getSliderModel(new DoubleModel(0), od)), "w 100lp, wrap");
|
panel.add(new BasicSlider(innerRadiusModel.getSliderModel(new DoubleModel(0), od)), "w 100lp, wrap");
|
||||||
|
|
||||||
|
|
||||||
//// Wall thickness
|
//// Wall thickness
|
||||||
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Wallthickness")));
|
panel.add(new JLabel(trans.get("BodyTubecfg.lbl.Wallthickness")));
|
||||||
|
|
||||||
m = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
final DoubleModel thicknessModel = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
component.addChangeListener(thicknessModel);
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
spin = new JSpinner(thicknessModel.getSpinnerModel());
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
spin.setEditor(new SpinnerEditor(spin));
|
||||||
panel.add(spin, "growx");
|
panel.add(spin, "growx");
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
panel.add(new UnitSelector(thicknessModel), "growx");
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.01)), "w 100lp, wrap 0px");
|
panel.add(new BasicSlider(thicknessModel.getSliderModel(0, 0.01)), "w 100lp, wrap 0px");
|
||||||
|
|
||||||
//// Filled
|
//// Filled
|
||||||
check = new JCheckBox(new BooleanModel(component, "Filled"));
|
check = new JCheckBox(new BooleanModel(component, "Filled"));
|
||||||
|
@ -44,104 +44,98 @@ public class NoseConeConfig extends RocketComponentConfig {
|
|||||||
public NoseConeConfig(OpenRocketDocument d, RocketComponent c) {
|
public NoseConeConfig(OpenRocketDocument d, RocketComponent c) {
|
||||||
super(d, c);
|
super(d, c);
|
||||||
|
|
||||||
DoubleModel m;
|
final JPanel panel = new JPanel(new MigLayout("", "[][65lp::][30lp::]"));
|
||||||
JPanel panel = new JPanel(new MigLayout("", "[][65lp::][30lp::]"));
|
|
||||||
|
|
||||||
//// Shape selection
|
//// Shape selection
|
||||||
//// Nose cone shape:
|
{//// Nose cone shape:
|
||||||
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Noseconeshape")));
|
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Noseconeshape")));
|
||||||
|
|
||||||
Transition.Shape selected = ((NoseCone) component).getType();
|
Transition.Shape selected = ((NoseCone) component).getType();
|
||||||
Transition.Shape[] typeList = Transition.Shape.values();
|
Transition.Shape[] typeList = Transition.Shape.values();
|
||||||
|
|
||||||
final JComboBox<Transition.Shape> typeBox = new JComboBox<Transition.Shape>(typeList);
|
final JComboBox<Transition.Shape> typeBox = new JComboBox<Transition.Shape>(typeList);
|
||||||
typeBox.setEditable(false);
|
typeBox.setEditable(false);
|
||||||
typeBox.setSelectedItem(selected);
|
typeBox.setSelectedItem(selected);
|
||||||
typeBox.addActionListener(new ActionListener() {
|
typeBox.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
Transition.Shape s = (Transition.Shape) typeBox.getSelectedItem();
|
Transition.Shape s = (Transition.Shape) typeBox.getSelectedItem();
|
||||||
((NoseCone) component).setType(s);
|
((NoseCone) component).setType(s);
|
||||||
description.setText(PREDESC + s.getNoseConeDescription());
|
description.setText(PREDESC + s.getNoseConeDescription());
|
||||||
updateEnabled();
|
updateEnabled();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(typeBox, "span, wrap rel");
|
panel.add(typeBox, "span, wrap rel");
|
||||||
|
|
||||||
|
//// Shape parameter:
|
||||||
|
this.shapeLabel = new JLabel(trans.get("NoseConeCfg.lbl.Shapeparam"));
|
||||||
|
panel.add(shapeLabel);
|
||||||
|
|
||||||
|
final DoubleModel parameterModel = new DoubleModel(component, "ShapeParameter");
|
||||||
|
|
||||||
|
this.shapeSpinner = new JSpinner(parameterModel.getSpinnerModel());
|
||||||
|
shapeSpinner.setEditor(new SpinnerEditor(shapeSpinner));
|
||||||
|
panel.add(shapeSpinner, "growx");
|
||||||
|
|
||||||
|
DoubleModel min = new DoubleModel(component, "ShapeParameterMin");
|
||||||
|
DoubleModel max = new DoubleModel(component, "ShapeParameterMax");
|
||||||
|
this.shapeSlider = new BasicSlider(parameterModel.getSliderModel(min, max));
|
||||||
|
panel.add(shapeSlider, "skip, w 100lp, wrap para");
|
||||||
|
|
||||||
|
updateEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
{ /// Nose cone length:
|
||||||
|
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Noseconelength")));
|
||||||
|
|
||||||
|
final DoubleModel lengthModel = new DoubleModel(component, "Length", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
JSpinner spin = new JSpinner(lengthModel.getSpinnerModel());
|
||||||
|
spin.setEditor(new SpinnerEditor(spin));
|
||||||
|
panel.add(spin, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(lengthModel), "growx");
|
||||||
|
panel.add(new BasicSlider(lengthModel.getSliderModel(0, 0.1, 0.7)), "w 100lp, wrap");
|
||||||
|
}
|
||||||
|
{
|
||||||
|
/// Base diameter:
|
||||||
|
|
||||||
|
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Basediam")));
|
||||||
|
|
||||||
|
final DoubleModel aftRadiusModel = new DoubleModel(component, "AftRadius", 2.0, UnitGroup.UNITS_LENGTH, 0); // Diameter = 2*Radius
|
||||||
|
component.addChangeListener(aftRadiusModel);
|
||||||
|
final JSpinner radiusSpinner = new JSpinner(aftRadiusModel.getSpinnerModel());
|
||||||
|
radiusSpinner.setEditor(new SpinnerEditor(radiusSpinner));
|
||||||
|
panel.add(radiusSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(aftRadiusModel), "growx");
|
||||||
|
panel.add(new BasicSlider(aftRadiusModel.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
||||||
|
|
||||||
|
JCheckBox check = new JCheckBox(aftRadiusModel.getAutomaticAction());
|
||||||
|
//// Automatic
|
||||||
|
check.setText(trans.get("NoseConeCfg.checkbox.Automatic"));
|
||||||
|
panel.add(check, "skip, span 2, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Wall thickness:
|
||||||
|
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Wallthickness")));
|
||||||
|
|
||||||
|
final DoubleModel thicknessModel = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
component.addChangeListener(thicknessModel);
|
||||||
|
final JSpinner thicknessSpinner = new JSpinner(thicknessModel.getSpinnerModel());
|
||||||
|
thicknessSpinner.setEditor(new SpinnerEditor(thicknessSpinner));
|
||||||
|
panel.add(thicknessSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(thicknessModel), "growx");
|
||||||
|
panel.add(new BasicSlider(thicknessModel.getSliderModel(0, 0.01)), "w 100lp, wrap 0px");
|
||||||
|
|
||||||
|
|
||||||
|
final JCheckBox filledCheckbox = new JCheckBox(new BooleanModel(component, "Filled"));
|
||||||
//// Shape parameter
|
//// Filled
|
||||||
//// Shape parameter:
|
filledCheckbox .setText(trans.get("NoseConeCfg.checkbox.Filled"));
|
||||||
shapeLabel = new JLabel(trans.get("NoseConeCfg.lbl.Shapeparam"));
|
panel.add(filledCheckbox, "skip, span 2, wrap");
|
||||||
panel.add(shapeLabel);
|
}
|
||||||
|
|
||||||
m = new DoubleModel(component, "ShapeParameter");
|
|
||||||
|
|
||||||
shapeSpinner = new JSpinner(m.getSpinnerModel());
|
|
||||||
shapeSpinner.setEditor(new SpinnerEditor(shapeSpinner));
|
|
||||||
panel.add(shapeSpinner, "growx");
|
|
||||||
|
|
||||||
DoubleModel min = new DoubleModel(component, "ShapeParameterMin");
|
|
||||||
DoubleModel max = new DoubleModel(component, "ShapeParameterMax");
|
|
||||||
shapeSlider = new BasicSlider(m.getSliderModel(min, max));
|
|
||||||
panel.add(shapeSlider, "skip, w 100lp, wrap para");
|
|
||||||
|
|
||||||
updateEnabled();
|
|
||||||
|
|
||||||
|
|
||||||
//// Length
|
|
||||||
//// Nose cone length:
|
|
||||||
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Noseconelength")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "Length", UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
JSpinner spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.1, 0.7)), "w 100lp, wrap");
|
|
||||||
|
|
||||||
//// Diameter
|
|
||||||
//// Base diameter:
|
|
||||||
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Basediam")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "AftRadius", 2.0, UnitGroup.UNITS_LENGTH, 0); // Diameter = 2*Radius
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
|
||||||
|
|
||||||
JCheckBox check = new JCheckBox(m.getAutomaticAction());
|
|
||||||
//// Automatic
|
|
||||||
check.setText(trans.get("NoseConeCfg.checkbox.Automatic"));
|
|
||||||
panel.add(check, "skip, span 2, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Wall thickness:
|
|
||||||
panel.add(new JLabel(trans.get("NoseConeCfg.lbl.Wallthickness")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.01)), "w 100lp, wrap 0px");
|
|
||||||
|
|
||||||
|
|
||||||
check = new JCheckBox(new BooleanModel(component, "Filled"));
|
|
||||||
//// Filled
|
|
||||||
check.setText(trans.get("NoseConeCfg.checkbox.Filled"));
|
|
||||||
panel.add(check, "skip, span 2, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
panel.add(new JLabel(""), "growy");
|
panel.add(new JLabel(""), "growy");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// Description
|
//// Description
|
||||||
|
|
||||||
@ -153,8 +147,6 @@ public class NoseConeConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
|
|
||||||
//// Material
|
//// Material
|
||||||
|
|
||||||
|
|
||||||
panel2.add(materialPanel( Material.Type.BULK), "span, wrap");
|
panel2.add(materialPanel( Material.Type.BULK), "span, wrap");
|
||||||
panel.add(panel2, "cell 4 0, gapleft paragraph, aligny 0%, spany");
|
panel.add(panel2, "cell 4 0, gapleft paragraph, aligny 0%, spany");
|
||||||
|
|
||||||
|
@ -45,13 +45,7 @@ public class TransitionConfig extends RocketComponentConfig {
|
|||||||
public TransitionConfig(OpenRocketDocument d, RocketComponent c) {
|
public TransitionConfig(OpenRocketDocument d, RocketComponent c) {
|
||||||
super(d, c);
|
super(d, c);
|
||||||
|
|
||||||
DoubleModel m;
|
final JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
||||||
JSpinner spin;
|
|
||||||
JCheckBox checkbox;
|
|
||||||
|
|
||||||
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// Shape selection
|
//// Shape selection
|
||||||
//// Transition shape:
|
//// Transition shape:
|
||||||
@ -73,108 +67,107 @@ public class TransitionConfig extends RocketComponentConfig {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
panel.add(typeBox, "span, split 2");
|
panel.add(typeBox, "span, split 2");
|
||||||
|
|
||||||
//// Clipped
|
|
||||||
checkbox = new JCheckBox(new BooleanModel(component, "Clipped"));
|
|
||||||
//// Clipped
|
|
||||||
checkbox.setText(trans.get("TransitionCfg.checkbox.Clipped"));
|
|
||||||
panel.add(checkbox, "wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Shape parameter:
|
{//// Clipped
|
||||||
shapeLabel = new JLabel(trans.get("TransitionCfg.lbl.Shapeparam"));
|
final JCheckBox checkbox = new JCheckBox(new BooleanModel(component, "Clipped"));
|
||||||
panel.add(shapeLabel);
|
checkbox.setText(trans.get("TransitionCfg.checkbox.Clipped"));
|
||||||
|
panel.add(checkbox, "wrap");
|
||||||
m = new DoubleModel(component, "ShapeParameter");
|
|
||||||
|
|
||||||
shapeSpinner = new JSpinner(m.getSpinnerModel());
|
|
||||||
shapeSpinner.setEditor(new SpinnerEditor(shapeSpinner));
|
|
||||||
panel.add(shapeSpinner, "growx");
|
|
||||||
|
|
||||||
DoubleModel min = new DoubleModel(component, "ShapeParameterMin");
|
|
||||||
DoubleModel max = new DoubleModel(component, "ShapeParameterMax");
|
|
||||||
shapeSlider = new BasicSlider(m.getSliderModel(min, max));
|
|
||||||
panel.add(shapeSlider, "skip, w 100lp, wrap");
|
|
||||||
|
|
||||||
updateEnabled();
|
|
||||||
|
|
||||||
|
|
||||||
//// Length
|
//// Shape parameter:
|
||||||
//// Transition length:
|
this.shapeLabel = new JLabel(trans.get("TransitionCfg.lbl.Shapeparam"));
|
||||||
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Transitionlength")));
|
panel.add(shapeLabel);
|
||||||
|
}
|
||||||
m = new DoubleModel(component, "Length", UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.05, 0.3)), "w 100lp, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Transition diameter 1
|
{
|
||||||
//// Fore diameter:
|
final DoubleModel shapeModel = new DoubleModel(component, "ShapeParameter");
|
||||||
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Forediam")));
|
|
||||||
|
|
||||||
DoubleModel od = new DoubleModel(component, "ForeRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
// Diameter = 2*Radius
|
|
||||||
|
|
||||||
spin = new JSpinner(od.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(od), "growx");
|
|
||||||
panel.add(new BasicSlider(od.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
|
||||||
|
|
||||||
checkbox = new JCheckBox(od.getAutomaticAction());
|
|
||||||
//// Automatic
|
|
||||||
checkbox.setText(trans.get("TransitionCfg.checkbox.Automatic"));
|
|
||||||
panel.add(checkbox, "skip, span 2, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Transition diameter 2
|
this.shapeSpinner = new JSpinner(shapeModel.getSpinnerModel());
|
||||||
//// Aft diameter:
|
shapeSpinner.setEditor(new SpinnerEditor(shapeSpinner));
|
||||||
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Aftdiam")));
|
panel.add(shapeSpinner, "growx");
|
||||||
|
|
||||||
od = new DoubleModel(component, "AftRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
// Diameter = 2*Radius
|
|
||||||
|
|
||||||
spin = new JSpinner(od.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(od), "growx");
|
|
||||||
panel.add(new BasicSlider(od.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
|
||||||
|
|
||||||
checkbox = new JCheckBox(od.getAutomaticAction());
|
|
||||||
//// Automatic
|
|
||||||
checkbox.setText(trans.get("TransitionCfg.checkbox.Automatic"));
|
|
||||||
panel.add(checkbox, "skip, span 2, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Wall thickness:
|
DoubleModel min = new DoubleModel(component, "ShapeParameterMin");
|
||||||
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Wallthickness")));
|
DoubleModel max = new DoubleModel(component, "ShapeParameterMax");
|
||||||
|
this.shapeSlider = new BasicSlider(shapeModel.getSliderModel(min, max));
|
||||||
m = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
panel.add(shapeSlider, "skip, w 100lp, wrap");
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.01)), "w 100lp, wrap 0px");
|
|
||||||
|
|
||||||
//// Filled
|
|
||||||
checkbox = new JCheckBox(new BooleanModel(component, "Filled"));
|
|
||||||
//// Filled
|
|
||||||
checkbox.setText(trans.get("TransitionCfg.checkbox.Filled"));
|
|
||||||
panel.add(checkbox, "skip, span 2, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
|
updateEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
{/// Transition length:
|
||||||
|
|
||||||
|
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Transitionlength")));
|
||||||
|
|
||||||
|
final DoubleModel lengthModel = new DoubleModel(component, "Length", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
|
||||||
|
final JSpinner lengthSpinner = new JSpinner(lengthModel.getSpinnerModel());
|
||||||
|
lengthSpinner.setEditor(new SpinnerEditor(lengthSpinner));
|
||||||
|
panel.add(lengthSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(lengthModel), "growx");
|
||||||
|
panel.add(new BasicSlider(lengthModel.getSliderModel(0, 0.05, 0.3)), "w 100lp, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{ /// Fore diameter:
|
||||||
|
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Forediam")));
|
||||||
|
|
||||||
|
final DoubleModel foreRadiusModel = new DoubleModel(component, "ForeRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
// Diameter = 2*Radius
|
||||||
|
component.addChangeListener(foreRadiusModel );
|
||||||
|
|
||||||
|
final JSpinner foreRadiusSpinner = new JSpinner(foreRadiusModel.getSpinnerModel());
|
||||||
|
foreRadiusSpinner.setEditor(new SpinnerEditor(foreRadiusSpinner));
|
||||||
|
panel.add(foreRadiusSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(foreRadiusModel), "growx");
|
||||||
|
panel.add(new BasicSlider(foreRadiusModel.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
||||||
|
|
||||||
|
final JCheckBox checkbox = new JCheckBox(foreRadiusModel.getAutomaticAction());
|
||||||
|
//// Automatic
|
||||||
|
checkbox.setText(trans.get("TransitionCfg.checkbox.Automatic"));
|
||||||
|
panel.add(checkbox, "skip, span 2, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{ //// Aft diameter:
|
||||||
|
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Aftdiam")));
|
||||||
|
|
||||||
|
final DoubleModel aftRadiusModel = new DoubleModel(component, "AftRadius", 2, UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
// Diameter = 2*Radius
|
||||||
|
component.addChangeListener(aftRadiusModel);
|
||||||
|
|
||||||
|
final JSpinner aftRadiusSpinner = new JSpinner(aftRadiusModel .getSpinnerModel());
|
||||||
|
aftRadiusSpinner.setEditor(new SpinnerEditor(aftRadiusSpinner));
|
||||||
|
panel.add(aftRadiusSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(aftRadiusModel), "growx");
|
||||||
|
panel.add(new BasicSlider(aftRadiusModel.getSliderModel(0, 0.04, 0.2)), "w 100lp, wrap 0px");
|
||||||
|
|
||||||
|
final JCheckBox aftRadiusCheckbox = new JCheckBox(aftRadiusModel.getAutomaticAction());
|
||||||
|
//// Automatic
|
||||||
|
aftRadiusCheckbox.setText(trans.get("TransitionCfg.checkbox.Automatic"));
|
||||||
|
panel.add(aftRadiusCheckbox, "skip, span 2, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{ /// Wall thickness:
|
||||||
|
panel.add(new JLabel(trans.get("TransitionCfg.lbl.Wallthickness")));
|
||||||
|
|
||||||
|
final DoubleModel thicknessModel = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
component.addChangeListener(thicknessModel);
|
||||||
|
|
||||||
|
final JSpinner thicknessSpinner = new JSpinner(thicknessModel.getSpinnerModel());
|
||||||
|
thicknessSpinner.setEditor(new SpinnerEditor(thicknessSpinner));
|
||||||
|
panel.add(thicknessSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(thicknessModel), "growx");
|
||||||
|
panel.add(new BasicSlider(thicknessModel.getSliderModel(0, 0.01)), "w 100lp, wrap 0px");
|
||||||
|
|
||||||
|
//// Filled
|
||||||
|
final JCheckBox thicknessCheckbox = new JCheckBox(new BooleanModel(component, "Filled"));
|
||||||
|
//// Filled
|
||||||
|
thicknessCheckbox.setText(trans.get("TransitionCfg.checkbox.Filled"));
|
||||||
|
panel.add(thicknessCheckbox, "skip, span 2, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
//// Description
|
//// Description
|
||||||
|
|
||||||
JPanel panel2 = new JPanel(new MigLayout("ins 0"));
|
JPanel panel2 = new JPanel(new MigLayout("ins 0"));
|
||||||
|
|
||||||
description = new DescriptionArea(5);
|
description = new DescriptionArea(5);
|
||||||
@ -184,8 +177,6 @@ public class TransitionConfig extends RocketComponentConfig {
|
|||||||
|
|
||||||
|
|
||||||
//// Material
|
//// Material
|
||||||
|
|
||||||
|
|
||||||
panel2.add(materialPanel(Material.Type.BULK), "span, wrap");
|
panel2.add(materialPanel(Material.Type.BULK), "span, wrap");
|
||||||
panel.add(panel2, "cell 4 0, gapleft paragraph, aligny 0%, spany");
|
panel.add(panel2, "cell 4 0, gapleft paragraph, aligny 0%, spany");
|
||||||
|
|
||||||
|
@ -32,193 +32,182 @@ public class TrapezoidFinSetConfig extends FinSetConfig {
|
|||||||
|
|
||||||
public TrapezoidFinSetConfig(OpenRocketDocument d, final RocketComponent component) {
|
public TrapezoidFinSetConfig(OpenRocketDocument d, final RocketComponent component) {
|
||||||
super(d, component);
|
super(d, component);
|
||||||
|
|
||||||
DoubleModel m;
|
|
||||||
JSpinner spin;
|
|
||||||
|
|
||||||
JPanel mainPanel = new JPanel(new MigLayout());
|
JPanel mainPanel = new JPanel(new MigLayout());
|
||||||
|
|
||||||
|
|
||||||
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
JPanel panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
||||||
|
|
||||||
//// Number of fins:
|
//// Number of fins:
|
||||||
JLabel label = new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Nbroffins"));
|
JLabel label = new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Nbroffins"));
|
||||||
//// The number of fins in the fin set.
|
//// The number of fins in the fin set.
|
||||||
label.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Nbroffins"));
|
label.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Nbroffins"));
|
||||||
panel.add(label);
|
panel.add(label);
|
||||||
|
|
||||||
IntegerModel im = new IntegerModel(component, "FinCount", 1, 8);
|
|
||||||
|
|
||||||
spin = new JSpinner(im.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
//// The number of fins in the fin set.
|
|
||||||
spin.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Nbroffins"));
|
|
||||||
panel.add(spin, "growx, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Base rotation
|
|
||||||
//// Fin rotation:
|
|
||||||
label = new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Finrotation"));
|
|
||||||
//// The angle of the first fin in the fin set.
|
|
||||||
label.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Finrotation"));
|
|
||||||
panel.add(label);
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "BaseRotation", UnitGroup.UNITS_ANGLE);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(-Math.PI, Math.PI)), "w 100lp, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Fin cant:
|
|
||||||
label = new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Fincant"));
|
|
||||||
//// The angle that the fins are canted with respect to the rocket
|
|
||||||
label.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Fincant"));
|
|
||||||
panel.add(label);
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "CantAngle", UnitGroup.UNITS_ANGLE,
|
|
||||||
-FinSet.MAX_CANT, FinSet.MAX_CANT);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(-FinSet.MAX_CANT, FinSet.MAX_CANT)),
|
|
||||||
"w 100lp, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Root chord:
|
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Rootchord")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "RootChord", UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.05, 0.2)), "w 100lp, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// Tip chord:
|
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Tipchord")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "TipChord", UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.05, 0.2)), "w 100lp, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Height:
|
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Height")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "Height", UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.05, 0.2)), "w 100lp, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// Sweep length:
|
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Sweeplength")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "Sweep", UnitGroup.UNITS_LENGTH);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
|
|
||||||
// sweep slider from -1.1*TipChord to 1.1*RootChord
|
|
||||||
DoubleModel tc = new DoubleModel(component, "TipChord", -1.1, UnitGroup.UNITS_LENGTH);
|
|
||||||
DoubleModel rc = new DoubleModel(component, "RootChord", 1.1, UnitGroup.UNITS_LENGTH);
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(tc, rc)), "w 100lp, wrap");
|
|
||||||
|
|
||||||
|
|
||||||
//// Sweep angle:
|
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Sweepangle")));
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "SweepAngle", UnitGroup.UNITS_ANGLE,
|
|
||||||
-TrapezoidFinSet.MAX_SWEEP_ANGLE, TrapezoidFinSet.MAX_SWEEP_ANGLE);
|
|
||||||
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(-Math.PI / 4, Math.PI / 4)),
|
|
||||||
"w 100lp, wrap paragraph");
|
|
||||||
|
|
||||||
|
|
||||||
//// Position
|
|
||||||
//// Position relative to:
|
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Posrelativeto")));
|
|
||||||
|
|
||||||
final EnumModel<AxialMethod> methodModel = new EnumModel<AxialMethod>(component, "AxialMethod", AxialMethod.axialOffsetMethods );
|
|
||||||
final JComboBox<AxialMethod> positionCombo = new JComboBox<AxialMethod>( methodModel );
|
|
||||||
|
|
||||||
panel.add(positionCombo, "spanx, growx, wrap");
|
|
||||||
//// plus
|
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.plus")), "right");
|
|
||||||
|
|
||||||
m = new DoubleModel(component, "AxialOffset", UnitGroup.UNITS_LENGTH);
|
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
|
||||||
panel.add(new UnitSelector(m), "growx");
|
|
||||||
panel.add(new BasicSlider(m.getSliderModel(
|
|
||||||
new DoubleModel(component.getParent(), "Length", -1.0, UnitGroup.UNITS_NONE),
|
|
||||||
new DoubleModel(component.getParent(), "Length"))),
|
|
||||||
"w 100lp, wrap para");
|
|
||||||
|
|
||||||
|
|
||||||
|
final IntegerModel finCountModel = new IntegerModel(component, "FinCount", 1, 8);
|
||||||
|
|
||||||
|
final JSpinner finCountSpinner = new JSpinner(finCountModel.getSpinnerModel());
|
||||||
mainPanel.add(panel, "aligny 20%");
|
finCountSpinner.setEditor(new SpinnerEditor(finCountSpinner));
|
||||||
|
//// The number of fins in the fin set.
|
||||||
mainPanel.add(new JSeparator(SwingConstants.VERTICAL), "growy");
|
finCountSpinner.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Nbroffins"));
|
||||||
|
panel.add(finCountSpinner, "growx, wrap");
|
||||||
|
|
||||||
|
|
||||||
|
{ /// Base rotation
|
||||||
|
label = new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Finrotation"));
|
||||||
|
//// The angle of the first fin in the fin set.
|
||||||
|
label.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Finrotation"));
|
||||||
|
panel.add(label);
|
||||||
|
|
||||||
|
final DoubleModel baseRotationModel = new DoubleModel(component, "BaseRotation", UnitGroup.UNITS_ANGLE);
|
||||||
|
|
||||||
|
final JSpinner baseRotationSpinner = new JSpinner(baseRotationModel.getSpinnerModel());
|
||||||
|
baseRotationSpinner.setEditor(new SpinnerEditor(baseRotationSpinner));
|
||||||
|
panel.add(baseRotationSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(baseRotationModel), "growx");
|
||||||
|
panel.add(new BasicSlider(baseRotationModel.getSliderModel(-Math.PI, Math.PI)), "w 100lp, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Fin cant:
|
||||||
|
label = new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Fincant"));
|
||||||
|
//// The angle that the fins are canted with respect to the rocket
|
||||||
|
label.setToolTipText(trans.get("TrapezoidFinSetCfg.lbl.ttip.Fincant"));
|
||||||
|
panel.add(label);
|
||||||
|
|
||||||
|
final DoubleModel cantModel = new DoubleModel(component, "CantAngle", UnitGroup.UNITS_ANGLE, -FinSet.MAX_CANT, FinSet.MAX_CANT);
|
||||||
|
|
||||||
|
final JSpinner cantSpinner = new JSpinner(cantModel.getSpinnerModel());
|
||||||
|
cantSpinner.setEditor(new SpinnerEditor(cantSpinner));
|
||||||
|
panel.add(cantSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(cantModel), "growx");
|
||||||
|
panel.add(new BasicSlider(cantModel.getSliderModel(-FinSet.MAX_CANT, FinSet.MAX_CANT)),
|
||||||
|
"w 100lp, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Root chord:
|
||||||
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Rootchord")));
|
||||||
|
|
||||||
|
final DoubleModel rootChordModel = new DoubleModel(component, "RootChord", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
|
||||||
|
final JSpinner rootChordSpinner = new JSpinner(rootChordModel.getSpinnerModel());
|
||||||
|
rootChordSpinner.setEditor(new SpinnerEditor(rootChordSpinner));
|
||||||
|
panel.add(rootChordSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(rootChordModel), "growx");
|
||||||
|
panel.add(new BasicSlider(rootChordModel.getSliderModel(0, 0.05, 0.2)), "w 100lp, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Tip chord:
|
||||||
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Tipchord")));
|
||||||
|
|
||||||
|
final DoubleModel tipChordModel = new DoubleModel(component, "TipChord", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
|
||||||
|
final JSpinner tipChordSpinner = new JSpinner(tipChordModel.getSpinnerModel());
|
||||||
|
tipChordSpinner.setEditor(new SpinnerEditor(tipChordSpinner));
|
||||||
|
panel.add(tipChordSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(tipChordModel), "growx");
|
||||||
|
panel.add(new BasicSlider(tipChordModel.getSliderModel(0, 0.05, 0.2)), "w 100lp, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Height:
|
||||||
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Height")));
|
||||||
|
|
||||||
|
final DoubleModel heightModel = new DoubleModel(component, "Height", UnitGroup.UNITS_LENGTH, 0);
|
||||||
|
|
||||||
|
final JSpinner heightSpinner = new JSpinner(heightModel.getSpinnerModel());
|
||||||
|
heightSpinner.setEditor(new SpinnerEditor(heightSpinner));
|
||||||
|
panel.add(heightSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(heightModel), "growx");
|
||||||
|
panel.add(new BasicSlider(heightModel.getSliderModel(0, 0.05, 0.2)), "w 100lp, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Sweep length:
|
||||||
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Sweeplength")));
|
||||||
|
|
||||||
|
final DoubleModel sweepDistanceModel = new DoubleModel(component, "Sweep", UnitGroup.UNITS_LENGTH);
|
||||||
|
component.addChangeListener(sweepDistanceModel);
|
||||||
|
final JSpinner sweepDistanceSpinner = new JSpinner(sweepDistanceModel.getSpinnerModel());
|
||||||
|
sweepDistanceSpinner.setEditor(new SpinnerEditor(sweepDistanceSpinner));
|
||||||
|
panel.add(sweepDistanceSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(sweepDistanceModel), "growx");
|
||||||
|
|
||||||
|
// sweep slider from -1.1*TipChord to 1.1*RootChord
|
||||||
|
DoubleModel tc = new DoubleModel(component, "TipChord", -1.1, UnitGroup.UNITS_LENGTH);
|
||||||
|
DoubleModel rc = new DoubleModel(component, "RootChord", 1.1, UnitGroup.UNITS_LENGTH);
|
||||||
|
panel.add(new BasicSlider(sweepDistanceModel.getSliderModel(tc, rc)), "w 100lp, wrap");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Sweep angle:
|
||||||
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Sweepangle")));
|
||||||
|
|
||||||
|
final DoubleModel sweepAngleModel = new DoubleModel(component, "SweepAngle", UnitGroup.UNITS_ANGLE,
|
||||||
|
-TrapezoidFinSet.MAX_SWEEP_ANGLE, TrapezoidFinSet.MAX_SWEEP_ANGLE);
|
||||||
|
component.addChangeListener(sweepAngleModel);
|
||||||
|
|
||||||
|
final JSpinner sweepAngleSpinner = new JSpinner(sweepAngleModel.getSpinnerModel());
|
||||||
|
sweepAngleSpinner.setEditor(new SpinnerEditor(sweepAngleSpinner));
|
||||||
|
panel.add(sweepAngleSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(sweepAngleModel), "growx");
|
||||||
|
panel.add(new BasicSlider(sweepAngleModel.getSliderModel(-Math.PI / 4, Math.PI / 4)),
|
||||||
|
"w 100lp, wrap paragraph");
|
||||||
|
}
|
||||||
|
|
||||||
|
{//// Position relative to:
|
||||||
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Posrelativeto")));
|
||||||
|
|
||||||
|
final EnumModel<AxialMethod> methodModel = new EnumModel<AxialMethod>(component, "AxialMethod", AxialMethod.axialOffsetMethods);
|
||||||
|
final JComboBox<AxialMethod> positionCombo = new JComboBox<AxialMethod>(methodModel);
|
||||||
|
|
||||||
|
panel.add(positionCombo, "spanx, growx, wrap");
|
||||||
|
//// plus
|
||||||
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.plus")), "right");
|
||||||
|
|
||||||
|
final DoubleModel axialOffsetModel = new DoubleModel(component, "AxialOffset", UnitGroup.UNITS_LENGTH);
|
||||||
|
final JSpinner axialOffsetSpinner = new JSpinner(axialOffsetModel.getSpinnerModel());
|
||||||
|
axialOffsetSpinner.setEditor(new SpinnerEditor(axialOffsetSpinner));
|
||||||
|
panel.add(axialOffsetSpinner, "growx");
|
||||||
|
|
||||||
|
panel.add(new UnitSelector(axialOffsetModel), "growx");
|
||||||
|
panel.add(new BasicSlider(axialOffsetModel.getSliderModel(
|
||||||
|
new DoubleModel(component.getParent(), "Length", -1.0, UnitGroup.UNITS_NONE),
|
||||||
|
new DoubleModel(component.getParent(), "Length"))),
|
||||||
|
"w 100lp, wrap para");
|
||||||
|
|
||||||
|
|
||||||
|
mainPanel.add(panel, "aligny 20%");
|
||||||
|
|
||||||
|
mainPanel.add(new JSeparator(SwingConstants.VERTICAL), "growy");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::]", ""));
|
||||||
|
|
||||||
|
|
||||||
|
{//// Fin cross section:
|
||||||
//// Fin cross section:
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.FincrossSection")));
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.FincrossSection")));
|
JComboBox<FinSet.CrossSection> sectionCombo = new JComboBox<FinSet.CrossSection>(
|
||||||
JComboBox<FinSet.CrossSection> sectionCombo = new JComboBox<FinSet.CrossSection>(
|
new EnumModel<FinSet.CrossSection>(component, "CrossSection"));
|
||||||
new EnumModel<FinSet.CrossSection>(component, "CrossSection"));
|
panel.add(sectionCombo, "span, growx, wrap");
|
||||||
panel.add( sectionCombo, "span, growx, wrap");
|
|
||||||
|
|
||||||
|
//// Thickness:
|
||||||
//// Thickness:
|
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Thickness")));
|
||||||
panel.add(new JLabel(trans.get("TrapezoidFinSetCfg.lbl.Thickness")));
|
|
||||||
|
final DoubleModel thicknessModel = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
||||||
m = new DoubleModel(component, "Thickness", UnitGroup.UNITS_LENGTH, 0);
|
|
||||||
|
final JSpinner thicknessSpinner = new JSpinner(thicknessModel.getSpinnerModel());
|
||||||
spin = new JSpinner(m.getSpinnerModel());
|
thicknessSpinner.setEditor(new SpinnerEditor(thicknessSpinner));
|
||||||
spin.setEditor(new SpinnerEditor(spin));
|
panel.add(thicknessSpinner, "growx");
|
||||||
panel.add(spin, "growx");
|
|
||||||
|
panel.add(new UnitSelector(thicknessModel), "growx");
|
||||||
panel.add(new UnitSelector(m), "growx");
|
panel.add(new BasicSlider(thicknessModel.getSliderModel(0, 0.01)), "w 100lp, wrap para");
|
||||||
panel.add(new BasicSlider(m.getSliderModel(0, 0.01)), "w 100lp, wrap para");
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//// Material
|
//// Material
|
||||||
|
Loading…
x
Reference in New Issue
Block a user