/** * creates a new container with the given layout * * @param l the layout for this container */ public SContainer(SLayoutManager l) { setLayout(l); }
private static void rebuildPanel(SContainer oldPanel, SContainer newPanel) { SLayoutManager layoutManager = oldPanel.getLayout(); SComponent[] components = oldPanel.getComponents(); ArrayList constraints = oldPanel.getConstraintList(); oldPanel.removeAll(); oldPanel.setLayout(null); newPanel.setLayout(layoutManager); for (int i = 0; i < components.length; i++) { SComponent component = components[i]; Object constraint = constraints.get(i); newPanel.add(component, constraint); } }
public static void showConfirmDialog(SComponent parent, Object message, String title, int type, ActionListener al, SLayoutManager layout) { SOptionPane p = new SOptionPane(); if (layout != null) { p.optionButtons.setLayout(layout); } // end of if () p.showQuestion(parent, message, title, type); p.addActionListener(al); }
/** * creates a new container with a Flowlayout as layout manager, like the * Swing default. */ public SContainer() { // init defaultLayout if not initialized yet if (defaultLayout == null) { // lookup the default Layout Behaviour final CGManager manager = getSession().getCGManager(); defaultLayout = (String) manager.getObject("SContainer.defaultLayoutBehaviour", String.class); } SLayoutManager layout = null; if (defaultLayout == null) { layout = new SFlowLayout(); } else if ("classic".equals(defaultLayout.toLowerCase())) { layout = new SBoxLayout(null, SBoxLayout.VERTICAL); } else if ("standard".equals(defaultLayout.toLowerCase())) { layout = new SFlowLayout(); } else if ("none".equals(defaultLayout.toLowerCase())) { layout = new SNullLayout(); } else { // fallback layout = new SFlowLayout(); } setLayout(layout); }
STemplateLayout layout = new STemplateLayout(resourcePath); final SFrame errorFrame = new SFrame(); errorFrame.getContentPane().setLayout(layout);