java.lang.Object
javax.swing.SwingUtilities
- All Implemented Interfaces:
SwingConstants
A collection of utility methods for Swing.
- Since:
- 1.2
-
Field Summary
Fields declared in interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Method Summary
Modifier and TypeMethodDescriptionstatic Rectangle
Stores the position and size of the inner painting area of the specified component inr
and returnsr
.static Rectangle[]
computeDifference
(Rectangle rectA, Rectangle rectB) Convenience returning an array of rect representing the regions withinrectA
that do not overlap withrectB
.static Rectangle
computeIntersection
(int x, int y, int width, int height, Rectangle dest) Convenience to calculate the intersection of two rectangles without allocating a new rectangle.static int
computeStringWidth
(FontMetrics fm, String str) Compute the width of the string using a font with the specified "metrics" (sizes).static Rectangle
computeUnion
(int x, int y, int width, int height, Rectangle dest) Convenience method that calculates the union of two rectangles without allocating a new rectangle.static MouseEvent
convertMouseEvent
(Component source, MouseEvent sourceEvent, Component destination) Returns a MouseEvent similar tosourceEvent
except that its x and y members have been converted todestination
's coordinate system.static Point
convertPoint
(Component source, int x, int y, Component destination) Convert the point(x,y)
insource
coordinate system todestination
coordinate system.static Point
convertPoint
(Component source, Point aPoint, Component destination) Convert aaPoint
insource
coordinate system todestination
coordinate system.static void
Convert a point from a screen coordinates to a component's coordinate systemstatic void