net.simplace.ui.formengine.geotools.MapLineChooserPanel
Version: 1.0
This class provides javax.swing.JPanel which shows several map layers and
let the user choose some points which are successively combined to a
LineString.
After each selection the point is marked in a special top layer. The
current selection can be accessed by getSelection() and
maintained by clearSelection() and undoSelection().
Informations about map control:
- Zoom-in: mouse wheel or left drag
- Zoom-out: right click or mouse wheel
- Move map: right drag
- Point selection: left click
public class MapLineChooserPanel extends MapPointsChooserPanel {
// Public Constructors
public MapLineChooserPanel(Element aFormElement, FWObservable aObservable);
// Protected Instance Variables
protected MapLayer iLineMapLayer;
protected Style iLineStyle;
protected SimpleFeatureType iLineFeatureType;
protected DefaultFeatureCollection iLineFeatureCollection;
// Public Instance Methods public void
undoSelection(int tCount);
// Defines AbstractMapChooserPanel
Removes previous made selections. After calling the super method,
a line string is created from all selection points.
- tCount count of undo operations
public void
redoSelection(int tCount);
// Defines AbstractMapChooserPanel
Restores previous undone selections. After calling the super method,
a line string is created from all selection points.
- tCount count of redo operations
public void closeSelectionLine();
Closes the selection line string by adding the start point to
the selection objects. Does nothing, if less than 2 points are
selected.
public boolean isSelectionLineClosed();
Checks whether the selection line string is closed, so the selection is a Ring.
returns if line selection is closed
public FeatureCollection
getSelectionFeatureCollection();
// Defines AbstractMapChooserPanel
Returns the selection as a org.geotools.feature.FeatureCollection containing
only one LineString feature.
public FeatureCollection getSelectionFeatureCollectionAsPolygons();
Returns the selection as a org.geotools.feature.FeatureCollection containing
only one Polygon feature. If the selection point sequence is not closed
yet, it will be closed at this moment.
returns the selection feature collection transferred to polygons
// Protected Instance Methods protected Style
getSelectionStyle(Color aSelectionColor);
// Overrides MapPointsChooserPanel
Returns the style used to visualize a selection com.vividsolutions.jts.geom.Point.
- aSelectionColor the color the style is created with (not used at the time!)
protected Class getLineGeometryType();
Returns the geometry type used to visualize the selection line.
returns the line geometry type
protected Style
getSelectionLineStyle(Color aSelectionColor);
Returns the style used to visualize the line specified by the
selection com.vividsolutions.jts.geom.PointPoints.
- aSelectionColor the color the style is created with (not used at the time!)
returns the selection line style
protected SimpleFeatureType createLineFeatureType();
Creates a org.opengis.feature.type.FeatureType for the line object.
returns the created line feature type
protected SimpleFeatureType createPolygonFeatureType();
Creates a org.opengis.feature.type.FeatureType for the line object.
returns the polygon feature type
protected void createLineFeatureCollection();
Initializes the org.geotools.feature.FeatureCollection to display the selection line.
protected void
addSelection(Coordinate aSelectionObject, boolean aRefresh,
boolean aClearRedo);
// Defines AbstractMapChooserPanel
Adds an selection object to the selection area. After calling the super method,
a line string is created from all selection points.
- aSelectionObject a new selection point (in geo coordinates)
- aRefresh indicates if a refresh of the map is performed
- aClearRedo indicates whether the REDO-Stack is cleared
protected Class getPolygonGeometryType();
Returns the geometry typ used to visualize the selection polygon.
returns the class type of the polygon geometry
}
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 - MapPointsChooserPanel - MapLineChooserPanel
Returned by: FWMapPolygonChooserFormComponent.createMapChooserPanel(), FWMapLineChooserFormComponent.createMapChooserPanel()