Package com.ribs
Class RUAwt
- java.lang.Object
-
- com.ribs.RUAwt
-
public class RUAwt extends java.lang.Object
This class offers a number of useful general purpose utilities used by ribs classes.Copyright (c) 2004 ReportMill Software, Inc. All Rights Reserved. Contact ReportMill
.
-
-
Field Summary
Fields Modifier and Type Field Description static byte
SCREEN_ABSOLUTE
static byte
SCREEN_CENTER
static byte
SCREEN_LOWER_LEFT
static byte
SCREEN_LOWER_RIGHT
static byte
SCREEN_UPPER_LEFT
static byte
SCREEN_UPPER_RIGHT
-
Constructor Summary
Constructors Constructor Description RUAwt()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.Color
fromStringColor(java.lang.String aString)
Returns a Color from a String/hex representation.static javax.swing.JComponent
getComponent(javax.swing.JComponent aComp, int anIndex)
Returns the given component's child at the given index (or null, if beyond bounds).static javax.swing.JComponent
getComponentLast(javax.swing.JComponent aComp)
Returns the given components last child (or null, if none).static java.awt.geom.GeneralPath
getPath(float[] xpoints, float[] ypoints, int npoints)
Returns a general path for the given float arrays of points.static java.awt.Dimension
getPreferredWindowSize(java.awt.Component aComponent)
Returns appropriate window size for a component in a scrollpane such that scrollers aren't visible if possible.static javax.swing.JViewport
getViewport(java.awt.Component aComp)
Returns the first viewport that is a parent of the given component.static java.awt.Window
getWindow(java.awt.Component aComponent)
Returns the window associated with this component.static void
setContentSize(java.awt.Window aWindow, int width, int height)
Sets the size of a window so that its contentPane is the given size.static void
setPreferredWindowSize(java.awt.Component aComponent)
Sets appropriate window size for a component in a scrollpane such that scrollers aren't visible if possible.static void
setWindowAlwaysOnTop(java.awt.Window aWindow, boolean aFlag)
Sets a window to always be on top in Java 5 or beyond.static void
setWindowVisible(java.awt.Component aWin, int x, int y, byte aCorner)
Makes a window visiable with the given corner at the given x & y.static void
setWindowVisible(java.awt.Component aWindow, int x, int y, byte aCorner, java.lang.String frameSaveName)
Makes a window visiable with the given corner at the given x & y.static void
setWindowVisibleCentered(java.awt.Component aWin)
Makes a window visable in the middle of the screen.static java.lang.String
toStringColor(java.awt.Color aColor)
Returns a String/hex representation of a given color (eg, "#FF00D8").
-
-
-
Field Detail
-
SCREEN_UPPER_LEFT
public static final byte SCREEN_UPPER_LEFT
- See Also:
- Constant Field Values
-
SCREEN_UPPER_RIGHT
public static final byte SCREEN_UPPER_RIGHT
- See Also:
- Constant Field Values
-
SCREEN_LOWER_LEFT
public static final byte SCREEN_LOWER_LEFT
- See Also:
- Constant Field Values
-
SCREEN_LOWER_RIGHT
public static final byte SCREEN_LOWER_RIGHT
- See Also:
- Constant Field Values
-
SCREEN_CENTER
public static final byte SCREEN_CENTER
- See Also:
- Constant Field Values
-
SCREEN_ABSOLUTE
public static final byte SCREEN_ABSOLUTE
- See Also:
- Constant Field Values
-
-
Method Detail
-
toStringColor
public static java.lang.String toStringColor(java.awt.Color aColor)
Returns a String/hex representation of a given color (eg, "#FF00D8").
-
fromStringColor
public static java.awt.Color fromStringColor(java.lang.String aString)
Returns a Color from a String/hex representation.
-
setWindowVisibleCentered
public static void setWindowVisibleCentered(java.awt.Component aWin)
Makes a window visable in the middle of the screen.
-
setWindowVisible
public static void setWindowVisible(java.awt.Component aWin, int x, int y, byte aCorner)
Makes a window visiable with the given corner at the given x & y.
-
setWindowVisible
public static void setWindowVisible(java.awt.Component aWindow, int x, int y, byte aCorner, java.lang.String frameSaveName)
Makes a window visiable with the given corner at the given x & y.
-
setWindowAlwaysOnTop
public static void setWindowAlwaysOnTop(java.awt.Window aWindow, boolean aFlag)
Sets a window to always be on top in Java 5 or beyond.
-
getPreferredWindowSize
public static java.awt.Dimension getPreferredWindowSize(java.awt.Component aComponent)
Returns appropriate window size for a component in a scrollpane such that scrollers aren't visible if possible.
-
setPreferredWindowSize
public static void setPreferredWindowSize(java.awt.Component aComponent)
Sets appropriate window size for a component in a scrollpane such that scrollers aren't visible if possible.
-
getWindow
public static java.awt.Window getWindow(java.awt.Component aComponent)
Returns the window associated with this component.
-
getComponent
public static javax.swing.JComponent getComponent(javax.swing.JComponent aComp, int anIndex)
Returns the given component's child at the given index (or null, if beyond bounds).
-
getComponentLast
public static javax.swing.JComponent getComponentLast(javax.swing.JComponent aComp)
Returns the given components last child (or null, if none).
-
getViewport
public static javax.swing.JViewport getViewport(java.awt.Component aComp)
Returns the first viewport that is a parent of the given component.
-
setContentSize
public static void setContentSize(java.awt.Window aWindow, int width, int height)
Sets the size of a window so that its contentPane is the given size.
-
getPath
public static java.awt.geom.GeneralPath getPath(float[] xpoints, float[] ypoints, int npoints)
Returns a general path for the given float arrays of points.
-
-