@Override public boolean canCellGrow(RadContainer container, boolean isRow, int cellIndex) { final GridLayoutManager gridLayoutManager = ((GridLayoutManager) container.getLayout()); int maxSizePolicy = 0; for (int i = 0; i < gridLayoutManager.getCellCount(isRow); i++) { maxSizePolicy = Math.max(maxSizePolicy, gridLayoutManager.getCellSizePolicy(isRow, i)); } return gridLayoutManager.getCellSizePolicy(isRow, cellIndex) == maxSizePolicy; }
@Override protected void updateConstraints(RadComponent component) { GridLayoutManager layout = (GridLayoutManager) component.getParent().getLayout(); final GridConstraints radConstraints = component.getConstraints(); final GridConstraints delegeeConstraints = layout.getConstraintsForComponent(component.getDelegee()); if (radConstraints != delegeeConstraints) { delegeeConstraints.restore(radConstraints); } super.updateConstraints(component); }
@Override public LayoutManager copyLayout(LayoutManager layout, int rowDelta, int columnDelta) { GridLayoutManager oldLayout = (GridLayoutManager) layout; final GridLayoutManager newLayout = new GridLayoutManager( oldLayout.getRowCount() + rowDelta, oldLayout.getColumnCount() + columnDelta); newLayout.setMargin(oldLayout.getMargin()); newLayout.setHGap(oldLayout.getHGap()); newLayout.setVGap(oldLayout.getVGap()); return newLayout; }
public void writeLayout(final XmlWriter writer, final RadContainer radContainer) { GridLayoutManager layout = (GridLayoutManager) radContainer.getLayout(); writer.addAttribute("row-count", layout.getRowCount()); writer.addAttribute("column-count", layout.getColumnCount()); writer.addAttribute( UIFormXmlConstants.ATTRIBUTE_SAME_SIZE_HORIZONTALLY, layout.isSameSizeHorizontally()); writer.addAttribute( UIFormXmlConstants.ATTRIBUTE_SAME_SIZE_VERTICALLY, layout.isSameSizeVertically()); RadXYLayoutManager.INSTANCE.writeLayout(writer, radContainer); }
public int[] getGridCellSizes(RadContainer container, boolean isRow) { GridLayoutManager grid = (GridLayoutManager) container.getLayout(); return isRow ? grid.getHeights() : grid.getWidths(); }
public int[] getGridCellCoords(RadContainer container, boolean isRow) { GridLayoutManager grid = (GridLayoutManager) container.getLayout(); return isRow ? grid.getYs() : grid.getXs(); }
@Override public int[] getVerticalGridLines(RadContainer container) { GridLayoutManager grid = (GridLayoutManager) container.getLayout(); return grid.getVerticalGridLines(); }