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:


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.
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.
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.
public void addSelection(Object aSelectionObject);

Adds a selection object to the selection area and refreshes the map.
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.
public void undoSelection();

Removes the last made selection.
public void clearSelection();

Removes all made selections.
public void redoSelection(int tCount);

Restores previous undone selections.
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.
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.
returns a {@linkplain Geometry JTS-Geometry}
protected abstract Style getSelectionStyle(Color aSelectionColor);


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.


}



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