Search in sources :

Example 6 with BaseJTable

use of com.revolsys.swing.table.BaseJTable in project com.revolsys.open by revolsys.

the class LabelCountMapTableModel method selectLabelCountCell.

public void selectLabelCountCell(final CharSequence label, final CharSequence countName) {
    this.selectedLabel = label.toString();
    this.selectedCountName = countName.toString();
    final BaseJTable table = getTable();
    table.repaint();
}
Also used : BaseJTable(com.revolsys.swing.table.BaseJTable)

Example 7 with BaseJTable

use of com.revolsys.swing.table.BaseJTable in project com.revolsys.open by revolsys.

the class LambdaTableModel method newTable.

@Override
public BaseJTable newTable() {
    final BaseJTable table = super.newTable();
    applyTableColumnSettings(table);
    return table;
}
Also used : BaseJTable(com.revolsys.swing.table.BaseJTable)

Example 8 with BaseJTable

use of com.revolsys.swing.table.BaseJTable in project com.revolsys.open by revolsys.

the class LayerRecordTableModel method newTablePanel.

public TablePanel newTablePanel() {
    final LayerRecordForm form = this.form.get();
    final BaseJTable table = AbstractSingleRecordTableModel.newTable(this);
    FormAllFieldsModifiedPredicate.add(form, table);
    FormAllFieldsErrorPredicate.add(form, table);
    final TableColumnModel columnModel = table.getColumnModel();
    for (int i = 0; i < columnModel.getColumnCount(); i++) {
        final TableColumn column = columnModel.getColumn(i);
        if (i == 2) {
            final TableCellEditor cellEditor = column.getCellEditor();
            cellEditor.addCellEditorListener(form);
        }
    }
    final TablePanel tablePanel = new TablePanel(table);
    final ToolBar toolBar = tablePanel.getToolBar();
    toolBar.addComponent("default", this.fieldNamesSetNamesField);
    toolBar.addButtonTitleIcon("default", "Edit Field Sets", "fields_filter_edit", () -> {
        final String fieldNamesSetName = FieldNamesSetPanel.showDialog(this.layer);
        if (Property.hasValue(fieldNamesSetName)) {
            this.fieldNamesSetNamesField.setFieldValue(fieldNamesSetName);
        }
    });
    int maxHeight = 500;
    for (final GraphicsDevice device : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) {
        final GraphicsConfiguration graphicsConfiguration = device.getDefaultConfiguration();
        final Rectangle bounds = graphicsConfiguration.getBounds();
        maxHeight = Math.min(bounds.height, maxHeight);
    }
    final int preferredHeight = Math.min(maxHeight, (this.getRowCount() + 1) * 20 + 45);
    tablePanel.setMinimumSize(new Dimension(100, preferredHeight));
    tablePanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, maxHeight));
    tablePanel.setPreferredSize(new Dimension(800, preferredHeight));
    return tablePanel;
}
Also used : LayerRecordForm(com.revolsys.swing.map.form.LayerRecordForm) Rectangle(java.awt.Rectangle) TableColumnModel(javax.swing.table.TableColumnModel) Dimension(java.awt.Dimension) TableColumn(javax.swing.table.TableColumn) GraphicsConfiguration(java.awt.GraphicsConfiguration) GraphicsDevice(java.awt.GraphicsDevice) BaseJTable(com.revolsys.swing.table.BaseJTable) ToolBar(com.revolsys.swing.toolbar.ToolBar) TableCellEditor(javax.swing.table.TableCellEditor) TablePanel(com.revolsys.swing.table.TablePanel)

Example 9 with BaseJTable

use of com.revolsys.swing.table.BaseJTable in project com.revolsys.open by revolsys.

the class AbstractRecordLayer method newPropertiesPanelFields.

protected void newPropertiesPanelFields(final TabbedValuePanel propertiesPanel) {
    final RecordDefinition recordDefinition = getRecordDefinition();
    final BaseJTable fieldTable = RecordDefinitionTableModel.newTable(recordDefinition);
    final BasePanel fieldPanel = new BasePanel(new BorderLayout());
    fieldPanel.setPreferredSize(new Dimension(500, 400));
    final JScrollPane fieldScroll = new JScrollPane(fieldTable);
    fieldPanel.add(fieldScroll, BorderLayout.CENTER);
    propertiesPanel.addTab("Fields", fieldPanel);
}
Also used : JScrollPane(javax.swing.JScrollPane) BasePanel(com.revolsys.swing.component.BasePanel) BorderLayout(java.awt.BorderLayout) BaseJTable(com.revolsys.swing.table.BaseJTable) Dimension(java.awt.Dimension) RecordDefinition(com.revolsys.record.schema.RecordDefinition)

Example 10 with BaseJTable

use of com.revolsys.swing.table.BaseJTable in project com.revolsys.open by revolsys.

the class RecordDefinitionTableModel method newTable.

public static BaseJTable newTable(final RecordDefinition recordDefinition) {
    if (recordDefinition == null) {
        return null;
    } else {
        final RecordDefinitionTableModel model = new RecordDefinitionTableModel(recordDefinition);
        final BaseJTable table = new BaseJTable(model);
        table.resizeColumnsToContent();
        return table;
    }
}
Also used : BaseJTable(com.revolsys.swing.table.BaseJTable)

Aggregations

BaseJTable (com.revolsys.swing.table.BaseJTable)15 TableColumnExt (org.jdesktop.swingx.table.TableColumnExt)5 TablePanel (com.revolsys.swing.table.TablePanel)4 Dimension (java.awt.Dimension)3 TableColumn (javax.swing.table.TableColumn)3 RecordDefinition (com.revolsys.record.schema.RecordDefinition)2 JToolBar (javax.swing.JToolBar)2 TableColumnModel (javax.swing.table.TableColumnModel)2 WebColors (com.revolsys.awt.WebColors)1 PropertyChangeSupport (com.revolsys.beans.PropertyChangeSupport)1 NumericComparator (com.revolsys.comparator.NumericComparator)1 SwingUtil (com.revolsys.swing.SwingUtil)1 TabbedPane (com.revolsys.swing.TabbedPane)1 BasePanel (com.revolsys.swing.component.BasePanel)1 LayerRecordForm (com.revolsys.swing.map.form.LayerRecordForm)1 BaseJPopupMenu (com.revolsys.swing.menu.BaseJPopupMenu)1 MenuFactory (com.revolsys.swing.menu.MenuFactory)1 AbstractTableModel (com.revolsys.swing.table.AbstractTableModel)1 ColorHighlighter (com.revolsys.swing.table.highlighter.ColorHighlighter)1 RecordRowTable (com.revolsys.swing.table.record.RecordRowTable)1