JavaTM 2 Platform
Std. Ed. v1.3.1

java.awt
Class VAWTSpy

java.lang.Object
  |
  +--java.awt.VAWTSpy

public class VAWTSpy
extends Object

A utility class that infiltrates the java.awt package to allow our peers to access package-private AWT things, including Component instance variables and the class EventDispatchThread.

To prevent a security hole, only our AWT peers are allowed access to this class. This is done through the idiom of allowing only one instance to be created. VToolkit creates the unique instance during class initialization and stuffs it into a static variable for us to use.

See Also:
VToolkit#sVAWTSpy

Constructor Summary
VAWTSpy()
          Creates a VAWTSpy.
 
Method Summary
 void finishChildResized(ScrollPane scrollPane, int w, int h)
          From ScrollPane.layout, because if max changes but value doesn't the peers don't get told Workaround for bug 2398946
 void getChildPointInParentSpace(Component child, Component parent, Point point)
          Adjusts point in the component's coordinate space to be in the parent's coordinate space.
 void getComponentOffset(Component child, Component parent, Point result)
          Gets the origin of the given component in its parent's coordinate space.
 int getComponentX(Component c)
           
 int getComponentY(Component c)
           
 void getParentPointInChildSpace(Component parent, Component child, Point point)
          Adjusts point in the parent's coordinate space to be in the component's coordinate space.
 Color gropeBackground(Component c)
           
 Cursor gropeCursor(Component c)
           
 EventListener gropeEventListenerA(AWTEventMulticaster m)
           
 EventListener gropeEventListenerB(AWTEventMulticaster m)
           
 Font gropeFont(Component c)
           
 Color gropeForeground(Component c)
           
 MouseListener gropeMouseListener(Component c)
           
 void popEventDispatcher()
           
 void processComponentEvent(Component c, AWTEvent e)
          Slams an event into the given component's handler, forcing it to be processed immediately.
 void pushEventDispatcher()
           
 void pushEventDispatcherIfNecessary()
          Pushes a new EventDispatchThread if called from a current one; useful before calling something that might block, but events still need to get delivered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VAWTSpy

public VAWTSpy()
        throws SecurityException
Creates a VAWTSpy. Only one can be created, and the VToolkit does that at init time, so that non-VAWT code can't use this class to access out-of-bounds stuff.
Method Detail

gropeForeground

public Color gropeForeground(Component c)

gropeBackground

public Color gropeBackground(Component c)

gropeFont

public Font gropeFont(Component c)

getComponentX

public int getComponentX(Component c)

getComponentY

public int getComponentY(Component c)

gropeCursor

public Cursor gropeCursor(Component c)

gropeMouseListener

public MouseListener gropeMouseListener(Component c)

gropeEventListenerA

public EventListener gropeEventListenerA(AWTEventMulticaster m)

gropeEventListenerB

public EventListener gropeEventListenerB(AWTEventMulticaster m)

pushEventDispatcherIfNecessary

public void pushEventDispatcherIfNecessary()
Pushes a new EventDispatchThread if called from a current one; useful before calling something that might block, but events still need to get delivered.

pushEventDispatcher

public void pushEventDispatcher()

popEventDispatcher

public void popEventDispatcher()

getParentPointInChildSpace

public void getParentPointInChildSpace(Component parent,
                                       Component child,
                                       Point point)
Adjusts point in the parent's coordinate space to be in the component's coordinate space.

getChildPointInParentSpace

public void getChildPointInParentSpace(Component child,
                                       Component parent,
                                       Point point)
Adjusts point in the component's coordinate space to be in the parent's coordinate space.

getComponentOffset

public void getComponentOffset(Component child,
                               Component parent,
                               Point result)
Gets the origin of the given component in its parent's coordinate space.

finishChildResized

public void finishChildResized(ScrollPane scrollPane,
                               int w,
                               int h)
From ScrollPane.layout, because if max changes but value doesn't the peers don't get told Workaround for bug 2398946

processComponentEvent

public void processComponentEvent(Component c,
                                  AWTEvent e)
Slams an event into the given component's handler, forcing it to be processed immediately. This is a hack required for drag and drop to be able to tell the result of a drop on a lightweight component. See VComponentPeer.handleDragAndDrop() for a more detailed explanation. - EJA, 7/1/99

JavaTM 2 Platform
Std. Ed. v1.3.1

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.