/** * Creates and returns a ButtonBarBuilder2 with * a left to right button order. * * @return a button bar builder with button order set to left-to-right */ public static ButtonBarBuilder2 createLeftToRightBuilder() { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.setLeftToRightButtonOrder(true); return builder; }
/** * Creates and returns an empty ButtonBarBuilder2 with * a left to right button order. * * @return a button bar builder with button order set to left-to-right */ public static ButtonBarBuilder2 createLeftToRightBuilder() { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.setLeftToRightButtonOrder(true); return builder; }
/** * Builds and returns a button bar with the given buttons. All button * columns will grow with the bar. * * @param buttons an array of buttons to add * @return a filled button bar with the given buttons */ public static JPanel buildGrowingBar(JButton... buttons) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.addGrowing(buttons); return builder.getPanel(); }
/** * Builds and returns a left aligned button bar with the given buttons. * * @param buttons an array of buttons to add * @return a left aligned button bar with the given buttons */ public static JPanel buildLeftAlignedBar(JButton... buttons) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.addButton(buttons); builder.addGlue(); return builder.getPanel(); }
/** * Builds and returns a right aligned button bar with the given buttons. * * @param buttons an array of buttons to add * @return a right aligned button bar with the given buttons */ public static JPanel buildRightAlignedBar(JButton... buttons) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.addGlue(); builder.addButton(buttons); return builder.getPanel(); }
/** * Builds and returns a centered button bar with the given buttons. * * @param buttons an array of buttons to add * @return a centered button bar with the given buttons */ public static JPanel buildCenteredBar(JButton... buttons) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.addGlue(); builder.addButton(buttons); builder.addGlue(); return builder.getPanel(); }
/** * Builds and returns a left aligned button bar with the given buttons. * * @param buttons an array of buttons to add * @param leftToRightButtonOrder the order in which the buttons to add * @return a left aligned button bar with the given buttons */ public static JPanel buildLeftAlignedBar( JButton[] buttons, boolean leftToRightButtonOrder) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.setLeftToRightButtonOrder(leftToRightButtonOrder); builder.addButton(buttons); builder.addGlue(); return builder.getPanel(); }
/** * Builds and returns a right aligned button bar with the given buttons. * * @param buttons an array of buttons to add * @param leftToRightButtonOrder the order in which the buttons to add * @return a right aligned button bar with the given buttons */ public static JPanel buildRightAlignedBar( JButton[] buttons, boolean leftToRightButtonOrder) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.setLeftToRightButtonOrder(leftToRightButtonOrder); builder.addGlue(); builder.addButton(buttons); return builder.getPanel(); }
/** * Builds and returns a right aligned bar with help and other buttons. * * @param help the help button to add on the left side * @param buttons an array of buttons to add * @return a right aligned button bar with the given buttons */ public static JPanel buildHelpBar(JButton help, JButton... buttons) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.addButton(help); builder.addUnrelatedGap(); builder.addGlue(); builder.addButton(buttons); return builder.getPanel(); }
/** * Builds and returns a filled button bar with Add, Remove, and * Properties. * * @param add the Add button * @param remove the Remove button * @param properties the Properties button * @return a panel that contains the button(s) */ public static JPanel buildAddRemovePropertiesBar( JButton add, JButton remove, JButton properties) { ButtonBarBuilder2 builder = new ButtonBarBuilder2(); builder.addButton(add); builder.addRelatedGap(); builder.addButton(remove); builder.addRelatedGap(); builder.addButton(properties); return builder.getPanel(); }