Search in sources :

Example 21 with LayerGroup

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

the class GridLayer method zoomToSheet.

public void zoomToSheet() {
    final LayerGroup project = getProject();
    if (project != null) {
        final MapPanel map = getMapPanel();
        final RectangularMapGrid grid = getGrid();
        final String gridName = grid.getName();
        final String preferenceName = CaseConverter.toCapitalizedWords(gridName) + "Mapsheet";
        String mapsheet = PreferencesUtil.getString(getClass(), preferenceName);
        final String title = "Zoom to Mapsheet: " + getName();
        mapsheet = (String) JOptionPane.showInputDialog(map, new JLabel("<html><p>" + gridName + "</p><p>Enter mapsheet to zoom to.</p></html>"), title, JOptionPane.QUESTION_MESSAGE, null, null, mapsheet);
        zoomToSheet(mapsheet);
    }
}
Also used : MapPanel(com.revolsys.swing.map.MapPanel) JLabel(javax.swing.JLabel) LayerGroup(com.revolsys.swing.map.layer.LayerGroup) RectangularMapGrid(com.revolsys.gis.grid.RectangularMapGrid)

Example 22 with LayerGroup

use of com.revolsys.swing.map.layer.LayerGroup 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);
            }
        });
    }
}
Also used : LayerGroup(com.revolsys.swing.map.layer.LayerGroup) Layer(com.revolsys.swing.map.layer.Layer)

Example 23 with LayerGroup

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

the class MapGuideWebServer method actionAddLayer.

private static void actionAddLayer(final FeatureLayer layerDescription) {
    final Project project = Project.get();
    if (project != null) {
        LayerGroup layerGroup = project;
        final PathName layerPath = layerDescription.getPathName();
        for (final String groupName : layerPath.getParent().getElements()) {
            layerGroup = layerGroup.addLayerGroup(groupName);
        }
        final MapGuideWebServerRecordLayer layer = new MapGuideWebServerRecordLayer(layerDescription);
        layerGroup.addLayer(layer);
        if (AbstractLayer.isShowNewLayerTableView()) {
            layer.showTableView();
        }
    }
}
Also used : Project(com.revolsys.swing.map.layer.Project) LayerGroup(com.revolsys.swing.map.layer.LayerGroup) PathName(com.revolsys.io.PathName)

Example 24 with LayerGroup

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

the class ArcGisRestServer method actionAddRecordLayer.

static void actionAddRecordLayer(final FeatureLayer layerDescription) {
    final LayerGroup layerGroup = WebServiceConnectionTrees.getLayerGroup(layerDescription);
    if (layerGroup != null) {
        final ArcGisRestServerRecordLayer layer = new ArcGisRestServerRecordLayer(layerDescription);
        layerGroup.addLayer(layer);
        if (AbstractLayer.isShowNewLayerTableView()) {
            layer.showTableView();
        }
    }
}
Also used : BaseMapLayerGroup(com.revolsys.swing.map.layer.BaseMapLayerGroup) LayerGroup(com.revolsys.swing.map.layer.LayerGroup)

Example 25 with LayerGroup

use of com.revolsys.swing.map.layer.LayerGroup 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);
                }
            }
        }
    }
}
Also used : LayerGroup(com.revolsys.swing.map.layer.LayerGroup) AbstractLayer(com.revolsys.swing.map.layer.AbstractLayer) Layer(com.revolsys.swing.map.layer.Layer)

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