Search in sources :

Example 26 with AbstractRecordLayer

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

the class AbstractMultipleRenderer method addAddMenuItem.

protected static void addAddMenuItem(final MenuFactory menu, final String type, final BiFunction<AbstractRecordLayer, AbstractMultipleRenderer, AbstractRecordLayerRenderer> rendererFactory) {
    final String iconName = ("style_" + type + ":add").toLowerCase();
    final String name = "Add " + type + " Style";
    Menus.addMenuItem(menu, "add", name, iconName, (final AbstractMultipleRenderer parentRenderer) -> {
        final AbstractRecordLayer layer = parentRenderer.getLayer();
        final AbstractRecordLayerRenderer newRenderer = rendererFactory.apply(layer, parentRenderer);
        parentRenderer.addRendererEdit(newRenderer);
    }, false);
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Example 27 with AbstractRecordLayer

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

the class AbstractMultipleRenderer method convertToFilterStyle.

public FilterMultipleRenderer convertToFilterStyle() {
    final AbstractRecordLayer layer = getLayer();
    final List<AbstractRecordLayerRenderer> renderers = getRenderers();
    final AbstractMultipleRenderer parent = (AbstractMultipleRenderer) getParent();
    final Map<String, Object> style = toMap();
    style.remove("styles");
    final FilterMultipleRenderer newRenderer = new FilterMultipleRenderer(layer, parent);
    newRenderer.setProperties(style);
    newRenderer.setRenderers(JavaBeanUtil.clone(renderers));
    final String name = getName();
    if (name.equals("Multiple Style")) {
        newRenderer.setName("Filter Style");
    } else if (name.equals("Scale Style")) {
        newRenderer.setName("Filter Style");
    }
    replace(layer, parent, newRenderer);
    return newRenderer;
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Example 28 with AbstractRecordLayer

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

the class RecordLayerListSelectionModel method setSelectionInterval.

@Override
public void setSelectionInterval(int index0, final int index1) {
    if (index0 == -1 || index1 == -1) {
        return;
    } else if (getSelectionMode() == SINGLE_SELECTION) {
        index0 = index1;
    }
    final boolean valueIsAdjusting = getValueIsAdjusting();
    try {
        setValueIsAdjusting(true);
        final List<LayerRecord> records = getRecords(index0, index1);
        final AbstractRecordLayer layer = this.model.getLayer();
        layer.setSelectedRecords(records);
        super.setSelectionInterval(index0, index1);
    } finally {
        setValueIsAdjusting(valueIsAdjusting);
    }
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Example 29 with AbstractRecordLayer

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

the class ModeAbstractCached method exportRecords.

@Override
public void exportRecords(final Query query, final Object target) {
    final Condition filter = query.getWhereCondition();
    final Map<? extends CharSequence, Boolean> orderBy = query.getOrderBy();
    final AbstractRecordLayer layer = getLayer();
    final Iterable<LayerRecord> records = new ListByIndexIterator<>(this.records);
    layer.exportRecords(records, filter, orderBy, target);
}
Also used : Condition(com.revolsys.record.query.Condition) ListByIndexIterator(com.revolsys.collection.list.ListByIndexIterator) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Example 30 with AbstractRecordLayer

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

the class ModeAbstractCached method activate.

@Override
public void activate() {
    this.selectionModel = newSelectionModel(this.model);
    final AbstractRecordLayer layer = getLayer();
    final PropertyChangeListener recordFieldListener = this::recordFieldChanged;
    layer.addPropertyChangeListener(recordFieldListener);
    addListeners(Property.addListenerNewValueSource(layer, AbstractRecordLayer.RECORD_UPDATED, // 
    this::recordUpdated), recordFieldListener);
}
Also used : PropertyChangeListener(java.beans.PropertyChangeListener) 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