Search in sources :

Example 86 with GroupLayout

use of javax.swing.GroupLayout in project com.revolsys.open by revolsys.

the class GroupLayouts method makeColumns.

public static void makeColumns(final Container container, final int columnCount, final boolean containerGaps, final boolean gaps) {
    final GroupLayout groupLayout = getLayout(container, containerGaps);
    groupLayout.setAutoCreateContainerGaps(containerGaps);
    groupLayout.setAutoCreateGaps(gaps);
    groupLayout.setLayoutStyle(LayoutStyle.getInstance());
    makeColumns(container, groupLayout, columnCount);
}
Also used : GroupLayout(javax.swing.GroupLayout)

Example 87 with GroupLayout

use of javax.swing.GroupLayout in project com.revolsys.open by revolsys.

the class GroupLayouts method makeColumns.

public static void makeColumns(final LayoutStyle layoutStyle, final Container container, final int columnCount) {
    final GroupLayout groupLayout = getLayout(container, true);
    groupLayout.setAutoCreateContainerGaps(false);
    groupLayout.setAutoCreateGaps(true);
    groupLayout.setLayoutStyle(layoutStyle);
    makeColumns(container, groupLayout, columnCount);
}
Also used : GroupLayout(javax.swing.GroupLayout)

Example 88 with GroupLayout

use of javax.swing.GroupLayout in project fql by CategoricalData.

the class OptionsDialog method optionsPanel.

/**
 * Creates a JPanel with the specified options. Interal use only.
 *
 * @param opts
 *            the options
 * @return a jpanel
 */
private static JPanel optionsPanel(final List<Option> opts) {
    final JPanel options = new JPanel();
    final GroupLayout gl = new GroupLayout(options);
    options.setLayout(gl);
    gl.setAutoCreateGaps(true);
    gl.setAutoCreateContainerGaps(true);
    final GroupLayout.ParallelGroup labels = gl.createParallelGroup();
    final GroupLayout.ParallelGroup values = gl.createParallelGroup();
    final GroupLayout.ParallelGroup titles = gl.createParallelGroup();
    final GroupLayout.ParallelGroup horiz = gl.createParallelGroup();
    final GroupLayout.SequentialGroup cols = gl.createSequentialGroup();
    final GroupLayout.SequentialGroup rows = gl.createSequentialGroup();
    cols.addGroup(labels);
    cols.addGroup(values);
    horiz.addGroup(cols);
    horiz.addGroup(titles);
    for (final Option o : opts) {
        final JLabel l = o.getLabel();
        final JComponent c = o.getComponent();
        if (c == null) {
            // This is a label-only row, allowed to take up the whole row
            titles.addComponent(l);
            rows.addComponent(l);
        } else {
            if (l.getBorder() == null) {
                l.setBorder(new EmptyBorder(3, 0, 0, 0));
            }
            if (l.getLabelFor() == null) {
                l.setLabelFor(c);
            }
            labels.addComponent(l);
            values.addComponent(c);
            final GroupLayout.ParallelGroup row = gl.createParallelGroup(GroupLayout.Alignment.BASELINE);
            row.addComponent(l);
            row.addComponent(c);
            rows.addGroup(row);
        }
    }
    gl.setHorizontalGroup(horiz);
    gl.setVerticalGroup(rows);
    return options;
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout) JComponent(javax.swing.JComponent) JLabel(javax.swing.JLabel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 89 with GroupLayout

use of javax.swing.GroupLayout in project GlassRemote by thorikawa.

the class MainFrame method initializePanel.

private void initializePanel() {
    JPanel panel = new JPanel();
    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    mInfoPanel = new InfoPanel();
    mScreencastPanel = new ScreencastPanel();
    mScreencastPanel.setZoom(mZoom);
    mScreencastPanel.setScreencastMouseEventListener(this);
    mControlPanel = new ControlPanel(mGlassConnection);
    layout.setHorizontalGroup(layout.createParallelGroup().addComponent(mInfoPanel).addComponent(mScreencastPanel).addComponent(mControlPanel));
    layout.setVerticalGroup(layout.createSequentialGroup().addComponent(mInfoPanel).addComponent(mScreencastPanel).addComponent(mControlPanel));
    add(panel);
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout)

Example 90 with GroupLayout

use of javax.swing.GroupLayout in project zaproxy by zaproxy.

the class DialogAddToken method getFieldsPanel.

@Override
protected JPanel getFieldsPanel() {
    JPanel fieldsPanel = new JPanel();
    GroupLayout layout = new GroupLayout(fieldsPanel);
    fieldsPanel.setLayout(layout);
    layout.setAutoCreateGaps(true);
    layout.setAutoCreateContainerGaps(true);
    JLabel nameLabel = new JLabel(NAME_FIELD_LABEL);
    JLabel enabledLabel = new JLabel(ENABLED_FIELD_LABEL);
    JLabel descLabel = new JLabel(DESC_FIELD_LABEL);
    layout.setHorizontalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(nameLabel).addComponent(enabledLabel).addComponent(descLabel)).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(getRegexTextField()).addComponent(getEnabledCheckBox()).addComponent(getDescTextField())));
    layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(nameLabel).addComponent(getRegexTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(enabledLabel).addComponent(getEnabledCheckBox())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(descLabel).addComponent(getDescTextField())));
    return fieldsPanel;
}
Also used : JPanel(javax.swing.JPanel) GroupLayout(javax.swing.GroupLayout) JLabel(javax.swing.JLabel)

Aggregations

GroupLayout (javax.swing.GroupLayout)194 JPanel (javax.swing.JPanel)132 JLabel (javax.swing.JLabel)79 JButton (javax.swing.JButton)53 ActionEvent (java.awt.event.ActionEvent)42 JScrollPane (javax.swing.JScrollPane)39 ActionListener (java.awt.event.ActionListener)23 JTextField (javax.swing.JTextField)22 Dimension (java.awt.Dimension)21 AbstractAction (javax.swing.AbstractAction)20 JSeparator (javax.swing.JSeparator)15 JCheckBox (javax.swing.JCheckBox)14 ParallelGroup (javax.swing.GroupLayout.ParallelGroup)11 SequentialGroup (javax.swing.GroupLayout.SequentialGroup)11 JComboBox (javax.swing.JComboBox)10 JTable (javax.swing.JTable)10 Color (java.awt.Color)9 Font (java.awt.Font)9 PropertyChangeListener (java.beans.PropertyChangeListener)8 AfterInjection (org.baderlab.csplugins.enrichmentmap.AfterInjection)8