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


Java GridConstraints.setVSizePolicy方法代码示例

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


在下文中一共展示了GridConstraints.setVSizePolicy方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 static GridConstraints createGridConstraints(int row, boolean growVertically) {
  GridConstraints constraints = new GridConstraints();
  constraints.setRow(row);
  constraints.setFill(GridConstraints.FILL_HORIZONTAL);
  constraints.setHSizePolicy(GridConstraints.SIZEPOLICY_WANT_GROW);
  if (growVertically) {
    constraints.setVSizePolicy(GridConstraints.SIZEPOLICY_WANT_GROW | GridConstraints.SIZEPOLICY_CAN_GROW);
  }
  return constraints;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ModulesTable.java

示例3: layout

import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private void layout(JPanel panel, int row, int ident) {
  GridConstraints c = new GridConstraints();
  c.setVSizePolicy(GridConstraints.SIZEPOLICY_FIXED);
  c.setRow(row);
  c.setColumn(0);
  c.setFill(GridConstraints.FILL_NONE);
  c.setAnchor(GridConstraints.ANCHOR_WEST);
  c.setRow(row);
  c.setIndent(ident);
  panel.add(myLabel, c);
  c.setIndent(0);
  c.setColumn(1);
  c.setFill(GridConstraints.FILL_HORIZONTAL);
  panel.add(myMinSdkCombobox, c);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ConfigureFormFactorStep.java

示例4: processDefaultConstraintsElement

import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
/**
 * Helper method.
 */
private static GridConstraints processDefaultConstraintsElement(@NotNull final Element element) {
  final GridConstraints constraints = new GridConstraints();

  // grid related attributes
  constraints.setVSizePolicy(LwXmlReader.getRequiredInt(element, ATTRIBUTE_VSIZE_POLICY));
  constraints.setHSizePolicy(LwXmlReader.getRequiredInt(element, ATTRIBUTE_HSIZE_POLICY));
  constraints.setAnchor(LwXmlReader.getRequiredInt(element, ATTRIBUTE_ANCHOR));
  constraints.setFill(LwXmlReader.getRequiredInt(element, ATTRIBUTE_FILL));

  // minimum size
  final Element minSizeElement = element.getChild(ELEMENT_MINIMUM_SIZE);
  if (minSizeElement != null) {
    constraints.myMinimumSize.width = LwXmlReader.getRequiredInt(minSizeElement, ATTRIBUTE_WIDTH);
    constraints.myMinimumSize.height = LwXmlReader.getRequiredInt(minSizeElement, ATTRIBUTE_HEIGHT);
  }

  // preferred size
  final Element prefSizeElement = element.getChild(ELEMENT_PREFERRED_SIZE);
  if (prefSizeElement != null) {
    constraints.myPreferredSize.width = LwXmlReader.getRequiredInt(prefSizeElement, ATTRIBUTE_WIDTH);
    constraints.myPreferredSize.height = LwXmlReader.getRequiredInt(prefSizeElement, ATTRIBUTE_HEIGHT);
  }

  // maximum size
  final Element maxSizeElement = element.getChild(ELEMENT_MAXIMUM_SIZE);
  if (maxSizeElement != null) {
    constraints.myMaximumSize.width = LwXmlReader.getRequiredInt(maxSizeElement, ATTRIBUTE_WIDTH);
    constraints.myMaximumSize.height = LwXmlReader.getRequiredInt(maxSizeElement, ATTRIBUTE_HEIGHT);
  }

  return constraints;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:Palette.java

示例5: setEditor

import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
private void setEditor(JComponent editor, int vSizePolicy) {
    if (myEditorComponent != null) {
        myForm.getEditorPanel().remove(myEditorComponent);
    }

    final GridConstraints gridConstraints = new GridConstraints();
    gridConstraints.setFill(vSizePolicy == GridConstraints.SIZEPOLICY_WANT_GROW ? GridConstraints.FILL_BOTH : GridConstraints.FILL_HORIZONTAL);
    gridConstraints.setVSizePolicy(vSizePolicy);
    myForm.getEditorPanel().add(myEditorComponent = editor, gridConstraints);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:InputExpressionDialog.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: doOKAction

import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
@Override
protected void doOKAction() {
  // TODO[vova] implement validation
  if (myClassRadioButton.isSelected()) {
    final String className = myDocument.getText().trim();
    PsiClass psiClass = JavaPsiFacade.getInstance(myProject).findClass(className, GlobalSearchScope.allScope(myProject));
    if (psiClass != null) {
      myItemToBeEdited.setClassName(getClassOrInnerName(psiClass));        
    }
    else {
      myItemToBeEdited.setClassName(className);
    }
  }
  else {
    if (!saveNestedForm()) return;
  }
  myItemToBeEdited.setIconPath(myTfIconPath.getText().trim());

  {
    final GridConstraints defaultConstraints = myItemToBeEdited.getDefaultConstraints();
    // Horizontal size policy
    defaultConstraints.setHSizePolicy(
      (myChkHorCanShrink.isSelected() ? GridConstraints.SIZEPOLICY_CAN_SHRINK : 0) |
      (myChkHorCanGrow.isSelected() ? GridConstraints.SIZEPOLICY_CAN_GROW : 0) |
      (myChkHorWantGrow.isSelected() ? GridConstraints.SIZEPOLICY_WANT_GROW : 0)
    );

    // Vertical size policy
    defaultConstraints.setVSizePolicy(
      (myChkVerCanShrink.isSelected() ? GridConstraints.SIZEPOLICY_CAN_SHRINK : 0) |
      (myChkVerCanGrow.isSelected() ? GridConstraints.SIZEPOLICY_CAN_GROW : 0) |
      (myChkVerWantGrow.isSelected() ? GridConstraints.SIZEPOLICY_WANT_GROW : 0)
    );

    defaultConstraints.setFill(
      (myChkHorWantGrow.isSelected() ? GridConstraints.FILL_HORIZONTAL : 0) |
      (myChkVerWantGrow.isSelected() ? GridConstraints.FILL_VERTICAL : 0)
    );
  }

  myItemToBeEdited.setIsContainer(myIsContainerCheckBox.isSelected());
  myItemToBeEdited.setAutoCreateBinding(myAutoCreateBindingCheckbox.isSelected());
  myItemToBeEdited.setCanAttachLabel(myCanAttachLabelCheckbox.isSelected());

  super.doOKAction();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:ComponentItemDialog.java

示例8: setValueImpl

import com.intellij.uiDesigner.core.GridConstraints; //导入方法依赖的package包/类
protected void setValueImpl(final GridConstraints constraints,final int policy){
  constraints.setVSizePolicy(policy);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:VSizePolicyProperty.java


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