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


Java GridConstraints.ALIGN_LEFT屬性代碼示例

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


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

示例1: setValueImpl

protected void setValueImpl(final RadComponent component, final Integer value) throws Exception {
  int anchorMask = myHorizontal ? 0x0C : 3;
  int fillMask = myHorizontal ? 1 : 2;
  int anchor = 0;
  int fill = 0;
  switch(value.intValue()) {
    case GridConstraints.ALIGN_FILL:
      fill = myHorizontal ? GridConstraints.FILL_HORIZONTAL : GridConstraints.FILL_VERTICAL;
      break;
    case GridConstraints.ALIGN_LEFT:
      anchor = myHorizontal ? GridConstraints.ANCHOR_WEST : GridConstraints.ANCHOR_NORTH;
      break;
    case GridConstraints.ALIGN_RIGHT:
      anchor = myHorizontal ? GridConstraints.ANCHOR_EAST : GridConstraints.ANCHOR_SOUTH;
      break;
  }
  GridConstraints gc = component.getConstraints();
  GridConstraints oldGC = (GridConstraints) gc.clone();
  gc.setAnchor((gc.getAnchor() & ~anchorMask) | anchor);
  gc.setFill((gc.getFill() & ~fillMask) | fill);
  AlignPropertyProvider provider = getAlignPropertyProvider(component);
  if (provider != null) {
    provider.setAlignment(component, myHorizontal, value.intValue());
  }
  component.fireConstraintsChanged(oldGC);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:AlignProperty.java

示例2: getAlignment

public int getAlignment(RadComponent component, boolean horizontal) {
  CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints();
  CellConstraints.Alignment al = horizontal ? cc.hAlign : cc.vAlign;
  if (al == CellConstraints.DEFAULT) {
    FormLayout formLayout = (FormLayout) component.getParent().getLayout();
    FormSpec formSpec = horizontal
                        ? formLayout.getColumnSpec(component.getConstraints().getColumn()+1)
                        : formLayout.getRowSpec(component.getConstraints().getRow()+1);
    final FormSpec.DefaultAlignment defaultAlignment = formSpec.getDefaultAlignment();
    if (defaultAlignment.equals(RowSpec.FILL)) {
      return GridConstraints.ALIGN_FILL;
    }
    if (defaultAlignment.equals(RowSpec.TOP) || defaultAlignment.equals(ColumnSpec.LEFT)) {
      return GridConstraints.ALIGN_LEFT;
    }
    if (defaultAlignment.equals(RowSpec.CENTER)) {
      return GridConstraints.ALIGN_CENTER;
    }
    return GridConstraints.ALIGN_RIGHT;
  }
  return Utils.alignFromConstraints(component.getConstraints(), horizontal);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:RadFormLayoutManager.java

示例3: alignFromConstraints

public static int alignFromConstraints(final GridConstraints gc, final boolean horizontal) {
  int anchor = gc.getAnchor();
  int fill = gc.getFill();
  int leftMask = horizontal ? GridConstraints.ANCHOR_WEST : GridConstraints.ANCHOR_NORTH;
  int rightMask = horizontal ? GridConstraints.ANCHOR_EAST : GridConstraints.ANCHOR_SOUTH;
  int fillMask = horizontal ? GridConstraints.FILL_HORIZONTAL : GridConstraints.FILL_VERTICAL;
  if ((fill & fillMask) != 0) return GridConstraints.ALIGN_FILL;
  if ((anchor & rightMask) != 0) return GridConstraints.ALIGN_RIGHT;
  if ((anchor & leftMask) != 0) return GridConstraints.ALIGN_LEFT;
  return GridConstraints.ALIGN_CENTER;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:Utils.java

示例4: getPairs

private IntEnumEditor.Pair[] getPairs() {
  return new IntEnumEditor.Pair[] {
    new IntEnumEditor.Pair(GridConstraints.ALIGN_LEFT,
                           myHorizontal ? UIDesignerBundle.message("property.left") : UIDesignerBundle.message("property.top")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_CENTER, UIDesignerBundle.message("property.center")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_RIGHT,
                           myHorizontal ? UIDesignerBundle.message("property.right") : UIDesignerBundle.message("property.bottom")),
    new IntEnumEditor.Pair(GridConstraints.ALIGN_FILL, UIDesignerBundle.message("property.fill"))
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:AlignProperty.java


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