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


Java RadAbstractGridLayoutManager.getComponentAtGrid方法代码示例

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


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

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

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


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