コード例 #1
0
  private StaticPanel createStaticComboBoxPanel(
      PrimitiveForm primitiveForm, DOTProperty property, String labelText, Object[] items) {
    JLabel label = new JLabel(labelText);
    JComboBox comboBox = new JComboBox(items);
    comboBox.setMaximumSize(new Dimension(300, 25));
    comboBox.setEnabled(_dotDefinitionDialogFrame.isEditable());

    StaticPanel thePanel = new StaticPanel(primitiveForm, property);
    thePanel.setMaximumSize(new Dimension(300, 25));
    thePanel.setLayout(new SpringLayout());
    thePanel.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.BLACK));
    thePanel.add(label);
    thePanel.add(comboBox);
    SpringUtilities.makeCompactGrid(thePanel, 2, 5, 5);

    thePanel.setValue(comboBox);
    thePanel.addListener(comboBox);

    return thePanel;
  }
コード例 #2
0
  private StaticPanel createStaticSpinnerPanel(
      PrimitiveForm primitiveForm,
      DOTProperty property,
      String labelText,
      SpinnerModel spinnerModel) {
    JLabel label = new JLabel(labelText);
    JSpinner spinner = new JSpinner(spinnerModel);
    spinner.setMaximumSize(new Dimension(200, 20));
    spinner.setEnabled(_dotDefinitionDialogFrame.isEditable());

    StaticPanel thePanel = new StaticPanel(primitiveForm, property);
    thePanel.setLayout(new SpringLayout());
    thePanel.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.BLACK));
    thePanel.add(label);
    thePanel.add(spinner);
    SpringUtilities.makeCompactGrid(thePanel, 2, 5, 5);

    thePanel.setValue(spinner);
    thePanel.addListener(spinner);

    return thePanel;
  }