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


Java GridConstraints.SIZEPOLICY_WANT_GROW屬性代碼示例

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


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

示例1: CodeMakerConfiguration

public CodeMakerConfiguration(CodeMakerSettings settings) {
    tabbedPane = new JBTabbedPane();
    editPaneMap = new HashMap<>();
    addTemplateButton.addActionListener(e -> {
        TemplateEditPane editPane = new TemplateEditPane(settings, "", this);
        String title = "Untitled";
        tabbedPane.addTab(title, editPane.getTemplateEdit());
        tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
        editPaneMap.put(title, editPane);
    });
    resetTabPane(settings);
    GridConstraints constraints = new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
        GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
        GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(300, 300), null, 0, true);
    mainPane.add(tabbedPane, constraints);
}
 
開發者ID:zeng198821,項目名稱:CodeGenerate,代碼行數:16,代碼來源:CodeMakerConfiguration.java

示例2: getWeight

private double getWeight(final GridConstraints constraints, final boolean horizontal) {
  int policy = horizontal ? constraints.getHSizePolicy() : constraints.getVSizePolicy();
  if ((policy & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) {
    return 1.0;
  }
  boolean canGrow = ((policy & GridConstraints.SIZEPOLICY_CAN_GROW) != 0);
  for (Iterator iterator = myConstraints.iterator(); iterator.hasNext();) {
    GridConstraints otherConstraints = (GridConstraints)iterator.next();

    if (!constraintsIntersect(horizontal, constraints, otherConstraints)) {
      int otherPolicy = horizontal ? otherConstraints.getHSizePolicy() : otherConstraints.getVSizePolicy();
      if ((otherPolicy & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) {
        return 0.0;
      }
      if (!canGrow && ((otherPolicy & GridConstraints.SIZEPOLICY_CAN_GROW) != 0)) {
        return 0.0;
      }
    }
  }
  return 1.0;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:GridBagConverter.java

示例3: customize

protected void customize(@NotNull final Integer value) {
  final int policy=value.intValue();
  myBuffer.setLength(0);

  if((policy & GridConstraints.SIZEPOLICY_CAN_SHRINK) != 0){
    myBuffer.append(UIDesignerBundle.message("property.can.shrink"));
  }
  if((policy & GridConstraints.SIZEPOLICY_CAN_GROW) != 0){
    if(myBuffer.length()>0){
      myBuffer.append(", ");
    }
    myBuffer.append(UIDesignerBundle.message("property.can.grow"));
  }
  if((policy & GridConstraints.SIZEPOLICY_WANT_GROW) != 0){
    if(myBuffer.length()>0){
      myBuffer.append(", ");
    }
    myBuffer.append(UIDesignerBundle.message("property.want.grow"));
  }

  if(policy==GridConstraints.SIZEPOLICY_FIXED){
    myBuffer.append(UIDesignerBundle.message("property.fixed"));
  }

  setText(myBuffer.substring(0, myBuffer.length())); // [jeka] important! do not use toString() on the StringBuffer that is reused
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:26,代碼來源:SizePolicyRenderer.java

示例4: addVmEditor

private void addVmEditor(String template) {
    EditorFactory factory = EditorFactory.getInstance();
    Document velocityTemplate = factory.createDocument(template);
    editor = factory.createEditor(velocityTemplate, null, FileTypeManager.getInstance()
        .getFileTypeByExtension("vm"), false);
    GridConstraints constraints = new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST,
        GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW,
        GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(300, 300), null, 0, true);
    editorPane.add(editor.getComponent(), constraints);
}
 
開發者ID:zeng198821,項目名稱:CodeGenerate,代碼行數:10,代碼來源:TemplateEditPane.java

示例5: SizePolicyProperty

public SizePolicyProperty(@NonNls final String name){
  super(null, name);
  myChildren=new Property[]{
    new MyBooleanProperty("Can Shrink", GridConstraints.SIZEPOLICY_CAN_SHRINK),
    new MyBooleanProperty("Can Grow", GridConstraints.SIZEPOLICY_CAN_GROW),
    new MyBooleanProperty("Want Grow", GridConstraints.SIZEPOLICY_WANT_GROW)
  };
  myRenderer=new SizePolicyRenderer();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:SizePolicyProperty.java

示例6: gridToCellConstraints

private static CellConstraints gridToCellConstraints(final RadComponent component) {
  GridConstraints gc = component.getConstraints();
  CellConstraints.Alignment hAlign = ((gc.getHSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0)
                                     ? CellConstraints.FILL
                                     : CellConstraints.DEFAULT;
  CellConstraints.Alignment vAlign = ((gc.getVSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0)
                                     ? CellConstraints.FILL
                                     : CellConstraints.DEFAULT;
  if (component.getCustomLayoutConstraints() instanceof CellConstraints) {
    CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints();
    hAlign = cc.hAlign;
    vAlign = cc.vAlign;
  }
  return new CellConstraints(gc.getColumn()+1, gc.getRow()+1, gc.getColSpan(), gc.getRowSpan(), hAlign, vAlign);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:RadFormLayoutManager.java

示例7: createUIComponents

private void createUIComponents() {
    ElementProducer<RegExSampleSet> producer = new ElementProducer<RegExSampleSet>() {
        @Override
        public RegExSampleSet createElement() {
            return new RegExSampleSet();
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    };

    GridConstraints constraints = new GridConstraints(0, 0, 1, 1
            , GridConstraints.ANCHOR_CENTER
            , GridConstraints.FILL_BOTH
            , GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW
            , GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW
            , null, null, null);

    ColumnInfo[] sampleTextColumns = { new SampleColumn(), new ResultColumn() };
    myTextModel = new ListTableModel<>(sampleTextColumns, new ArrayList<>(), 0);
    myTextTable = new TableView<RegExSampleSet>(myTextModel) {
        @Override
        public void editingCanceled(ChangeEvent e) {
            super.editingCanceled(e);
            ApplicationManager.getApplication().invokeLater(() -> validateResults(false));
        }
    };

    myTextTable.setPreferredScrollableViewportSize(JBUI.size(-1, 500));
    myTextTable.setRowSelectionAllowed(true);

    //int height = (int) myTextTable.getTableHeader().getPreferredSize().getHeight() + 10;
    //myTextTable.setRowHeight(height);
    int height = myTextTable.getRowHeight();
    myTableRowPadding = 8;
    myTextTable.setRowHeight(height + myTableRowPadding);

    ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTextTable, producer);
    myTablesPanel = new JPanel(new GridLayoutManager(1, 1));
    myTablesPanel.add(decorator.createPanel(), constraints);

    myViewPanel = new JPanel(new BorderLayout());
    myViewPanel.add(myTablesPanel, BorderLayout.CENTER);
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:46,代碼來源:RegExTestDialog.java

示例8: createHeaderLabelGridConstraints

private static GridConstraints createHeaderLabelGridConstraints(int row, int column, int anchor) {
  return new GridConstraints(row, column, 1, 1, anchor, GridConstraints.FILL_HORIZONTAL,
                             GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED,
                             null, null, null);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:WizardStepHeaderPanel.java

示例9: isHGrow

public boolean isHGrow() {
  for(GridConstraints c: myOriginalConstraints) {
    if ((c.getHSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) return true;
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:DraggedComponentList.java

示例10: isVGrow

public boolean isVGrow() {
  for(GridConstraints c: myOriginalConstraints) {
    if ((c.getVSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) return true;
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:DraggedComponentList.java

示例11: isHGrow

public boolean isHGrow() {
  return (myItem.getDefaultConstraints().getHSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:ComponentItemDragObject.java

示例12: isVGrow

public boolean isVGrow() {
  return (myItem.getDefaultConstraints().getVSizePolicy() & GridConstraints.SIZEPOLICY_WANT_GROW) != 0;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:3,代碼來源:ComponentItemDragObject.java

示例13: pushSizePolicy

private static void pushSizePolicy(final FormSourceCodeGenerator generator, final int value) {
  final String className = GridConstraints.class.getName();

  //noinspection NonConstantStringShouldBeStringBuffer
  @NonNls String presentation;
  if (GridConstraints.SIZEPOLICY_FIXED == value) {
    presentation = className + ".SIZEPOLICY_FIXED";
  }
  else {
    if ((value & GridConstraints.SIZEPOLICY_CAN_SHRINK) != 0) {
      presentation = className + ".SIZEPOLICY_CAN_SHRINK";
    }
    else {
      presentation = null;
    }

    if ((value & GridConstraints.SIZEPOLICY_WANT_GROW) != 0) {
      if (presentation == null) {
        presentation = className + ".SIZEPOLICY_WANT_GROW";
      }
      else {
        presentation += "|" + className + ".SIZEPOLICY_WANT_GROW";
      }
    }
    else if ((value & GridConstraints.SIZEPOLICY_CAN_GROW) != 0) {
      if (presentation == null) {
        presentation = className + ".SIZEPOLICY_CAN_GROW";
      }
      else {
        presentation += "|" + className + ".SIZEPOLICY_CAN_GROW";
      }
    }
    else {
      // ?
      generator.push(value);
      return;
    }
  }

  generator.pushVar(presentation);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:41,代碼來源:GridLayoutSourceGenerator.java


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