Package | com.yworks.canvas.input |
Class | public class MouseHoverInputMode |
Inheritance | MouseHoverInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
IInputMode
that detects when the mouse hovers over the
CanvasComponent
.
This implementation will show a ToolTip
.
In order to make use of this instance one has to provide a textProvider
function to the instance.
Setting a custom validHoverLocationHitTestable
will restrict the area where a tooltip can be shown.
See also
Property | Defined By | ||
---|---|---|---|
canvas : CanvasComponent [read-only]
The canvas instance this mode is currently installed in or null
| AbstractInputMode | ||
controller : ConcurrencyController
Gets or injects the ConcurrencyController for this instance. | AbstractConcurrentInputMode | ||
enabled : Boolean
Gets or sets the enabled state of this input mode. | AbstractConcurrentInputMode | ||
hideDelay : uint
The duration a tooltip is visible, in milliseconds. | MouseHoverInputMode | ||
hideEffect : Effect
The effect that is triggered when a tooltip is to be hidden. | MouseHoverInputMode | ||
inputModeContext : IInputModeContext [read-only]
The context instance this mode is currently installed in or
null if this instance is not installed. | AbstractInputMode | ||
installed : Boolean [read-only]
Whether this mode is currently installed, i.e
if a call to the canvas property will yield a non-null result. | AbstractInputMode | ||
preferredCursor : Cursor
Gets or sets the cursor this mode would like to have displayed in the CanvasComponent. | AbstractConcurrentInputMode | ||
showDelay : uint
The delay between a mouse hover over a target item and
the display of a tooltip for this item. | MouseHoverInputMode | ||
showEffect : Effect
The effect that is triggered when a tooltip is to be shown. | MouseHoverInputMode | ||
showing : Boolean
Determines whether the tooltip is currently showing. | MouseHoverInputMode | ||
textProvider : Function
Gets or sets the provider callback that returns a tool tip text for a given location. | MouseHoverInputMode | ||
toolTip : DisplayObject
Gets or sets the toolTip instance to use during display. | MouseHoverInputMode | ||
validHoverLocationHitTestable : IHitTestable
Gets or sets an IHitTestable that determines where
the mouse may hover and a Tooltip can be shown. | MouseHoverInputMode |
Property | Defined By | ||
---|---|---|---|
_lastMouseEvent : CanvasMouseEvent | MouseHoverInputMode |
Method | Defined By | ||
---|---|---|---|
MouseHoverInputMode(toolTip:DisplayObject = null, textProvider:Function = null)
Creates a new instance using the provided ToolTip and text provider. | MouseHoverInputMode | ||
cancel():void [override]
Releases the mutex if this input mode currently
owns the mutex. | AbstractConcurrentInputMode | ||
dispose():void
Disposes this input mode. | AbstractInputMode | ||
hide():void
Immediately hides the tooltip. | MouseHoverInputMode | ||
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | ||
show(x:Number, y:Number):void
Immediately shows the tooltip at the given location. | MouseHoverInputMode | ||
stop():Boolean [override]
Returns true if this input mode doesn't own
the mutex. | AbstractConcurrentInputMode | ||
uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode |
Method | Defined By | ||
---|---|---|---|
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | ||
Creates an IInputModeContext for use
with the textProvider function for the upcoming
text query operation. | MouseHoverInputMode | ||
createToolTip():DisplayObject
Create a DisplayObject that will be shown as a tooltip. | MouseHoverInputMode | ||
fireInstalled():void | AbstractInputMode | ||
fireInstalling():void | AbstractInputMode | ||
fireUninstalled():void | AbstractInputMode | ||
fireUninstalling():void | AbstractInputMode | ||
getToolTipLocation(x:Number, y:Number):IPoint
Finds the position in view coordinates to
display the tooltip at for the given world coordinates. | MouseHoverInputMode | ||
getToolTipText(location:IPoint):String
Callback method that provides a text for the given location or null. | MouseHoverInputMode | ||
hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | ||
initialize():void
Performs one-time initialization of this instance. | AbstractInputMode | ||
initializeAndSizeTip(text:String):void
Initialize the current tooltip before it is shown. | MouseHoverInputMode | ||
installCore(context:IInputModeContext):void [override]
Installs this mode into the given canvas. | MouseHoverInputMode | ||
invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | ||
onDisabled():void [override]
Called when the enabled property changes to false. | MouseHoverInputMode | ||
onEnabled():void
Called when the enabled property changes to true. | AbstractConcurrentInputMode | ||
onHide():void
Called when the tooltip should be hidden. | MouseHoverInputMode | ||
onHideTimer(evt:TimerEvent):void
Called by a timer to hide the tooltip. | MouseHoverInputMode | ||
onMouseEvent(evt:CanvasMouseEvent):void
Called when a mouse event occurs. | MouseHoverInputMode | ||
onMutexObtained():void
Called when this instance obtains the InputMutex. | AbstractConcurrentInputMode | ||
onMutexReleased():void
Called when this instance released the InputMutex. | AbstractConcurrentInputMode | ||
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | ||
onShow(x:Number, y:Number):void
Triggered when the mouse hovers over the given coordinates. | MouseHoverInputMode | ||
onShowTimer(evt:TimerEvent):void
Called by a timer when the mouse hovers. | MouseHoverInputMode | ||
releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | ||
requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | ||
setTipLocation(x:Number, y:Number):void
Set the location of the current tooltip when it is shown. | MouseHoverInputMode | ||
sizeTip():void
Set the size of a toolTip. | MouseHoverInputMode | ||
uninstallCore(context:IInputModeContext):void [override]
Uninstalls this mode from the given canvas. | MouseHoverInputMode |
_lastMouseEvent | property |
protected var _lastMouseEvent:CanvasMouseEvent
hideDelay | property |
hideDelay:uint
The duration a tooltip is visible, in milliseconds.
The default value is 3000
.
This property can be used as the source for data binding.
public function get hideDelay():uint
public function set hideDelay(value:uint):void
hideEffect | property |
hideEffect:Effect
The effect that is triggered when a tooltip is to be hidden.
The default value is null
.
public function get hideEffect():Effect
public function set hideEffect(value:Effect):void
showDelay | property |
showDelay:uint
The delay between a mouse hover over a target item and the display of a tooltip for this item.
The default value is 500
.
This property can be used as the source for data binding.
public function get showDelay():uint
public function set showDelay(value:uint):void
showEffect | property |
showEffect:Effect
The effect that is triggered when a tooltip is to be shown.
The default value is null
.
public function get showEffect():Effect
public function set showEffect(value:Effect):void
showing | property |
showing:Boolean
Determines whether the tooltip is currently showing.
public function get showing():Boolean
public function set showing(value:Boolean):void
textProvider | property |
textProvider:Function
Gets or sets the provider callback that returns a tool tip text for a given location.
The textProvider function is a function that takes a IInputModeContext
and an IPoint
that specifies the tooltip location as arguments and returns a String
:
function myTooltipTextProvider( context:IInputModeContext, location:IPoint ):String { var s:String; .. return s; }
public function get textProvider():Function
public function set textProvider(value:Function):void
See also
toolTip | property |
toolTip:DisplayObject
Gets or sets the toolTip
instance to use during display.
This method will trigger the createToolTip
method
if no tool tip has been set.
public function get toolTip():DisplayObject
public function set toolTip(value:DisplayObject):void
validHoverLocationHitTestable | property |
validHoverLocationHitTestable:IHitTestable
Gets or sets an IHitTestable
that determines where
the mouse may hover and a Tooltip can be shown.
The default value of this property always returns true.
public function get validHoverLocationHitTestable():IHitTestable
public function set validHoverLocationHitTestable(value:IHitTestable):void
MouseHoverInputMode | () | Constructor |
public function MouseHoverInputMode(toolTip:DisplayObject = null, textProvider:Function = null)
Creates a new instance using the provided ToolTip and text provider.
ParameterstoolTip:DisplayObject (default = null ) — The DisplayObject that will be shown as a tool tip.
If null , a mx.controls.ToolTip instance is used.
| |
textProvider:Function (default = null ) — The text provider function
|
See also
createHoverInputModeContext | () | method |
protected function createHoverInputModeContext():IInputModeContext
Creates an IInputModeContext
for use
with the textProvider
function for the upcoming
text query operation.
IInputModeContext — An instance of IInputModeContext .
|
See also
createToolTip | () | method |
protected function createToolTip():DisplayObject
Create a DisplayObject
that will be shown as a tooltip.
If the tooltip is an IStyleClient
, it will be shown and hidden
using the showEffect
and hideEffect
properties.
If the tooltip is not an IUIComponent
, initializeAndSizeTip
will have to be overridden to correctly initialize the tooltip.
DisplayObject — A DisplayObject to use as a tooltip.
|
getToolTipLocation | () | method |
protected function getToolTipLocation(x:Number, y:Number):IPoint
Finds the position in view coordinates to display the tooltip at for the given world coordinates.
Parameters
x:Number — The x world coordinate.
| |
y:Number — The y world coordinate.
|
IPoint — The position in view coordinates.
|
getToolTipText | () | method |
protected function getToolTipText(location:IPoint):String
Callback method that provides a text for the given location or null
.
Parameters
location:IPoint — The location to find a text for.
|
String — A string or null to indicate that no ToolTip should be shown.
|
See also
hide | () | method |
public function hide():void
Immediately hides the tooltip.
initializeAndSizeTip | () | method |
protected function initializeAndSizeTip(text:String):void
Initialize the current tooltip before it is shown.
Parameters
text:String |
installCore | () | method |
override protected function installCore(context:IInputModeContext):void
Installs this mode into the given canvas.
Installation usually means registering some event listeners
on the canvasComponent
or on canvasComponent.root
.
Parameters
context:IInputModeContext — The context containing the graph canvas that this instance shall be installed into
|
onDisabled | () | method |
override protected function onDisabled():void
Called when the enabled
property changes to false
.
This implementation sets the preferredCursor
property to null
.
onHide | () | method |
protected function onHide():void
Called when the tooltip should be hidden.
onHideTimer | () | method |
protected function onHideTimer(evt:TimerEvent):void
Called by a timer to hide the tooltip.
Parameters
evt:TimerEvent — The timer event.
|
onMouseEvent | () | method |
protected function onMouseEvent(evt:CanvasMouseEvent):void
Called when a mouse event occurs.
Parameters
evt:CanvasMouseEvent — The mouse event to handle.
|
onShow | () | method |
protected function onShow(x:Number, y:Number):void
Triggered when the mouse hovers over the given coordinates.
This method will call getToolTipText
to query the text
and will display the toolTip
at the location
returned by getToolTipLocation
if the text is not null
.
Parameters
x:Number — The x coordinate in world coordinates
| |
y:Number — The y coordinate in world coordinates
|
onShowTimer | () | method |
protected function onShowTimer(evt:TimerEvent):void
Called by a timer when the mouse hovers.
Parameters
evt:TimerEvent — The timer event.
|
setTipLocation | () | method |
protected function setTipLocation(x:Number, y:Number):void
Set the location of the current tooltip when it is shown.
Parameters
x:Number — The x-coordinate of the tooltip location in stage coordinates.
| |
y:Number — The y-coordinate of the tooltip location in stage coordinates.
|
show | () | method |
public function show(x:Number, y:Number):void
Immediately shows the tooltip at the given location.
Parameters
x:Number — The x location in the world coordinate system.
| |
y:Number — The y location in the world coordinate system.
|
sizeTip | () | method |
protected function sizeTip():void
Set the size of a toolTip.
It is assumed that toolTip
is an IUIComponent
.
If not, override this method.
ArgumentError — if toolTip is not an IUIComponent .
|
uninstallCore | () | method |
override protected function uninstallCore(context:IInputModeContext):void
Uninstalls this mode from the given canvas.
This code should clean up all changes made to the canvas in the install
method. After a mode has been uninstalled it can be installed again into the same or
another canvas.
Parameters
context:IInputModeContext — The context containing the graph canvas that this instance shall be deregistered from.
|
See also