Class AWT
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PointReturns a point at the center of the given.Componentstatic PointReturns a point at the center of the given.Rectanglestatic PointReturns a point at the center of the visible rectangle of the given.JComponentstatic InsetsReturns the insets of the given, or an empty one if no insets can be found.Containerstatic ComponentReturns the invoker, if any, of the given; orComponentnull, if theComponentis not on a pop-up of any sort.static booleanReturnstrueif the given component is an Applet viewer.static booleanIndicates whether the AWT Tree Lock is currently held.static booleanReturns whether the givenComponentis a heavy-weight pop-up, that is, a container for aJPopupMenuthat is implemented with a heavy-weight component (usually aWindow).static booleanIndicates whether the given point is inside the screen boundaries.static booleanIndicates whether the given point, relative to the givenJComponent, is inside the screen boundaries.static booleanReturns whether the given component is the default Swing hidden frame.static PointSafe version of, which avoids lockup if an AWT pop-up menu is showing.Component.getLocationOnScreen()private static Stringstatic Window[]Returns an array of alls that have no owner.Windowstatic intReturns themask for the pop-up trigger button.InputEventstatic booleanReturns whether the platform registers a pop-up on mouse press.static PointTranslates the given coordinates to the location on screen of the given.Componentstatic PointReturns a point at the center of the visible area of the given.Component
-
Field Details
-
APPLET_APPLET_VIEWER_CLASS
- See Also:
-
ROOT_FRAME_CLASSNAME
-
-
Constructor Details
-
AWT
private AWT()
-
-
Method Details
-
isPointInScreenBoundaries
Indicates whether the given point, relative to the givenJComponent, is inside the screen boundaries.- Parameters:
c- the givenJComponent.p- the point to verify.- Returns:
trueif the point is inside the screen boundaries;falseotherwise.- Since:
- 1.2
-
isPointInScreenBoundaries
Indicates whether the given point is inside the screen boundaries.- Parameters:
p- the point to verify.- Returns:
trueif the point is inside the screen boundaries;falseotherwise.- Since:
- 1.2
-
ownerLessWindows
Returns an array of alls that have no owner. They includeWindows and ownerlessFrames andDialogs.WindowThis method only works when using JDK 1.6 or later. For JDK 1.5, this method returns an empty array.
- Returns:
- an array of all
s that have no owner.Window - Since:
- 1.2
-
translate
Translates the given coordinates to the location on screen of the given.ComponentNote: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c- the givenComponent.x- X coordinate.y- Y coordinate.- Returns:
- the translated coordinates.
- Since:
- 1.1
-
visibleCenterOf
Returns a point at the center of the visible area of the given.Component- Parameters:
c- the givenComponent.- Returns:
- a point at the center of the visible area of the given
Component.
-
centerOf
Returns a point at the center of the given.ComponentNote: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c- the givenComponent.- Returns:
- a point at the center of the given
Component.
-
centerOfVisibleRect
Returns a point at the center of the visible rectangle of the given.JComponentNote: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c- the givenJComponent.- Returns:
- a point at the center of the visible rectangle of the given
JComponent.
-
centerOf
Returns a point at the center of the given.Rectangle- Parameters:
r- the givenRectangle.- Returns:
- a point at the center of the given
Rectangle.
-
insetsFrom
Returns the insets of the given, or an empty one if no insets can be found.ContainerNote: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c- the givenContainer.- Returns:
- the insets of the given
Container, or an empty one if no insets can be found.
-
isAppletViewer
Returnstrueif the given component is an Applet viewer.- Parameters:
c- the component to check.- Returns:
trueif the given component is an Applet viewer,falseotherwise.
-
isHeavyWeightPopup
Returns whether the givenComponentis a heavy-weight pop-up, that is, a container for aJPopupMenuthat is implemented with a heavy-weight component (usually aWindow).- Parameters:
c- the givenComponent.- Returns:
trueif the givenComponentis a heavy-weight pop-up;falseotherwise.- Since:
- 1.2
-
obtainNameSafely
-
invokerOf
Returns the invoker, if any, of the given; orComponentnull, if theComponentis not on a pop-up of any sort.Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c- the givenComponent.- Returns:
- the invoker, if any, of the given
Component; ornull, if theComponentis not on a pop-up of any sort.
-
locationOnScreenOf
Safe version of, which avoids lockup if an AWT pop-up menu is showing. The AWT pop-up holds the AWT tree lock when showing, which lock is required byComponent.getLocationOnScreen()getLocationOnScreen.Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.
- Parameters:
c- the givenComponent.- Returns:
- the a point specifying the
Component's top-left corner in the screen's coordinate space, ornull, if theComponentis not showing on the screen.
-
popupOnPress
public static boolean popupOnPress()Returns whether the platform registers a pop-up on mouse press.- Returns:
trueif the platform registers a pop-up on mouse press,falseotherwise.
-
popupMask
public static int popupMask()Returns themask for the pop-up trigger button.InputEvent- Returns:
- the
InputEventmask for the pop-up trigger button.
-
isAWTTreeLockHeld
public static boolean isAWTTreeLockHeld()Indicates whether the AWT Tree Lock is currently held.- Returns:
trueif the AWT Tree Lock is currently held,falseotherwise.
-