Class ALspCreateHandle
java.lang.Object
com.luciad.view.lightspeed.editor.handle.ALspHandle
com.luciad.view.lightspeed.editor.handle.ALspEditHandle
com.luciad.view.lightspeed.editor.handle.ALspCreateHandle
- Direct Known Subclasses:
ALspDynamicCreateHandle
,TLspStaticCreateHandle
Base class for handles that are used to create and initialize
new domain objects.
A create handle has a list of other handles that are used during the creation process. Only
one handle is active at a time though. The create handle itself becomes active at construction
time and cannot be reactivated when becoming inactive.
This class can be implemented by implementing the following methods.
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.- Since:
- 2012.0
-
Field Summary
Fields inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
PRIORITY_2D_CONTOUR, PRIORITY_2D_POINT, PRIORITY_2D_SHAPE, PRIORITY_3D_CONTOUR, PRIORITY_3D_POINT, PRIORITY_3D_SHAPE, PRIORITY_MULTIPLE_SHAPES
-
Constructor Summary
ModifierConstructorDescriptionprotected
ALspCreateHandle
(Object aGeometry) Creates a create handle for the given object. -
Method Summary
Modifier and TypeMethodDescriptionprotected TLspEditHandleResult
deactivate
(AWTEvent aEvent, TLspEditContext aEditContext) Called right before the handle is deactivatedprotected TLspEditHandleResultFX
deactivate
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofdeactivate(AWTEvent, TLspEditContext)
.protected ALspEditHandle
Returns the cursor for this handle.protected List
<ALspEditHandle> Returns all style target providers components of the currently active handle and previously used handles.handleAWTEvent
(AWTEvent aEvent, TLspEditContext aEditContext) Processes the given event if this create handle is active.handleFXEvent
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofhandleAWTEvent(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
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofhasNext(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
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofhasPrevious(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
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofnext(AWTEvent, TLspEditContext)
.protected void
previous
(AWTEvent aEvent, TLspEditContext aEditContext) Makes the previous handle the current handle.protected void
previous
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofprevious(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
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofrequestsDeactivation(AWTEvent, TLspEditContext)
.boolean
requestsFocus
(AWTEvent aEvent, TLspEditContext aEditContext) Indicates whether this handle requests focus for the given event.boolean
requestsFocus
(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofALspEditHandle.requestsFocus(AWTEvent, TLspEditContext)
.Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspEditHandle
getGeometry
Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspHandle
getCursorFX, getPriority, getProperties, setCursor, setCursorFX, setPriority
-
Constructor Details
-
ALspCreateHandle
Creates a create handle for the given object.- Parameters:
aGeometry
- a geometry for that is edited by this handle. Null is allowed, for instance if editing doesn't involve geometry directly.
-
-
Method Details
-
hasNext
Checks whether there is a next handle to be used in the creation process.- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if another handle is available,false
otherwise.
-
hasNext
JavaFX equivalent ofhasNext(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if another handle is available,false
otherwise.- Since:
- 2020.0
-
next
Makes the next handle the active handle.- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
- the next handle.
-
next
JavaFX equivalent ofnext(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
- the next handle.
- Since:
- 2020.0
-
hasPrevious
Checks whether there is a previous handle used in the creation process, or a currently active handle.- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if a previous handle is available,false
otherwise.
-
hasPrevious
JavaFX equivalent ofhasPrevious(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the eventaEditContext
- the edit context- Returns:
true
if a previous handle is available,false
otherwise.- Since:
- 2020.0
-
previous
Makes the previous handle the current handle. The previous handle is provided with the given event in order to make it active again. If there is no previous handle, the active handle is made null. This allows the create handle to go back to its initial state.- Parameters:
aEvent
- the given eventaEditContext
- the edit context
-
previous
JavaFX equivalent ofprevious(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the given eventaEditContext
- the edit context- Since:
- 2020.0
-
requestsDeactivation
Checks whether the create handle should be deactivated. This is the case if the current handle is the last handle and it is not active. Subclasses can implement this method to perform additional checks on the input event and for example request deactivation when the right mouse button is clicked. The result of having this method return true is that the currently active handle (if any) is invoked one more time, and the resulting TLspEditHandleResult will contain a ELspInteractionStatus.FINISHED as an interaction status. Note that this create handle automatically deactivates ifhasNext
returnsfalse
, regardless of this method. This method should be considered an "early-out".- Parameters:
aEvent
- the eventaEditContext
- the edit context for this request- Returns:
- true if deactivation is requested, false otherwise.
-
requestsDeactivation
JavaFX equivalent ofrequestsDeactivation(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- the eventaEditContext
- the edit context for this request- Returns:
- true if deactivation is requested, false otherwise.
- Since:
- 2020.0
-
deactivate
Called right before the handle is deactivated- Parameters:
aEvent
- The eventaEditContext
- the edit context- Returns:
- A resulting operation of deactivation.
-
deactivate
JavaFX equivalent ofdeactivate(AWTEvent, TLspEditContext)
.- Parameters:
aEvent
- The eventaEditContext
- the edit context- Returns:
- A resulting operation of deactivation.
- Since:
- 2020.0
-
isActive
public boolean isActive()Description copied from class:ALspHandle
Checks whether this handle is active. When a handle is active, it will be the first candidate to receive events. If a handle is inactive, it might still receive events (possibly making it active) if all other active handles didn't process an event.- Specified by:
isActive
in classALspHandle
- Returns:
- true if active, false otherwise
-
requestsFocus
Description copied from class:ALspEditHandle
Indicates whether this handle requests focus for the given event. The edit controller can respond to this by forwarding event objects to this handle by callinghandleAWTEvent
. However, this is not ensured, because another handle may have precedence over this handle and also request focus. Precedence is primarily determined by thehandle 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.- Overrides:
requestsFocus
in classALspEditHandle
- Parameters:
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 handled- Returns:
true
if this handle requests focus for the given event,false
otherwise.- See Also:
-
requestsFocus
Description copied from class:ALspEditHandle
JavaFX equivalent ofALspEditHandle.requestsFocus(AWTEvent, TLspEditContext)
.- Overrides:
requestsFocus
in classALspEditHandle
- Parameters:
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 handled- Returns:
true
if this handle requests focus for the given event,false
otherwise.
-
handleAWTEvent
Processes the given event if this create handle is active. The create handle first tries to deactivate itself. If it is not deactivated it tries to delegate the event to the active handle (last returned byhasNext
. 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.- Specified by:
handleAWTEvent
in classALspEditHandle
- Parameters:
aEvent
- the input eventaEditContext
- the edit context- Returns:
- an edit handle result containing a collection of operations to perform, and the
(partially) consumed event object. The handle result itself should not be
null
. - See Also:
-
handleFXEvent
JavaFX equivalent ofhandleAWTEvent(AWTEvent, TLspEditContext)
.- Overrides:
handleFXEvent
in classALspEditHandle
- Parameters:
aEvent
- the input eventaEditContext
- the edit context- Returns:
- an edit handle result containing a collection of operations to perform, and the
(partially) consumed event object. The handle result itself should not be
null
. - Since:
- 2020.0
-
getPreviousHandles
-
removePreviousHandle
-
getStyleTargetProviders
Returns all style target providers components of the currently active handle and previously used handles.- Specified by:
getStyleTargetProviders
in classALspHandle
- Parameters:
aType
- the handle component type for which the visual representations are to be retrieved- Returns:
- the combined collection of visual handle components of the active handle, and possibly of all previously used handles
-
getActiveHandle
-
getCursor
Description copied from class:ALspHandle
Returns the cursor for this handle. In practice, this cursor is used when this handle is active, or when it has focus.- Overrides:
getCursor
in classALspHandle
- Returns:
- the cursor for this handle.
-