微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.swing.LayoutStyle.ComponentPlacement的实例源码

项目:Neukoelln_SER316    文件EditProjectTagDialog.java   
private void configureVerticalLayout(GroupLayout groupLayout) {
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(projectLbl,GroupLayout.DEFAULT_SIZE,37,Short.MAX_VALUE)
                    .addComponent(projectBox,GroupLayout.PREFERRED_SIZE,GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(ComponentPlacement.RELATED)
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(editTagLbl,GroupLayout.PREFERRED_SIZE)
                    .addComponent(tagSelectBox,Short.MAX_VALUE))
                .addPreferredGap(ComponentPlacement.UNRELATED)
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(tagEditLbl,29,GroupLayout.PREFERRED_SIZE)
                    .addComponent(editTagTxtField,GroupLayout.PREFERRED_SIZE))
                .addGap(18)
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(saveBtn,39,GroupLayout.PREFERRED_SIZE)
                    .addComponent(removeBtn,38,GroupLayout.PREFERRED_SIZE))
                .addGap(11))
    );
}
项目:osumer    文件TextPanel.java   
/**
 * Create the panel.
 */
public TextPanel(String text) {

    JLabel lblUpdateChangelog = new JLabel("Update description/change-log:");

    JScrollPane scrollPane = new JScrollPane();

    JLabel lblDoYouWant = new JLabel("Do you want to install this update?");
    lblDoYouWant.setFont(new Font("Tahoma",Font.PLAIN,15));
    lblDoYouWant.setHorizontalAlignment(SwingConstants.CENTER);
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addComponent(scrollPane,430,Short.MAX_VALUE)
                    .addComponent(lblUpdateChangelog,Short.MAX_VALUE)
                    .addComponent(lblDoYouWant,Alignment.TRAILING,Short.MAX_VALUE))
                .addContainerGap())
    );
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblUpdateChangelog)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(scrollPane,249,Short.MAX_VALUE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(lblDoYouWant)
                .addContainerGap())
    );

    JTextArea textArea = new JTextArea();
    scrollPane.setViewportView(textArea);
    setLayout(groupLayout);
    textArea.setEditable(false);
    textArea.setText(text);

}
项目:Openjsharp    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,JComponent component2,ComponentPlacement type,int position,Container parent) {
    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }

    checkPosition(position);

    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:jdk8u-jdk    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:openjdk-jdk10    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:openjdk9    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:snobot-2017    文件WrappedJoystickPanel.java   
private void initComponents()
{
    digitalPanel = new JPanel();
    analogPanel = new JPanel();

    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                    .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                            .addComponent(analogPanel,450,Short.MAX_VALUE).addComponent(digitalPanel,Short.MAX_VALUE))
                    .addGap(0)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addComponent(analogPanel,91,Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(digitalPanel,178,Short.MAX_VALUE)
                    .addGap(0)));
    setLayout(groupLayout);
}
项目:jdk8u_jdk    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:lookaside_java-1.8.0-openjdk    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:gscrot    文件JKeyBindingPanel.java   
public JKeyBindingPanel(FrameKeyBindings parent,KeyBinding.Type type,KeyBinding binding) {
    this.parent = parent;

    JLabel label = new JLabel("  " + type.toString());
    label.setPreferredSize(new Dimension(5000,50));
    label.setBorder(BorderFactory.createLineBorder(Color.gray));

    btn = new JKeyBindingButton(this,type,binding);
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addComponent(label,152,GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(btn,294,Short.MAX_VALUE))
    );
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addComponent(label,34,Short.MAX_VALUE)
            .addComponent(btn,Short.MAX_VALUE)
    );
    setLayout(groupLayout);
}
项目:infobip-open-jdk-8    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:jdk8u-dev-jdk    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:jdk7-jdk    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,Container parent) {

    if (component1 == null || component2 == null || type == null) {
        throw new NullPointerException();
    }
    if (type == ComponentPlacement.INDENT &&
            (position == SwingConstants.EAST ||
             position == SwingConstants.WEST)) {
        int indent = getIndent(component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:openjdk-source-code-learn    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:OLD-OpenJDK8    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:Pasapalabra    文件Juego.java   
public JPanel getPanelPregunta() {
    if (panelPregunta == null) {
        panelPregunta = new JPanel();
        panelPregunta.setBorder(new EmptyBorder(4,6,4,6));
        GroupLayout gl_panelPregunta = new GroupLayout(panelPregunta);
        gl_panelPregunta
                .setHorizontalGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING)
                        .addGroup(gl_panelPregunta.createSequentialGroup()
                                .addComponent(getPanelLetra(),58,GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(ComponentPlacement.RELATED)
                                .addComponent(getScrollPane(),403,Short.MAX_VALUE)
                                .addGap(1)));
        gl_panelPregunta.setVerticalGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING)
                .addGroup(gl_panelPregunta.createSequentialGroup()
                        .addGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING)
                                .addComponent(getPanelLetra(),48,GroupLayout.PREFERRED_SIZE)
                        .addComponent(getScrollPane(),GroupLayout.PREFERRED_SIZE))
                        .addContainerGap(GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE)));
        panelPregunta.setLayout(gl_panelPregunta);
    }
    return panelPregunta;
}
项目:openjdk-jdk7u-jdk    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:openjdk-icedtea7    文件DefaultLayoutStyle.java   
@Override
public int getPreferredGap(JComponent component1,position);
        if (indent > 0) {
            return indent;
        }
    }
    return (type == ComponentPlacement.UNRELATED) ? 12 : 6;
}
项目:vars    文件RS422ConnectionPanel.java   
private void initialize() {
      setBorder(new TitledBorder(null,"RS422",TitledBorder.LEADING,TitledBorder.TOP,null,null));

GroupLayout groupLayout = new GroupLayout(this);
groupLayout.setHorizontalGroup(
    groupLayout.createParallelGroup(Alignment.LEADING)
        .addGroup(groupLayout.createSequentialGroup()
                      .addContainerGap()
                      .addComponent(getLblPort())
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(getComboBox(),404,Short.MAX_VALUE)
                      .addContainerGap())
);
groupLayout.setVerticalGroup(
    groupLayout.createParallelGroup(Alignment.LEADING)
        .addGroup(groupLayout.createSequentialGroup()
                      .addContainerGap()
                      .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                              .addComponent(getLblPort())
                              .addComponent(getComboBox(),GroupLayout.PREFERRED_SIZE))
                      .addContainerGap(280,Short.MAX_VALUE))
);
setLayout(groupLayout);
  }
项目:litiengine    文件StaticShadowPanel.java   
public StaticShadowPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128,128,128)),Resources.get("panel_staticShadow"),null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblShadowType = new JLabel(Resources.get("panel_shadowType"));

  comboBoxShadowType = new JComboBox<>();
  comboBoxShadowType.setModel(new DefaultComboBoxModel<StaticShadowType>(StaticShadowType.values()));

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addComponent(lblShadowType,51,GroupLayout.PREFERRED_SIZE)
              .addGap(10)
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(comboBoxShadowType,95,Short.MAX_VALUE)
                      .addGap(4)))));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(comboBoxShadowType,19,GroupLayout.PREFERRED_SIZE)
                  .addComponent(lblShadowType,13,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addContainerGap(GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE)));
  setLayout(groupLayout);

  this.setupChangedListeners();
}
项目:litiengine    文件EmitterPanel.java   
public EmitterPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128,Resources.get("panel_emitter"),null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblShadowType = new JLabel(Resources.get("panel_emitterType"));

  textFieldType = new JTextField();
  textFieldType.setColumns(10);

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addComponent(lblShadowType,GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(textFieldType,Short.MAX_VALUE)
              .addContainerGap()));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblShadowType,GroupLayout.PREFERRED_SIZE)
                  .addComponent(textFieldType,GroupLayout.PREFERRED_SIZE))
              .addContainerGap(GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE)));
  setLayout(groupLayout);

  this.setupChangedListeners();
}
项目:litiengine    文件GridEditPanel.java   
public GridEditPanel(int rasterSize) {

    JLabel lblSize = new JLabel("size (px)");
    lblSize.setFont(Program.TEXT_FONT.deriveFont(Font.BOLD).deriveFont(10f));

    textField = new jformattedtextfield(NumberFormat.getIntegerInstance());

    textField.setText("16");
    textField.setFont(Program.TEXT_FONT.deriveFont(10f));
    textField.setColumns(10);
    textField.setValue(rasterSize);
    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lblSize,44,GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(textField,166,Short.MAX_VALUE)
                .addGap(34)));
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(lblSize,GroupLayout.PREFERRED_SIZE)
                    .addComponent(textField,GroupLayout.PREFERRED_SIZE))
                .addContainerGap(46,Short.MAX_VALUE)));
    setLayout(groupLayout);
  }
项目:incubator-netbeans    文件BoxFillerInitializer.java   
WidthHeightPanel(boolean showWidth,boolean showHeight) {
    ResourceBundle bundle = NbBundle.getBundle(BoxFillerInitializer.class);
    JLabel widthLabel = new JLabel(bundle.getString("BoxFillerInitializer.width")); // NOI18N
    JLabel heightLabel = new JLabel(bundle.getString("BoxFillerInitializer.height")); // NOI18N
    widthField = new JSpinner(new SpinnerNumberModel());
    heightField = new JSpinner(new SpinnerNumberModel());
    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                .addComponent(widthLabel)
                .addComponent(heightLabel))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                .addComponent(widthField)
                .addComponent(heightField))
            .addContainerGap())
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(widthLabel)
                .addComponent(widthField,GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(heightLabel)
                .addComponent(heightField,GroupLayout.PREFERRED_SIZE))
            .addContainerGap(GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE))
    );
    widthLabel.setVisible(showWidth);
    heightLabel.setVisible(showHeight);
    widthField.setVisible(showWidth);
    heightField.setVisible(showHeight);
}
项目:incubator-netbeans    文件VCSCommitPanel.java   
static Component makeVerticalStrut(JComponent compA,JComponent compB,ComponentPlacement relatedUnrelated,JPanel parent) {
    int height = LayoutStyle.getInstance().getPreferredGap(
                        compA,compB,relatedUnrelated,SOUTH,parent);
    return Box.createVerticalStrut(height);
}
项目:incubator-netbeans    文件VCSCommitPanel.java   
static Component makeHorizontalStrut(JComponent compA,JPanel parent) {
        int width = LayoutStyle.getInstance().getPreferredGap(
                            compA,WEST,parent);
        return Box.createHorizontalStrut(width);
}
项目:osumer    文件ProgressDialog.java   
/**
 * Create the dialog.
 */
public ProgressDialog() {
    setBounds(100,100,141);
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5,5,5));
    getContentPane().add(contentPanel,BorderLayout.CENTER);
    lblStatus = new JLabel("Status: Initializing");
    lblStatus.setFont(new Font("Tahoma",12));
    pb = new JProgressBar();
    GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
    gl_contentPanel
            .setHorizontalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,gl_contentPanel.createSequentialGroup().addContainerGap()
                            .addGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(pb,Alignment.LEADING,Short.MAX_VALUE)
                                    .addComponent(lblStatus,Short.MAX_VALUE))
                            .addContainerGap()));
    gl_contentPanel.setVerticalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_contentPanel.createSequentialGroup().addContainerGap().addComponent(lblStatus)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(pb,28,Short.MAX_VALUE)));
    contentPanel.setLayout(gl_contentPanel);
    {
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
        getContentPane().add(buttonPane,BorderLayout.soUTH);
        {
            JButton cancelButton = new JButton("Cancel");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    dispose();
                }
            });
            cancelButton.setActionCommand("Cancel");
            buttonPane.add(cancelButton);
        }
    }
}
项目:jGAF    文件ComponentizerLayout.java   
private void computeall()
{
    if (!_inited)
    {
        _baseline = ComponentHelper.maxValues(_children,BaselineExtractor.INSTANCE);
        _minWidth = ComponentHelper.sumValues(_children,MinWidthExtractor.INSTANCE);
        _prefWidth = ComponentHelper.sumValues(_children,PrefWidthExtractor.INSTANCE);
        _height = ComponentHelper.maxValues(_children,PrefheightExtractor.INSTANCE);

        ComponentGapsHelper helper = ComponentGapsHelper.instance();
        _gaps = new int[_children.size()];
        _gap = 0;
        for (int nth = 0; nth < _children.size() - 1; nth++)
        {
            JComponent left = _children.get(nth).component();
            JComponent right = _children.get(nth + 1).component();
            int gap = helper.getHorizontalGap(
                left,right,ComponentPlacement.RELATED,_wrapper.parent());
            _gaps[nth] = gap;
            _gap += gap;
        }
        _minWidth += _gap;
        _prefWidth += _gap;
        if (!_children.isEmpty())
        {
            _gaps[_children.size() - 1] = 0;
        }
        _variableHeight = false;
        for (ComponentizerItem child: _children)
        {
            if (_heightTester.cangrowHeight(child.component()))
            {
                _variableHeight = true;
                break;
            }
        }

        _inited = true;
    }
}
项目:jGAF    文件ComponentGapsHelper.java   
public int getHorizontalIndent()
{
    if (_indent == -1)
    {
        JLabel label1 = new JLabel("Top label");
        JLabel label2 = new JLabel("Bottom label");
        _indent = _style.getPreferredGap(
            label1,label2,ComponentPlacement.INDENT,SwingConstants.soUTH,null);
    }
    return _indent;
}
项目:tellapic    文件TableCellPanel.java   
/**
 * Create the panel.
 */
public TableCellPanel(Icon buttonIcon) {
    setMinimumSize(new Dimension(1,1));
    setAlignmentY(Component.TOP_ALIGNMENT);
    setAlignmentX(Component.LEFT_ALIGNMENT);
    setBackground(Color.WHITE);

    btnNewButton = new JButton("");
    btnNewButton.setIcon(buttonIcon);
    btnNewButton.setMinimumSize(new Dimension(107,1));

    lblNewLabel = new JTextField();
    lblNewLabel.setFont(new Font("Droid Sans",11));
    lblNewLabel.setMinimumSize(new Dimension(4,1));

    GroupLayout groupLayout = new GroupLayout(this);
    groupLayout.setHorizontalGroup(
        groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(groupLayout.createSequentialGroup()
                .addComponent(lblNewLabel,552,Short.MAX_VALUE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(btnNewButton,24,GroupLayout.PREFERRED_SIZE))
    );
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addComponent(btnNewButton,263,Short.MAX_VALUE)
            .addComponent(lblNewLabel,Short.MAX_VALUE)
    );
    setLayout(groupLayout);
}
项目:universal-pokemon-randomizer    文件RandomizerGUI.java   
private GroupLayout makeTweaksLayout(List<JCheckBox> tweaks) {
    GroupLayout gl = new GroupLayout(miscTweaksPanel);
    int numTweaks = tweaks.size();

    // Handle columns
    SequentialGroup columnsGroup = gl.createSequentialGroup().addContainerGap();
    int numCols = Math.min(TWEAK_COLS,numTweaks);
    ParallelGroup[] colGroups = new ParallelGroup[numCols];
    for (int col = 0; col < numCols; coL++) {
        if (col > 0) {
            columnsGroup.addGap(18,18,18);
        }
        colGroups[col] = gl.createParallelGroup(GroupLayout.Alignment.LEADING);
        columnsGroup.addGroup(colGroups[col]);
    }
    for (int tweak = 0; tweak < numTweaks; tweak++) {
        colGroups[tweak % numCols].addComponent(tweaks.get(tweak));
    }
    columnsGroup.addContainerGap();
    gl.setHorizontalGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(columnsGroup));

    // And rows
    SequentialGroup rowsGroup = gl.createSequentialGroup().addContainerGap();
    int numRows = (numTweaks - 1) / numCols + 1;
    ParallelGroup[] rowGroups = new ParallelGroup[numRows];
    for (int row = 0; row < numRows; row++) {
        if (row > 0) {
            rowsGroup.addPreferredGap(ComponentPlacement.UNRELATED);
        }
        rowGroups[row] = gl.createParallelGroup(GroupLayout.Alignment.BASELINE);
        rowsGroup.addGroup(rowGroups[row]);
    }
    for (int tweak = 0; tweak < numTweaks; tweak++) {
        rowGroups[tweak / numCols].addComponent(tweaks.get(tweak));
    }
    rowsGroup.addContainerGap();
    gl.setVerticalGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(rowsGroup));
    return gl;
}
项目:UiL-OTS-Video-Coding-System    文件SaveAs.java   
private void createGroups()
{
    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
                    .addComponent(lblProjectName)
                    .addComponent(lblProjectLocation))
                .addPreferredGap(ComponentPlacement.UNRELATED)
                .addGroup(groupLayout.createParallelGroup(Alignment.LEADING,false)
                    .addGroup(groupLayout.createSequentialGroup()
                        .addComponent(btnSave)
                        .addPreferredGap(ComponentPlacement.RELATED,Short.MAX_VALUE)
                        .addComponent(btnCancel))
                    .addComponent(text_projectLocation)
                    .addComponent(text_projectName,180,Short.MAX_VALUE))
                .addContainerGap(56,Short.MAX_VALUE))
    );
    groupLayout.setVerticalGroup(
        groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup()
                .addGap(32)
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(lblProjectName)
                    .addComponent(text_projectName,GroupLayout.PREFERRED_SIZE))
                .addGap(18)
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(lblProjectLocation)
                    .addComponent(text_projectLocation,GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(ComponentPlacement.RELATED,31,Short.MAX_VALUE)
                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(btnSave)
                    .addComponent(btnCancel))
                .addGap(26))
    );
    getContentPane().setLayout(groupLayout);
}
项目:vars    文件AddSamplePropDialog.java   
private JPanel getPanel() {
        if (panel == null) {
                panel = new JPanel();
                GroupLayout groupLayout = new GroupLayout(panel);
                groupLayout.setHorizontalGroup(
                        groupLayout.createParallelGroup(Alignment.LEADING)
                                .addGroup(groupLayout.createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                                                .addComponent(getLblSampledBy())
                                                .addComponent(getLblSampleId()))
                                        .addPreferredGap(ComponentPlacement.RELATED)
                                        .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                                                .addComponent(getTextField(),361,Short.MAX_VALUE)
                                                .addComponent(getComboBox(),Short.MAX_VALUE))
                                        .addContainerGap())
                );
                groupLayout.setVerticalGroup(
                        groupLayout.createParallelGroup(Alignment.LEADING)
                                .addGroup(groupLayout.createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                                                .addComponent(getLblSampledBy())
                                                .addComponent(getComboBox(),GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(ComponentPlacement.RELATED)
                                        .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                                                .addComponent(getLblSampleId())
                                                .addComponent(getTextField(),GroupLayout.PREFERRED_SIZE))
                                        .addContainerGap(0,Short.MAX_VALUE))
                );
                panel.setLayout(groupLayout);
        }
        return panel;
}
项目:vars    文件VideoArchiveSetEditorPanel.java   
private JPanel getSearchPanel() {
    if (searchPanel == null) {
            searchPanel = new JPanel();
            GroupLayout gl_searchPanel = new GroupLayout(searchPanel);
            gl_searchPanel.setHorizontalGroup(
                    gl_searchPanel.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_searchPanel.createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(gl_searchPanel.createParallelGroup(Alignment.LEADING)
                                            .addGroup(gl_searchPanel.createSequentialGroup()
                                                    .addGroup(gl_searchPanel.createParallelGroup(Alignment.LEADING)
                                                            .addComponent(getChckbxAssociation())
                                                            .addComponent(getChckbxConcept()))
                                                    .addPreferredGap(ComponentPlacement.RELATED)
                                                    .addGroup(gl_searchPanel.createParallelGroup(Alignment.LEADING)
                                                            .addComponent(getConceptComboBox(),309,Short.MAX_VALUE)
                                                            .addComponent(getAssociationComboBox(),Short.MAX_VALUE)))
                                            .addComponent(getBtnSearch(),Alignment.TRAILING))
                                    .addContainerGap())
            );
            gl_searchPanel.setVerticalGroup(
                    gl_searchPanel.createParallelGroup(Alignment.TRAILING)
                            .addGroup(gl_searchPanel.createSequentialGroup()
                                    .addContainerGap(GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE)
                                    .addGroup(gl_searchPanel.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(getChckbxConcept())
                                            .addComponent(getConceptComboBox(),GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_searchPanel.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(getChckbxAssociation())
                                            .addComponent(getAssociationComboBox(),GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(getBtnSearch()))
            );
            searchPanel.setLayout(gl_searchPanel);
    }
    return searchPanel;
}
项目:vars    文件UDPConnectionPanel.java   
private void initialize() {
        setBorder(new TitledBorder(null,"UDP",null));

        GroupLayout groupLayout = new GroupLayout(this);
        groupLayout.setHorizontalGroup(
                groupLayout.createParallelGroup(Alignment.LEADING)
                        .addGroup(groupLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                                        .addComponent(getLblHost())
                                        .addComponent(getLblPort()))
                                .addPreferredGap(ComponentPlacement.RELATED)
                                .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                                        .addComponent(getPortTextField(),401,Short.MAX_VALUE)
                                        .addComponent(getHostTextField(),Short.MAX_VALUE))
                                .addContainerGap())
        );
        groupLayout.setVerticalGroup(
                groupLayout.createParallelGroup(Alignment.LEADING)
                        .addGroup(groupLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(getLblHost())
                                        .addComponent(getHostTextField(),GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(ComponentPlacement.RELATED)
                                .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                                        .addComponent(getLblPort())
                                        .addComponent(getPortTextField(),GroupLayout.PREFERRED_SIZE))
                                .addContainerGap(248,Short.MAX_VALUE))
        );
        setLayout(groupLayout);
}
项目:maps4cim    文件PanelFileSelect.java   
public PanelFileSelect(String selectedpath,String btnbrowseText,JFileChooser fileChooser) {
    this.fileChooser = fileChooser;

    // text field for path
    inputFilePath = new JTextField();
    inputFilePath.setText(selectedpath);
    inputFilePath.setToolTipText("The selected file");
    inputFilePath.setColumns(10);

    // browse button
    JButton btnbrowse = new JButton(btnbrowseText);
    btnbrowse.setToolTipText("Choose a file");
    btnbrowse.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            openFile();
        }
    });

    // layout
    GroupLayout layout = new GroupLayout(this);
    layout.setHorizontalGroup(
        layout.createParallelGroup(Alignment.LEADING)
            .addGroup(Alignment.LEADING,layout.createSequentialGroup()
                .addComponent(inputFilePath,Short.MAX_VALUE)
                .addPreferredGap(ComponentPlacement.RELATED)
                .addComponent(btnbrowse))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                    .addComponent(btnbrowse)
                    .addComponent(inputFilePath,GroupLayout.PREFERRED_SIZE)))
    );
    this.setLayout(layout);
}
项目:litiengine    文件SpawnpointPanel.java   
public SpawnpointPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128,Resources.get("panel_spawnPoint"),null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblShadowType = new JLabel(Resources.get("panel_entity"));

  textFieldType = new JTextField();
  textFieldType.setColumns(10);

  JLabel lblDirection = new JLabel(Resources.get("panel_direction"));

  comboBoxDirection = new JComboBox<>();
  comboBoxDirection.setModel(new DefaultComboBoxModel<Direction>(Direction.values()));

  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblShadowType,GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(textFieldType,371,Short.MAX_VALUE))
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblDirection,GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(comboBoxDirection,Short.MAX_VALUE)))
              .addGap(4)));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblShadowType,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblDirection,GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxDirection,GroupLayout.PREFERRED_SIZE))
              .addContainerGap(226,Short.MAX_VALUE)));
  setLayout(groupLayout);

  this.setupChangedListeners();
}
项目:litiengine    文件DecorMobPanel.java   
/**
 * Create the panel.
 */
public DecorMobPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128,Resources.get("panel_decorMob"),null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblSprite = new JLabel(Resources.get("panel_sprite"));

  comboBoxSpriteSheets = new JComboBox<>();
  comboBoxSpriteSheets.setRenderer(new MyComboRenderer());

  JLabel lblBehavIoUr = new JLabel(Resources.get("panel_behavior"));

  comboBoxBehavIoUr = new JComboBox<>();
  comboBoxBehavIoUr.setModel(new DefaultComboBoxModel<MovementBehavior>(MovementBehavior.values()));

  lblVveLocity = new JLabel(Resources.get("panel_veLocity"));

  spinnerVeLocity = new JSpinner();
  spinnerVeLocity.setModel(new SpinnerNumberModel(0,1));

  chckbxAttackable = new JCheckBox(Resources.get("panel_attackable"));
  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblSprite,GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(comboBoxSpriteSheets,Short.MAX_VALUE)
                      .addGap(10))
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblBehavIoUr,GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addComponent(comboBoxBehavIoUr,Short.MAX_VALUE)
                      .addContainerGap())
                  .addGroup(groupLayout.createSequentialGroup()
                      .addComponent(lblVveLocity,GroupLayout.PREFERRED_SIZE)
                      .addPreferredGap(ComponentPlacement.RELATED)
                      .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                          .addGroup(groupLayout.createSequentialGroup()
                              .addComponent(chckbxAttackable,Short.MAX_VALUE)
                              .addGap(28))
                          .addComponent(spinnerVeLocity,Short.MAX_VALUE))
                      .addContainerGap()))));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addComponent(lblSprite,GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxSpriteSheets,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblBehavIoUr,GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxBehavIoUr,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblVveLocity,GroupLayout.PREFERRED_SIZE)
                  .addComponent(spinnerVeLocity,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addComponent(chckbxAttackable)
              .addContainerGap(171,Short.MAX_VALUE)));
  setLayout(groupLayout);
  this.setupChangedListeners();
}
项目:litiengine    文件PropPanel.java   
/**
 * Create the panel.
 */
public PropPanel() {
  TitledBorder border = new TitledBorder(new LineBorder(new Color(128,Resources.get("panel_prop"),null);
  border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
  setBorder(border);

  JLabel lblHealth = new JLabel(Resources.get("panel_health"));

  spinnerHealth = new JSpinner();
  spinnerHealth.setModel(new SpinnerNumberModel(100,1000000,1));

  JLabel lblMaterial = new JLabel(Resources.get("panel_material"));

  comboBoxMaterial = new JComboBox<>();
  comboBoxMaterial.setModel(new DefaultComboBoxModel<Material>(Material.values()));

  JLabel lblSprite = new JLabel(Resources.get("panel_sprite"));

  comboBoxSpriteSheets = new JComboBox<>();
  comboBoxSpriteSheets.setRenderer(new MyComboRenderer());

  chckbxIndestructible = new JCheckBox(Resources.get("panel_destructible"));

  chckbxIsObstacle = new JCheckBox(Resources.get("panel_isObstacle"));

  chckbxShadow = new JCheckBox("shadow");
  GroupLayout groupLayout = new GroupLayout(this);
  groupLayout.setHorizontalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addContainerGap()
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addComponent(lblHealth,GroupLayout.PREFERRED_SIZE)
                  .addComponent(lblMaterial,GroupLayout.PREFERRED_SIZE)
                  .addComponent(lblSprite,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                  .addComponent(chckbxShadow,81,GroupLayout.PREFERRED_SIZE)
                  .addComponent(comboBoxMaterial,365,Short.MAX_VALUE)
                  .addComponent(spinnerHealth,Short.MAX_VALUE)
                  .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING,false)
                      .addComponent(chckbxIsObstacle,Short.MAX_VALUE)
                      .addComponent(chckbxIndestructible,Short.MAX_VALUE)))
              .addContainerGap()));
  groupLayout.setVerticalGroup(
      groupLayout.createParallelGroup(Alignment.LEADING)
          .addGroup(groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblHealth,GroupLayout.PREFERRED_SIZE)
                  .addComponent(spinnerHealth,20,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(lblMaterial,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
                  .addComponent(comboBoxSpriteSheets,GroupLayout.PREFERRED_SIZE))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(chckbxIndestructible)
              .addPreferredGap(ComponentPlacement.UNRELATED)
              .addComponent(chckbxIsObstacle,21,GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(chckbxShadow,GroupLayout.PREFERRED_SIZE)
              .addContainerGap(138,Short.MAX_VALUE)));
  setLayout(groupLayout);
  this.setupChangedListeners();
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。