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