Search in sources :

Example 61 with CellConstraints

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JPanel(javax.swing.JPanel) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) BorderLayout(java.awt.BorderLayout) JTableHeader(javax.swing.table.JTableHeader) Dimension(java.awt.Dimension) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 62 with CellConstraints

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) BorderLayout(java.awt.BorderLayout) TextAdapter(org.apache.cayenne.modeler.util.TextAdapter) JTextField(javax.swing.JTextField) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 63 with CellConstraints

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JPanel(javax.swing.JPanel) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) JRadioButton(javax.swing.JRadioButton) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) ButtonGroup(javax.swing.ButtonGroup) JButton(javax.swing.JButton) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 64 with CellConstraints

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);
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JPanel(javax.swing.JPanel) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) Container(java.awt.Container) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JProgressBar(javax.swing.JProgressBar) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 65 with CellConstraints

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));
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Aggregations

CellConstraints (com.jgoodies.forms.layout.CellConstraints)142 FormLayout (com.jgoodies.forms.layout.FormLayout)97 JPanel (javax.swing.JPanel)65 Dimension (java.awt.Dimension)42 JLabel (javax.swing.JLabel)30 JScrollPane (javax.swing.JScrollPane)29 PanelBuilder (com.jgoodies.forms.builder.PanelBuilder)18 BorderLayout (java.awt.BorderLayout)12 JButton (javax.swing.JButton)7 TitledSeparator (com.jeta.forms.components.separator.TitledSeparator)6 JRadioButton (javax.swing.JRadioButton)6 DatePanel (jgnash.ui.components.DatePanel)5 TextAdapter (org.apache.cayenne.modeler.util.TextAdapter)5 FlowLayout (java.awt.FlowLayout)4 JSpinner (javax.swing.JSpinner)4 JTextField (javax.swing.JTextField)4 SpinnerNumberModel (javax.swing.SpinnerNumberModel)4 GridConstraints (com.intellij.uiDesigner.core.GridConstraints)3 DefaultFormBuilder (com.jgoodies.forms.builder.DefaultFormBuilder)3 JCayenneCheckBox (org.apache.cayenne.swing.components.JCayenneCheckBox)3