本文整理了Java中org.orbisgis.view.background.ZoomToSelection
类的一些代码示例,展示了ZoomToSelection
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoomToSelection
类的具体详情如下:
包路径:org.orbisgis.view.background.ZoomToSelection
类名称:ZoomToSelection
[英]Zoom to provided layer selection
[中]缩放到提供的图层选择
代码示例来源:origin: org.orbisgis/mapeditor
/**
* The user click on the button Zoom to selection
*/
public void onZoomToAllSelection() {
ArrayList<ILayer> selectedLayers = new ArrayList<ILayer>();
for (ILayer iLayer : mapContext.getLayers()) {
if (!iLayer.getSelection().isEmpty()) {
selectedLayers.add(iLayer);
}
}
if (!selectedLayers.isEmpty()) {
BackgroundManager bm = Services.getService(BackgroundManager.class);
bm.backgroundOperation(new ZoomToSelection(mapContext, selectedLayers.toArray(new ILayer[selectedLayers.size()])));
} else {
GUILOGGER.warn(I18N.tr("There is any selection available."));
}
}
代码示例来源:origin: org.orbisgis/orbisgis-view
@Override
public void run(ProgressMonitor pm) {
try {
Envelope selectionEnvelope = new Envelope();
for(ILayer layer : layers) {
if(layer.isVisible()) {
Set<Long> data = layer.getSelection();
if(!data.isEmpty()){
Envelope layerEnv = getLayerSelectionEnvelope(pm, data, layer.getTableReference());
if(layerEnv!=null) {
selectionEnvelope.expandToInclude(layerEnv);
}
if(pm.isCancelled()) {
return;
}
}
}
}
if(!selectionEnvelope.isNull()) {
mapContext.setBoundingBox(selectionEnvelope);
}
} catch (SQLException ex ){
LOGGER.error(ex.getLocalizedMessage(), ex);
}
}
代码示例来源:origin: org.orbisgis/toc
/**
* The user click on the Zoom To Layer selection menu
*/
public void zoomToLayerSelection() {
ILayer[] selectedLayers = mapContext.getSelectedLayers();
ZoomToSelection zoomJob = new ZoomToSelection(mapContext, selectedLayers);
BackgroundManager bm = Services.getService(BackgroundManager.class);
bm.backgroundOperation(zoomJob);
}
/**
代码示例来源:origin: org.orbisgis/mapeditor
/**
* Zoom on selected geometries of each selected layers
*/
public void onZoomToLayerSelection(){
ILayer[] selectedLayers = getMapControl().getToolManager().getSelectedLayerAndStyle();
// Loop through all selected layers.
if (selectedLayers == null || selectedLayers.length == 0) {
GUILOGGER.warn(I18N.tr("Please select a layer or a style in the TOC"));
} else {
BackgroundManager bm = Services.getService(BackgroundManager.class);
bm.backgroundOperation(new ZoomToSelection(mapContext, selectedLayers));
}
}
内容来源于网络,如有侵权,请联系作者删除!