Package org.apache.batik.bridge
Class FocusManager
- java.lang.Object
-
- org.apache.batik.bridge.FocusManager
-
- Direct Known Subclasses:
SVG12FocusManager
public class FocusManager extends java.lang.ObjectA class that manages focus on elements.- Version:
- $Id: FocusManager.java 1851346 2019-01-15 13:41:00Z ssteiner $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFocusManager.DOMFocusInTrackerThe class that is responsible for tracking 'DOMFocusIn' changes.protected classFocusManager.DOMFocusOutTrackerThe class that is responsible for tracking 'DOMFocusOut' changes.protected classFocusManager.MouseClickTrackerThe class that is responsible for tracking 'mouseclick' changes.protected classFocusManager.MouseOutTrackerThe class that is responsible to update the focus according to 'mouseout' event.protected classFocusManager.MouseOverTrackerThe class that is responsible to update the focus according to 'mouseover' event.
-
Field Summary
Fields Modifier and Type Field Description protected org.w3c.dom.DocumentdocumentThe document.protected org.w3c.dom.events.EventListenerdomFocusInListenerThe EventListener that tracks 'DOMFocusIn' events.protected org.w3c.dom.events.EventListenerdomFocusOutListenerThe EventListener that tracks 'DOMFocusOut' events.protected org.w3c.dom.events.EventTargetlastFocusEventTargetThe element that has the focus so far.protected org.w3c.dom.events.EventListenermouseclickListenerThe EventListener that tracks 'mouseclick' events.protected org.w3c.dom.events.EventListenermouseoutListenerThe EventListener that tracks 'mouseout' events.protected org.w3c.dom.events.EventListenermouseoverListenerThe EventListener that tracks 'mouseover' events.
-
Constructor Summary
Constructors Constructor Description FocusManager(org.w3c.dom.Document doc)Constructs a newFocusManagerfor the specified document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddEventListeners(org.w3c.dom.Document doc)Adds the event listeners to the document.voiddispose()Removes all listeners attached to the document and that manage focus.protected voidfireDOMActivateEvent(org.w3c.dom.events.EventTarget target, int detailArg)Fires a 'DOMActivate' event to the specified target.protected voidfireDOMFocusInEvent(org.w3c.dom.events.EventTarget target, org.w3c.dom.events.EventTarget relatedTarget)Fires a 'DOMFocusIn' event to the specified target.protected voidfireDOMFocusOutEvent(org.w3c.dom.events.EventTarget target, org.w3c.dom.events.EventTarget relatedTarget)Fires a 'DOMFocusOut' event to the specified target.org.w3c.dom.events.EventTargetgetCurrentEventTarget()Returns the current element that has the focus or null if any.protected voidremoveEventListeners(org.w3c.dom.Document doc)Removes the event listeners from the document.
-
-
-
Field Detail
-
lastFocusEventTarget
protected org.w3c.dom.events.EventTarget lastFocusEventTarget
The element that has the focus so far.
-
document
protected org.w3c.dom.Document document
The document.
-
mouseclickListener
protected org.w3c.dom.events.EventListener mouseclickListener
The EventListener that tracks 'mouseclick' events.
-
domFocusInListener
protected org.w3c.dom.events.EventListener domFocusInListener
The EventListener that tracks 'DOMFocusIn' events.
-
domFocusOutListener
protected org.w3c.dom.events.EventListener domFocusOutListener
The EventListener that tracks 'DOMFocusOut' events.
-
mouseoverListener
protected org.w3c.dom.events.EventListener mouseoverListener
The EventListener that tracks 'mouseover' events.
-
mouseoutListener
protected org.w3c.dom.events.EventListener mouseoutListener
The EventListener that tracks 'mouseout' events.
-
-
Method Detail
-
addEventListeners
protected void addEventListeners(org.w3c.dom.Document doc)
Adds the event listeners to the document.
-
removeEventListeners
protected void removeEventListeners(org.w3c.dom.Document doc)
Removes the event listeners from the document.
-
getCurrentEventTarget
public org.w3c.dom.events.EventTarget getCurrentEventTarget()
Returns the current element that has the focus or null if any.
-
dispose
public void dispose()
Removes all listeners attached to the document and that manage focus.
-
fireDOMFocusInEvent
protected void fireDOMFocusInEvent(org.w3c.dom.events.EventTarget target, org.w3c.dom.events.EventTarget relatedTarget)Fires a 'DOMFocusIn' event to the specified target.- Parameters:
target- the newly focussed event targetrelatedTarget- the previously focussed event target
-
fireDOMFocusOutEvent
protected void fireDOMFocusOutEvent(org.w3c.dom.events.EventTarget target, org.w3c.dom.events.EventTarget relatedTarget)Fires a 'DOMFocusOut' event to the specified target.- Parameters:
target- the previously focussed event targetrelatedTarget- the newly focussed event target
-
fireDOMActivateEvent
protected void fireDOMActivateEvent(org.w3c.dom.events.EventTarget target, int detailArg)Fires a 'DOMActivate' event to the specified target.- Parameters:
target- the event targetdetailArg- the detailArg parameter of the event
-
-