net.simplace.ui.formengine.geotools.AbstractMapChooserPanel
Version: 1.0
This class provides javax.swing.JPanel which shows several map layers and
let the user choose some points.
After each selection the point is marked in a special top layer. The
current selection can be accessed by getSelection() and
getSelectionFeatureCollection() and maintained by clearSelection()
and undoSelection().
Informations about map control:
- Zoom-in: mouse wheel
- Zoom-out: right click or mouse wheel
- Move map: right drag
- Point selection: left click
public abstract class AbstractMapChooserPanel extends GeoObjectChooserPanel {
// Public Constructors
public AbstractMapChooserPanel(Element aFormElement, FWObservable
aObservable);
// Constants
public static final StyleBuilder STYLE_BUILDER;
public static final GeometryFactory GEOMETRY_FACTORY;
// Protected Instance Variables
protected Category cCat;
protected ArrayList iSelectionObjects;
protected ArrayList iRedoObjects;
protected SimpleFeatureType iSelectionFeatureType;
protected DefaultFeatureCollection iSelectionFeatureCollection;
protected SimpleFeatureType iTemplateFeatureType;
protected HashMap iSelectionFeatures;
protected MapLayer iSelectionMapLayer;
protected Style iSelectionStyle;
protected Color iSelectionColor;
protected int iMaxSelectionCount;
protected boolean iAutoUndo;
// Public Instance Methods public void
setMultiSelectionEnabled(boolean aEnabled);
// Overrides GeoObjectChooserPanel
Does nothing because the sub-classes are special chooser components,
whose selection procedure is fixed.
public void
setAutoUndo(boolean aAutoUndo);
Sets the "autoUndo" property. When true, the last selection is automatically
undone, if the maximum number of allowed selections is reached and a new selection
is made.
- aAutoUndo enables/disabled the "autoUndo" property
public boolean getAutoUndo();
Returns the "autoUndo" property. When true, the last selection is automatically
undone, if the maximum number of allowed selections is reached and a new selection
is made.
returns aAutoUndo enables/disabled the "autoUndo" property
public void
setMaxSelectionCount(int aMaxSelectionCount);
Sets the maximum number of allowed selections. If the current selection
count is greater than the new limit, selections are undone.
- aMaxSelectionCount maximum number of allowed selections
public int getMaxSelectionCount();
returns the maximum number of allowed selections.
public void
addSelection(Object aSelectionObject, boolean refresh);
Adds an selection object to the selection area.
- aSelectionObject a new selection object (in geo coordinates)
- refresh indicates if a refresh of the map is performed
public void
addSelection(Object aSelectionObject);
Adds a selection object to the selection area and refreshes the map.
- aSelectionObject a new selection object (in geo coordinates)
public boolean isSelectionMade();
returns whether a selection is made.
public int getSelectionCount();
returns the number of selected objects.
public void
undoSelection(int tCount);
Removes previous made selections.
- tCount count of undo operations
public void undoSelection();
Removes the last made selection.
public void clearSelection();
Removes all made selections.
public void
redoSelection(int tCount);
Restores previous undone selections.
- tCount count of redo operations
public void redoSelection();
Restores the last undone selection.
public boolean isRedoPossible();
returns whether a re do operation can be performed.
public ArrayList getSelection();
returns (a copy of) the list of the selected envelopes.
public FeatureCollection getSelectionFeatureCollection();
returns the selection as the displayed {@link FeatureCollection}.
// Protected Instance Methods protected abstract Class getGeometryType();
returns the geometry type used to visualize a selection object (of type {@code G})
protected SimpleFeatureType createSelectionFeatureType();
Creates a org.opengis.feature.simple.SimpleFeatureType for the selection objects.
returns a {@link SimpleFeatureType} for the selection objects.
protected SimpleFeature
transformSelectionObjectToFeature(Object
aSelectionObject);
Creates a org.opengis.feature.simple.SimpleFeature from a selection object (of type G).
If aSelectionObject is null, a default (dummy) Feature
must be generated.
- aSelectionObject the object of one selection
- aFeatureType (template) feature type used to generate the {@link SimpleFeature}
returns a {@link SimpleFeature} from a selection object
protected abstract Geometry
transformSelectionObjectToGeometry(Object
aSelectionObject);
Creates a com.vividsolutions.jts.geom.GeometryJTS-Geometry from a selection object (of type G).
If aSelectionObject is null, a default (dummy) Geometry
must be generated.
- aSelectionObject the object of one selection
returns a {@linkplain Geometry JTS-Geometry}
protected abstract Style
getSelectionStyle(Color aSelectionColor);
- aSelectionColor the color the style is created with
returns the style used to visualize the selection area.
protected void initSelectionFeatureCollection();
Initializes the org.geotools.feature.FeatureCollection to display the selection.
protected void
addSelection(Object aSelectionObject, boolean aRefresh,
boolean aClearRedo);
Adds an selection object to the selection area.
- aSelectionObject a new selection object
- aRefresh indicates if a refresh of the map is performed
- aClearRedo indicates whether the REDO-Stack is cleared
}
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) - AbstractMapChooserPanel
Extended by: MapAreaChooserPanel, MapObjectChooserPanel, MapPointsChooserPanel
Returned by: FWAbstractMapChooserFormComponent.createMapChooserPanel()
Type of: FWAbstractMapChooserFormComponent.iMapChooserPanel