protected LayoutManager createInitialLayout(){ return new XYLayoutManager(); }
public final boolean isXY(){ return getLayout() instanceof XYLayoutManager; }
void readLayout(Element element, LwContainer container) { container.setLayout(new XYLayoutManager()); }
public static void breakGrid(final GuiEditor editor) { final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(editor); if (selection.size() != 1){ return; } if (!(selection.get(0) instanceof RadContainer)) { return; } final RadContainer container = (RadContainer)selection.get(0); if ( container instanceof RadScrollPane || container instanceof RadSplitPane || container instanceof RadTabbedPane ){ return; } final RadContainer parent = container.getParent(); if (parent instanceof RadRootContainer) { editor.getRootContainer().setMainComponentBinding(container.getBinding()); } // XY can be broken only if its parent is also XY. // In other words, breaking of XY is a deletion of unnecessary intermediate panel if (container.isXY() && !parent.isXY()) { return; } if (parent != null && parent.isXY()) { // parent is XY // put the contents of the container into 'parent' and remove 'container' final int dx = container.getX(); final int dy = container.getY(); while (container.getComponentCount() > 0) { final RadComponent component = container.getComponent(0); component.shift(dx, dy); parent.addComponent(component); } parent.removeComponent(container); } else { // container becomes XY final XYLayoutManager xyLayout = new XYLayoutManagerImpl(); container.setLayout(xyLayout); xyLayout.setPreferredSize(container.getSize()); } editor.refreshAndSave(true); }
public final boolean isXY() { return getLayout() instanceof XYLayoutManager; }