Fix large rail button default size.
The default values assigned to RailButton sizes were configured with a 1.0 meter outer diameter and 0.8 meter internal diameter (for 1010 rail buttons) which resulted in overly large rail buttons when added using the default values. Presuming that 1010 rail buttons are the common and an acceptable default, change the default button sizes to align with the 1010 size. Additionally, this change fixes some of the layout issues present in add railbutton dialog. Closes #554 Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
This commit is contained in:
parent
da5dcca83d
commit
232b363712
@ -1993,6 +1993,8 @@ table.column.AftShoulderDiameter = Aft Shoulder Diameter
|
||||
table.column.ForeShoulderLength = Fore Shoulder Length
|
||||
table.column.ForeShoulderDiameter = Fore Shoulder Diameter
|
||||
table.column.ForeOuterDiameter = Fore Outer Diameter
|
||||
table.column.StandoffHeight = Standoff Height
|
||||
table.column.FlangeHeight = Flange Height
|
||||
table.column.Shape = Shape
|
||||
table.column.Material = Material
|
||||
table.column.Finish = Finish
|
||||
|
@ -16,7 +16,7 @@ import net.sf.openrocket.util.Coordinate;
|
||||
import net.sf.openrocket.util.MathUtil;
|
||||
|
||||
/**
|
||||
* WARNING: This class is only partially implemented. Recomend a bit of testing before you attach it to the GUI.
|
||||
* WARNING: This class is only partially implemented. Recommend a bit of testing before you attach it to the GUI.
|
||||
* @author widget (Daniel Williams)
|
||||
*
|
||||
*/
|
||||
@ -59,12 +59,12 @@ public class RailButton extends ExternalComponent implements AnglePositionable,
|
||||
|
||||
public RailButton(){
|
||||
super(AxialMethod.MIDDLE);
|
||||
this.outerDiameter_m = 1.0;
|
||||
this.totalHeight_m = 1.0;
|
||||
this.innerDiameter_m = 0.8;
|
||||
this.outerDiameter_m = 0.0097;
|
||||
this.totalHeight_m = 0.0097;
|
||||
this.innerDiameter_m = 0.008;
|
||||
this.flangeHeight_m = 0.002;
|
||||
this.setStandoff( 0.002);
|
||||
this.setInstanceSeparation( 1.0);
|
||||
this.setInstanceSeparation( this.outerDiameter_m * 6);
|
||||
}
|
||||
|
||||
public RailButton( final double od, final double ht ) {
|
||||
|
@ -43,6 +43,9 @@ public class RailButtonConfig extends RocketComponentConfig {
|
||||
}
|
||||
|
||||
private JPanel buttonTab( final RailButton rbc ){
|
||||
|
||||
JPanel primary = new JPanel(new MigLayout("fill"));
|
||||
|
||||
JPanel panel = new JPanel( new MigLayout());
|
||||
|
||||
|
||||
@ -75,12 +78,16 @@ public class RailButtonConfig extends RocketComponentConfig {
|
||||
panel.add(new BasicSlider( angleModel.getSliderModel(-180, 180)), "w 100lp, wrap");
|
||||
}
|
||||
|
||||
primary.add(panel, "grow, gapright 201p");
|
||||
panel = new JPanel(new MigLayout("gap rel unrel", "[][65lp::][30lp::][]", ""));
|
||||
|
||||
|
||||
{ //// Position relative to:
|
||||
panel.add(new JLabel(trans.get("RailBtnCfg.lbl.PosRelativeTo")));
|
||||
|
||||
final EnumModel<AxialMethod> methodModel = new EnumModel<AxialMethod>(component, "AxialMethod", AxialMethod.axialOffsetMethods );
|
||||
JComboBox<AxialMethod> relToCombo = new JComboBox<AxialMethod>( methodModel );
|
||||
panel.add( relToCombo, "growx, wrap rel");
|
||||
panel.add( relToCombo, "spanx, growx, wrap");
|
||||
}
|
||||
|
||||
{ //// plus
|
||||
@ -90,20 +97,30 @@ public class RailButtonConfig extends RocketComponentConfig {
|
||||
JSpinner offsetSpinner = new JSpinner(offsetModel.getSpinnerModel());
|
||||
offsetSpinner.setEditor(new SpinnerEditor(offsetSpinner));
|
||||
panel.add(offsetSpinner, "growx");
|
||||
panel.add(new UnitSelector( offsetModel), "growx");
|
||||
panel.add(new BasicSlider( offsetModel.getSliderModel(0, parentLength)), "w 100lp, wrap para");
|
||||
panel.add(new UnitSelector(offsetModel), "growx");
|
||||
panel.add(new BasicSlider(offsetModel.getSliderModel(
|
||||
new DoubleModel(component.getParent(), "Length", -1.0, UnitGroup.UNITS_NONE),
|
||||
new DoubleModel(component.getParent(), "Length"))),
|
||||
"w 100lp, wrap para");
|
||||
|
||||
}
|
||||
|
||||
//// Material
|
||||
panel.add( instanceablePanel(rbc), "cell 4 0, spany 3, wrap para");
|
||||
/* TODO (wolsen) confirm this removal
|
||||
* I think the instanceablePanel should be removed and doesn't make much sense. I understand
|
||||
* the idea that you may want to say "I have 2 rail buttons, 12 inches apart". I think in reality
|
||||
* that most people would add 2 (or more) individual rail buttons at specific locations on the
|
||||
* rocket. That will keep consistency with other components such as launch lugs.
|
||||
*/
|
||||
//panel.add( instanceablePanel(rbc), "cell 4 0, spany 3, wrap para");
|
||||
|
||||
|
||||
//// Material
|
||||
panel.add(materialPanel(Material.Type.BULK),"cell 4 2, spany 2, gapleft paragraph, aligny 0%, growy");
|
||||
// ... spany");
|
||||
panel.add(materialPanel(Material.Type.BULK),"span, wrap");
|
||||
|
||||
return panel;
|
||||
primary.add(panel, "grow");
|
||||
|
||||
return primary;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user