当前位置: 首页>>代码示例>>Java>>正文


Java RadAbstractGridLayoutManager.copyLayout方法代码示例

本文整理汇总了Java中com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager.copyLayout方法的典型用法代码示例。如果您正苦于以下问题:Java RadAbstractGridLayoutManager.copyLayout方法的具体用法?Java RadAbstractGridLayoutManager.copyLayout怎么用?Java RadAbstractGridLayoutManager.copyLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager的用法示例。


在下文中一共展示了RadAbstractGridLayoutManager.copyLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: insertRowOrColumn

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入方法依赖的package包/类
/**
 * @param cellIndex column or row index, depending on isRow parameter; must be in the range 0..grid.get{Row|Column}Count()-1
 * @param isRow if true, row inserted, otherwise column
 * @param isBefore if true, row/column will be inserted before row/column with given index, otherwise after
 */
public static void insertRowOrColumn(final RadContainer grid, final int cellIndex, final boolean isRow, final boolean isBefore) {
  check(grid, isRow, cellIndex);

  final RadAbstractGridLayoutManager oldLayout = grid.getGridLayoutManager();

  int beforeIndex = cellIndex;
  if (!isBefore) {
    // beforeIndex can actually be equal to get{Row|Column}Count an case we add row after the last row/column
    beforeIndex++;
  }

  final LayoutManager newLayout = oldLayout.copyLayout(grid.getLayout(), isRow ? 1 : 0, isRow ? 0 : 1);
  GridConstraints[] oldConstraints = copyConstraints(grid);

  for (int i=grid.getComponentCount() - 1; i >= 0; i--){
    final GridConstraints constraints = grid.getComponent(i).getConstraints();
    adjustConstraintsOnInsert(constraints, isRow, beforeIndex, 1);
  }

  grid.setLayout(newLayout);
  fireAllConstraintsChanged(grid, oldConstraints);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:GridChangeUtil.java

示例2: deleteCell

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入方法依赖的package包/类
/**
 * @param cellIndex column or row index, depending on isRow parameter; must be in the range 0..grid.get{Row|Column}Count()-1
 * @param isRow if true, row is deleted, otherwise column
 */
public static void deleteCell(final RadContainer grid, final int cellIndex, final boolean isRow) {
  check(grid, isRow, cellIndex);
  if (canDeleteCell(grid, cellIndex, isRow) == CellStatus.Required) {
    throw new IllegalArgumentException("cell cannot be deleted");
  }

  final RadAbstractGridLayoutManager oldLayout = grid.getGridLayoutManager();

  final LayoutManager newLayout = oldLayout.copyLayout(grid.getLayout(), isRow ? -1 : 0, isRow ? 0 : -1);
  GridConstraints[] oldConstraints = copyConstraints(grid);

  for (int i=grid.getComponentCount() - 1; i >= 0; i--){
    final GridConstraints constraints = grid.getComponent(i).getConstraints();

    if (constraints.getCell(isRow) > cellIndex) {
      // component starts after the cell being deleted - move it
      addToCell(constraints, isRow, -1);
    }
    else if (isCellInsideComponent(constraints, isRow, cellIndex)) {
      // component belongs to the cell being deleted - decrement component's span
      addToSpan(constraints, isRow, -1);
    }
  }

  grid.setLayout(newLayout);
  fireAllConstraintsChanged(grid, oldConstraints);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:GridChangeUtil.java


注:本文中的com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager.copyLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。