• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RadAbstractGridLayoutManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



RadAbstractGridLayoutManager类属于com.intellij.uiDesigner.radComponents包,在下文中一共展示了RadAbstractGridLayoutManager类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: processDrop

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
@Override
public void processDrop(final GuiEditor editor, final RadComponent[] components, final GridConstraints[] constraintsToAdjust,
                        final ComponentDragObject dragObject) {
  RadAbstractGridLayoutManager gridLayout = myContainer.getGridLayoutManager();
  if (myContainer.getGridRowCount() == 0) {
    gridLayout.insertGridCells(myContainer, 0, true, true, true);
  }
  if (myContainer.getGridColumnCount() == 0) {
    gridLayout.insertGridCells(myContainer, 0, false, true, true);
  }
  dropIntoGrid(myContainer, components, myRow, myColumn, dragObject);

  FormLayout formLayout = (FormLayout) myContainer.getDelegee().getLayout();
  if (myXPart == 0) {
    formLayout.setColumnSpec(1, new ColumnSpec("d"));
  }
  else if (myXPart == 2) {
    gridLayout.insertGridCells(myContainer, 0, false, true, true);
  }
  if (myYPart == 0) {
    formLayout.setRowSpec(1, new RowSpec("d"));
  }
  else if (myYPart == 2) {
    gridLayout.insertGridCells(myContainer, 0, true, true, true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:FormFirstComponentInsertLocation.java


示例3: processDrop

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
@Override
public void processDrop(final GuiEditor editor, final RadComponent[] components, final GridConstraints[] constraintsToAdjust,
                        final ComponentDragObject dragObject) {
  RadAbstractGridLayoutManager gridLayout = myContainer.getGridLayoutManager();
  if (myContainer.getGridRowCount() == 0) {
    gridLayout.insertGridCells(myContainer, 0, true, true, true);
  }
  if (myContainer.getGridColumnCount() == 0) {
    gridLayout.insertGridCells(myContainer, 0, false, true, true);
  }
  dropIntoGrid(myContainer, components, myRow, myColumn, dragObject);

  FormLayout formLayout = (FormLayout) myContainer.getDelegee().getLayout();
  if (myXPart == 0) {
    formLayout.setColumnSpec(1, ColumnSpec.decode("d"));
  }
  else if (myXPart == 2) {
    gridLayout.insertGridCells(myContainer, 0, false, true, true);
  }
  if (myYPart == 0) {
    formLayout.setRowSpec(1, RowSpec.decode("d"));
  }
  else if (myYPart == 2) {
    gridLayout.insertGridCells(myContainer, 0, true, true, true);
  }
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:27,代码来源:FormFirstComponentInsertLocation.java


示例4: 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


示例5: deleteEmptyGridCells

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
private static void deleteEmptyGridCells(final RadContainer parent, final GridConstraints delConstraints, final boolean isRow) {
  final RadAbstractGridLayoutManager layoutManager = parent.getGridLayoutManager();
  for (int cell = delConstraints.getCell(isRow) + delConstraints.getSpan(isRow) - 1; cell >= delConstraints.getCell(isRow); cell--) {
    if (cell < parent.getGridCellCount(isRow) && GridChangeUtil.canDeleteCell(parent, cell, isRow) == GridChangeUtil.CellStatus.Empty &&
        !layoutManager.isGapCell(parent, isRow, cell)) {
      layoutManager.deleteGridCells(parent, cell, isRow);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FormEditingUtil.java


示例6: processDrop

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
@Override public void processDrop(final GuiEditor editor,
                                  final RadComponent[] components,
                                  final GridConstraints[] constraintsToAdjust,
                                  final ComponentDragObject dragObject) {
  RadAbstractGridLayoutManager gridLayout = myContainer.getGridLayoutManager();
  if (myContainer.getGridRowCount() == 0 && myContainer.getGridColumnCount() == 0) {
    gridLayout.insertGridCells(myContainer, 0, false, true, true);
    gridLayout.insertGridCells(myContainer, 0, true, true, true);
  }

  super.processDrop(editor, components, constraintsToAdjust, dragObject);

  Palette palette = Palette.getInstance(editor.getProject());
  ComponentItem hSpacerItem = palette.getItem(HSpacer.class.getName());
  ComponentItem vSpacerItem = palette.getItem(VSpacer.class.getName());

  InsertComponentProcessor icp = new InsertComponentProcessor(editor);

  if (myXPart == 0) {
    insertSpacer(icp, hSpacerItem, GridInsertMode.ColumnAfter);
  }
  if (myXPart == 2) {
    insertSpacer(icp, hSpacerItem, GridInsertMode.ColumnBefore);
  }

  if (myYPart == 0) {
    insertSpacer(icp, vSpacerItem, GridInsertMode.RowAfter);
  }
  if (myYPart == 2) {
    insertSpacer(icp, vSpacerItem, GridInsertMode.RowBefore);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:FirstComponentInsertLocation.java


示例7: normalize

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
public GridInsertLocation normalize() {
  final RadAbstractGridLayoutManager gridManager = myContainer.getGridLayoutManager();

  if (myMode == GridInsertMode.RowBefore && myRow > 0) {
    myMode = GridInsertMode.RowAfter;
    myRow--;
  }
  else if (myMode == GridInsertMode.ColumnBefore && myColumn > 0) {
    myMode = GridInsertMode.ColumnAfter;
    myColumn--;
  }

  if (myMode == GridInsertMode.RowAfter && gridManager.isGapCell(myContainer, true, myRow)) {
    myRow--;
  }
  else if (myMode == GridInsertMode.RowBefore && gridManager.isGapCell(myContainer, true, myRow)) {
    myRow++;
  }
  else if (myMode == GridInsertMode.ColumnAfter && gridManager.isGapCell(myContainer, false, myColumn)) {
    myColumn--;
  }
  else if (myMode == GridInsertMode.ColumnBefore && gridManager.isGapCell(myContainer, false, myColumn)) {
    myColumn++;
  }

  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:GridInsertLocation.java


示例8: isInsertInsideComponent

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
private boolean isInsertInsideComponent(final int size) {
  int endColumn = getInsertCell();
  if (isInsertAfter()) endColumn++;
  int row = getOppositeCell();

  for(int r=row; r<row+size; r++) {
    for(int col = 0; col<endColumn; col++) {
      RadComponent component;
      if (isColumnInsert()) {
        component = RadAbstractGridLayoutManager.getComponentAtGrid(getContainer(), r, col);
      }
      else {
        component = RadAbstractGridLayoutManager.getComponentAtGrid(getContainer(), col, r);
      }

      if (component != null) {
        GridConstraints constraints = component.getConstraints();
        final boolean isRow = !isColumnInsert();
        if (constraints.getCell(isRow) + constraints.getSpan(isRow) > endColumn &&
            constraints.getSpan(isRow) > 1) {
          return true;
        }
      }
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:GridInsertLocation.java


示例9: deleteEmptyGridCells

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
private static void deleteEmptyGridCells(final RadContainer parent, final GridConstraints delConstraints, final boolean isRow)
{
	final RadAbstractGridLayoutManager layoutManager = parent.getGridLayoutManager();
	for(int cell = delConstraints.getCell(isRow) + delConstraints.getSpan(isRow) - 1; cell >= delConstraints.getCell(isRow); cell--)
	{
		if(cell < parent.getGridCellCount(isRow) && GridChangeUtil.canDeleteCell(parent, cell, isRow) == GridChangeUtil.CellStatus.Empty &&
				!layoutManager.isGapCell(parent, isRow, cell))
		{
			layoutManager.deleteGridCells(parent, cell, isRow);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:13,代码来源:FormEditingUtil.java


示例10: GridSpanInsertProcessor

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
public GridSpanInsertProcessor(RadContainer container,
                               int insertRow,
                               int insertColumn,
                               GridInsertMode mode,
                               ComponentDragObject dragObject) {
  myContainer = container;
  myLayoutManager = container.getGridLayoutManager();
  myRow = insertRow;
  myColumn = insertColumn;

  int[] vGridLines = myLayoutManager.getVerticalGridLines(container);
  int[] hGridLines = myLayoutManager.getHorizontalGridLines(container);

  RadComponent component = RadAbstractGridLayoutManager.getComponentAtGrid(container, insertRow, insertColumn);

  if (component != null) {
    int lastColIndex = insertColumn + dragObject.getColSpan(0);
    if (lastColIndex > vGridLines.length - 1) {
      lastColIndex = insertColumn + 1;
    }

    int lastRowIndex = insertRow + dragObject.getRowSpan(0);
    if (lastRowIndex > hGridLines.length - 1) {
      lastRowIndex = insertRow + 1;
    }

    Rectangle bounds = component.getBounds();
    bounds.translate(-vGridLines[insertColumn], -hGridLines[insertRow]);

    int spaceToRight = vGridLines[lastColIndex] - vGridLines[insertColumn] - (bounds.x + bounds.width);
    int spaceBelow = hGridLines[lastRowIndex] - hGridLines[insertRow] - (bounds.y + bounds.height);

    if (mode == GridInsertMode.RowBefore && bounds.y > GridInsertLocation.INSERT_RECT_MIN_SIZE) {
      myMode = GridInsertMode.RowBefore;
      myInsertCellComponent = component;
    }
    else if (mode == GridInsertMode.RowAfter && spaceBelow > GridInsertLocation.INSERT_RECT_MIN_SIZE) {
      myMode = GridInsertMode.RowAfter;
    }
    else if (mode == GridInsertMode.ColumnBefore && bounds.x > GridInsertLocation.INSERT_RECT_MIN_SIZE) {
      myMode = GridInsertMode.ColumnBefore;
      myInsertCellComponent = component;
    }
    else if (mode == GridInsertMode.ColumnAfter && spaceToRight > GridInsertLocation.INSERT_RECT_MIN_SIZE) {
      myMode = GridInsertMode.ColumnAfter;
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:GridSpanInsertProcessor.java


示例11: getInsertFeedbackPosition

import com.intellij.uiDesigner.radComponents.RadAbstractGridLayoutManager; //导入依赖的package包/类
public static Rectangle getInsertFeedbackPosition(final GridInsertMode mode, final RadContainer container, final Rectangle cellRect,
                                                  final Rectangle feedbackRect) {
  final RadAbstractGridLayoutManager manager = container.getGridLayoutManager();
  int[] vGridLines = manager.getVerticalGridLines(container);
  int[] hGridLines = manager.getHorizontalGridLines(container);

  Rectangle rc = feedbackRect;
  int w=4;
  switch (mode) {
    case ColumnBefore:
      rc = new Rectangle(vGridLines [cellRect.x] - w, feedbackRect.y - INSERT_ARROW_SIZE,
                         2 * w, feedbackRect.height + 2 * INSERT_ARROW_SIZE);
      if (cellRect.x > 0 && manager.isGapCell(container, false, cellRect.x-1)) {
        rc.translate(-(vGridLines [cellRect.x] - vGridLines [cellRect.x-1]) / 2, 0);
      }
      break;

    case ColumnAfter:
      rc = new Rectangle(vGridLines [cellRect.x + cellRect.width+1] - w, feedbackRect.y - INSERT_ARROW_SIZE,
                         2 * w, feedbackRect.height + 2 * INSERT_ARROW_SIZE);
      if (cellRect.x < manager.getGridColumnCount(container)-1 && manager.isGapCell(container, false, cellRect.x+1)) {
        rc.translate((vGridLines [cellRect.x+2] - vGridLines [cellRect.x+1]) / 2, 0);
      }
      break;

    case RowBefore:
      rc = new Rectangle(feedbackRect.x - INSERT_ARROW_SIZE, hGridLines [cellRect.y] - w,
                         feedbackRect.width + 2 * INSERT_ARROW_SIZE, 2 * w);
      if (cellRect.y > 0 && manager.isGapCell(container, true, cellRect.y-1)) {
        rc.translate(0, -(hGridLines [cellRect.y] - hGridLines [cellRect.y-1]) / 2);
      }
      break;

    case RowAfter:
      rc = new Rectangle(feedbackRect.x - INSERT_ARROW_SIZE, hGridLines [cellRect.y+cellRect.height+1] - w,
                         feedbackRect.width + 2 * INSERT_ARROW_SIZE, 2 * w);
      if (cellRect.y < manager.getGridRowCount(container)-1 && manager.isGapCell(container, true, cellRect.y+1)) {
        rc.translate(0, (hGridLines [cellRect.y+2] - hGridLines [cellRect.y+1]) / 2);
      }
      break;
  }

  return rc;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:45,代码来源:GridInsertLocation.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Addons类代码示例发布时间:2022-05-16
下一篇:
Java RenamePackageChange类代码示例发布时间:2022-05-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap