use of com.revolsys.swing.map.layer.record.AbstractRecordLayer 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);
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer 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;
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer 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));
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer in project com.revolsys.open by revolsys.
the class OsmProxyLayerRecord method getRecordProxied.
@Override
protected LayerRecord getRecordProxied() {
final Identifier identifier = getIdentifier();
final OsmElement record = this.document.getRecord(identifier);
final AbstractRecordLayer layer = getLayer();
return new ArrayLayerRecord(layer, record);
}
use of com.revolsys.swing.map.layer.record.AbstractRecordLayer in project com.revolsys.open by revolsys.
the class AbstractOverlay method hasSnapPoint.
protected boolean hasSnapPoint() {
this.snapPoint = null;
this.snapEventX = MouseOverlay.getEventX();
this.snapEventY = MouseOverlay.getEventY();
this.snapCentre = MouseOverlay.getEventPoint();
final double snapCentreX = this.snapCentre.getX();
final double snapCentreY = this.snapCentre.getY();
final double maxDistance = this.viewport.getHotspotMapUnits();
final BoundingBox boundingBox = this.snapCentre.getBoundingBox().expand(maxDistance);
final GeometryFactory geometryFactory = getViewportGeometryFactory2d();
final Map<Point, Set<CloseLocation>> snapLocations = new HashMap<>();
final List<AbstractRecordLayer> layers = getSnapLayers();
for (final AbstractRecordLayer layer : layers) {
final List<LayerRecord> records = layer.getRecordsBackground(boundingBox);
for (final LayerRecord record : records) {
if (layer.isVisible(record)) {
final Geometry recordGeometry = record.getGeometry();
final CloseLocation closeLocation = this.map.findCloseLocation(geometryFactory, layer, record, recordGeometry, snapCentreX, snapCentreY, maxDistance);
if (closeLocation != null) {
final Point closePoint = closeLocation.getViewportPoint();
Maps.addToSet(snapLocations, closePoint, closeLocation);
}
}
}
}
return setSnapLocations(snapLocations);
}
Aggregations