Search in sources :

Example 11 with LayerGroup

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

the class MacApplicationListenerHandler method openFiles.

private void openFiles(final Object event) {
    final List<File> files = Property.getSimple(event, "files");
    final LayerGroup layerGroup = Project.get();
    if (layerGroup != null) {
        layerGroup.openFiles(files);
    }
}
Also used : LayerGroup(com.revolsys.swing.map.layer.LayerGroup) File(java.io.File)

Example 12 with LayerGroup

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

the class SelectRecordsOverlay method unSelectRecords.

public void unSelectRecords(final BoundingBox boundingBox) {
    final LayerGroup project = getProject();
    unSelectRecords(project, boundingBox);
    final LayerRendererOverlay overlay = getMap().getLayerOverlay();
    overlay.redraw();
}
Also used : LayerGroup(com.revolsys.swing.map.layer.LayerGroup) LayerRendererOverlay(com.revolsys.swing.map.overlay.LayerRendererOverlay)

Example 13 with LayerGroup

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

the class SelectRecordsOverlay method unSelectRecords.

private void unSelectRecords(final LayerGroup group, final BoundingBox boundingBox) {
    final double scale = getViewportScale();
    final List<Layer> layers = group.getLayers();
    Collections.reverse(layers);
    for (final Layer layer : layers) {
        if (layer instanceof LayerGroup) {
            final LayerGroup childGroup = (LayerGroup) layer;
            unSelectRecords(childGroup, boundingBox);
        } else if (layer instanceof AbstractRecordLayer) {
            final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
            if (recordLayer.isSelectable(scale)) {
                recordLayer.unSelectRecords(boundingBox);
            }
        }
    }
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) LayerGroup(com.revolsys.swing.map.layer.LayerGroup) Layer(com.revolsys.swing.map.layer.Layer) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) AbstractLayer(com.revolsys.swing.map.layer.AbstractLayer)

Example 14 with LayerGroup

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

the class SelectRecordsOverlay method addSelectedRecords.

private void addSelectedRecords(final LayerGroup group, final BoundingBox boundingBox) {
    final double scale = getViewportScale();
    final List<Layer> layers = group.getLayers();
    Collections.reverse(layers);
    for (final Layer layer : layers) {
        if (layer instanceof LayerGroup) {
            final LayerGroup childGroup = (LayerGroup) layer;
            addSelectedRecords(childGroup, boundingBox);
        } else if (layer instanceof AbstractRecordLayer) {
            final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
            if (recordLayer.isSelectable(scale)) {
                recordLayer.addSelectedRecords(boundingBox);
            }
        }
    }
}
Also used : AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) LayerGroup(com.revolsys.swing.map.layer.LayerGroup) Layer(com.revolsys.swing.map.layer.Layer) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) AbstractLayer(com.revolsys.swing.map.layer.AbstractLayer)

Example 15 with LayerGroup

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

the class SelectRecordsOverlay method refreshImageRenderer.

private void refreshImageRenderer(final ImageViewport viewport, final LayerGroup layerGroup) {
    for (final Layer layer : layerGroup.getLayers()) {
        if (layer instanceof LayerGroup) {
            final LayerGroup childGroup = (LayerGroup) layer;
            refreshImageRenderer(viewport, childGroup);
        } else if (layer instanceof AbstractRecordLayer) {
            final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
            final AbstractRecordLayerRenderer layerRenderer = layer.getRenderer();
            if (recordLayer.isSelectable()) {
                final List<LayerRecord> selectedRecords = recordLayer.getSelectedRecords();
                for (final LayerRecord record : selectedRecords) {
                    if (record != null && recordLayer.isVisible(record)) {
                        if (!recordLayer.isDeleted(record)) {
                            layerRenderer.renderSelectedRecord(viewport, recordLayer, record);
                        }
                    }
                }
            }
        }
    }
}
Also used : AbstractRecordLayerRenderer(com.revolsys.swing.map.layer.record.renderer.AbstractRecordLayerRenderer) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) List(java.util.List) ArrayList(java.util.ArrayList) LayerGroup(com.revolsys.swing.map.layer.LayerGroup) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord) Layer(com.revolsys.swing.map.layer.Layer) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer) AbstractLayer(com.revolsys.swing.map.layer.AbstractLayer)

Aggregations

LayerGroup (com.revolsys.swing.map.layer.LayerGroup)30 Layer (com.revolsys.swing.map.layer.Layer)16 AbstractLayer (com.revolsys.swing.map.layer.AbstractLayer)13 AbstractRecordLayer (com.revolsys.swing.map.layer.record.AbstractRecordLayer)7 ArrayList (java.util.ArrayList)7 BaseTreeNode (com.revolsys.swing.tree.BaseTreeNode)5 List (java.util.List)5 LayerRecord (com.revolsys.swing.map.layer.record.LayerRecord)4 Geometry (com.revolsys.geometry.model.Geometry)3 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)3 PathName (com.revolsys.io.PathName)3 LayerRendererOverlay (com.revolsys.swing.map.overlay.LayerRendererOverlay)3 BaseMapLayerGroup (com.revolsys.swing.map.layer.BaseMapLayerGroup)2 Project (com.revolsys.swing.map.layer.Project)2 File (java.io.File)2 LinkedList (java.util.LinkedList)2 BoundingBox (com.revolsys.geometry.model.BoundingBox)1 RectangularMapGrid (com.revolsys.gis.grid.RectangularMapGrid)1 BaseCloseable (com.revolsys.io.BaseCloseable)1 RecordStore (com.revolsys.record.schema.RecordStore)1