use of com.jgoodies.forms.layout.CellConstraints in project cayenne by apache.
the class AbstractCallbackMethodsTab method addButtonAtHeader.
private void addButtonAtHeader(JTable table, JButton button, ActionListener buttonListener, ImageIcon buttonIcon) {
PanelBuilder builder = new PanelBuilder(new FormLayout("left:10dlu, 2dlu", "center:14dlu"));
CellConstraints cc = new CellConstraints();
button.setIcon(buttonIcon);
button.setOpaque(false);
button.setBorderPainted(false);
button.setContentAreaFilled(false);
button.addActionListener(buttonListener);
builder.add(button, cc.xy(1, 1));
JPanel buttonPanel = builder.getPanel();
buttonPanel.setOpaque(false);
JTableHeader header = table.getTableHeader();
header.setLayout(new BorderLayout());
header.setReorderingAllowed(false);
header.setPreferredSize(new Dimension(150, 22));
header.add(buttonPanel, BorderLayout.EAST);
}
use of com.jgoodies.forms.layout.CellConstraints in project cayenne by apache.
the class EjbqlQueryMainTab method initView.
private void initView() {
// create widgets
name = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setQueryName(text);
}
};
comment = new TextAdapter(new JTextField()) {
@Override
protected void updateModel(String text) {
setQueryComment(text);
}
};
properties = new EjbqlQueryPropertiesPanel(mediator);
// assemble
CellConstraints cc = new CellConstraints();
FormLayout layout = new FormLayout("right:max(80dlu;pref), 3dlu, fill:max(200dlu;pref)", "p, 3dlu, p, 3dlu, p");
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
builder.addSeparator("EJBQL Query Settings", cc.xywh(1, 1, 3, 1));
builder.addLabel("Query Name:", cc.xy(1, 3));
builder.add(name.getComponent(), cc.xy(3, 3));
builder.addLabel("Comment:", cc.xy(1, 5));
builder.add(comment.getComponent(), cc.xy(3, 5));
this.setLayout(new BorderLayout());
this.add(builder.getPanel(), BorderLayout.NORTH);
this.add(properties, BorderLayout.CENTER);
}
use of com.jgoodies.forms.layout.CellConstraints in project cayenne by apache.
the class DefaultsPreferencesView method initView.
protected void initView(String allControl, String uninitializedControl) {
updateAll = new JRadioButton(allControl);
updateAll.setSelected(true);
updateEmpty = new JRadioButton(uninitializedControl);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(updateAll);
buttonGroup.add(updateEmpty);
updateButton = new JButton("Update");
cancelButton = new JButton("Cancel");
// assemble
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
buttonPanel.add(updateButton);
buttonPanel.add(cancelButton);
CellConstraints cc = new CellConstraints();
FormLayout layout = new FormLayout("left:max(180dlu;pref)", "p, 3dlu, p, 3dlu");
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
builder.add(updateAll, cc.xy(1, 1));
builder.add(updateEmpty, cc.xy(1, 3));
setLayout(new BorderLayout());
add(builder.getPanel(), BorderLayout.CENTER);
add(buttonPanel, BorderLayout.SOUTH);
}
use of com.jgoodies.forms.layout.CellConstraints in project cayenne by apache.
the class ProgressDialog method init.
private void init(String message) {
progressBar = new JProgressBar();
statusLabel = new JLabel(message, SwingConstants.LEFT);
JLabel messageLabel = new JLabel(message, SwingConstants.LEFT);
cancelButton = new JButton("Cancel");
// assemble
CellConstraints cc = new CellConstraints();
FormLayout layout = new FormLayout("fill:max(250dlu;pref)", "p, 3dlu, p, 3dlu, p");
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
builder.add(messageLabel, cc.xy(1, 1));
builder.add(progressBar, cc.xy(1, 3));
builder.add(statusLabel, cc.xy(1, 5));
JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT));
buttons.add(cancelButton);
Container root = getContentPane();
root.setLayout(new BorderLayout(5, 5));
root.add(builder.getPanel(), BorderLayout.CENTER);
root.add(buttons, BorderLayout.SOUTH);
setResizable(false);
pack();
ModelerUtil.centerWindow(getOwner(), this);
}
use of com.jgoodies.forms.layout.CellConstraints in project jgnash by ccavanaugh.
the class MainViewPanel method layoutPanel.
private void layoutPanel() {
FormLayout layout = new FormLayout("min, $lcgap, fill:min:g", "fill:p:g");
CellConstraints cc = new CellConstraints();
setLayout(layout);
add(buttonPanel, cc.xy(1, 1));
add(contentPanel, cc.xy(3, 1));
}
Aggregations