コード例 #1
0
 @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;
 }
コード例 #2
0
 @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);
 }
コード例 #3
0
 @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;
 }
コード例 #4
0
  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);
  }
コード例 #5
0
 public int[] getGridCellSizes(RadContainer container, boolean isRow) {
   GridLayoutManager grid = (GridLayoutManager) container.getLayout();
   return isRow ? grid.getHeights() : grid.getWidths();
 }
コード例 #6
0
 public int[] getGridCellCoords(RadContainer container, boolean isRow) {
   GridLayoutManager grid = (GridLayoutManager) container.getLayout();
   return isRow ? grid.getYs() : grid.getXs();
 }
コード例 #7
0
 @Override
 public int[] getVerticalGridLines(RadContainer container) {
   GridLayoutManager grid = (GridLayoutManager) container.getLayout();
   return grid.getVerticalGridLines();
 }