Package com.sun.javatest.util
Class MainFrame
java.lang.Object
com.sun.javatest.util.MainFrame
This class provides a means whereby tools in Personal Java can
temporarily give access to a shared GUI frame, such as the
one top-level Frame.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Frame
Try to acquire exclusive access to a shared context previously registered with @link(#setContext).static Container
Deprecated.replaced by acquireFrame.static void
Release access to the previously acquired frame.static void
Deprecated.replaced by releaseFrame.static void
Deprecated.replaced by @link(#setFrame)static void
Set a frame that can be subsequently accessed via @link(#acquireFrame) and @link(#releaseFrame).
-
Constructor Details
-
MainFrame
public MainFrame()
-
-
Method Details
-
setFrame
Set a frame that can be subsequently accessed via @link(#acquireFrame) and @link(#releaseFrame).- Parameters:
f
- The container to be registered
-
getContext
Deprecated.replaced by acquireFrame.Try to acquire exclusive access to a shared context previously registered with @link(#setFrame). If the frame is currently in use by someone else, the call will wait until the other owner is releases it.- Returns:
- The container previously registered with setFrame. It will be returned in as clean a state as possible, with no children, and a new instance of @link(FlowLayout). null is returned if the call is interrupted.
- See Also:
-
setContext
Deprecated.replaced by @link(#setFrame)Set a context that can be subsequently accessed via @link(#acquireFrame) and @link(#releaseFrame).- Parameters:
c
- The container to be registered- Throws:
ClassCastException
- if the container being registered is not a frame- See Also:
-
acquireFrame
Try to acquire exclusive access to a shared context previously registered with @link(#setContext). If the context is currently in use by someone else, the call will wait until the other owner is releases it.- Returns:
- The container previously registered with setContext. It will be returned in as clean a state as possible, with no children, and a new instance of @link(FlowLayout). If no frame has been registered, one has been created.
- Throws:
InterruptedException
- if the thread is interrupted while waiting for the context to become available.- See Also:
-
restoreContext
Deprecated.replaced by releaseFrame.Release access to the previously acquired context. The context is reset to its state before @link(#acquireContext) was called, and made available to subsequent callers of @link(#acquireContext).- Parameters:
c
- The result of previously calling @link(#acquireContext).- Throws:
IllegalStateException
- if the argument is not the result of calling @link(#acquireFrame), or if it has already been released.ClassCastException
- if the container is not a frame.
-
releaseFrame
Release access to the previously acquired frame. The frame is reset to its state before @link(#acquireFrame) was called, and made available to subsequent callers of @link(#acquireFrame).- Parameters:
f
- The result of previously calling @link(#acquireFrame).- Throws:
IllegalStateException
- if the argument is not the result of calling @link(#acquireFrame), or if it has already been released.- See Also:
-