Search in sources :

Example 11 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordLayerTablePanel method mouseClicked.

@Override
public void mouseClicked(final MouseEvent e) {
    super.mouseClicked(e);
    if (e.getClickCount() == 2 && SwingUtilities.isLeftMouseButton(e)) {
        if (isEditing()) {
            final JTable table = getTable();
            final TableCellEditor cellEditor = table.getCellEditor();
            cellEditor.stopCellEditing();
        }
        final LayerRecord record = RecordRowTable.getEventRecord();
        this.layer.showForm(record);
    }
}
Also used : JTable(javax.swing.JTable) RecordTableCellEditor(com.revolsys.swing.table.record.editor.RecordTableCellEditor) TableCellEditor(javax.swing.table.TableCellEditor) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Example 12 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordLayerHighlightedListSelectionModel method removeSelectionInterval.

@Override
public void removeSelectionInterval(final int index0, final int index1) {
    super.removeSelectionInterval(convertRowIndexToModel(index0), convertRowIndexToModel(index1));
    final List<LayerRecord> records = getObjects(index0, index1);
    final AbstractRecordLayer layer = this.model.getLayer();
    layer.unHighlightRecords(records);
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Example 13 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordLayerHighlightedListSelectionModel method isSelectedIndex.

@Override
public boolean isSelectedIndex(final int index) {
    final int rowIndex = convertRowIndexToModel(index);
    final LayerRecord record = this.model.getRecord(rowIndex);
    if (record != null) {
        final AbstractRecordLayer layer = this.model.getLayer();
        return layer.isHighlighted(record);
    }
    return false;
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Example 14 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordLayerHighlightedListSelectionModel method getObjects.

protected List<LayerRecord> getObjects(final int index0, final int index1) {
    final List<LayerRecord> records = new ArrayList<>();
    for (int i = index0; i <= index1; i++) {
        final int rowIndex = convertRowIndexToModel(i);
        final LayerRecord record = this.model.getRecord(rowIndex);
        records.add(record);
    }
    return records;
}
Also used : ArrayList(java.util.ArrayList) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Example 15 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordLayerHighlightedListSelectionModel method setSelectionInterval.

@Override
public void setSelectionInterval(final int index0, final int index1) {
    final List<LayerRecord> records = getObjects(index0, index1);
    final AbstractRecordLayer layer = this.model.getLayer();
    layer.setHighlightedRecords(records);
    super.setSelectionInterval(convertRowIndexToModel(index0), convertRowIndexToModel(index1));
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Aggregations

LayerRecord (com.revolsys.swing.map.layer.record.LayerRecord)79 AbstractRecordLayer (com.revolsys.swing.map.layer.record.AbstractRecordLayer)34 Geometry (com.revolsys.geometry.model.Geometry)15 IdentifierProxyLayerRecord (com.revolsys.swing.map.layer.record.IdentifierProxyLayerRecord)15 NewProxyLayerRecord (com.revolsys.swing.map.layer.record.NewProxyLayerRecord)15 BoundingBox (com.revolsys.geometry.model.BoundingBox)11 Record (com.revolsys.record.Record)11 ArrayList (java.util.ArrayList)11 List (java.util.List)10 Test (org.junit.Test)10 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)7 Point (com.revolsys.geometry.model.Point)6 Condition (com.revolsys.record.query.Condition)4 LayerRecordMenu (com.revolsys.swing.map.layer.record.LayerRecordMenu)4 CloseLocation (com.revolsys.swing.map.overlay.CloseLocation)4 RecordRowTable (com.revolsys.swing.table.record.RecordRowTable)4 LineString (com.revolsys.geometry.model.LineString)3 RecordDefinition (com.revolsys.record.schema.RecordDefinition)3 AbstractLayer (com.revolsys.swing.map.layer.AbstractLayer)3 Layer (com.revolsys.swing.map.layer.Layer)3