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


Java RadAbstractGridLayoutManager.getGridColumnCount方法代码示例

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


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

示例1: 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.getGridColumnCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。