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);
}
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;
}
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);
}
}
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);
}
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);
}
Aggregations