Merge pull request #659 from teyrana/643-fix-button-formatting

[ui] Moves new assembly buttons to their own row in the New Component panel.
This commit is contained in:
Daniel Williams 2020-05-09 18:25:56 -04:00 committed by GitHub
commit 800101e6bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ public class ComponentAddButtons extends JPanel implements Scrollable {
private static final Logger log = LoggerFactory.getLogger(ComponentAddButtons.class);
private static final Translator trans = Application.getTranslator();
private static final int ROWS = 3;
private static final int ROWS = 4;
private static final int MAXCOLS = 6;
private static final String BUTTONPARAM = "grow, sizegroup buttons";
@ -116,6 +116,18 @@ public class ComponentAddButtons extends JPanel implements Scrollable {
}
int row = 0;
int col = 0;
////////////////////////////////////////////
add(new JLabel(trans.get("compaddbuttons.assembly")), "span, gaptop unrel, wrap");
//// Component Assembly Components:
addButtonGroup(row,
new ComponentButton(AxialStage.class, trans.get("RocketActions.NewStageAct.Newstage")),
new ComponentButton(ParallelStage.class, trans.get("compaddbuttons.newBooster.lbl")),
new ComponentButton(PodSet.class, trans.get("compaddbuttons.newPods.lbl")));
row++;
////////////////////////////////////////////
//// Body components and fin sets
@ -160,20 +172,8 @@ public class ComponentAddButtons extends JPanel implements Scrollable {
row++;
////////////////////////////////////////////
add(new JLabel(trans.get("compaddbuttons.assembly")), "span 3");
add(new JLabel(trans.get("compaddbuttons.Massobjects")), "span, gaptop unrel, wrap");
// RocketActions.NewStageAct.ttip.Newstage = Add a new stage to the rocket design.
// RocketActions.NewStageAct.ttip.newBooster = Add a new set booster stage to the rocket design.
// RocketActions.NewStageAct.ttip.newPods = Add a new set of pods to the rocket design.
//// Component Assembly Components:
ComponentButton[] buttonsToAdd = {
new ComponentButton(AxialStage.class, trans.get("RocketActions.NewStageAct.Newstage")),
new ComponentButton(ParallelStage.class, trans.get("compaddbuttons.newBooster.lbl")),
new ComponentButton(PodSet.class, trans.get("compaddbuttons.newPods.lbl"))};
addButtonGroup(row, buttonsToAdd);
//// Mass objects
// NOTE: These are on the same line as the assemblies above
addButtonGroup(row,