Package com.luciad.view.lightspeed.query
Class TLspIsTouchedQuery
java.lang.Object
com.luciad.view.lightspeed.query.ALspPaintQuery<Boolean>
com.luciad.view.lightspeed.query.TLspIsTouchedQuery
Query to determine whether an object is touched.
If this query is used for an object that is currently not painted (ex. because it is outside the
view) then this query determines whether the object would have been touched if it were painted.
The
touched(com.luciad.view.lightspeed.layer.ALspWorldTouchInfo)
methods may be called multiple times if the object is touched at multiple
points. This implementation only keeps track of the first touched point. You can override this
class if you want to handle all touched points.- Since:
- 2012.0
- See Also:
-
Constructor Summary
ConstructorDescriptionTLspIsTouchedQuery
(TLspLabelID aLabel, ILcdPoint aViewPoint, double aSensitivity) Creates a new is touched query for a label.TLspIsTouchedQuery
(TLspLabelID aLabel, ILcdPoint aViewPoint, double aSensitivity, ALspLabelLocation aLabelLocation) Creates a new is touched query for a label, for the given location.TLspIsTouchedQuery
(Object aObject, TLspPaintRepresentation aPaintRepresentation, ILcdPoint aViewPoint, double aSensitivity) Creates a new is touched query. -
Method Summary
Modifier and TypeMethodDescriptiongetLabel()
Returns the label that should be queried.Returns the label location for the label that should be queried.Returns the object that should be queried.Returns the paint representation that should be queried.Returns whether the object is touched.double
Returns the sensitivity in pixels.Returns the touch info if the object is touched.Returns the view point that should be queried.boolean
Returns whether the object is touched.boolean
touched
(ALspViewTouchInfo aTouchInfo) Called if the object is touched at a point in view coordinates.boolean
touched
(ALspWorldTouchInfo aTouchInfo) Called if the object is touched at a point in world coordinates.
-
Constructor Details
-
TLspIsTouchedQuery
public TLspIsTouchedQuery(Object aObject, TLspPaintRepresentation aPaintRepresentation, ILcdPoint aViewPoint, double aSensitivity) Creates a new is touched query.- Parameters:
aObject
- the object that should be testedaPaintRepresentation
- the paint representationaViewPoint
- the view pointaSensitivity
- the sensitivity
-
TLspIsTouchedQuery
Creates a new is touched query for a label.- Parameters:
aLabel
- the label that should be testedaViewPoint
- the view pointaSensitivity
- the sensitivity
-
TLspIsTouchedQuery
public TLspIsTouchedQuery(TLspLabelID aLabel, ILcdPoint aViewPoint, double aSensitivity, ALspLabelLocation aLabelLocation) Creates a new is touched query for a label, for the given location. If this location is null, the label location is retrieved from theILspLabelPlacer
instead.- Parameters:
aLabel
- the label that should be testedaViewPoint
- the view pointaSensitivity
- the sensitivity
-
-
Method Details
-
getObject
Returns the object that should be queried.- Returns:
- the object
-
getLabel
Returns the label that should be queried.- Returns:
- the label
-
getLabelLocation
Returns the label location for the label that should be queried.- Returns:
- the label location. Can be
null
.
-
getPaintRepresentation
Returns the paint representation that should be queried.- Returns:
- the paint representation
-
getViewPoint
Returns the view point that should be queried.- Returns:
- the view point
-
getSensitivity
public double getSensitivity()Returns the sensitivity in pixels.- Returns:
- the sensitivity
-
getResult
Returns whether the object is touched.- Specified by:
getResult
in classALspPaintQuery<Boolean>
- Returns:
true
if the object is touched,false
otherwise
-
touched
Called if the object is touched at a point in world coordinates. Note that theaTouchInfo
may change after this method call returns. The implementation can create aALspTouchInfo.clone()
if it still needs it after the method call returns.- Parameters:
aTouchInfo
- the touch info- Returns:
true
if the query should continue,false
if it should stop
-
touched
Called if the object is touched at a point in view coordinates. Note that theaTouchInfo
may change after this method call returns. The implementation can create aALspTouchInfo.clone()
if it still needs it after the method call returns.- Parameters:
aTouchInfo
- the touch info- Returns:
true
if the query should continue,false
if it should stop
-
isTouched
public boolean isTouched()Returns whether the object is touched.- Returns:
true
if the object is touched,false
otherwise
-
getTouchInfo
Returns the touch info if the object is touched.- Returns:
- the touch info or
null
-