Class TLspTouchSelectEditController
- All Implemented Interfaces:
ILcdUndoableSource,ILcdAWTEventListener,ILspController
The handleFXEventImpl(Event aEvent) converts the native JavaFX TouchEvent
to a TLcdTouchEvent and passes it to the ALspController.handleAWTEvent(AWTEvent aEvent).
- Since:
- 2012.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a TLspTouchSelectEditController with a default name, icon, short description, sensitivity and move event threshold. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUndoableListener(ILcdUndoableListener aUndoableListener) Adds a listener to this source, so this listener is notified when something undoable has happened.voidThis method will append the passed controller to the end of the chain.doubleReturns the current sensitivity of the controller for editing operations.Returns the handle styler used to style handles that have focus in this edit controller.Returns the handle styler used to style handles in this edit controller.Returns anILcdLayeredfor this controller.intReturns the current threshold for move events.Returns a reference to the controller that is located after this one in a chain, or null if this controller is the last element of the chain.Returns the controller model used for selection.doubleReturns the current sensitivity of the controller for selection operations.Gets the snapper provider used by this edit controllerGets the snapper styler used by this edit controllerReturns theILcdStringTranslatorset on this controller.intReturns the time (in milliseconds) it takes for a touch and hold to be registered.handleAWTEventImpl(AWTEvent aEvent) Called byhandleAWTEvent.handleFXEventImpl(Event aEvent) Called byhandleFXEvent.booleanReturns true if this controller is configured to visualize touch points in the view.paint(ILcdGLDrawable aGLDrawable, ILspView aView, TLspPaintPhase aPaintPhase) Paints the visual feedback of this controller.voidremoveUndoableListener(ILcdUndoableListener aUndoableListener) Removes the specified listener so it is no longer notified.protected TLspSelectChoiceselectChoice(TLcdTouchPoint aTouchPoint, ALspSelectInput aInput, Set<TLspPaintRepresentation> aRepresentations) Returns theTLspSelectChoiceto use, a parameter that indicates how to select the actual candidates from a set of possible selection candidates.protected TLspSelectModeselectMode(TLcdTouchPoint aTouchPoint, ALspSelectInput aInput, Set<TLspPaintRepresentation> aRepresentations, TLspSelectChoice aChoice) Returns the mode that defines how the objects involved in the selection should interact with the existing selection, for example add them, remove them, toggle their selection state, etc.protected Set<TLspPaintRepresentation> selectWhat(TLcdTouchPoint aTouchPoint, ALspSelectInput aInput) Returns the mode that defines by what objects can be selected: by their bodies, their labels, ...voidsetDrawTouchPoints(boolean aDrawTouchPoints) Determines whether this controller should visualize touch points in the view.voidsetEditingSensitivity(double aSensitivity) Sets the sensitivity of the controller for editing operations.voidsetFocusHandleStyler(ILspStyler aHandleStyler) Sets the handle styler used to style handles that have focus in this edit controller.voidsetHandleStyler(ILspStyler aHandleStyler) Sets the handle styler used to style handles in this edit controller.voidsetMoveThreshold(int aMoveThreshold) Sets the threshold for move events.voidsetSelectControllerModel(TLspSelectControllerModel aControllerModel) Configures the controller model used for selectionvoidsetSelectionSensitivity(double aSensitivity) Sets the sensitivity of the controller for selection operations.voidsetSensitivity(double aSensitivity) Sets the sensitivity of the controller for both editing and selection to the same value.voidsetSnapperProvider(ILspSnapperProvider aSnapperProvider) Sets the snapper provider used by this edit controllervoidsetSnapperStyler(ILspStyler aStyler) Sets the snapper styler used by this edit controllervoidsetStringTranslator(ILcdStringTranslator aStringTranslator) Sets theILcdStringTranslatorthat this controller should use to translate theStringsthat will be visible in the user interface.voidsetTouchAndHoldTime(int aTouchAndHoldTime) Sets the time (in milliseconds) it takes for a touch and hold to be registered.protected voidstartInteractionImpl(ILspView aView) The specific implementation ofstartInteractionfor this controller.protected voidterminateInteractionImpl(ILspView aView) The specific implementation ofterminateInteractionfor this controller.Methods inherited from class com.luciad.view.lightspeed.controller.ALspController
addPropertyChangeListener, addStatusListener, firePropertyChange, fireStatusEvent, getAWTFilter, getCursor, getFXCursor, getFXFilter, getIcon, getName, getShortDescription, getView, handleAWTEvent, handleFXEvent, paintImpl, registerViewPropertyNameForReset, removePropertyChangeListener, removeStatusListener, setAWTFilter, setCursor, setFXCursor, setFXFilter, setIcon, setName, setShortDescription, startInteraction, terminateInteraction
-
Constructor Details
-
TLspTouchSelectEditController
public TLspTouchSelectEditController()Creates a TLspTouchSelectEditController with a default name, icon, short description, sensitivity and move event threshold.
-
-
Method Details
-
setSelectControllerModel
Configures the controller model used for selection- Parameters:
aControllerModel- the new controller model, never null- Since:
- 2019.1
-
getSelectControllerModel
Returns the controller model used for selection.- Returns:
- the controller model used for selection, never null
- Since:
- 2019.1
-
getHandleStyler
Returns the handle styler used to style handles in this edit controller. By default this is an instance ofTLspEditHandleStyler- Returns:
- the handle styler
-
setHandleStyler
Sets the handle styler used to style handles in this edit controller.- Parameters:
aHandleStyler- The handle styler to use
-
getFocusHandleStyler
Returns the handle styler used to style handles that have focus in this edit controller. By default this is an instance ofTLspEditHandleStyler- Returns:
- the handle styler
-
setFocusHandleStyler
Sets the handle styler used to style handles that have focus in this edit controller.- Parameters:
aHandleStyler- The handle styler to use
-
getSnapperProvider
Gets the snapper provider used by this edit controller- Returns:
- the snapper provider used by this edit controller
-
setSnapperProvider
Sets the snapper provider used by this edit controller- Parameters:
aSnapperProvider- the snapper provider used by this edit controller
-
getSnapperStyler
Gets the snapper styler used by this edit controller- Returns:
- the snapper styler used by this edit controller
-
setSnapperStyler
Sets the snapper styler used by this edit controller- Parameters:
aStyler- the snapper styler used by this edit controller
-
setDrawTouchPoints
public void setDrawTouchPoints(boolean aDrawTouchPoints) Determines whether this controller should visualize touch points in the view. If true, the controller'spaint()method will draw a circle at the location of each current touch point. By default, this property is set to false.- Parameters:
aDrawTouchPoints- whether or not to visualize touch points in the view
-
isDrawTouchPoints
public boolean isDrawTouchPoints()Returns true if this controller is configured to visualize touch points in the view. By default, this feature is off.- Returns:
- true if this controller is configured to visualize touch points in the view
- See Also:
-
setSensitivity
public void setSensitivity(double aSensitivity) Sets the sensitivity of the controller for both editing and selection to the same value.- Parameters:
aSensitivity- the sensitivity.
-
setSelectionSensitivity
public void setSelectionSensitivity(double aSensitivity) Sets the sensitivity of the controller for selection operations. The default value is 1 pixel.- Parameters:
aSensitivity- the selection sensitivity
-
setEditingSensitivity
public void setEditingSensitivity(double aSensitivity) Sets the sensitivity of the controller for editing operations. The default value is 20 pixels.- Parameters:
aSensitivity- the editing sensitivity
-
getEditingSensitivity
public double getEditingSensitivity()Returns the current sensitivity of the controller for editing operations.- Returns:
- the editing sensitivity
-
getSelectionSensitivity
public double getSelectionSensitivity()Returns the current sensitivity of the controller for selection operations.- Returns:
- the selection sensitivity
-
getMoveThreshold
public int getMoveThreshold()Returns the current threshold for move events.
As long as a touch point remains within the threshold it is considered to be stationary, and eligible for a
touch and hold.The default value for this property is 3.
- Returns:
- the current threshold for move events.
- See Also:
-
setMoveThreshold
public void setMoveThreshold(int aMoveThreshold) Sets the threshold for move events.
As long as a touch point remains within the threshold it is considered to be stationary, and eligible for a
touch and hold.The new value of the threshold will not affect any events which arrived at the controller prior to the change in threshold.
The default value for this property is 3.
- Parameters:
aMoveThreshold- the threshold for move events. Must be positive.- See Also:
-
getTouchAndHoldTime
public int getTouchAndHoldTime()Returns the time (in milliseconds) it takes for a touch and hold to be registered.- Returns:
- the time spent waiting on a touch and hold.
- See Also:
-
setTouchAndHoldTime
public void setTouchAndHoldTime(int aTouchAndHoldTime) Sets the time (in milliseconds) it takes for a touch and hold to be registered. If the finger does not move (over themove threshold) in that time, a touch and hold is registered. The default value is 1000.- Parameters:
aTouchAndHoldTime- the time it takes to recognize a touch and hold.
-
setStringTranslator
Sets the
ILcdStringTranslatorthat this controller should use to translate theStringsthat will be visible in the user interface.This method should be called before this controller is used. Any
Stringsalready created by this controller will not be translated with the specified translator. TheILcdStringTranslatordoes not translate the controller's name and description.The following list of
Stringsare translated by the given instance:- "Edit {0}".
{0}will be replaced by the result of callingObject.toString()on the edited object. E.g. "Edit Polygon". - The result of calling
Object.toString()on the edited objects. E.g. "Polygon". - "Undo {0}".
{0}will be replaced by the display name of the action that is to be undone. E.g. "Undo Edit Polygon". - "Redo {0}".
{0}will be replaced by the display name of the action that is to be redone. E.g. "Redo Edit Polygon".
ILcdStringTranslatorneeds to be able to translate what is passed in{0}, but not the entire formattedString. For example, for "Edit {0}" it needs to be able to translate "Edit {0}" itself and the edited object'sObject.toString(), e.g. "Polygon", but not "Edit Polygon".- Parameters:
aStringTranslator- TheILcdStringTranslatorthat should be used. Must not benull.
- "Edit {0}".
-
getStringTranslator
Returns the
ILcdStringTranslatorset on this controller.- Returns:
- The translator set on this controller. Never
null.
-
selectWhat
protected Set<TLspPaintRepresentation> selectWhat(TLcdTouchPoint aTouchPoint, ALspSelectInput aInput) Returns the mode that defines by what objects can be selected: by their bodies, their labels, ...
This method can be overridden to alter its behavior. By default it returns a set containing all available paint representations in the view.- Parameters:
aTouchPoint- The last touch point that was involved in the selection change.aInput- The selection input- Returns:
- an set of paint representations indicating which interact with the selection functionality.
-
selectChoice
protected TLspSelectChoice selectChoice(TLcdTouchPoint aTouchPoint, ALspSelectInput aInput, Set<TLspPaintRepresentation> aRepresentations) Returns the
TLspSelectChoiceto use, a parameter that indicates how to select the actual candidates from a set of possible selection candidates.By default
This method can be overridden to alter its behavior.TLspSelectChoice.DEFAULTis returned.- Parameters:
aTouchPoint- The last touch point that was involved in the selection change.aInput- The selection input.aRepresentations- The paint representations interacting with selection.- Returns:
- The select choice
-
selectMode
protected TLspSelectMode selectMode(TLcdTouchPoint aTouchPoint, ALspSelectInput aInput, Set<TLspPaintRepresentation> aRepresentations, TLspSelectChoice aChoice) Returns the mode that defines how the objects involved in the selection should interact with the existing selection, for example add them, remove them, toggle their selection state, etc.
By default
This method can be overridden to alter its behavior.TLspSelectMode.REPLACEis returned.- Parameters:
aTouchPoint- The last touch point that was involved in the selection change.aInput- The selection input.aRepresentations- The paint representations interacting with selection.aChoice- The TLspSelectChoice that will be used.- Returns:
- The select mode.
-
handleAWTEventImpl
Description copied from class:ALspControllerCalled byhandleAWTEvent. Returnsnullwhen the controller consumed the event or a partially consumed event when the controller partially consumed the event (which could happen withTLcdTouchEvents). When the controller did not use the given event, it is returned unaltered.- Specified by:
handleAWTEventImplin classALspController- Parameters:
aEvent- the event to be handled.- Returns:
nullwhen the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
-
handleFXEventImpl
Description copied from class:ALspControllerCalled byhandleFXEvent. Returnsnullwhen the controller consumed the event. When the controller did not use the given event, it is returned unaltered.- Overrides:
handleFXEventImplin classALspController- Parameters:
aEvent- the event to be handled.- Returns:
nullwhen the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
-
startInteractionImpl
Description copied from class:ALspControllerThe specific implementation ofstartInteractionfor this controller.- Overrides:
startInteractionImplin classALspController- Parameters:
aView- the view to start interaction with.
-
terminateInteractionImpl
Description copied from class:ALspControllerThe specific implementation ofterminateInteractionfor this controller.- Overrides:
terminateInteractionImplin classALspController- Parameters:
aView- the view to terminate interaction with.
-
paint
public TLspPaintProgress paint(ILcdGLDrawable aGLDrawable, ILspView aView, TLspPaintPhase aPaintPhase) Description copied from class:ALspControllerPaints the visual feedback of this controller. This method is called multiple times for different paint phases.Empty implementation. Redefine
ALspController.paintImpl(com.luciad.view.opengl.binding.ILcdGLDrawable, com.luciad.view.lightspeed.ILspView, com.luciad.view.lightspeed.TLspPaintPhase)method to render on the ILcdGLDrawable on which the view is rendered.- Specified by:
paintin interfaceILspController- Overrides:
paintin classALspController- Parameters:
aGLDrawable- the ILcdGLDrawable on which the view is rendered.aView- the view.aPaintPhase- the current paint phase- Returns:
- whether or not the painting was finished.
-
getNextController
Description copied from interface:ILspControllerReturns a reference to the controller that is located after this one in a chain, or null if this controller is the last element of the chain. Note that this reference is not allowed to change while the controller is attached to a view directly or indirectly.- Specified by:
getNextControllerin interfaceILspController- Overrides:
getNextControllerin classALspController- Returns:
- a reference to the next controller.
- See Also:
-
appendController
Description copied from interface:ILspControllerThis method will append the passed controller to the end of the chain. The controller will be stored as the next controller in the last element of the current chain. Note that this method is not allowed to be called while the controller is attached to a view directly or indirectly. Unattach the controller first, before calling this method.- Specified by:
appendControllerin interfaceILspController- Overrides:
appendControllerin classALspController- Parameters:
aEnd- the controller to be appended to the end of the chain.
-
addUndoableListener
Description copied from interface:ILcdUndoableSourceAdds a listener to this source, so this listener is notified when something undoable has happened.- Specified by:
addUndoableListenerin interfaceILcdUndoableSource- Parameters:
aUndoableListener- The listener to be notified when something undoable has happened.
-
removeUndoableListener
Description copied from interface:ILcdUndoableSourceRemoves the specified listener so it is no longer notified.- Specified by:
removeUndoableListenerin interfaceILcdUndoableSource- Parameters:
aUndoableListener- The listener to remove.
-
getLayered
Description copied from interface:ILspControllerReturns an
ILcdLayeredfor this controller. Custom implementations of this method should take care to return the sameILcdLayeredinstance every time this method is called to guarantee correct working of theILcdLayeredinterface.The returned layered object should contain layers that are relevant to this controller. Any view using this controller should take into account the layers of its active controller.
Note that the ILcdLayered is only allowed to contain
ILspLayerinstances.- Specified by:
getLayeredin interfaceILspController- Overrides:
getLayeredin classALspController- Returns:
- an ILcdLayered object, or null if this controller has no layers.
-