List of usage examples for com.jgoodies.forms.builder ButtonStackBuilder addStrut
public ButtonStackBuilder addStrut(ConstantSize size)
From source file:ai.aitia.meme.utils.FormsUtils.java
License:Open Source License
/** * Example:<pre>/*from w w w . ja v a 2 s. c o m*/ * buttonStack( jMoveUpButton, jMoveDownButton, FormsUtils.BS_UNRELATED, * jRemoveButton, jEditButton ).getPanel() * </pre> */ public static ButtonStackBuilder buttonStack(Object... args) { ButtonStackBuilder ans = new ButtonStackBuilder(); boolean addrel = false; for (int i = 0; i < args.length; ++i) { if (args[i] instanceof javax.swing.JComponent) { if (addrel) ans.addRelatedGap(); ans.addGridded((javax.swing.JComponent) args[i]); addrel = true; } else if (BS_UNRELATED.equals(args[i])) { ans.addUnrelatedGap(); addrel = false; } else if (BS_GLUE.equals(args[i])) { ans.addGlue(); addrel = false; } else { ans.addStrut(Sizes.constant(args[i].toString(), false)); addrel = false; } } return ans; }