java_uno_accessbridge

16:37:14.270 INFO  jd.cli.Main - Decompiling java_uno_accessbridge.jar
package org.openoffice.accessibility;

class AccessBridge$_AccessBridge$1
  implements Runnable
{
  AccessBridge$_AccessBridge$1(AccessBridge._AccessBridge param_AccessBridge) {}
  
  public void run() {}
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.AccessBridge._AccessBridge.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.awt.XExtendedToolkit;
import com.sun.star.awt.XTopWindowListener;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XEventListener;
import com.sun.star.lang.XInitialization;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import java.awt.EventQueue;
import java.awt.Toolkit;
import java.awt.Window;
import java.lang.reflect.InvocationTargetException;

public class AccessBridge$_AccessBridge
  implements XTopWindowListener, XInitialization, XComponent
{
  static final String _serviceName = "com.sun.star.accessibility.AccessBridge";
  XComponentContext xComponentContext;
  
  public AccessBridge$_AccessBridge(XComponentContext paramXComponentContext)
  {
    xComponentContext = paramXComponentContext;
  }
  
  public void initialize(Object[] paramArrayOfObject)
  {
    try
    {
      XExtendedToolkit localXExtendedToolkit = (XExtendedToolkit)AnyConverter.toObject(new Type(XExtendedToolkit.class), paramArrayOfObject[0]);
      if (localXExtendedToolkit != null)
      {
        localXExtendedToolkit.addTopWindowListener(this);
        
        String str = System.getProperty("os.name");
        if (str.startsWith("Windows")) {
          WindowsAccessBridgeAdapter.attach(xComponentContext);
        } else {
          localXExtendedToolkit.addKeyHandler(new KeyHandler());
        }
      }
    }
    catch (IllegalArgumentException localIllegalArgumentException) {}
  }
  
  public void windowOpened(EventObject paramEventObject)
  {
    XAccessible localXAccessible = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, Source);
    
    Window localWindow = AccessBridge.getTopWindow(localXAccessible);
  }
  
  public void windowActivated(EventObject paramEventObject) {}
  
  public void windowDeactivated(EventObject paramEventObject) {}
  
  public void windowMinimized(EventObject paramEventObject) {}
  
  public void windowNormalized(EventObject paramEventObject) {}
  
  public void windowClosing(EventObject paramEventObject) {}
  
  public void windowClosed(EventObject paramEventObject)
  {
    XAccessible localXAccessible = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, Source);
    
    Window localWindow = AccessBridge.removeTopWindow(localXAccessible);
    if (localWindow != null) {
      localWindow.dispose();
    }
  }
  
  public void disposing(EventObject paramEventObject) {}
  
  public void addEventListener(XEventListener paramXEventListener) {}
  
  public void removeEventListener(XEventListener paramXEventListener) {}
  
  public void dispose()
  {
    try
    {
      Toolkit.getDefaultToolkit().getSystemEventQueue();EventQueue.invokeAndWait(new Runnable()
      {
        public void run() {}
      });
    }
    catch (InterruptedException localInterruptedException) {}catch (InvocationTargetException localInvocationTargetException) {}
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.AccessBridge._AccessBridge
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.XExtendedToolkit;
import com.sun.star.awt.XTopWindowListener;
import com.sun.star.comp.loader.FactoryHelper;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XEventListener;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.lang.XSingleServiceFactory;
import com.sun.star.registry.XRegistryKey;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.Type;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import java.awt.EventQueue;
import java.awt.Toolkit;
import java.awt.Window;
import java.lang.reflect.InvocationTargetException;
import java.util.Hashtable;
import org.openoffice.java.accessibility.AccessibleObjectFactory;

public class AccessBridge
{
  protected static Hashtable topWindowMap = new Hashtable();
  
  private static Window getTopWindowImpl(XAccessible paramXAccessible)
  {
    synchronized (topWindowMap)
    {
      String str = UnoRuntime.generateOid(paramXAccessible);
      Window localWindow = (Window)topWindowMap.get(str);
      if (localWindow == null)
      {
        localWindow = AccessibleObjectFactory.getTopWindow(paramXAccessible);
        if (localWindow != null) {
          topWindowMap.put(str, localWindow);
        }
      }
      return localWindow;
    }
  }
  
  protected static Window getTopWindow(XAccessible paramXAccessible)
  {
    if (paramXAccessible != null)
    {
      XAccessibleContext localXAccessibleContext = paramXAccessible.getAccessibleContext();
      if (localXAccessibleContext != null) {
        switch (localXAccessibleContext.getAccessibleRole())
        {
        case 43: 
        case 49: 
          return getTopWindow(localXAccessibleContext.getAccessibleParent());
        case 1: 
        case 12: 
        case 21: 
        case 67: 
          return getTopWindowImpl(paramXAccessible);
        }
      }
    }
    return null;
  }
  
  protected static Window removeTopWindow(XAccessible paramXAccessible)
  {
    if (paramXAccessible != null)
    {
      XAccessibleContext localXAccessibleContext = paramXAccessible.getAccessibleContext();
      if (localXAccessibleContext != null) {
        switch (localXAccessibleContext.getAccessibleRole())
        {
        case 43: 
        case 49: 
          return removeTopWindow(localXAccessibleContext.getAccessibleParent());
        case 12: 
        case 21: 
        case 67: 
          return (Window)topWindowMap.remove(UnoRuntime.generateOid(paramXAccessible));
        }
      }
    }
    return null;
  }
  
  public static XSingleServiceFactory __getServiceFactory(String paramString, XMultiServiceFactory paramXMultiServiceFactory, XRegistryKey paramXRegistryKey)
  {
    XSingleServiceFactory localXSingleServiceFactory = null;
    if (paramString.equals(AccessBridge.class.getName()))
    {
      Toolkit localToolkit = Toolkit.getDefaultToolkit();
      
      localXSingleServiceFactory = FactoryHelper.getServiceFactory(_AccessBridge.class, "com.sun.star.accessibility.AccessBridge", paramXMultiServiceFactory, paramXRegistryKey);
    }
    return localXSingleServiceFactory;
  }
  
  public static class _AccessBridge
    implements XTopWindowListener, XInitialization, XComponent
  {
    static final String _serviceName = "com.sun.star.accessibility.AccessBridge";
    XComponentContext xComponentContext;
    
    public _AccessBridge(XComponentContext paramXComponentContext)
    {
      xComponentContext = paramXComponentContext;
    }
    
    public void initialize(Object[] paramArrayOfObject)
    {
      try
      {
        XExtendedToolkit localXExtendedToolkit = (XExtendedToolkit)AnyConverter.toObject(new Type(XExtendedToolkit.class), paramArrayOfObject[0]);
        if (localXExtendedToolkit != null)
        {
          localXExtendedToolkit.addTopWindowListener(this);
          
          String str = System.getProperty("os.name");
          if (str.startsWith("Windows")) {
            WindowsAccessBridgeAdapter.attach(xComponentContext);
          } else {
            localXExtendedToolkit.addKeyHandler(new KeyHandler());
          }
        }
      }
      catch (IllegalArgumentException localIllegalArgumentException) {}
    }
    
    public void windowOpened(EventObject paramEventObject)
    {
      XAccessible localXAccessible = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, Source);
      
      Window localWindow = AccessBridge.getTopWindow(localXAccessible);
    }
    
    public void windowActivated(EventObject paramEventObject) {}
    
    public void windowDeactivated(EventObject paramEventObject) {}
    
    public void windowMinimized(EventObject paramEventObject) {}
    
    public void windowNormalized(EventObject paramEventObject) {}
    
    public void windowClosing(EventObject paramEventObject) {}
    
    public void windowClosed(EventObject paramEventObject)
    {
      XAccessible localXAccessible = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, Source);
      
      Window localWindow = AccessBridge.removeTopWindow(localXAccessible);
      if (localWindow != null) {
        localWindow.dispose();
      }
    }
    
    public void disposing(EventObject paramEventObject) {}
    
    public void addEventListener(XEventListener paramXEventListener) {}
    
    public void removeEventListener(XEventListener paramXEventListener) {}
    
    public void dispose()
    {
      try
      {
        Toolkit.getDefaultToolkit().getSystemEventQueue();EventQueue.invokeAndWait(new Runnable()
        {
          public void run() {}
        });
      }
      catch (InterruptedException localInterruptedException) {}catch (InvocationTargetException localInvocationTargetException) {}
    }
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.AccessBridge
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.accessibility.XAccessibleEventListener;
import com.sun.star.awt.XExtendedToolkit;
import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.UnoRuntime;
import java.lang.ref.WeakReference;
import java.util.Hashtable;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;

public abstract class AccessibilityModel
  extends DefaultTreeModel
{
  protected Hashtable nodeList;
  protected static DefaultMutableTreeNode disconnectedRootNode = new DefaultMutableTreeNode("<not connected>");
  
  public AccessibilityModel()
  {
    super(disconnectedRootNode, false);
    nodeList = new Hashtable();
  }
  
  public synchronized void setRoot(XExtendedToolkit paramXExtendedToolkit)
  {
    if (paramXExtendedToolkit != null) {
      try
      {
        if ((getRoot() instanceof ToolkitNode))
        {
          ToolkitNode localToolkitNode = (ToolkitNode)getRoot();
          if (xToolkit != null) {
            xToolkit.removeTopWindowListener(localToolkitNode);
          }
        }
        nodeList.clear();
        setRoot(new ToolkitNode(paramXExtendedToolkit, this));
        paramXExtendedToolkit.addTopWindowListener((ToolkitNode)getRoot());
      }
      catch (RuntimeException localRuntimeException) {}
    }
  }
  
  public void addNodeInto(MutableTreeNode paramMutableTreeNode1, MutableTreeNode paramMutableTreeNode2)
  {
    int i = paramMutableTreeNode2.getChildCount();
    if ((paramMutableTreeNode1 != null) && (paramMutableTreeNode1.getParent() == paramMutableTreeNode2)) {
      i--;
    }
    insertNodeInto(paramMutableTreeNode1, paramMutableTreeNode2, i);
  }
  
  public static void addEventListener(TreeNode paramTreeNode, XAccessibleEventListener paramXAccessibleEventListener)
  {
    if ((paramTreeNode instanceof AccessibilityNode)) {
      ((AccessibilityNode)paramTreeNode).addEventListener(paramXAccessibleEventListener);
    }
  }
  
  public static void removeEventListener(TreeNode paramTreeNode, XAccessibleEventListener paramXAccessibleEventListener)
  {
    if ((paramTreeNode instanceof AccessibilityNode)) {
      ((AccessibilityNode)paramTreeNode).removeEventListener(paramXAccessibleEventListener);
    }
  }
  
  protected abstract AccessibilityNode createWindowNode(XAccessible paramXAccessible, XAccessibleContext paramXAccessibleContext);
  
  protected abstract AccessibilityNode createNode(XAccessible paramXAccessible);
  
  public AccessibilityNode putNode(XAccessible paramXAccessible, AccessibilityNode paramAccessibilityNode)
  {
    if (paramXAccessible != null)
    {
      String str = UnoRuntime.generateOid(paramXAccessible);
      WeakReference localWeakReference = (WeakReference)nodeList.put(str, new WeakReference(paramAccessibilityNode));
      if (localWeakReference != null) {
        return (AccessibilityNode)localWeakReference.get();
      }
    }
    return null;
  }
  
  public AccessibilityNode findNode(XAccessible paramXAccessible)
  {
    if (paramXAccessible != null)
    {
      String str = UnoRuntime.generateOid(paramXAccessible);
      WeakReference localWeakReference = (WeakReference)nodeList.get(str);
      if (localWeakReference != null) {
        return (AccessibilityNode)localWeakReference.get();
      }
    }
    return null;
  }
  
  public AccessibilityNode removeNode(XAccessible paramXAccessible)
  {
    if (paramXAccessible != null)
    {
      String str = UnoRuntime.generateOid(paramXAccessible);
      WeakReference localWeakReference = (WeakReference)nodeList.remove(str);
      if (localWeakReference != null) {
        return (AccessibilityNode)localWeakReference.get();
      }
    }
    return null;
  }
  
  public AccessibilityNode removeNode(Object paramObject)
  {
    if ((paramObject instanceof XAccessible)) {
      return removeNode((XAccessible)paramObject);
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.AccessibilityModel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

class AccessibilityNode$1
  implements Runnable
{
  AccessibilityNode$1(AccessibilityNode paramAccessibilityNode1, AccessibilityNode paramAccessibilityNode2) {}
  
  public void run()
  {
    this$0.treeModel.removeNodeFromParent(val$node);
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.AccessibilityNode.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.uno.RuntimeException;

class AccessibilityNode$2
  implements Runnable
{
  AccessibilityNode$2(AccessibilityNode paramAccessibilityNode1, AccessibilityNode paramAccessibilityNode2, AccessibilityNode paramAccessibilityNode3) {}
  
  public void run()
  {
    try
    {
      XAccessibleContext localXAccessibleContext = val$node.getAccessibleContext();
      if (localXAccessibleContext != null) {
        this$0.treeModel.insertNodeInto(val$node, val$parent, localXAccessibleContext.getAccessibleIndexInParent());
      }
    }
    catch (RuntimeException localRuntimeException) {}
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.AccessibilityNode.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.accessibility.AccessibleEventObject;
import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.accessibility.XAccessibleEventBroadcaster;
import com.sun.star.accessibility.XAccessibleEventListener;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.RuntimeException;
import com.sun.star.uno.UnoRuntime;
import javax.swing.SwingUtilities;
import javax.swing.tree.DefaultMutableTreeNode;
import org.openoffice.accessibility.misc.AccessibleEventMulticaster;

class AccessibilityNode
  extends DefaultMutableTreeNode
  implements XAccessible, XAccessibleEventListener, XAccessibleEventBroadcaster
{
  protected AccessibilityModel treeModel;
  protected XAccessibleContext unoAccessibleContext;
  private XAccessibleEventListener listener;
  
  public AccessibilityNode(AccessibilityModel paramAccessibilityModel)
  {
    treeModel = paramAccessibilityModel;
  }
  
  protected void finalize()
    throws Throwable
  {
    if (userObject != null) {
      treeModel.removeNode(userObject);
    }
  }
  
  public void setAccessibleContext(XAccessibleContext paramXAccessibleContext)
  {
    unoAccessibleContext = paramXAccessibleContext;
  }
  
  public XAccessibleContext getAccessibleContext()
  {
    return unoAccessibleContext;
  }
  
  protected void setAttached(boolean paramBoolean)
  {
    XAccessibleContext localXAccessibleContext = unoAccessibleContext;
    if (localXAccessibleContext != null) {
      try
      {
        XAccessibleEventBroadcaster localXAccessibleEventBroadcaster = (XAccessibleEventBroadcaster)UnoRuntime.queryInterface(XAccessibleEventBroadcaster.class, localXAccessibleContext);
        if (localXAccessibleEventBroadcaster != null) {
          if (paramBoolean) {
            localXAccessibleEventBroadcaster.addEventListener(this);
          } else {
            localXAccessibleEventBroadcaster.removeEventListener(this);
          }
        }
      }
      catch (RuntimeException localRuntimeException) {}
    }
  }
  
  public void disposing(EventObject paramEventObject)
  {
    XAccessibleEventListener localXAccessibleEventListener = listener;
    if (localXAccessibleEventListener != null) {
      localXAccessibleEventListener.disposing(paramEventObject);
    }
    treeModel.removeNode(userObject);
    userObject = null;
    unoAccessibleContext = null;
  }
  
  protected void handleChildRemoved(XAccessible paramXAccessible)
  {
    final AccessibilityNode localAccessibilityNode = treeModel.findNode(paramXAccessible);
    if (localAccessibilityNode != null) {
      SwingUtilities.invokeLater(new Runnable()
      {
        public void run()
        {
          treeModel.removeNodeFromParent(localAccessibilityNode);
        }
      });
    }
  }
  
  protected void handleChildAdded(XAccessible paramXAccessible)
  {
    final AccessibilityNode localAccessibilityNode1 = this;
    final AccessibilityNode localAccessibilityNode2 = treeModel.createNode(paramXAccessible);
    if (localAccessibilityNode2 != null) {
      SwingUtilities.invokeLater(new Runnable()
      {
        public void run()
        {
          try
          {
            XAccessibleContext localXAccessibleContext = localAccessibilityNode2.getAccessibleContext();
            if (localXAccessibleContext != null) {
              treeModel.insertNodeInto(localAccessibilityNode2, localAccessibilityNode1, localXAccessibleContext.getAccessibleIndexInParent());
            }
          }
          catch (RuntimeException localRuntimeException) {}
        }
      });
    }
  }
  
  public void notifyEvent(AccessibleEventObject paramAccessibleEventObject)
  {
    if (EventId == 7)
    {
      localObject = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, OldValue);
      if (localObject != null) {
        handleChildRemoved((XAccessible)localObject);
      }
      localObject = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, NewValue);
      if (localObject != null) {
        handleChildAdded((XAccessible)localObject);
      }
    }
    Object localObject = listener;
    if (localObject != null) {
      ((XAccessibleEventListener)localObject).notifyEvent(paramAccessibleEventObject);
    }
  }
  
  public synchronized void addEventListener(XAccessibleEventListener paramXAccessibleEventListener)
  {
    listener = AccessibleEventMulticaster.add(listener, paramXAccessibleEventListener);
  }
  
  public synchronized void removeEventListener(XAccessibleEventListener paramXAccessibleEventListener)
  {
    listener = AccessibleEventMulticaster.remove(listener, paramXAccessibleEventListener);
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.AccessibilityNode
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.XExtendedToolkit;
import com.sun.star.uno.RuntimeException;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeModel;
import org.openoffice.accessibility.misc.NameProvider;

public class AccessibilityTree
  extends JTree
{
  public AccessibilityTree(TreeModel paramTreeModel)
  {
    super(paramTreeModel);
    
    showsRootHandles = true;
  }
  
  public void setToolkit(XExtendedToolkit paramXExtendedToolkit)
  {
    AccessibilityModel localAccessibilityModel = (AccessibilityModel)getModel();
    if (localAccessibilityModel != null)
    {
      setRootVisible(paramXExtendedToolkit == null);
      
      localAccessibilityModel.setRoot(paramXExtendedToolkit);
      localAccessibilityModel.reload();
    }
  }
  
  public String convertValueToText(Object paramObject, boolean paramBoolean1, boolean paramBoolean2, boolean paramBoolean3, int paramInt, boolean paramBoolean4)
  {
    if ((paramObject instanceof DefaultMutableTreeNode))
    {
      DefaultMutableTreeNode localDefaultMutableTreeNode = (DefaultMutableTreeNode)paramObject;
      
      Object localObject = localDefaultMutableTreeNode.getUserObject();
      if ((localObject != null) && ((localObject instanceof XAccessible)))
      {
        XAccessible localXAccessible = (XAccessible)localObject;
        try
        {
          XAccessibleContext localXAccessibleContext = localXAccessible.getAccessibleContext();
          if (localXAccessibleContext != null)
          {
            String str = localXAccessibleContext.getAccessibleName();
            if (str.length() == 0) {
              str = new String("<no name>");
            }
            paramObject = str + " / " + NameProvider.getRoleName(localXAccessibleContext.getAccessibleRole());
          }
        }
        catch (RuntimeException localRuntimeException)
        {
          paramObject = "???";
        }
      }
    }
    return super.convertValueToText(paramObject, paramBoolean1, paramBoolean2, paramBoolean3, paramInt, paramBoolean4);
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.AccessibilityTree
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.uno.RuntimeException;
import java.util.Enumeration;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeWillExpandListener;
import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;

public class DynamicAccessibilityModel
  extends AccessibilityModel
  implements TreeExpansionListener, TreeWillExpandListener
{
  protected AccessibilityNode createWindowNode(XAccessible paramXAccessible, XAccessibleContext paramXAccessibleContext)
  {
    if (paramXAccessible != null) {
      if (paramXAccessibleContext != null)
      {
        AccessibilityNode localAccessibilityNode = new AccessibilityNode(this);
        localAccessibilityNode.setUserObject(paramXAccessible);
        localAccessibilityNode.setAccessibleContext(paramXAccessibleContext);
        putNode(paramXAccessible, localAccessibilityNode);
        return localAccessibilityNode;
      }
    }
    return null;
  }
  
  protected AccessibilityNode createNode(XAccessible paramXAccessible)
  {
    if (paramXAccessible != null) {
      try
      {
        XAccessibleContext localXAccessibleContext = paramXAccessible.getAccessibleContext();
        if (localXAccessibleContext != null)
        {
          DynamicAccessibilityNode localDynamicAccessibilityNode = new DynamicAccessibilityNode(this);
          localDynamicAccessibilityNode.setUserObject(paramXAccessible);
          localDynamicAccessibilityNode.setAccessibleContext(localXAccessibleContext);
          putNode(paramXAccessible, localDynamicAccessibilityNode);
          return localDynamicAccessibilityNode;
        }
      }
      catch (RuntimeException localRuntimeException) {}
    }
    return null;
  }
  
  public void treeCollapsed(TreeExpansionEvent paramTreeExpansionEvent)
  {
    TreeNode localTreeNode = (TreeNode)paramTreeExpansionEvent.getPath().getLastPathComponent();
    if ((localTreeNode instanceof DynamicAccessibilityNode))
    {
      DynamicAccessibilityNode localDynamicAccessibilityNode = (DynamicAccessibilityNode)localTreeNode;
      localDynamicAccessibilityNode.clear();
    }
  }
  
  public void treeExpanded(TreeExpansionEvent paramTreeExpansionEvent)
  {
    TreeNode localTreeNode = (TreeNode)paramTreeExpansionEvent.getPath().getLastPathComponent();
    Enumeration localEnumeration;
    if ((localTreeNode instanceof AccessibilityNode)) {
      for (localEnumeration = localTreeNode.children(); localEnumeration.hasMoreElements();) {
        ((AccessibilityNode)localEnumeration.nextElement()).setAttached(true);
      }
    }
  }
  
  public void treeWillCollapse(TreeExpansionEvent paramTreeExpansionEvent)
    throws ExpandVetoException
  {
    TreeNode localTreeNode = (TreeNode)paramTreeExpansionEvent.getPath().getLastPathComponent();
    Enumeration localEnumeration;
    if ((localTreeNode instanceof AccessibilityNode)) {
      for (localEnumeration = localTreeNode.children(); localEnumeration.hasMoreElements();) {
        ((AccessibilityNode)localEnumeration.nextElement()).setAttached(false);
      }
    }
  }
  
  public void treeWillExpand(TreeExpansionEvent paramTreeExpansionEvent)
    throws ExpandVetoException
  {
    TreeNode localTreeNode = (TreeNode)paramTreeExpansionEvent.getPath().getLastPathComponent();
    if ((localTreeNode instanceof DynamicAccessibilityNode))
    {
      DynamicAccessibilityNode localDynamicAccessibilityNode = (DynamicAccessibilityNode)localTreeNode;
      localDynamicAccessibilityNode.populate();
    }
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.DynamicAccessibilityModel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.lang.IndexOutOfBoundsException;
import com.sun.star.uno.RuntimeException;

class DynamicAccessibilityNode
  extends AccessibilityNode
{
  public DynamicAccessibilityNode(AccessibilityModel paramAccessibilityModel)
  {
    super(paramAccessibilityModel);
  }
  
  protected void populate()
  {
    try
    {
      XAccessibleContext localXAccessibleContext = getAccessibleContext();
      if (localXAccessibleContext != null)
      {
        int i = localXAccessibleContext.getAccessibleChildCount();
        for (int j = 0; j < i; j++)
        {
          XAccessible localXAccessible = localXAccessibleContext.getAccessibleChild(j);
          AccessibilityNode localAccessibilityNode = treeModel.findNode(localXAccessible);
          if (localAccessibilityNode == null) {
            localAccessibilityNode = treeModel.createNode(localXAccessible);
          }
          if (localAccessibilityNode != null) {
            add(localAccessibilityNode);
          }
        }
      }
    }
    catch (IndexOutOfBoundsException localIndexOutOfBoundsException) {}catch (RuntimeException localRuntimeException) {}
  }
  
  protected void clear()
  {
    removeAllChildren();
  }
  
  public boolean isLeaf()
  {
    try
    {
      XAccessibleContext localXAccessibleContext = getAccessibleContext();
      if (localXAccessibleContext != null) {
        return localXAccessibleContext.getAccessibleChildCount() == 0;
      }
      return true;
    }
    catch (RuntimeException localRuntimeException) {}
    return true;
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.DynamicAccessibilityNode
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

class ToolkitNode$1
  implements Runnable
{
  ToolkitNode$1(ToolkitNode paramToolkitNode, AccessibilityNode paramAccessibilityNode) {}
  
  public void run()
  {
    try
    {
      ToolkitNode.access$000(this$0).removeNodeFromParent(val$an);
      
      val$an.setAttached(false);
    }
    catch (IllegalArgumentException localIllegalArgumentException) {}
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.ToolkitNode.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.awt.XTopWindow;

class ToolkitNode$2
  implements Runnable
{
  ToolkitNode$2(ToolkitNode paramToolkitNode1, XTopWindow paramXTopWindow, ToolkitNode paramToolkitNode2) {}
  
  public void run()
  {
    AccessibilityNode localAccessibilityNode = ToolkitNode.access$100(this$0, val$xTopWindow);
    if (localAccessibilityNode != null)
    {
      ToolkitNode.access$000(this$0).addNodeInto(localAccessibilityNode, val$tn);
      
      localAccessibilityNode.setAttached(true);
    }
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.ToolkitNode.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.tree;

import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.XExtendedToolkit;
import com.sun.star.awt.XTopWindow;
import com.sun.star.awt.XTopWindowListener;
import com.sun.star.lang.EventObject;
import com.sun.star.lang.IndexOutOfBoundsException;
import com.sun.star.uno.UnoRuntime;
import javax.swing.SwingUtilities;
import javax.swing.tree.DefaultMutableTreeNode;

public class ToolkitNode
  extends DefaultMutableTreeNode
  implements XTopWindowListener
{
  protected XExtendedToolkit xToolkit;
  private AccessibilityModel treeModel;
  
  public ToolkitNode(XExtendedToolkit paramXExtendedToolkit, AccessibilityModel paramAccessibilityModel)
  {
    super("<connected>");
    xToolkit = paramXExtendedToolkit;
    treeModel = paramAccessibilityModel;
    try
    {
      int i = 0;
      for (int j = paramXExtendedToolkit.getTopWindowCount(); i < j; i++)
      {
        XTopWindow localXTopWindow = paramXExtendedToolkit.getTopWindow(i);
        if (localXTopWindow != null)
        {
          AccessibilityNode localAccessibilityNode = getTopWindowNode(localXTopWindow);
          if (localAccessibilityNode != null)
          {
            add(localAccessibilityNode);
            
            localAccessibilityNode.setAttached(true);
          }
        }
      }
    }
    catch (IndexOutOfBoundsException localIndexOutOfBoundsException) {}
  }
  
  private AccessibilityNode getTopWindowNode(XAccessible paramXAccessible)
  {
    XAccessibleContext localXAccessibleContext = paramXAccessible.getAccessibleContext();
    if (localXAccessibleContext != null)
    {
      int i = localXAccessibleContext.getAccessibleRole();
      if ((i == 21) || (i == 12) || (i == 67)) {
        return treeModel.createWindowNode(paramXAccessible, localXAccessibleContext);
      }
    }
    return null;
  }
  
  private AccessibilityNode getTopWindowNode(XAccessible paramXAccessible, XAccessibleContext paramXAccessibleContext)
  {
    if (paramXAccessibleContext != null)
    {
      int i = paramXAccessibleContext.getAccessibleRole();
      if ((i == 21) || (i == 12) || (i == 67))
      {
        AccessibilityNode localAccessibilityNode1 = treeModel.createWindowNode(paramXAccessible, paramXAccessibleContext);
        if (localAccessibilityNode1 != null) {
          try
          {
            int j = paramXAccessibleContext.getAccessibleChildCount();
            for (int k = 0; k < j; k++)
            {
              AccessibilityNode localAccessibilityNode2 = treeModel.createNode(paramXAccessibleContext.getAccessibleChild(k));
              if (localAccessibilityNode2 != null) {
                localAccessibilityNode1.add(localAccessibilityNode2);
              }
            }
          }
          catch (IndexOutOfBoundsException localIndexOutOfBoundsException) {}
        }
        return localAccessibilityNode1;
      }
    }
    return null;
  }
  
  private AccessibilityNode getTopWindowNode(XTopWindow paramXTopWindow)
  {
    XAccessible localXAccessible1 = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, paramXTopWindow);
    if (localXAccessible1 != null)
    {
      XAccessibleContext localXAccessibleContext = localXAccessible1.getAccessibleContext();
      if (localXAccessibleContext != null)
      {
        XAccessible localXAccessible2 = localXAccessibleContext.getAccessibleParent();
        if (localXAccessible2 != null)
        {
          AccessibilityNode localAccessibilityNode1 = getTopWindowNode(localXAccessible2);
          AccessibilityNode localAccessibilityNode2 = treeModel.createNode(localXAccessible1);
          if ((localAccessibilityNode1 != null) && (localAccessibilityNode2 != null)) {
            localAccessibilityNode1.add(localAccessibilityNode2);
          }
          return localAccessibilityNode1;
        }
        return getTopWindowNode(localXAccessible1, localXAccessibleContext);
      }
    }
    return null;
  }
  
  public void disposing(EventObject paramEventObject)
  {
    xToolkit = null;
    treeModel.setRoot(AccessibilityModel.disconnectedRootNode);
  }
  
  public void windowActivated(EventObject paramEventObject) {}
  
  public void windowClosed(EventObject paramEventObject)
  {
    XAccessible localXAccessible = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, Source);
    if (localXAccessible != null)
    {
      AccessibilityNode localAccessibilityNode1 = treeModel.findNode(localXAccessible);
      if ((localAccessibilityNode1 != null) && (localAccessibilityNode1.getParent() != this)) {
        localAccessibilityNode1 = (AccessibilityNode)localAccessibilityNode1.getParent();
      }
      if (localAccessibilityNode1 != null)
      {
        final AccessibilityNode localAccessibilityNode2 = localAccessibilityNode1;
        Runnable local1 = new Runnable()
        {
          public void run()
          {
            try
            {
              treeModel.removeNodeFromParent(localAccessibilityNode2);
              
              localAccessibilityNode2.setAttached(false);
            }
            catch (IllegalArgumentException localIllegalArgumentException) {}
          }
        };
        SwingUtilities.invokeLater(local1);
      }
    }
  }
  
  public void windowClosing(EventObject paramEventObject) {}
  
  public void windowDeactivated(EventObject paramEventObject) {}
  
  public void windowMinimized(EventObject paramEventObject) {}
  
  public void windowNormalized(EventObject paramEventObject) {}
  
  public void windowOpened(EventObject paramEventObject)
  {
    final XTopWindow localXTopWindow = (XTopWindow)UnoRuntime.queryInterface(XTopWindow.class, Source);
    if (localXTopWindow != null)
    {
      final ToolkitNode localToolkitNode = this;
      Runnable local2 = new Runnable()
      {
        public void run()
        {
          AccessibilityNode localAccessibilityNode = ToolkitNode.this.getTopWindowNode(localXTopWindow);
          if (localAccessibilityNode != null)
          {
            treeModel.addNodeInto(localAccessibilityNode, localToolkitNode);
            
            localAccessibilityNode.setAttached(true);
          }
        }
      };
      SwingUtilities.invokeLater(local2);
    }
  }
}

/* Location:
 * Qualified Name:     org.openoffice.accessibility.awb.tree.ToolkitNode
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.openoffice.accessibility.awb.view;

import com.sun.star.accessibility.AccessibleEventObject;
import com.sun.star.accessibility.XAccessible;
import com.sun.star.accessibility.XAccessibleComponent;
import com.sun.star.accessibility.XAccessibleContext;
import com.sun.star.awt.Point;
import com.sun.star.awt.Rectangle;
import com.sun.star.awt.Size;
import com.sun.star.uno.UnoRuntime;
import javax.swing.JLabel;

public class ComponentView
  extends ObjectView
{
  private XAccessibleComponent mxComponent;
  private JLabel maRelativeLocationLabel;
  private JLabel maAbsoluteLocationLabel;
  private JLabel maSizeLabel;
  private JLabel maBoundingBoxLabel;
  private JLabel maConsistencyLabel;
  private JLabel maForegroundColorLabel;
  private JLabel maBackgroundColorLabel;
  
  public static ObjectView Create(ObjectViewContainer paramObjectViewContainer, XAccessibleContext paramXAccessibleContext)
  {
    if (UnoRuntime.queryInterface(XAccessibleComponent.class, paramXAccessibleContext) != null) {
      return new ComponentView(paramObjectViewContainer);
    }
    return null;
  }
  
  public ComponentView(ObjectViewContainer paramObjectViewContainer)
  {
    super(paramObjectViewContainer);
    
    ViewGridLayout localViewGridLayout = new ViewGridLayout(this);
    
    maRelativeLocationLabel = localViewGridLayout.AddLabeledEntry("Relative Location: ");
    maAbsoluteLocationLabel = localViewGridLayout.AddLabeledEntry("Location on Screen: ");
    maSizeLabel = localViewGridLayout.AddLabeledEntry("Size");
    maBoundingBoxLabel = localViewGridLayout.AddLabeledEntry("Bounding Box: ");
    maConsistencyLabel = localViewGridLayout.AddLabeledEntry("Consistent: ");
    maForegroundColorLabel = localViewGridLayout.AddLabeledEntry("Foreground Color: ");
    maBackgroundColorLabel = localViewGridLayout.AddLabeledEntry("Background Color: ");
  }
  
  public void SetObject(XAccessibleContext paramXAccessibleContext)
  {
    mxComponent = ((XAccessibleComponent)UnoRuntime.queryInterface(XAccessibleComponent.class, paramXAccessibleContext));
    
    super.SetObject(paramXAccessibleContext);
  }
  
  public void Update()
  {
    if (mxContext == null)
    {
      maRelativeLocationLabel.setText("<null object>");
      maAbsoluteLocationLabel.setText("<null object>");
      maSizeLabel.setText("<null object>");
      maBoundingBoxLabel.setText("<null object>");
      maConsistencyLabel.setText("<null object>");
      maForegroundColorLabel.setText("<null object>");
      maBackgroundColorLabel.setText("<null object>");
    }
    else
    {
      Point localPoint1 = mxComponent.getLocation();
      maRelativeLocationLabel.setText(X + ", " + Y);
      
      Point localPoint2 = mxComponent.getLocationOnScreen();
      
      maAbsoluteLocationLabel.setText(X + ", " + Y);
      
      Size localSize = mxComponent.getSize();
      maSizeLabel.setText(Width + ", " + Height);
      
      Rectangle localRectangle = mxComponent.getBounds();
      maBoundingBoxLabel.setText(X + ", " + Y + "," + Width + ", " + Height);
      
      int i = mxComponent.getForeground();
      maForegroundColorLabel.setText("R" + (i >> 16 & 0xFF) + "G" + (i >> 8 & 0xFF) + "B" + (i >> 0 & 0xFF) + "A" + (i >> 24 & 0xFF));
      
      i = mxComponent.getBackground();
      maBackgroundColorLabel.setText("R" + (i >> 16 & 0xFF) + "G" + (i >> 8 & 0xFF) + "B" + (i >> 0 & 0xFF) + "A" + (i >> 24 & 0xFF));
      
      String str = new String();
      if ((X != X) || (Y != Y)) {
        str = str + (str.length() != 0 ? ", " : "") + "Bounding box conflicts with relative location";
      }
      if ((Width != Width) || (Height != Height)) {
        str = str + (str.length() != 0 ? ", " : "") + "Bounding box conflicts with size";
      }
      XAccessible localXAccessible = mxContext.getAccessibleParent();
      XAccessibleComponent localXAccessibleComponent = (XAcc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

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-2017. Infinite Loop Ltd