Class AWT
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Point
Returns a point at the center of the given
.Component
static Point
Returns a point at the center of the given
.Rectangle
static Point
Returns a point at the center of the visible rectangle of the given
.JComponent
static Insets
Returns the insets of the given
, or an empty one if no insets can be found.Container
static Component
Returns the invoker, if any, of the given
; orComponent
null
, if theComponent
is not on a pop-up of any sort.static boolean
Returnstrue
if the given component is an Applet viewer.static boolean
Indicates whether the AWT Tree Lock is currently held.static boolean
Returns whether the givenComponent
is a heavy-weight pop-up, that is, a container for aJPopupMenu
that is implemented with a heavy-weight component (usually aWindow
).static boolean
Indicates whether the given point is inside the screen boundaries.static boolean
Indicates whether the given point, relative to the givenJComponent
, is inside the screen boundaries.static boolean
Returns whether the given component is the default Swing hidden frame.static Point
Safe version of
, which avoids lockup if an AWT pop-up menu is showing.Component.getLocationOnScreen()
private static String
static Window[]
Returns an array of all
s that have no owner.Window
static int
Returns the
mask for the pop-up trigger button.InputEvent
static boolean
Returns whether the platform registers a pop-up on mouse press.static Point
Translates the given coordinates to the location on screen of the given
.Component
static Point
Returns 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:
true
if the point is inside the screen boundaries;false
otherwise.- Since:
- 1.2
-
isPointInScreenBoundaries
Indicates whether the given point is inside the screen boundaries.- Parameters:
p
- the point to verify.- Returns:
true
if the point is inside the screen boundaries;false
otherwise.- Since:
- 1.2
-
ownerLessWindows
Returns an array of all
s that have no owner. They includeWindow
s and ownerlessFrame
s andDialog
s.Window
This 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
.Component
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
.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
.Component
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:
- a point at the center of the given
Component
.
-
centerOfVisibleRect
Returns a point at the center of the visible rectangle of the given
.JComponent
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 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.Container
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 givenContainer
.- Returns:
- the insets of the given
Container
, or an empty one if no insets can be found.
-
isAppletViewer
Returnstrue
if the given component is an Applet viewer.- Parameters:
c
- the component to check.- Returns:
true
if the given component is an Applet viewer,false
otherwise.
-
isHeavyWeightPopup
Returns whether the givenComponent
is a heavy-weight pop-up, that is, a container for aJPopupMenu
that is implemented with a heavy-weight component (usually aWindow
).- Parameters:
c
- the givenComponent
.- Returns:
true
if the givenComponent
is a heavy-weight pop-up;false
otherwise.- Since:
- 1.2
-
obtainNameSafely
-
invokerOf
Returns the invoker, if any, of the given
; orComponent
null
, if theComponent
is 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 theComponent
is 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 theComponent
is not showing on the screen.
-
popupOnPress
public static boolean popupOnPress()Returns whether the platform registers a pop-up on mouse press.- Returns:
true
if the platform registers a pop-up on mouse press,false
otherwise.
-
popupMask
public static int popupMask()Returns the
mask for the pop-up trigger button.InputEvent
- Returns:
- the
InputEvent
mask for the pop-up trigger button.
-
isAWTTreeLockHeld
public static boolean isAWTTreeLockHeld()Indicates whether the AWT Tree Lock is currently held.- Returns:
true
if the AWT Tree Lock is currently held,false
otherwise.
-