|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.geotools.gui.swing.JMapPane
schmitzm.geotools.gui.JMapPane
schmitzm.geotools.gui.JEditorPane
public class JEditorPane
The GeoEditorPane
extends the JMapPane
with functionalities
to create new vector layers by successively click points via mouse.
Nested Class Summary | |
---|---|
static class |
JEditorPane.EditorMode
Modes, the editor can be perform. |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected FeatureType |
additionalAttr
Contains the additional attributes for new FeatureCollections. |
protected FeatureInputOption |
attrInputOption
Contains the InputOption to specify the additional
attribute values. |
static Style |
DEFAULT_LINE_STYLE
Default-Style for line layers (blue lines). |
static Style |
DEFAULT_POINT_STYLE
Default-Style for point layers (blue dots). |
static Style |
DEFAULT_POLYGON_STYLE
Default-Style for polygon layers (orange with black borders). |
protected DefaultFeatureCollection |
editorFeatureCollection
Holds the FeatureCollection of the edited layer. |
protected FeatureType |
editorFeatureType
Holds the FeatureType of the edited layer. |
protected FeatureUtil.GeometryForm |
editorGeometryForm
Holds the kind of geometry of the edited layer. |
protected MapLayer |
editorLayer
Holds the edited layer. |
protected MapContext |
editorMapContext
The map context where the edited layers are displayed. |
protected JEditorPane.EditorMode |
editorMode
Holds the operation the editor currently performs. |
protected GTRenderer |
editorRenderer
The renderer the edited layers are rendered with. |
protected Map<FeatureUtil.GeometryForm,Style> |
editorStyles
Holds the styles to display edited layers. |
static String |
GEOMETRY_ATTR
Attribute name used for the geometry of new layers. |
protected Stack<Feature> |
globalRedoFeatures
Holds the undone segments (complete Features) which can be redone. |
protected Stack<Stack<Coordinate>> |
globalRedoPoints
Holds the undone points of former segments (complete Features) which can be redone. |
protected Stack<Feature> |
globalUndoFeatures
Holds the former segments (complete Features) which can be undone. |
protected Stack<Stack<Coordinate>> |
globalUndoPoints
Holds the points of former segments (complete Features) which can be undone. |
protected MapContext |
mapContext
The map context of the displayed layer. |
protected DefaultFeatureCollection |
segmLineFeatureCollection
Holds the FeatureCollection which holds the new segment
(incomplete Feature) displayed as line. |
protected FeatureType |
segmLineFeatureType
Holds the FeatureType of the new segment (incomplete Feature)
displayed as line. |
protected MapLayer |
segmLineLayer
Holds the layer, the new segment (incomplete Feature) is displayed in as line. |
protected DefaultFeatureCollection |
segmPointFeatureCollection
Holds the FeatureCollection which holds the new segment
(incomplete Feature) displayed as points. |
protected FeatureType |
segmPointFeatureType
Holds the FeatureType of the new segment (incomplete Feature)
displayed as points. |
protected MapLayer |
segmPointLayer
Holds the layer, the new segment (incomplete Feature) is displayed in as points. |
protected Stack<Coordinate> |
segmRedoPoints
Holds the undone points of the edited segment (incomplete Feature) which can be redone. |
protected Stack<Coordinate> |
segmUndoPoints
Holds the points of the edited segment (incomplete Feature) which can be undone. |
Fields inherited from class schmitzm.geotools.gui.JMapPane |
---|
LOGGER, mapLayerSelectable, mapPaneListeners, NONE, Pan, PAN, Reset, RESET, Select, SELECT_ALL, SELECT_ONE_FROM_TOP, SELECT_TOP, selState, selTracker, staticCursor, transform, ZOOM_IN, ZOOM_OUT, ZoomIn, ZoomOut |
Fields inherited from class org.geotools.gui.swing.JMapPane |
---|
baseImage, mapArea, oldMapArea, oldRect, panningImage, reset |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JEditorPane()
Creates a new GeoEditorPane . |
|
JEditorPane(LayoutManager layout,
boolean isDoubleBuffered,
GTRenderer renderer,
MapContext context)
Creates a new GeoEditorPane . |
Method Summary | |
---|---|
protected void |
addSegment(Coordinate coord)
Called when the mouse is clicked on map during creating a new layer. |
protected void |
addSegment(Coordinate coord,
boolean refresh,
boolean clearRedo)
Called when the mouse is clicked on map during creating a new layer. |
void |
cancelEditing()
Cancels the current edititing operation. |
protected Feature |
createSegmentLineFeature()
Creates a new Line-Feature from the currently selected
segment points. |
protected Feature |
createSegmentPointFeature()
Creates a new MultiPoint-Feature from the currently selected
segment points. |
void |
finishEditing()
Finishes the current editing operation. |
void |
finishFeature()
Finishes the editing of the current segment (Feature). |
protected void |
finishFeature(boolean refresh,
boolean clearRedo)
Finishes the editing of the current segment (Feature). |
protected void |
generateSegmentFeatureCollection()
Creates a new segment Feature from the currently selected points. |
FeatureType |
getAdditionalAttributes()
Returns the additional attributes for new FeatureCollections (besides the geometric attribute, which is added automatically). |
FeatureCollection |
getEditorFeatureCollection()
Returns the FeatureCollection of the edited layer. |
MapLayer |
getEditorLayer()
Returns the edited layer. |
JEditorPane.EditorMode |
getEditorMode()
Returns the current editor mode. |
Style |
getEditorStyle()
Returns the style for the current edited layer. |
Style |
getEditorStyle(FeatureUtil.GeometryForm geomForm)
Returns the style for edited layers. |
protected void |
initEditorFeatureCollection(String title)
Sets editorFeatureCollection and editorLayer to completely
new instances. |
protected void |
initSegmentFeatureCollection()
Clears the FeatureCollection used to handle the current
edited segment. |
protected void |
initUndoRedo()
Sets editorFeatureCollection and editorLayer to completely
new instances. |
boolean |
isEditorEnabled()
Checks, whether a layer is edited. |
boolean |
isRedoPossible()
Checks wheater a redo operation can be performed. |
boolean |
isUndoPossible()
Checks wheater a undo operation can be performed. |
void |
mouseClicked(MouseEvent e)
Ignores the actions of the super class for left-clicks. |
protected void |
paintComponent(Graphics g)
After the actions of the super method, this method paints the special editor layers in editorMapContext . |
void |
redoEditing()
Restores the last undone editing action. |
void |
redoEditing(int count)
Restores previous undone editing actions. |
void |
setAdditionalAttributes(FeatureType fType)
Sets the additional attributes for new FeatureCollections (besides the geometric attribute, which is added automatically). |
void |
setEditorStyle(FeatureUtil.GeometryForm geomForm,
Style style)
Sets the style for edited layers. |
void |
startEditing(JEditorPane.EditorMode mode,
String layerTitle)
Starts a new layer. |
void |
undoAll()
Makes all made editing action undone. |
void |
undoEditing()
Makes the last made editing action undone. |
void |
undoEditing(int count)
Makes previously made editing actions undone. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String GEOMETRY_ATTR
public static final Style DEFAULT_POINT_STYLE
public static final Style DEFAULT_LINE_STYLE
public static final Style DEFAULT_POLYGON_STYLE
protected MapContext mapContext
protected FeatureType additionalAttr
protected FeatureInputOption attrInputOption
InputOption
to specify the additional
attribute values.
protected MapContext editorMapContext
protected GTRenderer editorRenderer
protected Map<FeatureUtil.GeometryForm,Style> editorStyles
styles
to display edited layers.
protected JEditorPane.EditorMode editorMode
protected FeatureType editorFeatureType
FeatureType
of the edited layer.
protected FeatureUtil.GeometryForm editorGeometryForm
protected DefaultFeatureCollection editorFeatureCollection
FeatureCollection
of the edited layer.
protected MapLayer editorLayer
protected FeatureType segmLineFeatureType
FeatureType
of the new segment (incomplete Feature)
displayed as line.
protected DefaultFeatureCollection segmLineFeatureCollection
FeatureCollection
which holds the new segment
(incomplete Feature) displayed as line.
protected MapLayer segmLineLayer
protected FeatureType segmPointFeatureType
FeatureType
of the new segment (incomplete Feature)
displayed as points.
protected DefaultFeatureCollection segmPointFeatureCollection
FeatureCollection
which holds the new segment
(incomplete Feature) displayed as points.
protected MapLayer segmPointLayer
protected Stack<Coordinate> segmUndoPoints
protected Stack<Coordinate> segmRedoPoints
protected Stack<Stack<Coordinate>> globalUndoPoints
protected Stack<Stack<Coordinate>> globalRedoPoints
protected Stack<Feature> globalUndoFeatures
protected Stack<Feature> globalRedoFeatures
Constructor Detail |
---|
public JEditorPane()
GeoEditorPane
.
public JEditorPane(LayoutManager layout, boolean isDoubleBuffered, GTRenderer renderer, MapContext context)
GeoEditorPane
. This constructor provides the possibility
to use alternative implementations of the internal components.
The specified parameter all can be null
! In this case
the respective default component is used.
Method Detail |
---|
protected void paintComponent(Graphics g)
editorMapContext
.
paintComponent
in class JMapPane
g
- GraphicsJMapPane.resetTransform()
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
mouseClicked
in class JMapPane
public boolean isEditorEnabled()
public void setEditorStyle(FeatureUtil.GeometryForm geomForm, Style style)
geomForm
- kind of layers the style is set forstyle
- a Style (if null
a default style is set, so
#getEditorStyle(GeometryForm)
never returns null)public Style getEditorStyle(FeatureUtil.GeometryForm geomForm)
geomForm
- type of layers the style is returned forpublic Style getEditorStyle()
public void setAdditionalAttributes(FeatureType fType)
fType
- defines the attributes (If null
, new FeatureCollections
only contain the geometric attribute)public FeatureType getAdditionalAttributes()
public JEditorPane.EditorMode getEditorMode()
public MapLayer getEditorLayer()
public FeatureCollection getEditorFeatureCollection()
FeatureCollection
of the edited layer.
public void startEditing(JEditorPane.EditorMode mode, String layerTitle)
mode
- type of layerlayerTitle
- Title for the new layer
UnsupportedOperationException
- if no map area is defined yetprotected void addSegment(Coordinate coord, boolean refresh, boolean clearRedo)
coord
- World coordinates of click positionrefresh
- indicates whether the visualisation will be refreshedaClearRedo
- indicates whether the REDO-Stack is cleared (normally true
,
but false
during REDO operation!)protected void addSegment(Coordinate coord)
coord
- World coordinates of click positionprotected void finishFeature(boolean refresh, boolean clearRedo)
refresh
- indicates whether the visualisation will be refreshedaClearRedo
- indicates whether the REDO-Stack is cleared (normally true
,
but false
during REDO operation!)
UnsupportedOperationException
- if a line or polygon feature can not
be finished because of less specified pointspublic void finishFeature()
public void finishEditing()
getEditorLayer()
and getEditorFeatureCollection()
.
If no editing operation is currently in progress, this method does nothing.
public void cancelEditing()
public void undoEditing(int count)
count
- count of operations made undonepublic void undoEditing()
public void undoAll()
public boolean isUndoPossible()
public void redoEditing(int count)
count
- count of redo operationspublic void redoEditing()
public boolean isRedoPossible()
protected void initUndoRedo()
editorFeatureCollection
and editorLayer
to completely
new instances.
title
- title for the new layerprotected void initEditorFeatureCollection(String title)
editorFeatureCollection
and editorLayer
to completely
new instances.
title
- title for the new layerprotected void initSegmentFeatureCollection()
FeatureCollection
used to handle the current
edited segment.
protected void generateSegmentFeatureCollection()
protected Feature createSegmentLineFeature()
Line-Feature
from the currently selected
segment points.
protected Feature createSegmentPointFeature()
MultiPoint-Feature
from the currently selected
segment points.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |