use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class SelectRecordsOverlay method refreshImageSelectedAndHighlighted.
private void refreshImageSelectedAndHighlighted(final ImageViewport viewport, final Graphics2D graphics, final LayerGroup layerGroup) {
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
final GeometryFactory viewportGeometryFactory = getViewportGeometryFactory2d();
final List<Geometry> highlightedGeometries = new ArrayList<>();
for (final Layer layer : layerGroup.getLayers()) {
if (layer instanceof LayerGroup) {
final LayerGroup childGroup = (LayerGroup) layer;
refreshImageSelectedAndHighlighted(viewport, graphics, childGroup);
} else if (layer instanceof AbstractRecordLayer) {
final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
if (recordLayer.isSelectable()) {
final List<LayerRecord> selectedRecords = recordLayer.getSelectedRecords();
for (final LayerRecord record : selectedRecords) {
if (record != null && recordLayer.isVisible(record)) {
if (!recordLayer.isDeleted(record)) {
final Geometry geometry = record.getGeometry();
if (recordLayer.isHighlighted(record)) {
highlightedGeometries.add(geometry);
} else {
this.selectRenderer.paintSelected(viewport, graphics, viewportGeometryFactory, geometry);
}
}
}
}
}
}
}
for (final Geometry geometry : highlightedGeometries) {
this.highlightRenderer.paintSelected(viewport, graphics, viewportGeometryFactory, geometry);
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class ProjectFrame method expandLayers.
public void expandLayers(final Layer layer) {
if (layer != null) {
Invoke.later(() -> {
final LayerGroup group;
if (layer instanceof LayerGroup) {
group = (LayerGroup) layer;
} else {
group = layer.getLayerGroup();
}
if (group != null) {
final List<Layer> layerPath = group.getPathList();
this.tocTree.expandPath(layerPath);
}
});
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class ProjectFrame method loadProjectAfter.
protected void loadProjectAfter() {
this.bottomTabLayerPaths = Sets.newLinkedHash(this.project.<Collection<String>>getProperty("bottomTabLayerPaths"));
// TODO cleanup on save
this.project.setProperty("bottomTabLayerPaths", this.bottomTabLayerPaths);
for (final Iterator<String> iterator = this.bottomTabLayerPaths.iterator(); iterator.hasNext(); ) {
final String layerPath = iterator.next();
final Layer layer = this.project.getLayerByPath(layerPath);
if (layer == null) {
iterator.remove();
} else {
Invoke.later(layer::showTableView);
}
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class AbstractRecordLayer method addVisibleLayers.
public static void addVisibleLayers(final List<AbstractRecordLayer> layers, final LayerGroup group, final double scale) {
if (group.isExists() && group.isVisible(scale)) {
for (final Layer layer : group) {
if (layer instanceof LayerGroup) {
final LayerGroup layerGroup = (LayerGroup) layer;
addVisibleLayers(layers, layerGroup, scale);
} else if (layer instanceof AbstractRecordLayer) {
if (layer.isExists() && layer.isVisible(scale)) {
final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
layers.add(recordLayer);
}
}
}
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class LayerGroupListModel method setSelectedItem.
@Override
public void setSelectedItem(final Object selectedItem) {
if (selectedItem instanceof Layer) {
final Layer layer = (Layer) selectedItem;
if (this.selectedItem != layer) {
this.selectedItem = layer;
final int index = this.group.indexOf(layer);
fireContentsChanged(layer, index, index);
}
}
}
Aggregations