Ejemplo n.º 1
0
  private void setMetadataValues() {
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets = new Insets(5, 5, 5, 5);
    JLabel label = new JLabel();
    label.setText("Optimizer name:");
    gbc.gridx = 0;
    gbc.gridy = gridy;
    add(label, gbc);
    label = new JLabel();
    label.setText(constraints.getObjectiveDisplayName());
    label.setFont(label.getFont().deriveFont(Font.PLAIN));
    gbc.gridx = 1;
    add(label, gbc);

    label = new JLabel();
    label.setText("Constraints name:");
    gbc.gridx = 0;
    gbc.gridy = ++gridy;
    add(label, gbc);
    constraintsNameField = new JTextField(50);
    constraintsNameField.setText(constraints.getConstraintsName());
    gbc.gridx = 1;
    add(constraintsNameField, gbc);

    label = new JLabel();
    label.setText("Number of holes:");
    gbc.gridx = 0;
    gbc.gridy = ++gridy;
    add(label, gbc);
    label = new JLabel();
    label.setText(Integer.toString(constraints.getNumberOfHoles()));
    label.setFont(label.getFont().deriveFont(Font.PLAIN));
    gbc.gridx = 1;
    add(label, gbc);
  }
Ejemplo n.º 2
0
  private void setConstraintsValues() {
    Set<String> categories = constraints.getCategories();
    gbc.gridx = 0;
    for (String category : categories) {
      JPanel panel = new JPanel();
      panel.setLayout(new BorderLayout());
      JLabel label = new JLabel(category);
      panel.add(label, BorderLayout.NORTH);

      List<Constraint> constraintValues = constraints.getConstraints(category);
      JTable table = new JTable(new ConstraintTableModel(constraintValues));
      JScrollPane scrollPane = new JScrollPane(table);
      scrollPane.setPreferredSize(new Dimension(900, 150));
      panel.add(scrollPane, BorderLayout.CENTER);
      gbc.gridy = ++gridy;
      gbc.gridwidth = 2;
      add(panel, gbc);
    }
  }