當前位置: 首頁>>代碼示例>>Java>>正文


Java GridConstraints.setColSpan方法代碼示例

本文整理匯總了Java中com.intellij.uiDesigner.core.GridConstraints.setColSpan方法的典型用法代碼示例。如果您正苦於以下問題:Java GridConstraints.setColSpan方法的具體用法?Java GridConstraints.setColSpan怎麽用?Java GridConstraints.setColSpan使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.uiDesigner.core.GridConstraints的用法示例。


在下文中一共展示了GridConstraints.setColSpan方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addComponent

import com.intellij.uiDesigner.core.GridConstraints; //導入方法依賴的package包/類
private static int addComponent(JComponent parent, JComponent component, int row, int column, boolean isLast) {
  GridConstraints gridConstraints = new GridConstraints();
  gridConstraints.setRow(row);
  gridConstraints.setColumn(column);

  boolean isGreedyComponent = component instanceof JTextField || component instanceof Spacer ||
                              component instanceof LabelWithEditLink || component instanceof TextAccessor ||
                              component instanceof EditorComboBox;

  int columnSpan = (isLast && isGreedyComponent) ? COLUMN_COUNT - column : 1;
  gridConstraints.setColSpan(columnSpan);
  gridConstraints.setAnchor(GridConstraints.ALIGN_LEFT);
  gridConstraints.setHSizePolicy(isGreedyComponent
                                 ? GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW
                                 : GridConstraints.SIZEPOLICY_CAN_SHRINK);
  gridConstraints.setVSizePolicy(component instanceof Spacer
                                 ? GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW
                                 : GridConstraints.SIZEPOLICY_FIXED);
  gridConstraints.setFill(GridConstraints.FILL_HORIZONTAL);
  parent.add(component, gridConstraints);
  if (isLast && !isGreedyComponent && column < COLUMN_COUNT - 1) {
    addComponent(parent, new Spacer(), row, column + 1, true);
  }

  return columnSpan;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:TemplateParameterStep2.java

示例2: createGridConstraints

import com.intellij.uiDesigner.core.GridConstraints; //導入方法依賴的package包/類
private GridConstraints createGridConstraints(boolean grab, int columnSpan) {
  GridConstraints gridConstraints = new GridConstraints();
  gridConstraints.setRow(componentNumber / COLUMN_COUNT);
  final int column = componentNumber % COLUMN_COUNT;
  gridConstraints.setColumn(column);
  if (grab) {
    gridConstraints.setHSizePolicy(GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW);
  }
  gridConstraints.setFill(GridConstraints.FILL_HORIZONTAL);
  gridConstraints.setColSpan(columnSpan);
  componentNumber += columnSpan;
  return gridConstraints;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:ModuleImportSettingsPane.java

示例3: addToSpan

import com.intellij.uiDesigner.core.GridConstraints; //導入方法依賴的package包/類
private static void addToSpan(final GridConstraints constraints, final boolean isRow, final int delta){
  if (isRow) {
    constraints.setRowSpan(constraints.getRowSpan() + delta);
  }
  else {
    constraints.setColSpan(constraints.getColSpan() + delta);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:GridChangeUtil.java

示例4: createTwoDimensionGrid

import com.intellij.uiDesigner.core.GridConstraints; //導入方法依賴的package包/類
private static GridLayoutManager createTwoDimensionGrid(final RadComponent[] selection){
  final int[] x = new int[selection.length];
  final int[] y = new int[selection.length];
  final int[] colSpans = new int[selection.length];
  final int[] rowSpans = new int[selection.length];

  for (int i = selection.length - 1; i >= 0; i--) {
    x[i] = selection[i].getX();
    y[i] = selection[i].getY();
    rowSpans[i] = selection[i].getHeight();
    colSpans[i] = selection[i].getWidth();
  }

  final Couple<Integer> pair = layoutInGrid(x, y, rowSpans, colSpans);
  for (int i = 0; i < selection.length; i++) {
    final RadComponent component = selection[i];
    final GridConstraints constraints = component.getConstraints();

    constraints.setRow(y[i]);
    constraints.setRowSpan(rowSpans[i]);

    constraints.setColumn(x[i]);
    constraints.setColSpan(colSpans[i]);
  }

  return new GridLayoutManager(pair.first.intValue(), pair.second.intValue());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:GridBuildUtil.java

示例5: moveComponent

import com.intellij.uiDesigner.core.GridConstraints; //導入方法依賴的package包/類
@Override
public void moveComponent(RadComponent c, int rowDelta, int colDelta, final int rowSpanDelta, final int colSpanDelta) {
  GridConstraints constraints = c.getConstraints();
  GridConstraints oldConstraints = (GridConstraints)constraints.clone();
  constraints.setRow(getNewRow(c, rowDelta));
  constraints.setColumn(getNewColumn(c, colDelta));
  constraints.setRowSpan(getNewRowSpan(c, rowSpanDelta));
  constraints.setColSpan(getNewColSpan(c, colSpanDelta));
  c.fireConstraintsChanged(oldConstraints);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:RadAbstractGridLayoutManager.java

示例6: readChildConstraints

import com.intellij.uiDesigner.core.GridConstraints; //導入方法依賴的package包/類
void readChildConstraints(final Element constraintsElement, final LwComponent component) {
  // Read Grid constraints
  final Element gridElement = LwXmlReader.getChild(constraintsElement, "grid");
  if(gridElement != null){
    final GridConstraints constraints=new GridConstraints();

    constraints.setRow(LwXmlReader.getRequiredInt(gridElement, "row"));
    constraints.setColumn(LwXmlReader.getRequiredInt(gridElement, "column"));
    constraints.setRowSpan(LwXmlReader.getRequiredInt(gridElement, "row-span"));
    constraints.setColSpan(LwXmlReader.getRequiredInt(gridElement, "col-span"));
    constraints.setVSizePolicy(LwXmlReader.getRequiredInt(gridElement, "vsize-policy"));
    constraints.setHSizePolicy(LwXmlReader.getRequiredInt(gridElement, "hsize-policy"));
    constraints.setAnchor(LwXmlReader.getRequiredInt(gridElement, "anchor"));
    constraints.setFill(LwXmlReader.getRequiredInt(gridElement, "fill"));
    constraints.setIndent(LwXmlReader.getOptionalInt(gridElement, UIFormXmlConstants.ATTRIBUTE_INDENT, 0));
    constraints.setUseParentLayout(LwXmlReader.getOptionalBoolean(gridElement, UIFormXmlConstants.ATTRIBUTE_USE_PARENT_LAYOUT, false));

    // minimum size
    final Element minSizeElement = LwXmlReader.getChild(gridElement, "minimum-size");
    if (minSizeElement != null) {
      constraints.myMinimumSize.width = LwXmlReader.getRequiredInt(minSizeElement, "width");
      constraints.myMinimumSize.height = LwXmlReader.getRequiredInt(minSizeElement, "height");
    }

    // preferred size
    final Element prefSizeElement = LwXmlReader.getChild(gridElement, "preferred-size");
    if (prefSizeElement != null) {
      constraints.myPreferredSize.width = LwXmlReader.getRequiredInt(prefSizeElement, "width");
      constraints.myPreferredSize.height = LwXmlReader.getRequiredInt(prefSizeElement, "height");
    }

    // maximum size
    final Element maxSizeElement = LwXmlReader.getChild(gridElement, "maximum-size");
    if (maxSizeElement != null) {
      constraints.myMaximumSize.width = LwXmlReader.getRequiredInt(maxSizeElement, "width");
      constraints.myMaximumSize.height = LwXmlReader.getRequiredInt(maxSizeElement, "height");
    }

    component.getConstraints().restore(constraints);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:42,代碼來源:GridLayoutSerializer.java

示例7: copyCellToGridConstraints

import com.intellij.uiDesigner.core.GridConstraints; //導入方法依賴的package包/類
private static void copyCellToGridConstraints(final GridConstraints gc, final CellConstraints cc) {
  gc.setColumn(cc.gridX-1);
  gc.setRow(cc.gridY-1);
  gc.setColSpan(cc.gridWidth);
  gc.setRowSpan(cc.gridHeight);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:RadFormLayoutManager.java


注:本文中的com.intellij.uiDesigner.core.GridConstraints.setColSpan方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。