Search in sources :

Example 6 with VerticalLayout

use of org.jdesktop.swingx.VerticalLayout in project jabref by JabRef.

the class EntryTypeDialog method createEntryGroupsPanel.

private JPanel createEntryGroupsPanel() {
    JPanel panel = new JPanel();
    panel.setLayout(new VerticalLayout());
    if (frame.getCurrentBasePanel().getBibDatabaseContext().isBiblatexMode()) {
        panel.add(createEntryGroupPanel("biblatex", BiblatexEntryTypes.ALL));
        List<EntryType> customTypes = EntryTypes.getAllCustomTypes(BibDatabaseMode.BIBLATEX);
        if (!customTypes.isEmpty()) {
            panel.add(createEntryGroupPanel(Localization.lang("Custom"), customTypes));
        }
    } else {
        panel.add(createEntryGroupPanel("BibTeX", BibtexEntryTypes.ALL));
        panel.add(createEntryGroupPanel("IEEETran", IEEETranEntryTypes.ALL));
        List<EntryType> customTypes = EntryTypes.getAllCustomTypes(BibDatabaseMode.BIBTEX);
        if (!customTypes.isEmpty()) {
            panel.add(createEntryGroupPanel(Localization.lang("Custom"), customTypes));
        }
    }
    panel.add(createIdFetcherPanel());
    return panel;
}
Also used : JPanel(javax.swing.JPanel) EntryType(org.jabref.model.entry.EntryType) VerticalLayout(org.jdesktop.swingx.VerticalLayout)

Example 7 with VerticalLayout

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

the class LayerRecordForm method addScrollPaneTab.

protected JPanel addScrollPaneTab(final String title) {
    final JPanel panel = new JPanel(new VerticalLayout());
    panel.setOpaque(false);
    addScrollPaneTab(title, panel);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) VerticalLayout(org.jdesktop.swingx.VerticalLayout)

Example 8 with VerticalLayout

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

the class LayerRecordForm method addScrollPaneTab.

protected JPanel addScrollPaneTab(final int index, final String title) {
    final JPanel panel = new JPanel(new VerticalLayout());
    panel.setOpaque(false);
    addScrollPaneTab(index, title, panel);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) VerticalLayout(org.jdesktop.swingx.VerticalLayout)

Example 9 with VerticalLayout

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

the class AbstractLayer method newPropertiesTabGeneral.

protected BasePanel newPropertiesTabGeneral(final TabbedValuePanel tabPanel) {
    final BasePanel generalPanel = new BasePanel(new VerticalLayout(5));
    generalPanel.setScrollableHeightHint(ScrollableSizeHint.FIT);
    tabPanel.addTab("General", generalPanel);
    newPropertiesTabGeneralPanelGeneral(generalPanel);
    final ValueField sourcePanel = newPropertiesTabGeneralPanelSource(generalPanel);
    if (sourcePanel.getComponentCount() == 0) {
        generalPanel.remove(sourcePanel);
    }
    return generalPanel;
}
Also used : BasePanel(com.revolsys.swing.component.BasePanel) VerticalLayout(org.jdesktop.swingx.VerticalLayout) ValueField(com.revolsys.swing.component.ValueField)

Example 10 with VerticalLayout

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

the class AbstractLayer method newPropertiesTabCoordinateSystem.

protected JPanel newPropertiesTabCoordinateSystem(final TabbedValuePanel tabPanel) {
    final GeometryFactory geometryFactory = getGeometryFactory();
    if (geometryFactory != null) {
        final JPanel panel = new JPanel(new VerticalLayout(5));
        tabPanel.addTab("Spatial", "world", panel);
        final JPanel extentPanel = Panels.titledTransparent("Extent");
        extentPanel.setLayout(new BorderLayout());
        final BoundingBox boundingBox = getBoundingBox();
        if (boundingBox == null || boundingBox.isEmpty()) {
            extentPanel.add(new JLabel("Unknown"), BorderLayout.CENTER);
        } else {
            final JLabel extentLabel = new JLabel("<html><table cellspacing=\"3\" style=\"margin:0px\">" + "<tr><td>&nbsp;</td><th style=\"text-align:left\">Top:</th><td style=\"text-align:right\">" + DataTypes.toString(boundingBox.getMaximum(1)) + "</td><td>&nbsp;</td></tr><tr>" + "<td><b>Left</b>: " + DataTypes.toString(boundingBox.getMinimum(0)) + "</td><td>&nbsp;</td><td>&nbsp;</td>" + "<td><b>Right</b>: " + DataTypes.toString(boundingBox.getMaximum(0)) + "</td></tr>" + "<tr><td>&nbsp;</td><th>Bottom:</th><td style=\"text-align:right\">" + DataTypes.toString(boundingBox.getMinimum(1)) + "</td><td>&nbsp;</td></tr><tr>" + "</tr></table></html>");
            extentLabel.setFont(SwingUtil.FONT);
            extentPanel.add(extentLabel, BorderLayout.CENTER);
            final int boundingBoxAxisCount = boundingBox.getAxisCount();
            final DefaultTableModel boundingBoxTableModel = new DefaultTableModel(new Object[] { "AXIS", "MIN", "MAX" }, 0);
            boundingBoxTableModel.addRow(new Object[] { "X", boundingBox.getMinX(), boundingBox.getMaxY() });
            boundingBoxTableModel.addRow(new Object[] { "Y", boundingBox.getMinY(), boundingBox.getMaxY() });
            if (boundingBoxAxisCount > 2) {
                boundingBoxTableModel.addRow(new Object[] { "Z", boundingBox.getMinZ(), boundingBox.getMaxZ() });
            }
            final JXTable boundingBoxTable = new JXTable(boundingBoxTableModel);
            boundingBoxTable.setVisibleRowCount(3);
            boundingBoxTable.setDefaultEditor(Object.class, null);
            boundingBoxTable.setDefaultRenderer(Object.class, new NumberTableCellRenderer());
            final JScrollPane boundingBoxScroll = new JScrollPane(boundingBoxTable);
            extentPanel.add(boundingBoxScroll, BorderLayout.EAST);
            boundingBoxTable.getColumnExt(0).setMaxWidth(31);
        }
        panel.add(extentPanel);
        final JPanel coordinateSystemPanel = Panels.titledTransparent("Coordinate System");
        final CoordinateSystem coordinateSystem = geometryFactory.getCoordinateSystem();
        if (coordinateSystem == null) {
            coordinateSystemPanel.add(new JLabel("Unknown"));
        } else {
            final int axisCount = geometryFactory.getAxisCount();
            SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "ID", coordinateSystem.getCoordinateSystemId(), 10);
            SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "axisCount", axisCount, 10);
            final double scaleX = geometryFactory.getScaleX();
            if (scaleX > 0) {
                SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "scaleX", scaleX, 10);
            } else {
                SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "scaleX", "Floating", 10);
            }
            final double scaleY = geometryFactory.getScaleXY();
            if (scaleY > 0) {
                SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "scaleY", scaleY, 10);
            } else {
                SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "scaleY", "Floating", 10);
            }
            if (axisCount > 2) {
                final double scaleZ = geometryFactory.getScaleZ();
                if (scaleZ > 0) {
                    SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "scaleZ", scaleZ, 10);
                } else {
                    SwingUtil.addLabelledReadOnlyTextField(coordinateSystemPanel, "scaleZ", "Floating", 10);
                }
            }
            SwingUtil.addLabel(coordinateSystemPanel, "ESRI WKT");
            final String wktFormatted = geometryFactory.toWktCsFormatted();
            final TextArea wktTextArea = new TextArea(wktFormatted, 10, 80);
            wktTextArea.setEditable(false);
            wktTextArea.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 11));
            coordinateSystemPanel.add(wktTextArea);
            GroupLayouts.makeColumns(coordinateSystemPanel, 2, true);
        }
        panel.add(coordinateSystemPanel);
        return panel;
    }
    return null;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) JXTable(org.jdesktop.swingx.JXTable) TextArea(java.awt.TextArea) CoordinateSystem(com.revolsys.geometry.cs.CoordinateSystem) DefaultTableModel(javax.swing.table.DefaultTableModel) JLabel(javax.swing.JLabel) ScrollableSizeHint(org.jdesktop.swingx.ScrollableSizeHint) Font(java.awt.Font) BorderLayout(java.awt.BorderLayout) BoundingBox(com.revolsys.geometry.model.BoundingBox) VerticalLayout(org.jdesktop.swingx.VerticalLayout) NumberTableCellRenderer(com.revolsys.swing.table.NumberTableCellRenderer)

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