示例#1
0
  @Override
  public void initView() {
    initConfView();

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    javax.swing.GroupLayout.SequentialGroup hsg = layout.createSequentialGroup();
    hsg.addComponent(tf_PropData, javax.swing.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE);
    hsg.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    hsg.addComponent(
        pl_PropConf,
        javax.swing.GroupLayout.PREFERRED_SIZE,
        javax.swing.GroupLayout.DEFAULT_SIZE,
        javax.swing.GroupLayout.PREFERRED_SIZE);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, hsg));

    javax.swing.GroupLayout.ParallelGroup vpg =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER);
    vpg.addComponent(
        pl_PropConf,
        javax.swing.GroupLayout.PREFERRED_SIZE,
        javax.swing.GroupLayout.DEFAULT_SIZE,
        javax.swing.GroupLayout.PREFERRED_SIZE);
    vpg.addComponent(
        tf_PropData,
        javax.swing.GroupLayout.PREFERRED_SIZE,
        javax.swing.GroupLayout.DEFAULT_SIZE,
        javax.swing.GroupLayout.PREFERRED_SIZE);
    layout.setVerticalGroup(vpg);
  }
示例#2
0
 /** Create the horizontal group */
 private GroupLayout.Group createHorizontalGroup(GroupLayout gl) {
   GroupLayout.SequentialGroup hg = gl.createSequentialGroup();
   hg.addComponent(role_pnl);
   hg.addGap(UI.hgap);
   hg.addComponent(cap_pnl);
   return hg;
 }
示例#3
0
  private void createPathFilterPanelLayout() {
    GroupLayout pathFilterPanelLayout = new GroupLayout(pathFilterPanel);

    GroupLayout.ParallelGroup horizontalButtonPathGroup =
        pathFilterPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING, false);
    horizontalButtonPathGroup.addComponent(
        removePath, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
    horizontalButtonPathGroup.addComponent(
        addPath, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);

    GroupLayout.SequentialGroup horizontalPanePathGroup =
        pathFilterPanelLayout.createSequentialGroup();
    horizontalPanePathGroup.addComponent(pathFilterScrollPane);
    horizontalPanePathGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    horizontalPanePathGroup.addGroup(horizontalButtonPathGroup);
    horizontalPanePathGroup.addContainerGap();

    pathFilterPanelLayout.setHorizontalGroup(horizontalPanePathGroup);

    GroupLayout.SequentialGroup verticalButtonPathGroup =
        pathFilterPanelLayout.createSequentialGroup();
    verticalButtonPathGroup.addComponent(addPath);
    verticalButtonPathGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    verticalButtonPathGroup.addComponent(removePath);
    verticalButtonPathGroup.addContainerGap();

    GroupLayout.ParallelGroup verticalPanePathGroup =
        pathFilterPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    verticalPanePathGroup.addComponent(pathFilterScrollPane);
    verticalPanePathGroup.addGroup(verticalButtonPathGroup);

    pathFilterPanelLayout.setVerticalGroup(verticalPanePathGroup);
    pathFilterPanel.setLayout(pathFilterPanelLayout);
  }
示例#4
0
  final void makeLayout() {
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    GroupLayout.ParallelGroup g =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
    for (JPanel p : panels)
      g.addComponent(
          p,
          javax.swing.GroupLayout.DEFAULT_SIZE,
          javax.swing.GroupLayout.DEFAULT_SIZE,
          Short.MAX_VALUE);
    g.addGroup(
        javax.swing.GroupLayout.Alignment.TRAILING,
        layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(jButton1));
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout.createSequentialGroup().addContainerGap().addGroup(g).addContainerGap()));
    GroupLayout.SequentialGroup g2 = layout.createSequentialGroup().addContainerGap();
    for (JPanel p : panels)
      g2 =
          g2.addComponent(
                  p,
                  javax.swing.GroupLayout.PREFERRED_SIZE,
                  javax.swing.GroupLayout.DEFAULT_SIZE,
                  javax.swing.GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    g2 = g2.addComponent(jButton1).addContainerGap();
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(g2));

    pack();
  }
示例#5
0
  private void init() {
    btnOpen = new JButton("Open");
    btnOpen.setSize(100, 50);
    textArea = new JTextArea("sd");
    textArea.setSize(200, 100);
    textArea.setDragEnabled(true);

    btnOpen.addActionListener(new OpenAction());

    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

    } catch (ClassNotFoundException e) {
      // TODO 自动生成 catch 块
      e.printStackTrace();
    } catch (InstantiationException e) {
      // TODO 自动生成 catch 块
      e.printStackTrace();
    } catch (IllegalAccessException e) {
      // TODO 自动生成 catch 块
      e.printStackTrace();
    } catch (UnsupportedLookAndFeelException e) {
      // TODO 自动生成 catch 块
      e.printStackTrace();
    }
    Container container = getContentPane();
    GroupLayout groupLayout = new GroupLayout(container);
    container.setLayout(groupLayout);

    groupLayout.setAutoCreateContainerGaps(true);
    groupLayout.setAutoCreateGaps(true);
    // 左对齐
    GroupLayout.ParallelGroup p1 = groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    p1.addComponent(btnOpen);
    p1.addComponent(textArea);
    // 水平
    groupLayout.setHorizontalGroup(groupLayout.createSequentialGroup().addGroup(p1));

    GroupLayout.ParallelGroup v1 = groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    v1.addComponent(btnOpen);

    GroupLayout.ParallelGroup v2 = groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    v2.addComponent(textArea);

    GroupLayout.SequentialGroup vGroup = groupLayout.createSequentialGroup();
    vGroup.addGroup(v1).addGroup(v2);

    // 垂直
    groupLayout.setVerticalGroup(groupLayout.createSequentialGroup().addGroup(vGroup));

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setTitle("通讯录");
    setSize(300, 500);
    Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
    setLocation((dimension.width - getSize().width) / 2, (dimension.height - getSize().height) / 3);

    // pack();
    setVisible(true);
  }
示例#6
0
  /**
   * Sets the inner middle panel layout with the orders.
   *
   * @param innerMiddlePanelLayout
   * @param orders
   */
  private void setInnerMiddlePanelLayout(
      javax.swing.GroupLayout innerMiddlePanelLayout, ArrayList<javax.swing.JLabel> orders) {
    // Set horizontal axis
    javax.swing.GroupLayout.ParallelGroup tempHorizontalGroup =
        innerMiddlePanelLayout.createParallelGroup();
    for (int i = 0; i < orders.size(); i++) {
      tempHorizontalGroup.addComponent(
          orders.get(i),
          javax.swing.GroupLayout.PREFERRED_SIZE,
          773,
          javax.swing.GroupLayout.PREFERRED_SIZE);
    }

    innerMiddlePanelLayout.setHorizontalGroup(
        innerMiddlePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                innerMiddlePanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(tempHorizontalGroup)
                    .addContainerGap()));

    // Set vertical axis
    javax.swing.GroupLayout.SequentialGroup tempVerticalGroup =
        innerMiddlePanelLayout.createSequentialGroup();
    tempVerticalGroup.addContainerGap();
    for (int i = 0; i < orders.size(); i++) {
      tempVerticalGroup.addComponent(
          orders.get(i),
          javax.swing.GroupLayout.PREFERRED_SIZE,
          50,
          javax.swing.GroupLayout.PREFERRED_SIZE);
      tempVerticalGroup.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    }
    tempVerticalGroup.addContainerGap(6, Short.MAX_VALUE);

    innerMiddlePanelLayout.setVerticalGroup(
        innerMiddlePanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tempVerticalGroup));
  }
示例#7
0
  private void initializeLayout() {
    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);

    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(false);

    GroupLayout.SequentialGroup hg = layout.createSequentialGroup();
    hg.addComponent(backButton, 60, 60, 150);
    hg.addComponent(nextButton, 60, 60, 150);
    hg.addComponent(cancelButton, 60, 60, 150);
    layout.setHorizontalGroup(hg);

    GroupLayout.ParallelGroup vg = layout.createParallelGroup(GroupLayout.Alignment.BASELINE);
    vg.addComponent(backButton);
    vg.addComponent(nextButton);
    vg.addComponent(cancelButton);
    layout.setVerticalGroup(vg);
  }
示例#8
0
  private void createFilterViolationPanelLayout() {
    GroupLayout filterViolationPanelLayout = new GroupLayout(filterViolationPanel);

    GroupLayout.SequentialGroup horizontalFilterViolationGroup =
        filterViolationPanelLayout.createSequentialGroup();
    horizontalFilterViolationGroup.addComponent(ruletypePanel);
    horizontalFilterViolationGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    horizontalFilterViolationGroup.addComponent(violationtypePanel);

    filterViolationPanelLayout.setHorizontalGroup(horizontalFilterViolationGroup);

    GroupLayout.ParallelGroup verticalFilterViolationGroup =
        filterViolationPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
    verticalFilterViolationGroup.addComponent(ruletypePanel);
    verticalFilterViolationGroup.addComponent(violationtypePanel);

    filterViolationPanelLayout.setVerticalGroup(verticalFilterViolationGroup);
    filterViolationPanel.setLayout(filterViolationPanelLayout);
  }
  private JPanel createBattlefieldSlidersPanel() {
    JPanel panel = new JPanel();

    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);

    GroupLayout.SequentialGroup leftToRight = layout.createSequentialGroup();

    GroupLayout.ParallelGroup left = layout.createParallelGroup();
    left.addComponent(battlefieldSizeLabel);
    left.addComponent(battlefieldWidthSlider);
    leftToRight.addGroup(left);

    GroupLayout.ParallelGroup right = layout.createParallelGroup();
    right.addComponent(battlefieldHeightSlider);
    leftToRight.addGroup(right);

    GroupLayout.SequentialGroup topToBottom = layout.createSequentialGroup();

    GroupLayout.ParallelGroup top = layout.createParallelGroup();
    top.addComponent(battlefieldSizeLabel);
    top.addComponent(battlefieldHeightSlider);
    topToBottom.addGroup(top);

    GroupLayout.ParallelGroup bottom = layout.createParallelGroup();
    bottom.addComponent(battlefieldWidthSlider);
    topToBottom.addGroup(bottom);

    layout.setHorizontalGroup(leftToRight);
    layout.setVerticalGroup(topToBottom);

    return panel;
  }
示例#10
0
  /**
   * Universally creates layout for dialog.
   *
   * @param jcs
   */
  protected final void createLayout(JComponent... jcs) {
    Container pane = getContentPane();
    GroupLayout gl = new GroupLayout(pane);
    pane.setLayout(gl);

    gl.setAutoCreateContainerGaps(true);
    gl.setAutoCreateGaps(true);

    GroupLayout.ParallelGroup pg = gl.createParallelGroup(CENTER);

    for (JComponent jc : jcs) {
      pg.addComponent(jc).addGap(200);
    }
    gl.setHorizontalGroup(pg);

    GroupLayout.SequentialGroup sg = gl.createSequentialGroup();

    for (JComponent jc : jcs) {
      sg.addGap(30).addComponent(jc).addGap(20);
    }
    gl.setVerticalGroup(sg);

    pack();
  }
示例#11
0
  public GameLobby(JFrame f, GameControl gc) {
    super(f, "New Game", false);

    frame = f;
    GC = gc;

    setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
    addWindowListener(this);

    JPanel main_panel = new JPanel(new BorderLayout());
    // main_panel.setLayout(new BoxLayout(main_panel, BoxLayout.Y_AXIS));

    JPanel map_panel =
        new JPanel(new FlowLayout(FlowLayout.RIGHT)); // use flowLayout to right-align the row

    map_label =
        new JLabel(
            LOAD_MAP_MSG); // BOOKMARK!  should check with GC to see if map_file is already choosen.
    map_panel.add(map_label);

    is_hosting = GC.players[GC.player_id].hosting;

    choose_map = new JButton("Select Map");
    choose_map.addActionListener(this);
    choose_map.setEnabled(is_hosting);
    map_panel.add(choose_map);

    main_panel.add(map_panel, BorderLayout.NORTH);

    // Create and populate the panel.
    JPanel panel = new JPanel();

    GroupLayout gl = new GroupLayout(panel);
    panel.setLayout(gl);
    gl.setAutoCreateGaps(true);
    gl.setAutoCreateContainerGaps(true);

    JLabel[] player_nums = new JLabel[GC.players.length];
    player_names = new JLabel[GC.players.length];
    color_samples = new JPanel[GC.players.length];
    color_nums = new Integer[GC.players.length];

    GroupLayout.ParallelGroup hgroup1 = gl.createParallelGroup();
    GroupLayout.ParallelGroup hgroup2 = gl.createParallelGroup();
    GroupLayout.ParallelGroup hgroup3 = gl.createParallelGroup();
    GroupLayout.SequentialGroup vgroup = gl.createSequentialGroup();

    // create the header
    JLabel num = new JLabel("#");
    JLabel name = new JLabel("Name");
    JLabel color = new JLabel("Color");
    vgroup.addGroup(
        gl.createParallelGroup().addComponent(num).addComponent(name).addComponent(color));
    hgroup1.addComponent(num);
    hgroup2.addComponent(name);
    hgroup3.addComponent(color);

    for (int i = 0; i < GC.players.length; i++) {
      player_nums[i] = new JLabel(Integer.toString(i + 1));
      player_nums[i].setFont(player_nums[i].getFont().deriveFont(Font.PLAIN));
      hgroup1.addComponent(player_nums[i]);

      player_names[i] = new JLabel();
      color_samples[i] = new JPanel();
      if (GC.players[i] != null) {
        player_names[i].setText(GC.players[i].getName());
        if (GC.players[i].ready) player_names[i].setForeground(Color.GREEN);
        else player_names[i].setForeground(Color.RED);
        color_samples[i].setBackground(
            GC.players[i]
                .getColor()); // player.getColor() returns the default color here, since color is
                              // not yet set
        color_nums[i] = i;
      }
      player_names[i].setFont(player_names[i].getFont().deriveFont(Font.PLAIN));
      color_samples[i].setMinimumSize(new Dimension(50, 15));
      color_samples[i].setPreferredSize(new Dimension(50, 15));
      color_samples[i].setMaximumSize(new Dimension(50, 15));
      color_samples[i].addMouseListener(this);

      hgroup2.addComponent(player_names[i]);
      hgroup3.addComponent(color_samples[i]);
      vgroup.addGroup(
          gl.createParallelGroup()
              .addComponent(player_nums[i])
              .addComponent(player_names[i])
              .addComponent(color_samples[i]));
    }

    gl.setHorizontalGroup(
        gl.createSequentialGroup().addGroup(hgroup1).addGroup(hgroup2).addGroup(hgroup3));
    gl.setVerticalGroup(vgroup);

    JScrollPane scroller = new JScrollPane(panel);
    main_panel.add(scroller, BorderLayout.CENTER);

    JPanel p2 = new JPanel();

    if (is_hosting) start_game = new JButton("Start Game");
    else start_game = new JButton("Ready!");
    start_game.addActionListener(this);
    start_game.setMnemonic(KeyEvent.VK_S);
    start_game.setEnabled(false);
    p2.add(start_game);

    leave_game = new JButton("Leave Game");
    leave_game.addActionListener(this);
    leave_game.setMnemonic(KeyEvent.VK_L);
    p2.add(leave_game);

    main_panel.add(p2, BorderLayout.SOUTH);

    add(main_panel);

    pack();
    setVisible(true);

    filechooser = new JFileChooser();
    filechooser.setFileFilter(new FileNameExtensionFilter("XML files only", "xml"));
  }
  // GUI-Erstellung ----------------------------------------------------------
  private void buildGui() {
    EditorChangeListener editorChangeListener = new EditorChangeListener();

    /* Components: */
    comTitle.setEditable(true);
    comTitle.setPrototypeDisplayValue("");
    comArtist.setEditable(true);
    comArtist.setPrototypeDisplayValue("");
    comAlbum.setEditable(true);
    comAlbum.setPrototypeDisplayValue("");
    comGenre.setEditable(true);
    //		txtTotalTracks.setEnabled(false);
    txtDiscnumber.setEnabled(false);
    txtTotalDiscs.setEnabled(false);

    addChangeListenerToComboBox(comTitle, editorChangeListener);
    addChangeListenerToComboBox(comArtist, editorChangeListener);
    addChangeListenerToComboBox(comAlbum, editorChangeListener);
    addChangeListenerToComboBox(comGenre, editorChangeListener);
    txtTracknumber.getDocument().addDocumentListener(editorChangeListener);

    /* Layout: */
    // Vorbereiten:
    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);
    layout.setAutoCreateContainerGaps(true);

    // Labels:
    JLabel lblTitle = new JLabel("Title");
    JLabel lblArtist = new JLabel("Artist");
    JLabel lblAlbum = new JLabel("Album");
    JLabel lblTracknumber = new JLabel("Track");
    JLabel lblTotalTracks = new JLabel("of");
    JLabel lblDiscnumber = new JLabel("Disc");
    JLabel lblTotalDiscs = new JLabel("of");
    JLabel lblYear = new JLabel("Year");
    JLabel lblGenre = new JLabel("Genre");
    JLabel lblCover = new JLabel("Artwork");

    // Horizontales Layout:
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(lblTitle)
            .addComponent(lblArtist)
            .addComponent(lblAlbum)
            .addComponent(lblTracknumber)
            .addComponent(lblDiscnumber)
            .addComponent(lblYear)
            .addComponent(lblCover));
    hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(
                comTitle,
                GroupLayout.DEFAULT_SIZE,
                GroupLayout.DEFAULT_SIZE,
                GroupLayout.DEFAULT_SIZE)
            .addComponent(comArtist)
            .addComponent(comAlbum)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(txtTracknumber, 30, 30, 30)
                    .addGap(5)
                    .addComponent(lblTotalTracks)
                    .addGap(5)
                    .addComponent(txtTotalTracks, 30, 30, 30))
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(txtDiscnumber, 30, 30, 30)
                    .addGap(5)
                    .addComponent(lblTotalDiscs)
                    .addGap(5)
                    .addComponent(txtTotalDiscs, 30, 30, 30))
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(txtYear, 50, 50, 50)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(lblGenre)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(comGenre))
            .addComponent(
                imgArtwork,
                GroupLayout.PREFERRED_SIZE,
                GroupLayout.PREFERRED_SIZE,
                GroupLayout.PREFERRED_SIZE));

    layout.setHorizontalGroup(hGroup);

    // Vertikales Layout:
    GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(lblTitle)
            .addComponent(comTitle));
    vGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(lblArtist)
            .addComponent(comArtist));
    vGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(lblAlbum)
            .addComponent(comAlbum));
    vGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(lblTracknumber)
            .addComponent(txtTracknumber)
            .addComponent(lblTotalTracks)
            .addComponent(txtTotalTracks));
    vGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(lblDiscnumber)
            .addComponent(txtDiscnumber)
            .addComponent(lblTotalDiscs)
            .addComponent(txtTotalDiscs));
    vGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(lblYear)
            .addComponent(txtYear)
            .addComponent(lblGenre)
            .addComponent(comGenre));
    vGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(lblCover)
            .addComponent(
                imgArtwork,
                GroupLayout.PREFERRED_SIZE,
                GroupLayout.PREFERRED_SIZE,
                GroupLayout.PREFERRED_SIZE));
    layout.setVerticalGroup(vGroup);
  }
示例#13
0
  private void initForm(Map<Strategy, Integer> votingResults) {
    ForagingStrategy[] strategies = ForagingStrategy.values();
    JPanel panel = new JPanel();
    GroupLayout groupLayout = new GroupLayout(panel);
    panel.setLayout(groupLayout);
    groupLayout.setAutoCreateGaps(true);
    groupLayout.setAutoCreateContainerGaps(true);
    GroupLayout.SequentialGroup horizontalGroup = groupLayout.createSequentialGroup();
    // horizontal parallel group
    GroupLayout.ParallelGroup horizontalLabelParallelGroup = groupLayout.createParallelGroup();
    horizontalGroup.addGroup(horizontalLabelParallelGroup);
    GroupLayout.ParallelGroup horizontalButtonParallelGroup = groupLayout.createParallelGroup();
    horizontalGroup.addGroup(horizontalButtonParallelGroup);

    GroupLayout.SequentialGroup verticalGroup = groupLayout.createSequentialGroup();
    boolean imposedStrategyEnabled =
        (client != null) && client.getCurrentRoundConfiguration().isImposedStrategyEnabled();
    // XXX: this is certainly what Rawlins was warning against
    String rightColumnHeader =
        votingResults.isEmpty() ? (imposedStrategyEnabled) ? "" : "Select" : "Nominations";
    JLabel rightHeaderLabel = new JLabel(rightColumnHeader);
    rightHeaderLabel.setFont(UserInterfaceUtils.DEFAULT_BOLD_FONT);
    horizontalButtonParallelGroup.addComponent(rightHeaderLabel);

    JLabel strategyHeaderLabel = new JLabel("Strategy");
    strategyHeaderLabel.setFont(UserInterfaceUtils.DEFAULT_BOLD_FONT);
    horizontalLabelParallelGroup.addComponent(strategyHeaderLabel);

    verticalGroup.addGroup(
        groupLayout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(strategyHeaderLabel)
            .addGap(20)
            .addComponent(rightHeaderLabel));
    Dimension labelDimension = new Dimension(1000, 100);

    for (ForagingStrategy strategy : strategies) {
      JLabel ruleLabel = new JLabel("<html>" + strategy.getDescription() + "</html>");
      ruleLabel.setFont(UserInterfaceUtils.DEFAULT_PLAIN_FONT);
      ruleLabel.setMaximumSize(labelDimension);
      horizontalLabelParallelGroup.addComponent(ruleLabel);
      JComponent component = null;
      if (imposedStrategyEnabled) {
        component = new JLabel("");
      } else if (votingResults.isEmpty()) {
        JRadioButton radioButton = new JRadioButton();
        radioButton.setActionCommand(strategy.name());
        buttonGroup.add(radioButton);
        component = radioButton;
        //                horizontalButtonParallelGroup.addComponent(radioButton);
        //
        // verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(radioButton));
      } else {
        Integer numberOfVotes = votingResults.get(strategy);
        component = new JLabel(String.valueOf(numberOfVotes == null ? 0 : numberOfVotes));
      }
      horizontalButtonParallelGroup.addComponent(component);
      verticalGroup.addGroup(
          groupLayout
              .createParallelGroup(Alignment.BASELINE)
              .addComponent(ruleLabel)
              .addGap(DEFAULT_STRATEGY_GAP_SIZE)
              .addComponent(component));
    }
    if (votingResults.isEmpty()) {
      JButton submitButton = getSubmitButton();
      horizontalLabelParallelGroup.addComponent(submitButton);
      verticalGroup.addGroup(
          groupLayout
              .createParallelGroup(Alignment.BASELINE)
              .addComponent(submitButton)
              .addGap(80));
    }
    groupLayout.setHorizontalGroup(horizontalGroup);
    groupLayout.setVerticalGroup(verticalGroup);
    JScrollPane scrollPane =
        new JScrollPane(
            panel,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    setLayout(new BorderLayout());
    add(scrollPane, BorderLayout.CENTER);
  }
示例#14
0
  public DialogActivity(JFrame parentFrame) {
    super(parentFrame);
    setTitle("Activity");

    lbFirst = new JLabel("Date");
    lbSecond = new JLabel("Hours");
    lbThird = new JLabel("Activity");
    txtFirst = new JTextField();
    txtFirst.setColumns(20);
    txtSecond = new JTextField();
    txtSecond.setColumns(20);
    txtThird = new JTextField();
    txtThird.setColumns(20);

    GroupLayout layout = new GroupLayout(inputPanel);
    inputPanel.setLayout(layout);
    layout.setAutoCreateContainerGaps(true);
    layout.setAutoCreateGaps(true);

    GroupLayout.ParallelGroup parallelGroup1 = layout.createParallelGroup();
    GroupLayout.ParallelGroup parallelGroup2 = layout.createParallelGroup();
    parallelGroup1.addComponent(lbFirst).addComponent(lbSecond).addComponent(lbThird);
    parallelGroup2.addComponent(txtFirst).addComponent(txtSecond).addComponent(txtThird);

    GroupLayout.SequentialGroup sequentialGroup1 = layout.createSequentialGroup();
    sequentialGroup1.addGroup(parallelGroup1);
    sequentialGroup1.addGroup(parallelGroup2);

    layout.setHorizontalGroup(sequentialGroup1);

    GroupLayout.ParallelGroup parallelGroup3 = layout.createParallelGroup();
    GroupLayout.ParallelGroup parallelGroup4 = layout.createParallelGroup();
    GroupLayout.ParallelGroup parallelGroup5 = layout.createParallelGroup();
    parallelGroup3.addComponent(lbFirst).addComponent(txtFirst);
    parallelGroup4.addComponent(lbSecond).addComponent(txtSecond);
    parallelGroup5.addComponent(lbThird).addComponent(txtThird);

    GroupLayout.SequentialGroup sequentialGroup2 = layout.createSequentialGroup();
    sequentialGroup2.addGroup(parallelGroup3);
    sequentialGroup2.addGroup(parallelGroup4);
    sequentialGroup2.addGroup(parallelGroup5);

    layout.setVerticalGroup(sequentialGroup2);

    inputPanel.add(txtFirst);
    inputPanel.add(txtSecond);
    inputPanel.add(txtThird);

    GridLayout btnLayout = new GridLayout(1, 2);

    btnOk = new JButton("Ok");
    btnOk.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            if (txtFirst.getText().equals("") && txtSecond.getText().equals("")) result = null;
            else result = new Activity(txtFirst.getText(), txtSecond.getText(), txtThird.getText());
            setVisible(false);
          }
        });

    btnCancel = new JButton("Cancel");
    btnCancel.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            result = null;
            setVisible(false);
          }
        });
    buttonPanel.setLayout(btnLayout);
    buttonPanel.add(btnOk);
    buttonPanel.add(btnCancel);

    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(inputPanel, BorderLayout.CENTER);
    getContentPane().add(buttonPanel, BorderLayout.SOUTH);
    pack();
  }
示例#15
0
  public void initSetTable(String key, final String tableType) {

    JLabel tableTypelbl = new JLabel("Table type:");
    JLabel tableTypevalue = new JLabel("[" + tableType + "]");

    JLabel tableNamelbl = new JLabel("Table Key:");
    final JTextField tableNameText = new JTextField();

    Set<String> value = null;
    if (null == key) {
      key = "";
    } else {
      value = new SetMan().list(key);
    }
    tableNameText.setText(key + KEY_COPY);

    JLabel strTableValuelbl = new JLabel("Table value:");
    // final JTextField strTableNameText = new JTextField();
    // set table
    String[] tableHeaders = {"Field", "Value", "Type"};
    final String space = "";
    String[][] valueInfo = null;
    if (null != value && value.size() > 0) {
      int arraySize = value.size();
      valueInfo = new String[arraySize][3];
      int i = 0;
      for (String setv : value) {
        valueInfo[i][0] = space + (i + 1);
        valueInfo[i][1] = setv;
        valueInfo[i][2] = "String";
        i++;
      }
    } else {
      valueInfo = new String[1][3];
      valueInfo[0][0] = "";
      valueInfo[0][1] = "";
      valueInfo[0][2] = "";
    }

    // defaultModel = new DefaultTableModel(valueInfo, taskHeaders);
    // table = new JTable(defaultModel);
    // table.setName(tableType + "<" + tableNameText.getText() + ">");

    // set the table header to be sorted
    DefaultTableModel dtm = new DefaultTableModel(valueInfo, tableHeaders);
    table = new JTable(dtm);
    table.setRowSorter(new TableRowSorter<TableModel>(dtm));

    AlignColumn(table, tableHeaders[0], SwingConstants.CENTER);

    JScrollPane panel = new JScrollPane();
    panel.setViewportView(table);

    JButton addSetBtn = new JButton("Save Data");
    addSetBtn.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {
            String key = tableNameText.getText();
            if (key.isEmpty()) {
              PopMessage.popMsg("Added type:[" + tableType + "] Table Key is required");
            } else {
              Vector<String> vectorValues = new Vector<String>();
              int rows = table.getRowCount();
              // table.getCellEditor(0, 0).getCellEditorValue();
              String cellValue = null;
              for (int i = 0; i < rows; i++) {
                // cellValue = (String) table.getCellEditor(i, 1).getCellEditorValue();
                cellValue = (String) table.getValueAt(i, 1);
                // System.out.println("Get cellValue:[" + cellValue +"] at:["+ i + ", 0]");
                vectorValues.add(i, cellValue);
              }
              // StringBuilder values = new StringBuilder();
              // for(String value: vectorValues){
              // System.out.println("Get cellValue:[" + value +"] from vector");
              //    values.append(value).append(",");
              // }
              // PopMessage.popMsg("Added type:[" + tableType + "] key:[" + tableNameText.getText()
              // + "] value:[" + values.toString() + "]");
              // new SetMan().add(key, vectorValues);
              int effectRow = new SetMan().add(key, vectorValues);
              if (effectRow > 0) {
                PopMessage.popMsg("Save data for key:[" + key + "] success");
              } else {
                PopMessage.popMsg("Save data for key:[" + key + "] fail");
              }
            }
          }
        });

    // JPanel cellPanel = new JPanel();
    // cellPanel.add(addSetBtn);

    JPanel btnPanel = new JPanel();
    // btnPanel.setLayout(new BoxLayout(btnPanel, BoxLayout.X_AXIS));
    btnPanel.add(addSetBtn);
    // JScrollPane btnPanel = new JScrollPane();
    // addSetBtn.setSize(60, 20);

    JButton addRow = new JButton("Add Row");
    btnPanel.add(addRow);
    addRow.addActionListener(this);
    // addRow.setSize(60, 20);

    JButton addColumn = new JButton("Add Column");
    // btnPanel.add(addColumn);
    addColumn.addActionListener(this);
    // addColumn.setSize(60, 20);

    JButton removeRow = new JButton("Remove Row");
    btnPanel.add(removeRow);
    removeRow.addActionListener(this);
    // removeRow.setSize(60, 20);

    JButton removeColumn = new JButton("Remove Column");
    // btnPanel.add(removeColumn);
    removeColumn.addActionListener(this);
    // removeColumn.setSize(60, 20);

    GroupLayout layout = new GroupLayout(comboBoxPanel);
    comboBoxPanel.setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
    hGroup.addGap(5);
    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(tableTypelbl, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            .addComponent(tableNamelbl, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                strTableValuelbl, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE));
    hGroup.addGap(5);
    hGroup.addGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.LEADING)
            .addComponent(
                tableTypevalue, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableNameText, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)
            .addComponent(panel, GroupLayout.PREFERRED_SIZE, 500, GroupLayout.PREFERRED_SIZE)
            //        .addComponent(addSetBtn, GroupLayout.PREFERRED_SIZE, 70,
            // GroupLayout.PREFERRED_SIZE)
            // .addComponent(addRow, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            // .addComponent(addColumn, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            // .addComponent(removeRow, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            // .addComponent(removeColumn, GroupLayout.PREFERRED_SIZE, 70,
            // GroupLayout.PREFERRED_SIZE)
            .addComponent(btnPanel, GroupLayout.PREFERRED_SIZE, 300, GroupLayout.PREFERRED_SIZE));
    // hGroup.addGap(5);
    // hGroup.addGroup(layout.createParallelGroup()
    //        .addComponent(btnPanel, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
    //        );
    // btnPanel.setAlignmentX(SwingConstants.RIGHT);
    hGroup.addGap(5);
    // hGroup.addGroup(layout.createParallelGroup().addComponent(panel, GroupLayout.PREFERRED_SIZE,
    // 70, GroupLayout.PREFERRED_SIZE));
    // hGroup.addGap(5);
    layout.setHorizontalGroup(hGroup);

    GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(tableTypelbl, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableTypevalue, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(tableNamelbl, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableNameText, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(
                strTableValuelbl, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
            .addComponent(panel, GroupLayout.PREFERRED_SIZE, 300, GroupLayout.PREFERRED_SIZE));
    // vGroup.addGap(5);
    // vGroup.addGroup(layout.createParallelGroup()
    //        .addComponent(addSetBtn, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
    // .addComponent(addRow, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
    // .addComponent(addColumn, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
    // .addComponent(removeRow, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
    // .addComponent(removeColumn, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
    //        );
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(btnPanel, GroupLayout.PREFERRED_SIZE, 50, GroupLayout.PREFERRED_SIZE));
    // vGroup.addGap(5);
    // vGroup.addGroup(layout.createParallelGroup().addComponent(addRow, GroupLayout.PREFERRED_SIZE,
    // 100, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    layout.setVerticalGroup(vGroup);
  }
  private void makeArgumentPane(Action a, LibAction la) {
    setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
    JLabel lab;
    JPanel pane;
    pane = new JPanel();
    pane.setBorder(new EmptyBorder(6, 6, 0, 6));
    pane.setLayout(new BorderLayout());
    add(pane);
    if (la.actImage != null) {
      lab = new JLabel(new ImageIcon(la.actImage));
      lab.setBorder(new EmptyBorder(16, 16, 16, 20));
      pane.add(lab, BorderLayout.LINE_START);
    }

    String s = Messages.getString("ActionFrame.APPLIES"); // $NON-NLS-1$
    appliesPanel.setBorder(BorderFactory.createTitledBorder(s));
    pane.add(appliesPanel);
    if (!la.canApplyTo) appliesPanel.setVisible(false);

    List<Argument> args = a.getArguments();
    argComp = new ArgumentComponent[args.size()];
    if (args.size() > 0) {
      pane = new JPanel();
      pane.setBorder(
          BorderFactory.createCompoundBorder(
              new EmptyBorder(6, 8, 0, 8), BorderFactory.createTitledBorder("")));
      GroupLayout kvLayout = new GroupLayout(pane);
      GroupLayout.SequentialGroup hGroup, vGroup;
      GroupLayout.ParallelGroup keyGroup, valueGroup;
      hGroup = kvLayout.createSequentialGroup();
      vGroup = kvLayout.createSequentialGroup();
      keyGroup = kvLayout.createParallelGroup(Alignment.TRAILING);
      valueGroup = kvLayout.createParallelGroup();

      hGroup.addGap(4);
      hGroup.addGroup(keyGroup);
      hGroup.addGap(6);
      hGroup.addGroup(valueGroup);
      hGroup.addGap(4);

      kvLayout.setHorizontalGroup(hGroup);
      kvLayout.setVerticalGroup(vGroup);

      pane.setLayout(kvLayout);
      add(pane);

      vGroup.addGap(4);
      for (int n = 0; n < args.size(); n++) {
        argComp[n] = new ArgumentComponent(args.get(n), a.getLibAction().libArguments[n]);
        if (la.parent == null)
          lab = new JLabel(Messages.format("ActionFrame.UNKNOWN", n)); // $NON-NLS-1$
        else {
          LibArgument larg = la.libArguments[n];
          lab = new JLabel(larg.caption);
        }
        Alignment al;
        if (n == 0 && act.getLibAction().interfaceKind == LibAction.INTERFACE_ARROWS) {
          argComp[n].setEditor(new ArrowsEditor(argComp[n].getArgument().getVal()));
          al = Alignment.CENTER;
        } else {
          Component c = argComp[n].getEditor();
          c.setMaximumSize(new Dimension(240, 20));
          c.setPreferredSize(new Dimension(200, 20));
          c.setMinimumSize(new Dimension(160, 20));
          al = Alignment.BASELINE;
        }
        keyGroup.addComponent(lab);
        valueGroup.addComponent(argComp[n].getEditor());
        if (n > 0) vGroup.addGap(6);
        GroupLayout.ParallelGroup argGroup = kvLayout.createParallelGroup(al);
        argGroup.addComponent(lab).addComponent(argComp[n].getEditor());
        vGroup.addGroup(argGroup);
      }
      vGroup.addGap(4);
    }
    pane = new JPanel();
    pane.setLayout(new FlowLayout(FlowLayout.TRAILING));
    add(pane);
    if (la.allowRelative) {
      relativeBox = new JCheckBox(Messages.getString("ActionFrame.RELATIVE")); // $NON-NLS-1$
      relativeBox.setSelected(act.isRelative());
      pane.add(relativeBox);
    }
    if (la.question) {
      notBox = new JCheckBox(Messages.getString("ActionFrame.NOT")); // $NON-NLS-1$
      notBox.setSelected(act.isNot());
      pane.add(notBox);
    }

    pane = new JPanel();
    pane.setLayout(new GridLayout(1, 2, 8, 0));
    pane.setBorder(new EmptyBorder(0, 8, 8, 8));
    add(pane);
    s = Messages.getString("ActionFrame.SAVE"); // $NON-NLS-1$
    save = new JButton(s, LGM.getIconForKey("ActionFrame.SAVE")); // $NON-NLS-1$
    save.addActionListener(this);
    pane.add(save);
    s = Messages.getString("ActionFrame.DISCARD"); // $NON-NLS-1$
    discard = new JButton(s, LGM.getIconForKey("ActionFrame.DISCARD")); // $NON-NLS-1$
    discard.addActionListener(this);
    pane.add(discard);
  }
示例#17
0
  public void createGUI() {

    JButton submitButton = new JButton("Submit");
    submitButton.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent e) {

            // get text from input fields
            inputPath = inputField.getText();
            outputPath = outputField.getText();

            buttonPressed = true;
          }
        });

    JPanel inputPanel = new JPanel();
    inputPanel.add(new JLabel("Input Path"));
    inputPanel.add(inputField);

    JLabel inputLabel = new JLabel("Input Path");
    JLabel outputLabel = new JLabel("Output Path");

    JPanel content = new JPanel();
    content.setLayout(new BorderLayout());

    JPanel textFieldsContent = new JPanel();
    GroupLayout layout = new GroupLayout(textFieldsContent);
    textFieldsContent.setLayout(layout);

    // setting to true creates gaps between components
    layout.setAutoCreateGaps(true);
    // setting to true creates gaps between components and edge of container
    layout.setAutoCreateContainerGaps(true);

    // horizontal axis
    GroupLayout.SequentialGroup horizontalGroup = layout.createSequentialGroup();
    // each sequential group contains two parallel groups.
    //  one will contain labels, other will contain text fields
    horizontalGroup.addGroup(
        layout.createParallelGroup().addComponent(inputLabel).addComponent(outputLabel));
    horizontalGroup.addGroup(
        layout.createParallelGroup().addComponent(inputField).addComponent(outputField));
    layout.setHorizontalGroup(horizontalGroup);

    // vertical axis
    GroupLayout.SequentialGroup verticalGroup = layout.createSequentialGroup();
    verticalGroup.addGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(inputLabel)
            .addComponent(inputField));
    verticalGroup.addGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(outputLabel)
            .addComponent(outputField));
    layout.setVerticalGroup(verticalGroup);

    content.add(textFieldsContent, BorderLayout.CENTER);
    content.add(submitButton, BorderLayout.PAGE_END);

    window.setContentPane(content);
    window.setSize(350, 200);
    window.setLocation(100, 100);
    window.setVisible(true);
  }
示例#18
0
  public void initStringTable(String key, final String tableType) {

    JLabel tableTypelbl = new JLabel("Table type:");
    JLabel tableTypevalue = new JLabel("[" + tableType + "]");

    JLabel tableNamelbl = new JLabel("Table Key:");
    final JTextField tableNameText = new JTextField();
    String value = "";
    if (null == key) {
      key = "";
    } else {
      value = new StringMan().list(key);
    }
    tableNameText.setText(key + KEY_COPY);

    // comboBoxPanel.add(tableNamelbl);
    // comboBoxPanel.add(tableName);

    JLabel strTableValuelbl = new JLabel("Table value:");
    final JTextField tableValueText = new JTextField();
    tableValueText.setText(value);

    // do search and get the data from redis

    JButton addStrBtn = new JButton("Save Data");
    // addStrBtn.addActionListener(this);
    addStrBtn.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            String key = tableNameText.getText();
            String value = tableValueText.getText();
            // int effectRows = new StringMan().add(key, value);
            // if(effectRows > 0){
            //    PopMessage.popMsg("Added type:[" + tableType + "] key:[" + key + "] value:[" +
            // value + "] success");
            // } else {
            //    PopMessage.popWarn("Added type:[" + tableType + "] key:[" + key + "] value:[" +
            // value + "] Fail");
            // }
            int effectRow = new StringMan().add(key, value);
            if (effectRow > 0) {
              PopMessage.popMsg("Save data for key:[" + key + "] success");
            } else {
              PopMessage.popMsg("Save data for key:[" + key + "] fail");
            }
          }
        });

    GroupLayout layout = new GroupLayout(comboBoxPanel);
    comboBoxPanel.setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
    hGroup.addGap(5);
    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(tableTypelbl, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            .addComponent(tableNamelbl, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                strTableValuelbl, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE));
    hGroup.addGap(5);
    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(
                tableTypevalue, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableNameText, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableValueText, GroupLayout.PREFERRED_SIZE, 160, GroupLayout.PREFERRED_SIZE)
            .addComponent(addStrBtn, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE));
    // hGroup.addGap(5);
    // hGroup.addGroup(layout.createParallelGroup().addComponent(addbtn, GroupLayout.PREFERRED_SIZE,
    // 100, GroupLayout.PREFERRED_SIZE));
    layout.setHorizontalGroup(hGroup);

    GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(tableTypelbl, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableTypevalue, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(tableNamelbl, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableNameText, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(
                strTableValuelbl, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                tableValueText, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(addStrBtn, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    layout.setVerticalGroup(vGroup);

    // comboBoxPanel.add(strTableValuelbl);
    // comboBoxPanel.add(strTableNameText);
  }
示例#19
0
  private void createBaseLayout() {
    GroupLayout layout = new GroupLayout(getContentPane());

    GroupLayout.SequentialGroup horizontalButtonGroup = layout.createSequentialGroup();
    horizontalButtonGroup.addComponent(hideFilteredValues);
    horizontalButtonGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    horizontalButtonGroup.addComponent(showFilteredValues);
    horizontalButtonGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    horizontalButtonGroup.addComponent(save);
    horizontalButtonGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
    horizontalButtonGroup.addComponent(cancel);
    horizontalButtonGroup.addContainerGap();

    GroupLayout.ParallelGroup horizontalPaneGroup =
        layout.createParallelGroup(GroupLayout.Alignment.LEADING);
    horizontalPaneGroup.addComponent(tabbedPane);
    horizontalPaneGroup.addGroup(horizontalButtonGroup);

    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(horizontalPaneGroup);

    GroupLayout.ParallelGroup verticalRadioButtonGroup =
        layout.createParallelGroup(GroupLayout.Alignment.TRAILING);
    verticalRadioButtonGroup.addComponent(hideFilteredValues);
    verticalRadioButtonGroup.addComponent(showFilteredValues);

    GroupLayout.ParallelGroup verticalButtonGroup =
        layout.createParallelGroup(GroupLayout.Alignment.TRAILING);
    verticalButtonGroup.addComponent(save);
    verticalButtonGroup.addComponent(cancel);
    verticalButtonGroup.addGroup(verticalRadioButtonGroup);

    GroupLayout.SequentialGroup verticalPaneGroup = layout.createSequentialGroup();
    verticalPaneGroup.addComponent(tabbedPane);
    verticalPaneGroup.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    verticalPaneGroup.addGroup(verticalButtonGroup);

    layout.setVerticalGroup(verticalPaneGroup);
  }
  private JPanel createRulesPanel() {
    JPanel panel = new JPanel();

    panel.addAncestorListener(new EventHandler());
    panel.setBorder(BorderFactory.createEtchedBorder());

    GroupLayout layout = new GroupLayout(panel);
    layout.setAutoCreateContainerGaps(true);
    layout.setAutoCreateGaps(true);
    panel.setLayout(layout);

    GroupLayout.SequentialGroup leftToRight = layout.createSequentialGroup();

    GroupLayout.ParallelGroup left = layout.createParallelGroup();
    left.addComponent(numberOfRoundsLabel);
    left.addComponent(gunCoolingRateLabel);
    left.addComponent(inactivityTimeLabel);
    left.addComponent(sentryBorderSizeLabel);
    left.addComponent(hideEnemyNamesLabel);
    leftToRight.addGroup(left);

    GroupLayout.ParallelGroup right = layout.createParallelGroup();
    right.addComponent(getNumberOfRoundsTextField());
    right.addComponent(getGunCoolingRateTextField());
    right.addComponent(getInactivityTimeTextField());
    right.addComponent(getSentryBorderSizeTextField());
    right.addComponent(hideEnemyNamesCheckBox);
    leftToRight.addGroup(right);

    GroupLayout.SequentialGroup topToBottom = layout.createSequentialGroup();

    GroupLayout.ParallelGroup row0 = layout.createParallelGroup(Alignment.BASELINE);
    row0.addComponent(numberOfRoundsLabel);
    row0.addComponent(numberOfRoundsTextField);
    topToBottom.addGroup(row0);

    GroupLayout.ParallelGroup row1 = layout.createParallelGroup(Alignment.BASELINE);
    row1.addComponent(gunCoolingRateLabel);
    row1.addComponent(getGunCoolingRateTextField());
    topToBottom.addGroup(row1);

    GroupLayout.ParallelGroup row2 = layout.createParallelGroup(Alignment.BASELINE);
    row2.addComponent(inactivityTimeLabel);
    row2.addComponent(inactivityTimeTextField);
    topToBottom.addGroup(row2);

    GroupLayout.ParallelGroup row3 = layout.createParallelGroup(Alignment.BASELINE);
    row3.addComponent(sentryBorderSizeLabel);
    row3.addComponent(sentryBorderSizeTextField);
    topToBottom.addGroup(row3);

    GroupLayout.ParallelGroup row4 = layout.createParallelGroup(Alignment.CENTER);
    row4.addComponent(hideEnemyNamesLabel);
    row4.addComponent(hideEnemyNamesCheckBox);
    topToBottom.addGroup(row4);

    layout.setHorizontalGroup(leftToRight);
    layout.setVerticalGroup(topToBottom);

    return panel;
  }
示例#21
0
	/**
	 * Initializes this panel with two sub-panels:
	 * <ul>
	 * <li>the panel with ranges of position and frequency that should be
	 * displayed,</li>
	 * <li>the panel with check-box if the zoom ratio should be preserved
	 * on drag.</li>
	 * </ul>
	 */
	private void initialize() {

		setLayout(new BorderLayout());

		JPanel rangePanel = new JPanel();

		rangePanel.setBorder(new CompoundBorder(
								 new TitledCrossBorder(_("Range"), hasCloseCross),
								 new EmptyBorder(3,3,3,3)
							 ));

		GroupLayout layout = new GroupLayout(rangePanel);
		rangePanel.setLayout(layout);
		layout.setAutoCreateContainerGaps(false);
		layout.setAutoCreateGaps(true);

		JLabel positionLabel = new JLabel(_("Position"));
		JLabel frequencyLabel = new JLabel(_("Frequency"));

		JLabel minPositionLabel = new JLabel(_("min"));
		JLabel minFrequencyLabel = new JLabel(_("min"));

		JLabel maxPositionLabel = new JLabel(_("max"));
		JLabel maxFrequencyLabel = new JLabel(_("max"));

		Component positionGlue = Box.createHorizontalGlue();
		Component frequencyGlue = Box.createHorizontalGlue();

		GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();

		hGroup.addGroup(
			layout.createParallelGroup()
			.addComponent(positionLabel)
			.addComponent(frequencyLabel)
		);

		hGroup.addGroup(
			layout.createParallelGroup()
			.addComponent(minPositionLabel)
			.addComponent(minFrequencyLabel)
		);

		hGroup.addGroup(
			layout.createParallelGroup()
			.addComponent(getMinPositionSpinner())
			.addComponent(getMinFrequencySpinner())
		);

		hGroup.addGroup(
			layout.createParallelGroup()
			.addComponent(positionGlue)
			.addComponent(frequencyGlue)
		);

		hGroup.addGroup(
			layout.createParallelGroup()
			.addComponent(maxPositionLabel)
			.addComponent(maxFrequencyLabel)
		);

		hGroup.addGroup(
			layout.createParallelGroup()
			.addComponent(getMaxPositionSpinner())
			.addComponent(getMaxFrequencySpinner())
		);

		layout.setHorizontalGroup(hGroup);

		GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();

		vGroup.addGroup(
			layout.createParallelGroup(Alignment.BASELINE)
			.addComponent(positionLabel)
			.addComponent(minPositionLabel)
			.addComponent(getMinPositionSpinner())
			.addComponent(positionGlue)
			.addComponent(maxPositionLabel)
			.addComponent(getMaxPositionSpinner())
		);

		vGroup.addGroup(
			layout.createParallelGroup(Alignment.BASELINE)
			.addComponent(frequencyLabel)
			.addComponent(minFrequencyLabel)
			.addComponent(getMinFrequencySpinner())
			.addComponent(frequencyGlue)
			.addComponent(maxFrequencyLabel)
			.addComponent(getMaxFrequencySpinner())
		);

		layout.setVerticalGroup(vGroup);

		JPanel preservationPanel = new JPanel(new FlowLayout());

		preservationPanel.setBorder(new CompoundBorder(
										new TitledBorder(_("Ratio preservation")),
										new EmptyBorder(3,3,3,3)
									));

		preservationPanel.add(getPreserveRatioCheckBox());

		add(rangePanel, BorderLayout.CENTER);
		add(preservationPanel, BorderLayout.SOUTH);
		Dimension size = getPreferredSize();
		if (size.width < 150) {
			size.width = 150;
		}
		setPreferredSize(size);

	}
示例#22
0
  @Override
  public void initView() {
    btPath = new BtnLabel();
    btPath.addActionListener(
        new java.awt.event.ActionListener() {

          @Override
          public void actionPerformed(java.awt.event.ActionEvent e) {
            btPathActionPerformed(e);
          }
        });
    tfPath = new javax.swing.JTextField();
    lbPath = new javax.swing.JLabel();
    tfArgs = new javax.swing.JTextField();
    lbArgs = new javax.swing.JLabel();

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    javax.swing.GroupLayout.SequentialGroup hsg1 = layout.createSequentialGroup();
    hsg1.addComponent(tfPath, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE);
    hsg1.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    hsg1.addComponent(btPath, 21, 21, 21);
    javax.swing.GroupLayout.ParallelGroup hpg1 =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
    hpg1.addComponent(lbArgs, javax.swing.GroupLayout.Alignment.TRAILING);
    hpg1.addComponent(lbPath, javax.swing.GroupLayout.Alignment.TRAILING);
    javax.swing.GroupLayout.ParallelGroup hpg2 =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING);
    hpg2.addGroup(hsg1);
    hpg2.addComponent(tfArgs, javax.swing.GroupLayout.DEFAULT_SIZE, 150, Short.MAX_VALUE);
    javax.swing.GroupLayout.SequentialGroup hsg2 = layout.createSequentialGroup();
    //        hsg2.addContainerGap();
    hsg2.addGroup(hpg1);
    hsg2.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    hsg2.addGroup(hpg2);
    //        hsg2.addContainerGap();
    layout.setHorizontalGroup(hsg2);

    javax.swing.GroupLayout.ParallelGroup vpg1 =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE);
    vpg1.addComponent(lbPath);
    vpg1.addComponent(
        tfPath,
        javax.swing.GroupLayout.PREFERRED_SIZE,
        javax.swing.GroupLayout.DEFAULT_SIZE,
        javax.swing.GroupLayout.PREFERRED_SIZE);
    vpg1.addComponent(btPath, 21, 21, 21);
    javax.swing.GroupLayout.ParallelGroup vpg2 =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE);
    vpg2.addComponent(lbArgs);
    vpg2.addComponent(
        tfArgs,
        javax.swing.GroupLayout.PREFERRED_SIZE,
        javax.swing.GroupLayout.DEFAULT_SIZE,
        javax.swing.GroupLayout.PREFERRED_SIZE);
    javax.swing.GroupLayout.SequentialGroup vsg = layout.createSequentialGroup();
    //        vsg.addContainerGap();
    vsg.addGroup(vpg1);
    vsg.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    vsg.addGroup(vpg2);
    //        vsg.addContainerGap();
    layout.setVerticalGroup(vsg);
  }
  private Component createSongInformationPanel(Lied lied) {
    JPanel panel = new JPanel();

    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);

    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);

    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();

    JLabel titleLabel =
        new JLabel(
            "<html><b>" + MusikbrainMessages.getString(MusikbrainMessages.TITEL) + "</html></b>");
    JLabel interpretLabel =
        new JLabel(
            "<html><b>"
                + MusikbrainMessages.getString(MusikbrainMessages.INTERPRET)
                + "</html></b>");
    JLabel albumLabel =
        new JLabel(
            "<html><b>" + MusikbrainMessages.getString(MusikbrainMessages.ALBUM) + "</html></b>");
    JLabel durationLabel =
        new JLabel(
            "<html><b>" + MusikbrainMessages.getString(MusikbrainMessages.DAUER) + "</html></b>");
    JLabel filepathLabel =
        new JLabel(
            "<html><b>"
                + MusikbrainMessages.getString(MusikbrainMessages.DATEIPFAD)
                + "</html></b>");

    JLabel title = new JLabel(lied.getTitel());
    JLabel interpret = new JLabel(lied.getInterpret());
    JLabel album = new JLabel(lied.getAlbum());
    JLabel duration = new JLabel(lied.getDauer().toString());
    JLabel filepath = new JLabel(lied.getFile().getAbsolutePath());

    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(titleLabel)
            .addComponent(interpretLabel)
            .addComponent(albumLabel)
            .addComponent(durationLabel)
            .addComponent(filepathLabel));
    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(title)
            .addComponent(interpret)
            .addComponent(album)
            .addComponent(duration)
            .addComponent(filepath));
    layout.setHorizontalGroup(hGroup);

    GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(titleLabel)
            .addComponent(title));
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(interpretLabel)
            .addComponent(interpret));
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(albumLabel)
            .addComponent(album));
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(durationLabel)
            .addComponent(duration));
    vGroup.addGroup(
        layout
            .createParallelGroup(Alignment.BASELINE)
            .addComponent(filepathLabel)
            .addComponent(filepath));
    layout.setVerticalGroup(vGroup);

    return panel;
  }
示例#24
0
  private CopyWindow() {
    setTitle(editWindowTitle);

    JPanel selectPanle = new JPanel();
    selectPanle.setLayout(new BoxLayout(selectPanle, BoxLayout.X_AXIS));
    // typejsp = new JScrollPane();
    // JLabel addTypeLbl = new JLabel("Table Type:");
    comboBoxPanel = new JPanel();
    // comboBoxPanel.setSize(100, 50);
    // comboBoxPanel.setLayout(new BoxLayout(comboBoxPanel, BoxLayout.X_AXIS));
    comboBoxPanel.setVisible(true);

    type_comboBox = new JComboBox<String>();
    type_comboBox.addItem("Set");
    type_comboBox.addItem("Hash");
    type_comboBox.addItem("List");
    type_comboBox.addItem("String");
    type_comboBox.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent ae) {
            JComboBox selectedObj = (JComboBox) ae.getSource();
            // PopMessage.popMsg("type_comboBox selected : " + selectedObj.getSelectedItem());
            selectedTableType = selectedObj.getSelectedItem().toString();
            showDiffContents(selectedTableType);
          }
        });
    selectPanle.add(editTypeLbl);
    selectPanle.add(type_comboBox);
    // type_comboBox.setPreferredSize(new Dimension(100,50));
    // type_comboBox.setLocation(80, 20);

    GroupLayout layout = new GroupLayout(this.getContentPane());
    this.getContentPane().setLayout(layout);
    GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
    hGroup.addGap(5);
    hGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(selectPanle, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)
            // .addComponent(addTypeLbl, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
            .addComponent(
                comboBoxPanel, GroupLayout.PREFERRED_SIZE, 600, GroupLayout.PREFERRED_SIZE));
    hGroup.addGap(5);
    // hGroup.addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER)
    // hGroup.addGroup(layout.createParallelGroup(Alignment.LEADING)
    //        .addComponent(type_comboBox, GroupLayout.PREFERRED_SIZE, 70,
    // GroupLayout.PREFERRED_SIZE)
    // .addComponent(comboBoxPanel, GroupLayout.PREFERRED_SIZE, 680,GroupLayout.PREFERRED_SIZE)
    //        );
    // hGroup.addGap(5);
    // hGroup.addGroup(layout.createParallelGroup().addComponent(comboBoxPanel,
    // GroupLayout.PREFERRED_SIZE, 300,GroupLayout.PREFERRED_SIZE));
    layout.setHorizontalGroup(hGroup);

    GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            // .addComponent(addTypeLbl, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
            // .addComponent(type_comboBox, GroupLayout.PREFERRED_SIZE, 20,
            // GroupLayout.PREFERRED_SIZE));
            .addComponent(selectPanle, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    vGroup.addGroup(
        layout
            .createParallelGroup()
            .addComponent(
                comboBoxPanel, GroupLayout.PREFERRED_SIZE, 400, GroupLayout.PREFERRED_SIZE));
    vGroup.addGap(5);
    layout.setVerticalGroup(vGroup);

    // showDiffContents("Set");
    // type_comboBox.setSelectedItem(selectedTableType);

    // comboBoxPanel.setLayout(layout);
    // type_comboBox.setPreferredSize(new Dimension(50,50));
    // comboBoxPanel.setPreferredSize(new Dimension(50,50));
    // typejsp.add(addTypeLbl);
    // comboBoxPanel.add(addTypeLbl);
    // addTypeLbl.setBounds(10, 0, 50, 50);

    // typejsp.add(type_comboBox);
    // comboBoxPanel.add(typejsp);
    // comboBoxPanel.add(type_comboBox);
    // type_comboBox.setBounds(60, 0, 50, 50);
    // type_comboBox.setPreferredSize(new Dimension(50,50));

    // this.getContentPane().add(typejsp, BorderLayout.NORTH);
    // this.getContentPane().add(comboBoxPanel);
    // comboBoxPanel.setPreferredSize(new Dimension(30,50));

    // comboBoxPanel.setVisible(true);
    // addTypeLbl.setVisible(true);
    // comboBoxPanel.setBounds(10, 10, 100, 200);
    // typejsp.updateUI();
    // typejsp.setVisible(true);

    // detailjsp = new JScrollPane();
    // JPanel detailPanel = new JPanel();
    // detailPanel.add(tableDetailLbl);
    // detailjsp.add(detailPanel);
    // this.getContentPane().add(detailPanel, BorderLayout.SOUTH);
    // detailjsp.setBounds(10, 50, 400, 100);
    // detailjsp.updateUI();
    // PopMessage.popMsg("Create the add window");
  };
示例#25
0
  public void initView() {
    ls_DataList = new javax.swing.JList();
    bt_Cancel = new javax.swing.JButton();
    bt_Update = new javax.swing.JButton();

    ls_DataList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    javax.swing.JScrollPane sp_DataList = new javax.swing.JScrollPane();
    sp_DataList.setViewportView(ls_DataList);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    javax.swing.GroupLayout.SequentialGroup hsg1 = layout.createSequentialGroup();
    hsg1.addComponent(bt_Update);
    hsg1.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    hsg1.addComponent(bt_Cancel);
    javax.swing.GroupLayout.ParallelGroup hpg =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING);
    hpg.addComponent(
        sp_DataList,
        javax.swing.GroupLayout.Alignment.LEADING,
        javax.swing.GroupLayout.DEFAULT_SIZE,
        220,
        Short.MAX_VALUE);
    hpg.addGroup(hsg1);
    javax.swing.GroupLayout.SequentialGroup hsg = layout.createSequentialGroup();
    hsg.addContainerGap();
    hsg.addGroup(hpg);
    hsg.addContainerGap();
    layout.setHorizontalGroup(hsg);

    javax.swing.GroupLayout.ParallelGroup vpg1 =
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE);
    vpg1.addComponent(bt_Cancel);
    vpg1.addComponent(bt_Update);
    javax.swing.GroupLayout.SequentialGroup vsg = layout.createSequentialGroup();
    vsg.addContainerGap();
    vsg.addComponent(sp_DataList, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE);
    vsg.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED);
    vsg.addGroup(vpg1);
    vsg.addContainerGap();
    layout.setVerticalGroup(vsg);

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setIconImage(Bean.getLogo(16));
  }
  @Override
  public JComponent createOptionsPanel() {
    final JPanel panel = new JPanel();
    final JLabel textFieldLabel = new JLabel(getConfigurationLabel());
    final JFormattedTextField valueField = prepareNumberEditor("m_limit");
    final JLabel comboBoxLabel =
        new JLabel(InspectionGadgetsBundle.message("constructor.visibility.option"));
    final JComboBox comboBox = new JComboBox();
    comboBox.addItem(Scope.NONE);
    comboBox.addItem(Scope.PRIVATE);
    comboBox.addItem(Scope.PACKAGE_LOCAL);
    comboBox.addItem(Scope.PROTECTED);
    comboBox.setRenderer(
        new ListCellRendererWrapper() {
          @Override
          public void customize(
              JList list, Object value, int index, boolean selected, boolean hasFocus) {
            if (value instanceof Scope) setText(((Scope) value).getText());
          }
        });
    comboBox.setSelectedItem(ignoreScope);
    comboBox.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            ignoreScope = (Scope) comboBox.getSelectedItem();
          }
        });
    comboBox.setPrototypeDisplayValue(Scope.PROTECTED);

    final GroupLayout layout = new GroupLayout(panel);
    layout.setAutoCreateGaps(true);
    panel.setLayout(layout);
    final GroupLayout.ParallelGroup horizontal = layout.createParallelGroup();
    horizontal.addGroup(
        layout
            .createSequentialGroup()
            .addComponent(textFieldLabel)
            .addComponent(
                valueField,
                GroupLayout.PREFERRED_SIZE,
                GroupLayout.DEFAULT_SIZE,
                GroupLayout.PREFERRED_SIZE));
    horizontal.addGroup(
        layout
            .createSequentialGroup()
            .addComponent(comboBoxLabel)
            .addComponent(comboBox, 100, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
    layout.setHorizontalGroup(horizontal);
    final GroupLayout.SequentialGroup vertical = layout.createSequentialGroup();
    vertical.addGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(textFieldLabel)
            .addComponent(valueField));
    vertical.addGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.BASELINE)
            .addComponent(comboBoxLabel)
            .addComponent(comboBox));
    layout.setVerticalGroup(vertical);

    return panel;
  }