Search in sources :

Example 46 with AbstractRecordLayer

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

the class SetRecordsFieldValue method initFieldPanel.

@Override
protected JPanel initFieldPanel() {
    final FieldDefinition fieldDefinition = this.getFieldDefinition();
    final JPanel fieldPanel = new JPanel();
    final String fieldName = fieldDefinition.getName();
    final AbstractRecordLayer layer = getLayer();
    this.editField = RecordLayerFields.newFormField(layer, fieldName, true);
    Property.addListenerNewValue(this.editField, fieldName, (newValue) -> {
        validateField(this.editField, fieldDefinition);
    });
    Property.addListenerNewValue(this.editField, "text", (newValue) -> {
        validateField(this.editField, fieldDefinition);
    });
    fieldPanel.add((Component) this.editField);
    GroupLayouts.makeColumns(fieldPanel, 1, true);
    return fieldPanel;
}
Also used : JPanel(javax.swing.JPanel) FieldDefinition(com.revolsys.record.schema.FieldDefinition) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Example 47 with AbstractRecordLayer

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

the class AbstractRecordLayerRenderer method wrapWithScaleStyle.

public ScaleMultipleRenderer wrapWithScaleStyle() {
    final AbstractRecordLayer layer = getLayer();
    final AbstractMultipleRenderer parent = (AbstractMultipleRenderer) getParent();
    final ScaleMultipleRenderer newRenderer = new ScaleMultipleRenderer(layer, parent);
    wrap(layer, parent, newRenderer);
    return newRenderer;
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Example 48 with AbstractRecordLayer

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

the class TextStylePanel method newField.

@Override
protected Field newField(final String fieldName, final Class<?> fieldClass, final Object value) {
    if (fieldName.equals("textName")) {
        final AbstractRecordLayer layer = getLayer();
        final TextNameField textNameField = new TextNameField(layer, fieldName, value);
        Property.addListener(textNameField, fieldName, this);
        return textNameField;
    } else {
        return super.newField(fieldName, fieldClass, value);
    }
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Example 49 with AbstractRecordLayer

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

the class RecordLayerTable method initializeColumnPreferredWidth.

@Override
protected void initializeColumnPreferredWidth(final TableColumn column) {
    final int columnIndex = column.getModelIndex();
    final String fieldName = getColumnFieldName(columnIndex);
    if (fieldName != null) {
        final AbstractRecordLayer layer = getLayer();
        final int width = layer.getFieldColumnWidth(fieldName);
        if (width >= 0) {
            column.setWidth(width);
            column.setPreferredWidth(width);
        } else {
            super.initializeColumnPreferredWidth(column);
        }
    }
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Example 50 with AbstractRecordLayer

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

the class ModeAllList method activate.

@Override
public void activate() {
    final AbstractRecordLayer layer = getLayer();
    addListeners(Property.addListenerNewValueSource(layer, AbstractRecordLayer.RECORDS_INSERTED, // 
    this::addCachedRecords), // 
    newRecordsDeletedListener(layer));
    for (final String propertyName : new String[] { "filter", AbstractRecordLayer.RECORDS_CHANGED }) {
        addListeners(Property.addListenerRunnable(layer, propertyName, this::refresh));
    }
    super.activate();
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Aggregations

AbstractRecordLayer (com.revolsys.swing.map.layer.record.AbstractRecordLayer)71 LayerRecord (com.revolsys.swing.map.layer.record.LayerRecord)35 Geometry (com.revolsys.geometry.model.Geometry)9 ArrayList (java.util.ArrayList)8 AbstractLayer (com.revolsys.swing.map.layer.AbstractLayer)7 Layer (com.revolsys.swing.map.layer.Layer)7 List (java.util.List)7 Record (com.revolsys.record.Record)6 Condition (com.revolsys.record.query.Condition)6 LayerGroup (com.revolsys.swing.map.layer.LayerGroup)6 CloseLocation (com.revolsys.swing.map.overlay.CloseLocation)4 Color (java.awt.Color)4 BoundingBox (com.revolsys.geometry.model.BoundingBox)3 Point (com.revolsys.geometry.model.Point)3 Field (com.revolsys.swing.field.Field)3 LayerRecordMenu (com.revolsys.swing.map.layer.record.LayerRecordMenu)3 WebColors (com.revolsys.awt.WebColors)2 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)2 Identifier (com.revolsys.identifier.Identifier)2 FieldDefinition (com.revolsys.record.schema.FieldDefinition)2