net.simplace.ui.formengine.geotools.GeoObjectChooserPanel

Version: 1.0

This class provides de.schmitzm.swing.JPanel which shows several map layers and let the user choose a geo object from one specific layer. The selection result is provided by getSelectionResult() and depends on, whether a raster or a feature layer is set as selection layer (by setSelectionLayer(int)). The panel can be used to choose only one object (raster value or single org.opengis.feature.Feature) by single click or multiple objects (subset org.geotools.coverage.grid.GridCoverage2D or org.geotools.feature.FeatureCollection) by window selection. Use the setMultiSelectionEnabled(boolean) method to switch between these options. The default is false (only single selection).
The value ( double, org.geotools.coverage.grid.GridCoverage2D, org.opengis.feature.Feature, org.geotools.feature.FeatureCollection selected by the user is provided by the getSelectionResult() method; the selected range by getSelectionRange().
Informations about map control: In addition to the map, the panel contains a de.schmitzm.geotools.gui.MapPaneStatusBar to show the geo coordinates and the raster value the mouse moves over. In contrast to the default de.schmitzm.geotools.gui.MapPaneStatusBar, not the raster values of the upper visible layer are shown, but of the selection layer always.


public class GeoObjectChooserPanel extends de.schmitzm.swing.JPanel implements
de.schmitzm.geotools.map.event.JMapPaneListener {
// Public Constructors
public GeoObjectChooserPanel(Element aFormElement, FWObservable aObservable);
public GeoObjectChooserPanel(boolean aMultiSelection, Element aFormElement,
FWObservable aObservable);

// Protected Instance Variables
protected boolean iMultiSelection;
protected FWAtlasMapPanel iAtlasMapPanel;
protected GeoMapPane iMapPane;
protected MapPaneToolBar iToolBar;
protected MapPaneStatusBar iMapPaneStatusBar;
protected MapLayer iSelectionLayer;
protected Object iSelectionResult;
protected Object iSelectionRange;
protected int TOOL_SELECT_ON_MAP;
protected FWObservable iObservable;
protected Element iFormElement;
protected XMapPaneTool GEOCHOOSER_MULTI_TOOL;
protected XMapPaneTool GEOCHOOSER_SINGLE_TOOL;

// Public Instance Methods
public int getSelectTool();

Returns the ID of the new tool "Select on map", added to the atlas visualization tool bar.
returns the selected tool
public SelectableXMapPane getMapPane();


returns the {@link SelectableXMapPane} the layer are displayed in.
public FWAtlasMapPanel getAtlasPanel();


returns the {@link FWAtlasMapPanel} the layer are displayed in.
public MapContext getMapContext();


returns the {@link MapContext} the layer can be put in.
public MapLayer getSelectionLayer();

Returns the layer the selection is made on.
returns {@code null} if no selection layer is specified yet
public void setSelectionLayer(MapLayer aLayer);

Sets the layer the selection is made on.
public void setSelectionLayer(int aLayerIdx);

Sets the layer the selection is made on.
public void setMultiSelectionEnabled(boolean aMultiSelection);

Sets whether the dialog can be used to choose more than one object.
public boolean isMultiSelectionEnabled();


returns Checks whether the dialog can be used to choose more than one object.
public Object getSelectionResult();

Returns the geo object(s) of the last user selection. Returns
  1. a single double value, if multi selection is disabled and the selection layer is a raster layer.
  2. a single Feature, if multi selection is disabled and the selection layer is a vector layer.
  3. a subset GridCoverage2D, if multi selection is enabled and the selection layer is a raster layer.
  4. a FeatureCollection, if multi selection is enabled and the selection layer is a vector layer.

returns {@code null} is no selection layer is specified or no selection if performed yet
public Object getSelectionRange();

Returns the bounds of the last user selection. Returns
  1. a java.awt.geom.Point2D with map coordinates, if multi selection is disabled.
  2. a com.vividsolutions.jts.geom.Envelope with map bounds, if multi selection is enabled.

returns {@code null} is no selection layer is specified or no selection if performed yet
public void performMapPaneEvent(XMapPaneEvent e); // From
de.schmitzm.geotools.map.event.JMapPaneListener


Performs the map actions (selection) initiated by the user.

// Protected Instance Methods
protected void performSelectTool();

Sets the cursor to de.schmitzm.swing.SwingUtil.CROSSHAIR_CURSOR and the selection functionality of the map pane by calling net.simplace.ui.formengine.geotools.GeoObjectChooserPanel.setMultiSelectionEnabled(boolean).
protected void initializeMaps();

initializes the Maps in GeoObjectChooser
protected void performSelection();

Is called after a selection is made. Does nothing. Sub classes can override this method to react on selections individually.


}



Hierarchy: java.lang.Object - java.awt.Component (java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) - java.awt.Container - javax.swing.JComponent (java.io.Serializable, javax.swing.TransferHandler.HasGetTransferHandler) - javax.swing.JPanel (javax.accessibility.Accessible) - de.schmitzm.swing.JPanel (de.schmitzm.swing.Disposable) - GeoObjectChooserPanel (de.schmitzm.geotools.map.event.JMapPaneListener)



Extended by: AbstractMapChooserPanel



Type of: GeoObjectChooser.choosePanel, net.simplace.ui.formengine.fuzzy.FWFuzzyResultFormComponentPanel.iGeoObjectChooserPanel, net.simplace.ui.formengine.fuzzy.FWFuzzyFormComponent.iGeoObjectChooserPanel, FWMapChoiceFormComponent.iGeoObjectChooserPanel