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);
}
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);
}
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;
}
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);
}
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;
}
Aggregations