Search in sources :

Example 11 with VerticalLayout

use of org.jdesktop.swingx.VerticalLayout in project com.revolsys.open by revolsys.

the class AbstractUpdateField method initDialog.

protected void initDialog() {
    setLayout(new VerticalLayout());
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    setResizable(false);
    addWindowListener(new WindowAdapter() {

        @Override
        public void windowClosing(final WindowEvent e) {
            cancel();
        }
    });
    final JPanel fieldPanel = initFieldPanel();
    final String fieldTitle = this.fieldDefinition.getTitle();
    fieldPanel.setBorder(BorderFactory.createTitledBorder("Set " + fieldTitle + " = "));
    add(fieldPanel);
    final JLabel recordCountLabel = new JLabel("<html><b style='color:#32CD32'>" + getRecordCountString() + "</b> records will be updated.</html>");
    recordCountLabel.setBorder(BorderFactory.createEmptyBorder(1, 5, 1, 5));
    add(recordCountLabel);
    final JComponent errorsPanel = initErrorsPanel();
    if (errorsPanel != null) {
        add(errorsPanel);
    }
    final JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    add(buttonsPanel);
    final JButton cancelButton = RunnableAction.newButton("Cancel", this::cancel);
    buttonsPanel.add(cancelButton);
    this.okButton = RunnableAction.newButton("OK", this::finish);
    if (this.fieldDefinition.isRequired()) {
        this.okButton.setEnabled(false);
    }
    buttonsPanel.add(this.okButton);
    pack();
    SwingUtil.autoAdjustPosition(this);
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) WindowEvent(java.awt.event.WindowEvent) JComponent(javax.swing.JComponent) JButton(javax.swing.JButton) VerticalLayout(org.jdesktop.swingx.VerticalLayout) WindowAdapter(java.awt.event.WindowAdapter) JLabel(javax.swing.JLabel)

Example 12 with VerticalLayout

use of org.jdesktop.swingx.VerticalLayout in project com.revolsys.open by revolsys.

the class RecordLayerTablePanel method getHeaderMenu.

@Override
public JPopupMenu getHeaderMenu(final int columnIndex) {
    final JPopupMenu headerMenu = super.getHeaderMenu(columnIndex);
    final String columnName = this.tableModel.getColumnName(columnIndex);
    final JMenuItem menuItem = new JMenuItem();
    final JLabel title = new JLabel(columnName);
    title.setFont(menuItem.getFont().deriveFont(Font.BOLD));
    title.setBackground(menuItem.getBackground());
    title.setHorizontalAlignment(SwingConstants.CENTER);
    title.setHorizontalTextPosition(SwingConstants.CENTER);
    final JPanel labelPanel = new JPanel(new VerticalLayout());
    labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    labelPanel.setOpaque(false);
    labelPanel.add(title);
    headerMenu.add(labelPanel, 0);
    headerMenu.add(new JPopupMenu.Separator(), 1);
    return headerMenu;
}
Also used : JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) VerticalLayout(org.jdesktop.swingx.VerticalLayout) JMenuItem(javax.swing.JMenuItem) BaseJPopupMenu(com.revolsys.swing.menu.BaseJPopupMenu) JPopupMenu(javax.swing.JPopupMenu)

Example 13 with VerticalLayout

use of org.jdesktop.swingx.VerticalLayout in project com.revolsys.open by revolsys.

the class MergeRecordsDialog method initDialog.

protected void initDialog() {
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    setMinimumSize(new Dimension(600, 100));
    addWindowListener(this);
    final BasePanel panel = new BasePanel(new BorderLayout());
    add(new JScrollPane(panel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED));
    this.mergedRecordsPanel = new JPanel(new VerticalLayout());
    panel.add(this.mergedRecordsPanel, BorderLayout.CENTER);
    final JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    add(buttonsPanel, BorderLayout.SOUTH);
    final JButton cancelButton = RunnableAction.newButton("Cancel", this::cancel);
    buttonsPanel.add(cancelButton);
    this.okButton = RunnableAction.newButton("OK", this::finish);
    this.okButton.setEnabled(false);
    buttonsPanel.add(this.okButton);
    pack();
    SwingUtil.autoAdjustPosition(this);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BasePanel(com.revolsys.swing.component.BasePanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) VerticalLayout(org.jdesktop.swingx.VerticalLayout) Dimension(java.awt.Dimension)

Aggregations

VerticalLayout (org.jdesktop.swingx.VerticalLayout)13 JPanel (javax.swing.JPanel)9 JLabel (javax.swing.JLabel)5 BasePanel (com.revolsys.swing.component.BasePanel)4 BorderLayout (java.awt.BorderLayout)3 Dimension (java.awt.Dimension)3 JScrollPane (javax.swing.JScrollPane)3 ToolBar (com.revolsys.swing.toolbar.ToolBar)2 FlowLayout (java.awt.FlowLayout)2 Rectangle (java.awt.Rectangle)2 Window (java.awt.Window)2 JButton (javax.swing.JButton)2 JDialog (javax.swing.JDialog)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 FileTextField (com.intellij.openapi.fileChooser.FileTextField)1 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1 CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)1 BoundingBox (com.revolsys.geometry.model.BoundingBox)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 FieldDefinition (com.revolsys.record.schema.FieldDefinition)1