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


Java GridConstraints.SIZEPOLICY_FIXED属性代码示例

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


在下文中一共展示了GridConstraints.SIZEPOLICY_FIXED属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: 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

示例4: createFolderGroupComponent

protected JComponent createFolderGroupComponent(String title,
                                                ContentFolder[] folders,
                                                Color foregroundColor,
                                                @Nullable ModuleSourceRootEditHandler<?> editor) {
  final JPanel panel = new JPanel(new GridLayoutManager(folders.length, 3, new Insets(1, 17, 0, 2), 0, 1));
  panel.setOpaque(false);

  for (int idx = 0; idx < folders.length; idx++) {
    final ContentFolder folder = folders[idx];
    final int verticalPolicy = idx == folders.length - 1? GridConstraints.SIZEPOLICY_CAN_GROW : GridConstraints.SIZEPOLICY_FIXED;
    panel.add(createFolderComponent(folder, foregroundColor, editor), new GridConstraints(idx, 0, 1, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW | GridConstraints.SIZEPOLICY_CAN_SHRINK, verticalPolicy, null, null, null));
    int column = 1;
    int colspan = 2;

    if (editor != null) {
      JComponent additionalComponent = createRootPropertiesEditor(editor, (SourceFolder)folder);
      if (additionalComponent != null) {
        panel.add(additionalComponent, new GridConstraints(idx, column++, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, verticalPolicy, null, null, null));
        colspan = 1;
      }
    }
    panel.add(createFolderDeleteComponent(folder, editor), new GridConstraints(idx, column, 1, colspan, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, verticalPolicy, null, null, null));
  }

  final JLabel titleLabel = new JLabel(title);
  final Font labelFont = UIUtil.getLabelFont();
  titleLabel.setFont(labelFont.deriveFont(Font.BOLD));
  titleLabel.setOpaque(false);
  titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
  registerTextComponent(titleLabel, foregroundColor);

  final JPanel groupPanel = new JPanel(new BorderLayout());
  groupPanel.setOpaque(false);
  groupPanel.add(titleLabel, BorderLayout.NORTH);
  groupPanel.add(panel, BorderLayout.CENTER);

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

示例5: addIconIfExists

private boolean addIconIfExists(@Nullable ImageComponent iconComponent, int column, int spanningRows) {
  if (iconComponent != null) {
    GridConstraints imageConstraints =
      new GridConstraints(0, column, spanningRows, 1, GridConstraints.ANCHOR_NORTHWEST, GridConstraints.FILL_NONE,
                          GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(60, 60), null);
    add(iconComponent, imageConstraints);
    return true;
  }
  else {
    return false;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:WizardStepHeaderPanel.java

示例6: 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

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