Class FocusManager

java.lang.Object
org.apache.batik.bridge.FocusManager
Direct Known Subclasses:
SVG12FocusManager

public class FocusManager extends Object
A class that manages focus on elements.
  • Field Details

    • lastFocusEventTarget

      protected EventTarget lastFocusEventTarget
      The element that has the focus so far.
    • document

      protected Document document
      The document.
    • mouseclickListener

      protected EventListener mouseclickListener
      The EventListener that tracks 'mouseclick' events.
    • domFocusInListener

      protected EventListener domFocusInListener
      The EventListener that tracks 'DOMFocusIn' events.
    • domFocusOutListener

      protected EventListener domFocusOutListener
      The EventListener that tracks 'DOMFocusOut' events.
    • mouseoverListener

      protected EventListener mouseoverListener
      The EventListener that tracks 'mouseover' events.
    • mouseoutListener

      protected EventListener mouseoutListener
      The EventListener that tracks 'mouseout' events.
  • Constructor Details

    • FocusManager

      public FocusManager(Document doc)
      Constructs a new FocusManager for the specified document.
      Parameters:
      doc - the document
  • Method Details

    • addEventListeners

      protected void addEventListeners(Document doc)
      Adds the event listeners to the document.
    • removeEventListeners

      protected void removeEventListeners(Document doc)
      Removes the event listeners from the document.
    • getCurrentEventTarget

      public 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(EventTarget target, EventTarget relatedTarget)
      Fires a 'DOMFocusIn' event to the specified target.
      Parameters:
      target - the newly focussed event target
      relatedTarget - the previously focussed event target
    • fireDOMFocusOutEvent

      protected void fireDOMFocusOutEvent(EventTarget target, EventTarget relatedTarget)
      Fires a 'DOMFocusOut' event to the specified target.
      Parameters:
      target - the previously focussed event target
      relatedTarget - the newly focussed event target
    • fireDOMActivateEvent

      protected void fireDOMActivateEvent(EventTarget target, int detailArg)
      Fires a 'DOMActivate' event to the specified target.
      Parameters:
      target - the event target
      detailArg - the detailArg parameter of the event