Exemple #1
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();
  }
Exemple #2
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);
  }
Exemple #3
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);
  }
Exemple #4
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;
  }
Exemple #6
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);
  }