本文整理汇总了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;
}
示例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;
}
}
}