public abstract class ALspCreateHandle extends ALspEditHandle
hasNext
: Checks if there are more edit handles to process.next
: Returns the next edit handle.requestsDeactivation
: Makes it possible to stop creation, even
if there are still handles left.TLspStaticCreateHandle
. An example of an editor that uses a static create handle is
TLspCircleEditor
. For instance when
creating a TLcdLonLatCircle
, the number and type of handles is fixed and known
a-priori.
If the list of handles is not known a-priori, you can derive your create handle from
ALspDynamicCreateHandle
. An example of an editor that uses a
dynamic create handle is the TLsp2DPointListEditor
, where a new handle is constructed whenever a new point is added to the
point list under creation. Since the number of points in the list is unknown beforehand, a static
create handle cannot be used.PRIORITY_2D_CONTOUR, PRIORITY_2D_POINT, PRIORITY_2D_SHAPE, PRIORITY_3D_CONTOUR, PRIORITY_3D_POINT, PRIORITY_3D_SHAPE, PRIORITY_MULTIPLE_SHAPES
Modifier | Constructor and Description |
---|---|
protected |
ALspCreateHandle(Object aGeometry)
Creates a create handle for the given object.
|
Modifier and Type | Method and Description |
---|---|
protected TLspEditHandleResult |
deactivate(AWTEvent aEvent,
TLspEditContext aEditContext)
Called right before the handle is deactivated
|
protected TLspEditHandleResultFX |
deactivate(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
deactivate(AWTEvent, TLspEditContext) . |
protected ALspEditHandle |
getActiveHandle() |
Cursor |
getCursor()
Returns the cursor for this handle.
|
protected List<ALspEditHandle> |
getPreviousHandles() |
List<ALspStyleTargetProvider> |
getStyleTargetProviders(TLspHandleGeometryType aType)
Returns all style target providers components of the currently active handle and previously
used handles.
|
TLspEditHandleResult |
handleAWTEvent(AWTEvent aEvent,
TLspEditContext aEditContext)
Processes the given event if this create handle is active.
|
TLspEditHandleResultFX |
handleFXEvent(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
handleAWTEvent(AWTEvent, TLspEditContext) . |
protected abstract boolean |
hasNext(AWTEvent aEvent,
TLspEditContext aEditContext)
Checks whether there is a next handle to be used in the creation process.
|
protected boolean |
hasNext(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
hasNext(AWTEvent, TLspEditContext) . |
protected boolean |
hasPrevious(AWTEvent aEvent,
TLspEditContext aEditContext)
Checks whether there is a previous handle used in the creation process, or a currently
active handle.
|
protected boolean |
hasPrevious(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
hasPrevious(AWTEvent, TLspEditContext) . |
boolean |
isActive()
Checks whether this handle is active.
|
protected abstract ALspEditHandle |
next(AWTEvent aEvent,
TLspEditContext aEditContext)
Makes the next handle the active handle.
|
protected ALspEditHandle |
next(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
next(AWTEvent, TLspEditContext) . |
protected void |
previous(AWTEvent aEvent,
TLspEditContext aEditContext)
Makes the previous handle the current handle.
|
protected void |
previous(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
previous(AWTEvent, TLspEditContext) . |
protected void |
removePreviousHandle(ALspEditHandle aPreviousHandle) |
protected abstract boolean |
requestsDeactivation(AWTEvent aEvent,
TLspEditContext aEditContext)
Checks whether the create handle should be deactivated.
|
protected boolean |
requestsDeactivation(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
requestsDeactivation(AWTEvent, TLspEditContext) . |
boolean |
requestsFocus(AWTEvent aEvent,
TLspEditContext aEditContext)
Indicates whether this handle requests focus for the given event.
|
boolean |
requestsFocus(javafx.event.Event aEvent,
TLspEditContext aEditContext)
JavaFX equivalent of
ALspEditHandle.requestsFocus(AWTEvent, TLspEditContext) . |
getGeometry
getCursorFX, getPriority, getProperties, setCursor, setCursorFX, setPriority
protected ALspCreateHandle(Object aGeometry)
aGeometry
- a geometry for that is edited by this handle. Null is allowed, for instance
if editing doesn't involve geometry directly.protected abstract boolean hasNext(AWTEvent aEvent, TLspEditContext aEditContext)
aEvent
- the eventaEditContext
- the edit contexttrue
if another handle is available, false
otherwise.protected boolean hasNext(javafx.event.Event aEvent, TLspEditContext aEditContext)
hasNext(AWTEvent, TLspEditContext)
.aEvent
- the eventaEditContext
- the edit contexttrue
if another handle is available, false
otherwise.protected abstract ALspEditHandle next(AWTEvent aEvent, TLspEditContext aEditContext)
aEvent
- the eventaEditContext
- the edit contextprotected ALspEditHandle next(javafx.event.Event aEvent, TLspEditContext aEditContext)
next(AWTEvent, TLspEditContext)
.aEvent
- the eventaEditContext
- the edit contextprotected boolean hasPrevious(AWTEvent aEvent, TLspEditContext aEditContext)
aEvent
- the eventaEditContext
- the edit contexttrue
if a previous handle is available, false
otherwise.protected boolean hasPrevious(javafx.event.Event aEvent, TLspEditContext aEditContext)
hasPrevious(AWTEvent, TLspEditContext)
.aEvent
- the eventaEditContext
- the edit contexttrue
if a previous handle is available, false
otherwise.protected void previous(AWTEvent aEvent, TLspEditContext aEditContext)
aEvent
- the given eventaEditContext
- the edit contextprotected void previous(javafx.event.Event aEvent, TLspEditContext aEditContext)
previous(AWTEvent, TLspEditContext)
.aEvent
- the given eventaEditContext
- the edit contextprotected abstract boolean requestsDeactivation(AWTEvent aEvent, TLspEditContext aEditContext)
hasNext
returns false
, regardless of this method. This method should be considered
an "early-out".aEvent
- the eventaEditContext
- the edit context for this requestprotected boolean requestsDeactivation(javafx.event.Event aEvent, TLspEditContext aEditContext)
requestsDeactivation(AWTEvent, TLspEditContext)
.aEvent
- the eventaEditContext
- the edit context for this requestprotected TLspEditHandleResult deactivate(AWTEvent aEvent, TLspEditContext aEditContext)
aEvent
- The eventaEditContext
- the edit contextprotected TLspEditHandleResultFX deactivate(javafx.event.Event aEvent, TLspEditContext aEditContext)
deactivate(AWTEvent, TLspEditContext)
.aEvent
- The eventaEditContext
- the edit contextpublic boolean isActive()
ALspHandle
isActive
in class ALspHandle
public boolean requestsFocus(AWTEvent aEvent, TLspEditContext aEditContext)
ALspEditHandle
handleAWTEvent
. However, this is not ensured, because another handle may have precedence
over this handle and also request focus. Precedence is primarily determined by the
handle priority
.
The default implementation returns true
if the handle is active. Subclasses can override
this method for custom behavior. An example would be to request focus when the mouse hovers over
a visual handle component.
requestsFocus
in class ALspEditHandle
aEvent
- the AWTEvent that might result in a focus requestaEditContext
- the edit context, containing, amongst others, information about
the layer for which this handle is operating, the view, the object
for which this handle was created, the geometry that this
handle was created for, the paint representation in which geometry exists,
and the sensitivity with which the event should be handledtrue
if this handle requests focus for the given event, false
otherwise.ALspHandle.isActive()
,
ALspEditHandle.handleAWTEvent(java.awt.AWTEvent, com.luciad.view.lightspeed.editor.TLspEditContext)
public boolean requestsFocus(javafx.event.Event aEvent, TLspEditContext aEditContext)
ALspEditHandle
ALspEditHandle.requestsFocus(AWTEvent, TLspEditContext)
.requestsFocus
in class ALspEditHandle
aEvent
- the AWTEvent that might result in a focus requestaEditContext
- the edit context, containing, amongst others, information about
the layer for which this handle is operating, the view, the object
for which this handle was created, the geometry that this
handle was created for, the paint representation in which geometry exists,
and the sensitivity with which the event should be handledtrue
if this handle requests focus for the given event, false
otherwise.public TLspEditHandleResult handleAWTEvent(AWTEvent aEvent, TLspEditContext aEditContext)
hasNext
. If there
is no active handle, hasNext
is called to check if a next handle can be queried.
Finally if no active handle is available, this handle deactivates and
the creation ends.handleAWTEvent
in class ALspEditHandle
aEvent
- the input eventaEditContext
- the edit contextnull
.ALspHandle.isActive()
public TLspEditHandleResultFX handleFXEvent(javafx.event.Event aEvent, TLspEditContext aEditContext)
handleAWTEvent(AWTEvent, TLspEditContext)
.handleFXEvent
in class ALspEditHandle
aEvent
- the input eventaEditContext
- the edit contextnull
.protected List<ALspEditHandle> getPreviousHandles()
protected void removePreviousHandle(ALspEditHandle aPreviousHandle)
public List<ALspStyleTargetProvider> getStyleTargetProviders(TLspHandleGeometryType aType)
getStyleTargetProviders
in class ALspHandle
aType
- the handle component type for which the visual representations are to be
retrievedprotected ALspEditHandle getActiveHandle()
public Cursor getCursor()
ALspHandle
getCursor
in class ALspHandle