blob: 37c2749def10798eb192ab340343658a913b819d [file] [log] [blame]
{ "type": "class",
"qname": "org.apache.royale.textLayout.events.FlowElementMouseEventManager",
"baseClassname": ""
,
"description": "The ElementMouseEventManager class provides mouse element processing for visible FlowElements. The caller calls updateHitTests(), which traverses the FlowElement tree in the given character range, and collects hit test rectangles for FlowElements with active event mirrors, and LinkElements. The latter class exposes a number of mouse event handlers that this class calls directly. If no character range is supplied, the class makes an educated guess about the visible character range by inspecting the TextLine instances connected to the container widget as children. In edit mode, moving the mouse over the element and clicking it should not activate it, but rather allow for editing. Passing in the value true as an argument to updateHitTests() requires the Ctrl key to be held down in order to pass mouse events on the FlowElements. If the user presses or releases the Ctrl key while the mouse is over the container widget (and the pressing of the Ctrl key is required for activation, the class simulates mouseOut and mouseOver events to inform the FlowElement underneath about the change. The class dispatches only FlowElementMouseEvents. This class emits click events if the main mouse button is pressed and released over the same FlowElement. The owner may choose to forward several mouse and keyboard events to this class so it does not need to listen to these events at the container itself. The constructor takes an array of event names that this class needs to listen to itself. The events that this class needs to listen to are MouseEvent.MOUSE_OVER, MouseEvent.MOUSE_OUT, MouseEvent.MOUSE_DOWN, MouseEvent.MOUSE_UP, MouseEvent.MOUSE_MOVE, KeyboardEvent.KEY_DOWN, and KeyboardEvent.KEY_UP. Note that MouseEvent.CLICK is not needed.",
"members": [
{ "type": "method",
"qname": "org.apache.royale.textLayout.events.FlowElementMouseEventManager",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The constructor needs the container that contains the TextLines to be checked for visible, clicked elements. The container is also used as the event dispatcher for mouse events.",
"tags": [
{ "tagName": "param",
"values": ["container The container holding the TextLines and emitting mouse events", "eventNames An array of event names that the owner supplies itself."]} ],
"return": "",
"params": [{ "name": "container", "type": "org.apache.royale.core.IParentIUIBase"},
{ "name": "eventNames", "type": "Array"}]}
,
{ "type": "method",
"qname": "mouseToContainer",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Convert local mouse event coordinates, which are relative to the container or one of its children (the event's target is the current element) to container coordinates. TODO: This is temporary code.",
"tags": [
{ "tagName": "param",
"values": ["evt The mouse event containing the point to be converted."]},
{ "tagName": "return",
"values": ["A new Point instance containing the converted coordinates."]} ],
"return": "org.apache.royale.geom.Point",
"params": [{ "name": "evt", "type": "org.apache.royale.events.MouseEvent"}]}
,
{ "type": "accessor",
"access": "read-write",
"return": "Boolean",
"qname": "needsCtrlKey",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Retrieve the status of the flag that controls whether the Ctrl key is needed to activate event generation."},
{ "type": "method",
"qname": "updateHitTests",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Create an array of all FlowElements that are currently visible and that have an active event mirror, plus all LinkElements by default, and update the hit test area for these FlowElements. Clip the elements against the given clipping rectangle. All coordinates are assumed to be container coordinates. <p>If the start index is -1 and or the end index is -1, the method attempts to make an educated guess about the visible part of the text by inspecting the visible TextLine instances, and using their textBlockBeginIndex values as character offsets into the TextFlow tree. Note that this method may be slow if the container contains an entire tree of DisplayObjects, because the tree must be scanned recursively. It is always better to supply the start and end positions.</p> determine the first visible character. determine the last visible character. the Ctrl key is down. If the text is editable, simple clicks and moves should remain in the container rather than be forwarded to the element.",
"tags": [
{ "tagName": "param",
"values": ["clipRect The clipping rectangle, in container coordinates.", "textFlow The TextFlow instance containing the elements to be tracked", "startPos The character start position. If -1, the method attempts to", "endPos The character end position. If -1, the method attempts to", "needsCtrlKey If true, the event handler does not emit events unless"]} ],
"return": "void",
"params": [{ "name": "xoffset", "type": "Number"},
{ "name": "clipRect", "type": "org.apache.royale.geom.Rectangle"},
{ "name": "textFlow", "type": "org.apache.royale.textLayout.elements.ITextFlow"},
{ "name": "startPos", "type": "int"},
{ "name": "endPos", "type": "int"},
{ "name": "container", "type": "org.apache.royale.textLayout.container.IContainerController"},
{ "name": "needsCtrlKey", "type": "Boolean"}]}
,
{ "type": "method",
"qname": "stopHitTests",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Stop hit testing altogether. You must call this method if the FlowElement structure of the visible area has changed; you should also call this method if the visible area is rebuilt completely.",
"return": "void",
"params": []}
,
{ "type": "method",
"qname": "dispatchEvent",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Dispatch the mouse and keyboard events that the owner sends.",
"return": "void",
"params": [{ "name": "evt", "type": "org.apache.royale.events.Event"}]}
]
}