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
ConstructorsModifierConstructorDescriptionprotectedALspCreateHandle(Object aGeometry) Creates a create handle for the given object. -
Method Summary
Modifier and TypeMethodDescriptionprotected TLspEditHandleResultdeactivate(AWTEvent aEvent, TLspEditContext aEditContext) Called right before the handle is deactivatedprotected TLspEditHandleResultFXdeactivate(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofdeactivate(AWTEvent, TLspEditContext).protected ALspEditHandleReturns 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 booleanhasNext(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether there is a next handle to be used in the creation process.protected booleanhasNext(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofhasNext(AWTEvent, TLspEditContext).protected booleanhasPrevious(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether there is a previous handle used in the creation process, or a currently active handle.protected booleanhasPrevious(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofhasPrevious(AWTEvent, TLspEditContext).booleanisActive()Checks whether this handle is active.protected abstract ALspEditHandlenext(AWTEvent aEvent, TLspEditContext aEditContext) Makes the next handle the active handle.protected ALspEditHandlenext(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofnext(AWTEvent, TLspEditContext).protected voidprevious(AWTEvent aEvent, TLspEditContext aEditContext) Makes the previous handle the current handle.protected voidprevious(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofprevious(AWTEvent, TLspEditContext).protected voidremovePreviousHandle(ALspEditHandle aPreviousHandle) protected abstract booleanrequestsDeactivation(AWTEvent aEvent, TLspEditContext aEditContext) Checks whether the create handle should be deactivated.protected booleanrequestsDeactivation(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofrequestsDeactivation(AWTEvent, TLspEditContext).booleanrequestsFocus(AWTEvent aEvent, TLspEditContext aEditContext) Indicates whether this handle requests focus for the given event.booleanrequestsFocus(Event aEvent, TLspEditContext aEditContext) JavaFX equivalent ofALspEditHandle.requestsFocus(AWTEvent, TLspEditContext).Methods inherited from class com.luciad.view.lightspeed.editor.handle.ALspEditHandle
getGeometryMethods 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:
trueif another handle is available,falseotherwise.
-
hasNext
JavaFX equivalent ofhasNext(AWTEvent, TLspEditContext).- Parameters:
aEvent- the eventaEditContext- the edit context- Returns:
trueif another handle is available,falseotherwise.- 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:
trueif a previous handle is available,falseotherwise.
-
hasPrevious
JavaFX equivalent ofhasPrevious(AWTEvent, TLspEditContext).- Parameters:
aEvent- the eventaEditContext- the edit context- Returns:
trueif a previous handle is available,falseotherwise.- 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 ifhasNextreturnsfalse, 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:ALspHandleChecks 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:
isActivein classALspHandle- Returns:
- true if active, false otherwise
-
requestsFocus
Description copied from class:ALspEditHandleIndicates 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
trueif 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:
requestsFocusin 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:
trueif this handle requests focus for the given event,falseotherwise.- See Also:
-
requestsFocus
Description copied from class:ALspEditHandleJavaFX equivalent ofALspEditHandle.requestsFocus(AWTEvent, TLspEditContext).- Overrides:
requestsFocusin 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:
trueif this handle requests focus for the given event,falseotherwise.
-
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,hasNextis 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:
handleAWTEventin 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:
handleFXEventin 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:
getStyleTargetProvidersin 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:ALspHandleReturns the cursor for this handle. In practice, this cursor is used when this handle is active, or when it has focus.- Overrides:
getCursorin classALspHandle- Returns:
- the cursor for this handle.
-