org.apache.batik.dom_1.6.0.v201011041432

nt DOM_VK_BRACELEFT = 161;
  public static final int DOM_VK_BRACERIGHT = 162;
  public static final int DOM_VK_C = 67;
  public static final int DOM_VK_CANCEL = 3;
  public static final int DOM_VK_CAPS_LOCK = 20;
  public static final int DOM_VK_CIRCUMFLEX = 514;
  public static final int DOM_VK_CLEAR = 12;
  public static final int DOM_VK_CLOSE_BRACKET = 93;
  public static final int DOM_VK_CODE_INPUT = 258;
  public static final int DOM_VK_COLON = 513;
  public static final int DOM_VK_COMMA = 44;
  public static final int DOM_VK_COMPOSE = 65312;
  public static final int DOM_VK_CONTROL = 17;
  public static final int DOM_VK_CONVERT = 28;
  public static final int DOM_VK_COPY = 65485;
  public static final int DOM_VK_CUT = 65489;
  public static final int DOM_VK_D = 68;
  public static final int DOM_VK_DEAD_ABOVEDOT = 134;
  public static final int DOM_VK_DEAD_ABOVERING = 136;
  public static final int DOM_VK_DEAD_ACUTE = 129;
  public static final int DOM_VK_DEAD_BREVE = 133;
  public static final int DOM_VK_DEAD_CARON = 138;
  public static final int DOM_VK_DEAD_CEDILLA = 139;
  public static final int DOM_VK_DEAD_CIRCUMFLEX = 130;
  public static final int DOM_VK_DEAD_DIAERESIS = 135;
  public static final int DOM_VK_DEAD_DOUBLEACUTE = 137;
  public static final int DOM_VK_DEAD_GRAVE = 128;
  public static final int DOM_VK_DEAD_IOTA = 141;
  public static final int DOM_VK_DEAD_MACRON = 132;
  public static final int DOM_VK_DEAD_OGONEK = 140;
  public static final int DOM_VK_DEAD_SEMIVOICED_SOUND = 143;
  public static final int DOM_VK_DEAD_TILDE = 131;
  public static final int DOM_VK_DEAD_VOICED_SOUND = 142;
  public static final int DOM_VK_DECIMAL = 110;
  public static final int DOM_VK_DELETE = 127;
  public static final int DOM_VK_DIVIDE = 111;
  public static final int DOM_VK_DOLLAR = 515;
  public static final int DOM_VK_DOWN = 40;
  public static final int DOM_VK_E = 69;
  public static final int DOM_VK_END = 35;
  public static final int DOM_VK_ENTER = 13;
  public static final int DOM_VK_EQUALS = 61;
  public static final int DOM_VK_ESCAPE = 27;
  public static final int DOM_VK_EURO_SIGN = 516;
  public static final int DOM_VK_EXCLAMATION_MARK = 517;
  public static final int DOM_VK_F = 70;
  public static final int DOM_VK_F1 = 112;
  public static final int DOM_VK_F10 = 121;
  public static final int DOM_VK_F11 = 122;
  public static final int DOM_VK_F12 = 123;
  public static final int DOM_VK_F13 = 61440;
  public static final int DOM_VK_F14 = 61441;
  public static final int DOM_VK_F15 = 61442;
  public static final int DOM_VK_F16 = 61443;
  public static final int DOM_VK_F17 = 61444;
  public static final int DOM_VK_F18 = 61445;
  public static final int DOM_VK_F19 = 61446;
  public static final int DOM_VK_F2 = 113;
  public static final int DOM_VK_F20 = 61447;
  public static final int DOM_VK_F21 = 61448;
  public static final int DOM_VK_F22 = 61449;
  public static final int DOM_VK_F23 = 61450;
  public static final int DOM_VK_F24 = 61451;
  public static final int DOM_VK_F3 = 114;
  public static final int DOM_VK_F4 = 115;
  public static final int DOM_VK_F5 = 116;
  public static final int DOM_VK_F6 = 117;
  public static final int DOM_VK_F7 = 118;
  public static final int DOM_VK_F8 = 119;
  public static final int DOM_VK_F9 = 120;
  public static final int DOM_VK_FINAL = 24;
  public static final int DOM_VK_FIND = 65488;
  public static final int DOM_VK_FULL_WIDTH = 243;
  public static final int DOM_VK_G = 71;
  public static final int DOM_VK_GREATER = 160;
  public static final int DOM_VK_H = 72;
  public static final int DOM_VK_HALF_WIDTH = 244;
  public static final int DOM_VK_HELP = 156;
  public static final int DOM_VK_HIRAGANA = 242;
  public static final int DOM_VK_HOME = 36;
  public static final int DOM_VK_I = 73;
  public static final int DOM_VK_INSERT = 155;
  public static final int DOM_VK_INVERTED_EXCLAMATION_MARK = 518;
  public static final int DOM_VK_J = 74;
  public static final int DOM_VK_JAPANESE_HIRAGANA = 260;
  public static final int DOM_VK_JAPANESE_KATAKANA = 259;
  public static final int DOM_VK_JAPANESE_ROMAN = 261;
  public static final int DOM_VK_K = 75;
  public static final int DOM_VK_KANA = 21;
  public static final int DOM_VK_KANJI = 25;
  public static final int DOM_VK_KATAKANA = 241;
  public static final int DOM_VK_KP_DOWN = 225;
  public static final int DOM_VK_KP_LEFT = 226;
  public static final int DOM_VK_KP_RIGHT = 227;
  public static final int DOM_VK_KP_UP = 224;
  public static final int DOM_VK_L = 76;
  public static final int DOM_VK_LEFT = 37;
  public static final int DOM_VK_LEFT_PARENTHESIS = 519;
  public static final int DOM_VK_LESS = 153;
  public static final int DOM_VK_M = 77;
  public static final int DOM_VK_META = 157;
  public static final int DOM_VK_MINUS = 45;
  public static final int DOM_VK_MODECHANGE = 31;
  public static final int DOM_VK_MULTIPLY = 106;
  public static final int DOM_VK_N = 78;
  public static final int DOM_VK_NONCONVERT = 29;
  public static final int DOM_VK_NUM_LOCK = 144;
  public static final int DOM_VK_NUMBER_SIGN = 520;
  public static final int DOM_VK_NUMPAD0 = 96;
  public static final int DOM_VK_NUMPAD1 = 97;
  public static final int DOM_VK_NUMPAD2 = 98;
  public static final int DOM_VK_NUMPAD3 = 99;
  public static final int DOM_VK_NUMPAD4 = 100;
  public static final int DOM_VK_NUMPAD5 = 101;
  public static final int DOM_VK_NUMPAD6 = 102;
  public static final int DOM_VK_NUMPAD7 = 103;
  public static final int DOM_VK_NUMPAD8 = 104;
  public static final int DOM_VK_NUMPAD9 = 105;
  public static final int DOM_VK_O = 79;
  public static final int DOM_VK_OPEN_BRACKET = 91;
  public static final int DOM_VK_P = 80;
  public static final int DOM_VK_PAGE_DOWN = 34;
  public static final int DOM_VK_PAGE_UP = 33;
  public static final int DOM_VK_PASTE = 65487;
  public static final int DOM_VK_PAUSE = 19;
  public static final int DOM_VK_PERIOD = 46;
  public static final int DOM_VK_PLUS = 521;
  public static final int DOM_VK_PREVIOUS_CANDIDATE = 257;
  public static final int DOM_VK_PRINTSCREEN = 154;
  public static final int DOM_VK_PROPS = 65482;
  public static final int DOM_VK_Q = 81;
  public static final int DOM_VK_QUOTE = 222;
  public static final int DOM_VK_QUOTEDBL = 152;
  public static final int DOM_VK_R = 82;
  public static final int DOM_VK_RIGHT = 39;
  public static final int DOM_VK_RIGHT_PARENTHESIS = 522;
  public static final int DOM_VK_ROMAN_CHARACTERS = 245;
  public static final int DOM_VK_S = 83;
  public static final int DOM_VK_SCROLL_LOCK = 145;
  public static final int DOM_VK_SEMICOLON = 59;
  public static final int DOM_VK_SEPARATER = 108;
  public static final int DOM_VK_SHIFT = 16;
  public static final int DOM_VK_SLASH = 47;
  public static final int DOM_VK_SPACE = 32;
  public static final int DOM_VK_STOP = 65480;
  public static final int DOM_VK_SUBTRACT = 109;
  public static final int DOM_VK_T = 84;
  public static final int DOM_VK_TAB = 9;
  public static final int DOM_VK_U = 85;
  public static final int DOM_VK_UNDEFINED = 0;
  public static final int DOM_VK_UNDERSCORE = 523;
  public static final int DOM_VK_UNDO = 65483;
  public static final int DOM_VK_UP = 38;
  public static final int DOM_VK_V = 86;
  public static final int DOM_VK_W = 87;
  public static final int DOM_VK_X = 88;
  public static final int DOM_VK_Y = 89;
  public static final int DOM_VK_Z = 90;
  protected boolean ctrlKey;
  protected boolean altKey;
  protected boolean shiftKey;
  protected boolean metaKey;
  protected int keyCode;
  protected int charCode;
  
  public boolean getCtrlKey()
  {
    return ctrlKey;
  }
  
  public boolean getShiftKey()
  {
    return shiftKey;
  }
  
  public boolean getAltKey()
  {
    return altKey;
  }
  
  public boolean getMetaKey()
  {
    return metaKey;
  }
  
  public int getKeyCode()
  {
    return keyCode;
  }
  
  public int getCharCode()
  {
    return charCode;
  }
  
  public void initKeyEvent(String paramString, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, boolean paramBoolean4, boolean paramBoolean5, boolean paramBoolean6, int paramInt1, int paramInt2, AbstractView paramAbstractView)
  {
    initUIEvent(paramString, paramBoolean1, paramBoolean2, paramAbstractView, 0);
    ctrlKey = paramBoolean3;
    altKey = paramBoolean4;
    shiftKey = paramBoolean5;
    metaKey = paramBoolean6;
    keyCode = paramInt1;
    charCode = paramInt2;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DOMKeyEvent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.EventTarget;
import org.w3c.dom.events.MouseEvent;
import org.w3c.dom.views.AbstractView;

public class DOMMouseEvent
  extends DOMUIEvent
  implements MouseEvent
{
  private int screenX;
  private int screenY;
  private int clientX;
  private int clientY;
  private boolean ctrlKey;
  private boolean altKey;
  private boolean shiftKey;
  private boolean metaKey;
  private short button;
  private EventTarget relatedTarget;
  
  public int getScreenX()
  {
    return screenX;
  }
  
  public int getScreenY()
  {
    return screenY;
  }
  
  public int getClientX()
  {
    return clientX;
  }
  
  public int getClientY()
  {
    return clientY;
  }
  
  public boolean getCtrlKey()
  {
    return ctrlKey;
  }
  
  public boolean getShiftKey()
  {
    return shiftKey;
  }
  
  public boolean getAltKey()
  {
    return altKey;
  }
  
  public boolean getMetaKey()
  {
    return metaKey;
  }
  
  public short getButton()
  {
    return button;
  }
  
  public EventTarget getRelatedTarget()
  {
    return relatedTarget;
  }
  
  public void initMouseEvent(String paramString, boolean paramBoolean1, boolean paramBoolean2, AbstractView paramAbstractView, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, boolean paramBoolean3, boolean paramBoolean4, boolean paramBoolean5, boolean paramBoolean6, short paramShort, EventTarget paramEventTarget)
  {
    initUIEvent(paramString, paramBoolean1, paramBoolean2, paramAbstractView, paramInt1);
    screenX = paramInt2;
    screenY = paramInt3;
    clientX = paramInt4;
    clientY = paramInt5;
    ctrlKey = paramBoolean3;
    altKey = paramBoolean4;
    shiftKey = paramBoolean5;
    metaKey = paramBoolean6;
    button = paramShort;
    relatedTarget = paramEventTarget;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DOMMouseEvent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.Node;
import org.w3c.dom.events.MutationEvent;

public class DOMMutationEvent
  extends AbstractEvent
  implements MutationEvent
{
  private Node relatedNode;
  private String prevValue;
  private String newValue;
  private String attrName;
  private short attrChange;
  
  public Node getRelatedNode()
  {
    return relatedNode;
  }
  
  public String getPrevValue()
  {
    return prevValue;
  }
  
  public String getNewValue()
  {
    return newValue;
  }
  
  public String getAttrName()
  {
    return attrName;
  }
  
  public short getAttrChange()
  {
    return attrChange;
  }
  
  public void initMutationEvent(String paramString1, boolean paramBoolean1, boolean paramBoolean2, Node paramNode, String paramString2, String paramString3, String paramString4, short paramShort)
  {
    initEvent(paramString1, paramBoolean1, paramBoolean2);
    relatedNode = paramNode;
    prevValue = paramString2;
    newValue = paramString3;
    attrName = paramString4;
    attrChange = paramShort;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DOMMutationEvent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.UIEvent;
import org.w3c.dom.views.AbstractView;

public class DOMUIEvent
  extends AbstractEvent
  implements UIEvent
{
  private AbstractView view;
  private int detail;
  
  public AbstractView getView()
  {
    return view;
  }
  
  public int getDetail()
  {
    return detail;
  }
  
  public void initUIEvent(String paramString, boolean paramBoolean1, boolean paramBoolean2, AbstractView paramAbstractView, int paramInt)
  {
    initEvent(paramString, paramBoolean1, paramBoolean2);
    view = paramAbstractView;
    detail = paramInt;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DOMUIEvent
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.Event;

public abstract interface DocumentEventSupport$EventFactory
{
  public abstract Event createEvent();
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DocumentEventSupport.EventFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.Event;

public class DocumentEventSupport$KeyEventFactory
  implements DocumentEventSupport.EventFactory
{
  public Event createEvent()
  {
    return new DOMKeyEvent();
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DocumentEventSupport.KeyEventFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.Event;

public class DocumentEventSupport$MouseEventFactory
  implements DocumentEventSupport.EventFactory
{
  public Event createEvent()
  {
    return new DOMMouseEvent();
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DocumentEventSupport.MouseEventFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.Event;

public class DocumentEventSupport$MutationEventFactory
  implements DocumentEventSupport.EventFactory
{
  public Event createEvent()
  {
    return new DOMMutationEvent();
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DocumentEventSupport.MutationEventFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.Event;

public class DocumentEventSupport$SimpleEventFactory
  implements DocumentEventSupport.EventFactory
{
  public Event createEvent()
  {
    return new DOMEvent();
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DocumentEventSupport.SimpleEventFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.Event;

public class DocumentEventSupport$UIEventFactory
  implements DocumentEventSupport.EventFactory
{
  public Event createEvent()
  {
    return new DOMUIEvent();
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DocumentEventSupport.UIEventFactory
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.apache.batik.dom.util.HashTable;
import org.w3c.dom.DOMException;
import org.w3c.dom.events.Event;

public class DocumentEventSupport
{
  public static final String EVENT_TYPE = "Events";
  public static final String MUTATION_EVENT_TYPE = "MutationEvents";
  public static final String MOUSE_EVENT_TYPE = "MouseEvents";
  public static final String UI_EVENT_TYPE = "UIEvents";
  public static final String KEY_EVENT_TYPE = "KeyEvents";
  protected HashTable eventFactories = new HashTable();
  
  public DocumentEventSupport()
  {
    eventFactories.put("Events".toLowerCase(), new SimpleEventFactory());
    eventFactories.put("MutationEvents".toLowerCase(), new MutationEventFactory());
    eventFactories.put("MouseEvents".toLowerCase(), new MouseEventFactory());
    eventFactories.put("KeyEvents".toLowerCase(), new KeyEventFactory());
    eventFactories.put("UIEvents".toLowerCase(), new UIEventFactory());
  }
  
  public Event createEvent(String paramString)
    throws DOMException
  {
    EventFactory localEventFactory = (EventFactory)eventFactories.get(paramString.toLowerCase());
    if (localEventFactory == null) {
      throw new DOMException((short)9, "Bad event type: " + paramString);
    }
    return localEventFactory.createEvent();
  }
  
  public void registerEventFactory(String paramString, EventFactory paramEventFactory)
  {
    eventFactories.put(paramString.toLowerCase(), paramEventFactory);
  }
  
  public static abstract interface EventFactory
  {
    public abstract Event createEvent();
  }
  
  protected static class KeyEventFactory
    implements DocumentEventSupport.EventFactory
  {
    public Event createEvent()
    {
      return new DOMKeyEvent();
    }
  }
  
  protected static class MouseEventFactory
    implements DocumentEventSupport.EventFactory
  {
    public Event createEvent()
    {
      return new DOMMouseEvent();
    }
  }
  
  protected static class MutationEventFactory
    implements DocumentEventSupport.EventFactory
  {
    public Event createEvent()
    {
      return new DOMMutationEvent();
    }
  }
  
  protected static class SimpleEventFactory
    implements DocumentEventSupport.EventFactory
  {
    public Event createEvent()
    {
      return new DOMEvent();
    }
  }
  
  protected static class UIEventFactory
    implements DocumentEventSupport.EventFactory
  {
    public Event createEvent()
    {
      return new DOMUIEvent();
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.DocumentEventSupport
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.EventListener;

public class EventListenerList$Entry
{
  EventListener listener;
  Entry next;
  
  public EventListenerList$Entry(EventListener paramEventListener, Entry paramEntry)
  {
    listener = paramEventListener;
    next = paramEntry;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.EventListenerList.Entry
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.EventListener;

public class EventListenerList
{
  protected int n = 0;
  protected Entry first = null;
  protected EventListener[] listeners = null;
  
  public EventListener[] getEventListeners()
  {
    if (first == null) {
      return null;
    }
    if (listeners != null) {
      return listeners;
    }
    listeners = new EventListener[n];
    Entry localEntry = first;
    int i = 0;
    while (i < n)
    {
      listeners[i] = listener;
      i++;
      localEntry = next;
    }
    return listeners;
  }
  
  public void add(EventListener paramEventListener)
  {
    first = new Entry(paramEventListener, first);
    listeners = null;
    n += 1;
  }
  
  public void remove(EventListener paramEventListener)
  {
    if (first == null) {
      return;
    }
    if (first.listener == paramEventListener)
    {
      first = first.next;
      listeners = null;
      n -= 1;
    }
    else
    {
      Object localObject = first;
      for (Entry localEntry = first.next; localEntry != null; localEntry = next)
      {
        if (listener == paramEventListener)
        {
          next = next;
          listeners = null;
          n -= 1;
          break;
        }
        localObject = localEntry;
      }
    }
  }
  
  public boolean contains(EventListener paramEventListener)
  {
    for (Entry localEntry = first; localEntry != null; localEntry = next) {
      if (paramEventListener == listener) {
        return true;
      }
    }
    return false;
  }
  
  public int size()
  {
    return n;
  }
  
  protected static class Entry
  {
    EventListener listener;
    Entry next;
    
    public Entry(EventListener paramEventListener, Entry paramEntry)
    {
      listener = paramEventListener;
      next = paramEntry;
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.EventListenerList
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.apache.batik.dom.util.HashTable;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventException;
import org.w3c.dom.events.EventListener;

public class EventSupport
{
  protected HashTable capturingListeners;
  protected HashTable bubblingListeners;
  
  public void addEventListener(String paramString, EventListener paramEventListener, boolean paramBoolean)
  {
    HashTable localHashTable;
    if (paramBoolean)
    {
      if (capturingListeners == null) {
        capturingListeners = new HashTable();
      }
      localHashTable = capturingListeners;
    }
    else
    {
      if (bubblingListeners == null) {
        bubblingListeners = new HashTable();
      }
      localHashTable = bubblingListeners;
    }
    EventListenerList localEventListenerList = (EventListenerList)localHashTable.get(paramString);
    if (localEventListenerList == null)
    {
      localEventListenerList = new EventListenerList();
      localHashTable.put(paramString, localEventListenerList);
    }
    if (!localEventListenerList.contains(paramEventListener)) {
      localEventListenerList.add(paramEventListener);
    }
  }
  
  public void removeEventListener(String paramString, EventListener paramEventListener, boolean paramBoolean)
  {
    HashTable localHashTable;
    if (paramBoolean) {
      localHashTable = capturingListeners;
    } else {
      localHashTable = bubblingListeners;
    }
    if (localHashTable == null) {
      return;
    }
    EventListenerList localEventListenerList = (EventListenerList)localHashTable.get(paramString);
    if (localEventListenerList != null)
    {
      localEventListenerList.remove(paramEventListener);
      if (localEventListenerList.size() == 0) {
        localHashTable.remove(paramString);
      }
    }
  }
  
  public static boolean dispatchEvent(NodeEventTarget paramNodeEventTarget, Event paramEvent)
    throws EventException
  {
    AbstractEvent localAbstractEvent = (AbstractEvent)paramEvent;
    if (localAbstractEvent == null) {
      return false;
    }
    String str = localAbstractEvent.getType();
    if (str == null) {
      throw createUnspecifiedEventTypeErr("Event type can't be null");
    }
    localAbstractEvent.setTarget(paramNodeEventTarget);
    localAbstractEvent.stopPropagation(false);
    localAbstractEvent.preventDefault(false);
    NodeEventTarget[] arrayOfNodeEventTarget = getAncestors(paramNodeEventTarget);
    localAbstractEvent.setEventPhase((short)1);
    for (int i = 0; (i < arrayOfNodeEventTarget.length) && (!localAbstractEvent.getStopPropagation()); i++)
    {
      NodeEventTarget localNodeEventTarget1 = arrayOfNodeEventTarget[i];
      localAbstractEvent.setCurrentTarget(localNodeEventTarget1);
      fireEventListeners(localNodeEventTarget1, localAbstractEvent, true);
    }
    if (!localAbstractEvent.getStopPropagation())
    {
      localAbstractEvent.setEventPhase((short)2);
      localAbstractEvent.setCurrentTarget(paramNodeEventTarget);
      fireEventListeners(paramNodeEventTarget, localAbstractEvent, false);
    }
    if (localAbstractEvent.getBubbles())
    {
      localAbstractEvent.setEventPhase((short)3);
      for (int j = arrayOfNodeEventTarget.length - 1; (j >= 0) && (!localAbstractEvent.getStopPropagation()); j--)
      {
        NodeEventTarget localNodeEventTarget2 = arrayOfNodeEventTarget[j];
        localAbstractEvent.setCurrentTarget(localNodeEventTarget2);
        fireEventListeners(localNodeEventTarget2, localAbstractEvent, false);
      }
    }
    return !localAbstractEvent.getPreventDefault();
  }
  
  private static void fireEventListeners(NodeEventTarget paramNodeEventTarget, Event paramEvent, boolean paramBoolean)
  {
    String str = paramEvent.getType();
    EventSupport localEventSupport = paramNodeEventTarget.getEventSupport();
    if (localEventSupport == null) {
      return;
    }
    EventListenerList localEventListenerList = localEventSupport.getEventListeners(str, paramBoolean);
    if (localEventListenerList == null) {
      return;
    }
    EventListener[] arrayOfEventListener = localEventListenerList.getEventListeners();
    if (arrayOfEventListener == null) {
      return;
    }
    for (int i = 0; i < arrayOfEventListener.length; i++) {
      try
      {
        arrayOfEventListener[i].handleEvent(paramEvent);
      }
      catch (ThreadDeath localThreadDeath)
      {
        throw localThreadDeath;
      }
      catch (Throwable localThrowable)
      {
        localThrowable.printStackTrace();
      }
    }
  }
  
  private static NodeEventTarget[] getAncestors(NodeEventTarget paramNodeEventTarget)
  {
    paramNodeEventTarget = paramNodeEventTarget.getParentNodeEventTarget();
    int i = 0;
    NodeEventTarget localNodeEventTarget = paramNodeEventTarget;
    while (localNodeEventTarget != null)
    {
      localNodeEventTarget = localNodeEventTarget.getParentNodeEventTarget();
      i++;
    }
    NodeEventTarget[] arrayOfNodeEventTarget = new NodeEventTarget[i];
    int j = i - 1;
    while (j >= 0)
    {
      arrayOfNodeEventTarget[j] = paramNodeEventTarget;
      j--;
      paramNodeEventTarget = paramNodeEventTarget.getParentNodeEventTarget();
    }
    return arrayOfNodeEventTarget;
  }
  
  public EventListenerList getEventListeners(String paramString, boolean paramBoolean)
  {
    HashTable localHashTable = paramBoolean ? capturingListeners : bubblingListeners;
    if (localHashTable == null) {
      return null;
    }
    return (EventListenerList)localHashTable.get(paramString);
  }
  
  private static EventException createEventException(short paramShort, String paramString)
  {
    return new EventException(paramShort, paramString);
  }
  
  private static EventException createUnspecifiedEventTypeErr(String paramString)
  {
    return createEventException(, paramString);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.EventSupport
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.events;

import org.w3c.dom.events.EventTarget;

public abstract interface NodeEventTarget
  extends EventTarget
{
  public abstract EventSupport getEventSupport();
  
  public abstract NodeEventTarget getParentNodeEventTarget();
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.events.NodeEventTarget
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.traversal;

import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.dom.AbstractNode;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.traversal.NodeIterator;

public class DOMNodeIterator
  implements NodeIterator
{
  protected static final short INITIAL = 0;
  protected static final short INVALID = 1;
  protected static final short FORWARD = 2;
  protected static final short BACKWARD = 3;
  protected AbstractDocument document;
  protected Node root;
  protected int whatToShow;
  protected NodeFilter filter;
  protected boolean expandEntityReferences;
  protected short state;
  protected Node referenceNode;
  
  public DOMNodeIterator(AbstractDocument paramAbstractDocument, Node paramNode, int paramInt, NodeFilter paramNodeFilter, boolean paramBoolean)
  {
    document = paramAbstractDocument;
    root = paramNode;
    whatToShow = paramInt;
    filter = paramNodeFilter;
    expandEntityReferences = paramBoolean;
    referenceNode = root;
  }
  
  public Node getRoot()
  {
    return root;
  }
  
  public int getWhatToShow()
  {
    return whatToShow;
  }
  
  public NodeFilter getFilter()
  {
    return filter;
  }
  
  public boolean getExpandEntityReferences()
  {
    return expandEntityReferences;
  }
  
  public Node nextNode()
  {
    switch (state)
    {
    case 1: 
      throw document.createDOMException((short)11, "detached.iterator", null);
    case 0: 
    case 3: 
      state = 2;
      return referenceNode;
    }
    do
    {
      unfilteredNextNode();
      if (referenceNode == null) {
        return null;
      }
    } while (((whatToShow & 1 << referenceNode.getNodeType() - 1) == 0) || ((filter != null) && (filter.acceptNode(referenceNode) != 1)));
    return referenceNode;
  }
  
  public Node previousNode()
  {
    switch (state)
    {
    case 1: 
      throw document.createDOMException((short)11, "detached.iterator", null);
    case 0: 
    case 2: 
      state = 3;
      return referenceNode;
    }
    do
    {
      unfilteredPreviousNode();
      if (referenceNode == null) {
        return referenceNode;
      }
    } while (((whatToShow & 1 << referenceNode.getNodeType() - 1) == 0) || ((filter != null) && (filter.acceptNode(referenceNode) != 1)));
    return referenceNode;
  }
  
  public void detach()
  {
    state = 1;
    document.detachNodeIterator(this);
  }
  
  public void nodeToBeRemoved(Node paramNode)
  {
    if (state == 1) {
      return;
    }
    for (Node localNode1 = referenceNode; (localNode1 != null) && (localNode1 != root); localNode1 = localNode1.getParentNode()) {
      if (localNode1 == paramNode) {
        break;
      }
    }
    if ((localNode1 == null) || (localNode1 == root)) {
      return;
    }
    Object localObject;
    Node localNode2;
    if (state == 3)
    {
      if ((localNode1.getNodeType() != 5) || (expandEntityReferences))
      {
        localObject = localNode1.getFirstChild();
        if (localObject != null)
        {
          referenceNode = ((Node)localObject);
          return;
        }
      }
      localObject = localNode1.getNextSibling();
      if (localObject != null)
      {
        referenceNode = ((Node)localObject);
        return;
      }
      localObject = localNode1;
      while (((localObject = ((Node)localObject).getParentNode()) != null) && (localObject != root))
      {
        localNode2 = ((Node)localObject).getNextSibling();
        if (localNode2 != null)
        {
          referenceNode = localNode2;
          return;
        }
      }
      referenceNode = null;
    }
    else
    {
      localObject = localNode1.getPreviousSibling();
      if (localObject == null)
      {
        referenceNode = localNode1.getParentNode();
        return;
      }
      if (((Node)localObject).getNodeType() == 5)
      {
        if (!expandEntityReferences) {}
      }
      else {
        while ((localNode2 = ((Node)localObject).getLastChild()) != null) {
          localObject = localNode2;
        }
      }
      referenceNode = ((Node)localObject);
    }
  }
  
  protected void unfilteredNextNode()
  {
    if (referenceNode == null) {
      return;
    }
    if ((referenceNode.getNodeType() != 5) || (expandEntityReferences))
    {
      localNode1 = referenceNode.getFirstChild();
      if (localNode1 != null)
      {
        referenceNode = localNode1;
        return;
      }
    }
    Node localNode1 = referenceNode.getNextSibling();
    if (localNode1 != null)
    {
      referenceNode = localNode1;
      return;
    }
    localNode1 = referenceNode;
    while (((localNode1 = localNode1.getParentNode()) != null) && (localNode1 != root))
    {
      Node localNode2 = localNode1.getNextSibling();
      if (localNode2 != null)
      {
        referenceNode = localNode2;
        return;
      }
    }
    referenceNode = null;
  }
  
  protected void unfilteredPreviousNode()
  {
    if (referenceNode == null) {
      return;
    }
    if (referenceNode == root)
    {
      referenceNode = null;
      return;
    }
    Object localObject = referenceNode.getPreviousSibling();
    if (localObject == null)
    {
      referenceNode = referenceNode.getParentNode();
      return;
    }
    if (((Node)localObject).getNodeType() == 5)
    {
      if (!expandEntityReferences) {}
    }
    else
    {
      Node localNode;
      while ((localNode = ((Node)localObject).getLastChild()) != null) {
        localObject = localNode;
      }
    }
    referenceNode = ((Node)localObject);
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.traversal.DOMNodeIterator
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.traversal;

import org.apache.batik.dom.AbstractNode;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.traversal.TreeWalker;

public class DOMTreeWalker
  implements TreeWalker
{
  protected Node root;
  protected int whatToShow;
  protected NodeFilter filter;
  protected boolean expandEntityReferences;
  protected Node currentNode;
  
  public DOMTreeWalker(Node paramNode, int paramInt, NodeFilter paramNodeFilter, boolean paramBoolean)
  {
    root = paramNode;
    whatToShow = paramInt;
    filter = paramNodeFilter;
    expandEntityReferences = paramBoolean;
    currentNode = root;
  }
  
  public Node getRoot()
  {
    return root;
  }
  
  public int getWhatToShow()
  {
    return whatToShow;
  }
  
  public NodeFilter getFilter()
  {
    return filter;
  }
  
  public boolean getExpandEntityReferences()
  {
    return expandEntityReferences;
  }
  
  public Node getCurrentNode()
  {
    return currentNode;
  }
  
  public void setCurrentNode(Node paramNode)
  {
    if (paramNode == null) {
      throw ((AbstractNode)root).createDOMException((short)9, "null.current.node", null);
    }
    currentNode = paramNode;
  }
  
  public Node parentNode()
  {
    Node localNode = parentNode(currentNode);
    if (localNode != null) {
      currentNode = localNode;
    }
    return localNode;
  }
  
  public Node firstChild()
  {
    Node localNode = firstChild(currentNode);
    if (localNode != null) {
      currentNode = localNode;
    }
    return localNode;
  }
  
  public Node lastChild()
  {
    Node localNode = lastChild(currentNode);
    if (localNode != null) {
      currentNode = localNode;
    }
    return localNode;
  }
  
  public Node previousSibling()
  {
    Node localNode = previousSibling(currentNode, root);
    if (localNode != null) {
      currentNode = localNode;
    }
    return localNode;
  }
  
  public Node nextSibling()
  {
    Node localNode = nextSibling(currentNode, root);
    if (localNode != null) {
      currentNode = localNode;
    }
    return localNode;
  }
  
  public Node previousNode()
  {
    Node localNode1 = previousSibling(currentNode, root);
    if (localNode1 == null)
    {
      localNode1 = parentNode(currentNode);
      if (localNode1 != null) {
        currentNode = localNode1;
      }
      return localNode1;
    }
    Node localNode2 = lastChild(localNode1);
    Node localNode3 = localNode2;
    while (localNode2 != null)
    {
      localNode3 = localNode2;
      localNode2 = lastChild(localNode3);
    }
    return currentNode = localNode3 != null ? localNode3 : localNode1;
  }
  
  public Node nextNode()
  {
    Node localNode1;
    if ((localNode1 = firstChild(currentNode)) != null) {
      return currentNode = localNode1;
    }
    if ((localNode1 = nextSibling(currentNode, root)) != null) {
      return currentNode = localNode1;
    }
    Node localNode2 = currentNode;
    do
    {
      localNode2 = parentNode(localNode2);
      if (localNode2 == null) {
        return null;
      }
    } while ((localNode1 = nextSibling(localNode2, root)) == null);
    return currentNode = localNode1;
  }
  
  protected Node parentNode(Node paramNode)
  {
    if (paramNode == root) {
      return null;
    }
    Node localNode = paramNode;
    do
    {
      localNode = localNode.getParentNode();
      if (localNode == null) {
        return null;
      }
    } while (((whatToShow & 1 << localNode.getNodeType() - 1) == 0) || ((filter != null) && (filter.acceptNode(localNode) != 1)));
    return localNode;
  }
  
  protected Node firstChild(Node paramNode)
  {
    if ((paramNode.getNodeType() == 5) && (!expandEntityReferences)) {
      return null;
    }
    Node localNode1 = paramNode.getFirstChild();
    if (localNode1 == null) {
      return null;
    }
    switch (acceptNode(localNode1))
    {
    case 1: 
      return localNode1;
    case 3: 
      Node localNode2 = firstChild(localNode1);
      if (localNode2 != null) {
        return localNode2;
      }
      break;
    }
    return nextSibling(localNode1, paramNode);
  }
  
  protected Node lastChild(Node paramNode)
  {
    if ((paramNode.getNodeType() == 5) && (!expandEntityReferences)) {
      return null;
    }
    Node localNode1 = paramNode.getLastChild();
    if (localNode1 == null) {
      return null;
    }
    switch (acceptNode(localNode1))
    {
    case 1: 
      return localNode1;
    case 3: 
      Node localNode2 = lastChild(localNode1);
      if (localNode2 != null) {
        return localNode2;
      }
      break;
    }
    return previousSibling(localNode1, paramNode);
  }
  
  protected Node previousSibling(Node paramNode1, Node paramNode2)
  {
    for (;;)
    {
      if (paramNode1 == paramNode2) {
        return null;
      }
      Node localNode1 = paramNode1.getPreviousSibling();
      if (localNode1 == null)
      {
        localNode1 = paramNode1.getParentNode();
        if ((localNode1 == null) || (localNode1 == paramNode2)) {
          return null;
        }
        if (acceptNode(localNode1) == 3) {
          paramNode1 = localNode1;
        } else {
          return null;
        }
      }
      else
      {
        switch (acceptNode(localNode1))
        {
        case 1: 
          return localNode1;
        case 3: 
          Node localNode2 = lastChild(localNode1);
          if (localNode2 != null) {
            return localNode2;
          }
          break;
        }
        paramNode1 = localNode1;
      }
    }
  }
  
  protected Node nextSibling(Node paramNode1, Node paramNode2)
  {
    for (;;)
    {
      if (paramNode1 == paramNode2) {
        return null;
      }
      Node localNode1 = paramNode1.getNextSibling();
      if (localNode1 == null)
      {
        localNode1 = paramNode1.getParentNode();
        if ((localNode1 == null) || (localNode1 == paramNode2)) {
          return null;
        }
        if (acceptNode(localNode1) == 3) {
          paramNode1 = localNode1;
        } else {
          return null;
        }
      }
      else
      {
        switch (acceptNode(localNode1))
        {
        case 1: 
          return localNode1;
        case 3: 
          Node localNode2 = firstChild(localNode1);
          if (localNode2 != null) {
            return localNode2;
          }
          break;
        }
        paramNode1 = localNode1;
      }
    }
  }
  
  protected short acceptNode(Node paramNode)
  {
    if ((whatToShow & 1 << paramNode.getNodeType() - 1) != 0)
    {
      if (filter == null) {
        return 1;
      }
      return filter.acceptNode(paramNode);
    }
    return 3;
  }
}

/* Location:
 * Qualified Name:     org.apache.batik.dom.traversal.DOMTreeWalker
 * Java Class Version: 1.1 (45.3)
 * JD-Core Version:    0.7.1
 */
package org.apache.batik.dom.traversal;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.dom.AbstractNode;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.traversal.NodeFilter;
import org.w3c.dom.traversal.NodeIterator;
import org.w3c.dom.traversal.TreeWalker;

public class TraversalSupport
{
  protected List iterators;
  
  public static TreeWalker createTreeWalker(AbstractDocument paramAbstractDocument, Node paramNode, int paramInt, NodeFilter paramNodeFilter, boolean paramBoolean)
  {
    if (paramNode == null) {
      throw paramAbstractDocument.createDOMException((short)9, "null.root", null);
    }
    return new DOMTreeWalker(paramNode, paramInt, paramNodeFilter, paramBoolean);
  }
  
  public NodeIterator createNodeIterator(AbstractDocument paramAbstractDocument, Node paramNode, int paramInt, NodeFilter paramNodeFilter, boolean paramBoolean)
    throws DOMException
  {
    if (paramNode == null) {
      throw paramAbstractDocument.
1 2 3 4 5 6 7

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd