|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.graphic.impl.swing.SwingGraphics
Constants and utilities that are commonly used by Swing/AWT adapters.
Data type conversions are between Swing mouse coordinates (X increasing left in display, Y increasing down, integer precision) and Gumbo right-hand coordinates. Conversions, in either direction, do not affect the origin. Conversions to Swing ignore the Gumbo Z value and perform rounding. Conversions from Swing set the Gumbo Z value to zero.
Method Summary | |
static java.awt.Point |
centerPoint(java.awt.Dimension size,
java.awt.Point retVal)
Returns the center point of a box. |
static java.awt.Point |
centerPoint(java.awt.Rectangle bounds,
java.awt.Point retVal)
Returns the center point of a box. |
static java.awt.Rectangle |
contentBounds(java.awt.Container cont,
java.awt.Rectangle retVal)
Returns the bounds exclosing a container's visible contents. |
static Tuple3 |
fromDimension(java.awt.Dimension size,
Tuple3 retVal)
Converts a Dimension to a Tuple3. |
static Tuple3 |
fromPoint(java.awt.Point point,
Tuple3 retVal)
Converts a Point to a Tuple3. |
static AxisBound3 |
fromRectangle(java.awt.Rectangle rect,
AxisBound3 retVal)
Converts a Rectangle to a AxisBound3. |
static java.awt.Point |
originPoint(java.awt.Point center,
java.awt.Dimension size,
java.awt.Point retVal)
Returns the origin point of a box, given the box center and size. |
static void |
prepareGraphicPresence(java.util.Collection types,
java.awt.Container cont)
Calls prepareGraphicPresence() on each GraphicPresence component in a container that matches one of the specified types. |
static void |
realizeGraphicPresence(java.util.Collection types,
java.awt.Container cont)
Calls realizeGraphicPresence() on each GraphicPresence component in a container that matches one of the specified types. |
static java.awt.Dimension |
toDimension(Tuple3 tuple,
java.awt.Dimension retVal)
Converts a Tuple3 to a Dimension. |
static java.awt.Point |
toPoint(Tuple3 tuple,
java.awt.Point retVal)
Converts a Tuple3 to a Point. |
static java.awt.Rectangle |
toRectangle(AxisBound3 bound,
java.awt.Rectangle retVal)
Converts a AxisBound3 to a Rectangle. |
static java.awt.Rectangle |
usableBounds(java.awt.Container comp,
java.awt.Rectangle retVal)
Returns the usable bounds of a component, which is the bounds minus any room reserved for borders. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.awt.Point toPoint(Tuple3 tuple, java.awt.Point retVal)
tuple
- Tuple to convert. Never null.retVal
- Return value object. Never null.
public static Tuple3 fromPoint(java.awt.Point point, Tuple3 retVal)
point
- Point to convert. Never null.retVal
- Return value object. Never null.
public static java.awt.Dimension toDimension(Tuple3 tuple, java.awt.Dimension retVal)
tuple
- Tuple to convert. Never null.retVal
- Return value object. Never null.
public static Tuple3 fromDimension(java.awt.Dimension size, Tuple3 retVal)
size
- Dimension to convert. Never null.retVal
- Return value object. Never null.
public static java.awt.Rectangle toRectangle(AxisBound3 bound, java.awt.Rectangle retVal)
bound
- AxisBound3 to convert. Never null.retVal
- Return value object. Never null.
public static AxisBound3 fromRectangle(java.awt.Rectangle rect, AxisBound3 retVal)
retVal
- Return value object. Never null.
public static java.awt.Point centerPoint(java.awt.Dimension size, java.awt.Point retVal)
size
- Size of the box. Possibly zero. Never null.retVal
- Return value object. The center point, relative to (0, 0).
Never null.
public static java.awt.Point centerPoint(java.awt.Rectangle bounds, java.awt.Point retVal)
bounds
- Position and size of the box. Possibly zero. Never null.retVal
- Return value object. The center point, in the same space
as the bounds. Never null.
public static java.awt.Point originPoint(java.awt.Point center, java.awt.Dimension size, java.awt.Point retVal)
center
- Center point of the box. Never null.size
- Size of the box. Possibly zero. Never null.retVal
- Return value object. The origin point, in the same space
as the center point. Never null.
public static java.awt.Rectangle usableBounds(java.awt.Container comp, java.awt.Rectangle retVal)
comp
- Target component. Never null.retVal
- Return value object. The usable bounds. Never null.
public static java.awt.Rectangle contentBounds(java.awt.Container cont, java.awt.Rectangle retVal)
cont
- Target container. Never null.retVal
- Return value object. The contents bounds. Never null.
public static void prepareGraphicPresence(java.util.Collection types, java.awt.Container cont)
types
- Types (Class) of components to prepare. If null,
all types are validated.cont
- Target container. Never null.public static void realizeGraphicPresence(java.util.Collection types, java.awt.Container cont)
types
- Types (Class) of components to refresh. If null,
all types are validated.cont
- Target container. Never null.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |