public class RMAWTUtils extends RMObject
Modifier and Type | Field and Description |
---|---|
static java.awt.Font |
Arial10 |
static java.awt.Font |
Arial11 |
static java.awt.Font |
Arial12 |
static java.awt.Font |
Arial14 |
static java.awt.Font |
Arial8 |
static java.awt.Font |
ArialBold10 |
static java.awt.Font |
ArialBold11 |
static java.awt.Font |
ArialBold12 |
static java.awt.Font |
ArialBold14 |
static int |
COMMAND_MASK |
static int |
CONTROL_MASK |
static java.awt.Font |
Helvetica10 |
static java.awt.Font |
Helvetica11 |
static java.awt.Font |
Helvetica12 |
static java.awt.Font |
HelveticaBold11 |
static java.awt.Font |
HelveticaBold12 |
static java.awt.BasicStroke |
Stroke1 |
static java.awt.BasicStroke |
StrokeDash1 |
Constructor and Description |
---|
RMAWTUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
drawButton(java.awt.Graphics2D g,
double x,
double y,
double w,
double h,
boolean isPressed)
Draws a button for the given rect with an option for pressed.
|
static void |
drawButton(java.awt.Graphics2D g,
RMRect aRect,
boolean isPressed)
Draws a button for the given rect with an option for pressed.
|
static void |
drawLine(java.awt.Graphics2D g,
double p1x,
double p1y,
double p2x,
double p2y)
Draws a line between the given points.
|
static void |
drawLine(java.awt.Graphics2D g,
RMPoint p1,
RMPoint p2)
Draws a line between the given points.
|
static void |
drawRect(java.awt.Graphics2D g,
double x,
double y,
double w,
double h)
Strokes the given rect.
|
static void |
fill3DRect(java.awt.Graphics2D g,
double x,
double y,
double w,
double h,
boolean isRaised)
Fills the given rect with simple 3D button effect.
|
static void |
fill3DRect(java.awt.Graphics2D g,
RMRect aRect,
boolean isRaised)
Fills the given rect with simple 3D button effect.
|
static void |
fillRect(java.awt.Graphics2D g,
double x,
double y,
double w,
double h)
Fills the given rect.
|
static java.awt.Color |
fromStringColor(java.lang.String aString)
Returns a Color from a String/hex representation.
|
static java.awt.Insets |
fromStringInsets(java.lang.String aString)
Returns an Insets instance from given string.
|
static java.awt.image.BufferedImage |
getBufferedImage(java.awt.Image anImage)
Returns a buffered image for an AWT image with transparency.
|
static java.awt.image.BufferedImage |
getBufferedImage(java.awt.Image anImage,
boolean withAlpha)
Returns a buffered image for an AWT image.
|
static java.awt.image.BufferedImage |
getBufferedImage(int aWidth,
int aHeight,
boolean withAlpha)
Returns a compatible buffered image for width and height with given transparency.
|
static byte[] |
getBytesJPEG(java.awt.Image anImage)
Returns a JPeg byte array for the given buffered image.
|
static byte[] |
getBytesPNG(java.awt.Image anImage)
Returns a PNG byte array for the given buffered image.
|
static java.awt.Cursor |
getHiddenCursor()
A method to hide the cursor.
|
static java.awt.Image |
getImageForString(java.lang.String aString,
java.awt.Font aFont)
Returns an image for the given string and font.
|
static java.awt.Cursor |
getResizeCursor(int anEdgeMask)
Returns a resize cursor for a rect edge mask.
|
static java.awt.BasicStroke |
getStroke(float aStrokeWidth)
Returns a basic stroke with the given stroke width.
|
static boolean |
isCommandDown(java.awt.event.InputEvent anEvent)
Returns whether the given event has command down.
|
static boolean |
isControlDown(java.awt.event.InputEvent anEvent)
Returns whether the given input event has control down.
|
static boolean |
setAntialiasing(java.awt.Graphics2D g,
boolean aFlag)
Turns antialiasing on or off for a given graphics (returns previous state).
|
static java.lang.String |
toStringColor(java.awt.Color aColor)
Returns a String/hex representation of a given color (eg, "#FF00D8").
|
static java.lang.String |
toStringInsets(java.awt.Insets theInsets)
Returns a string representation of a given Insets.
|
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange, toString
addListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
public static final java.awt.BasicStroke Stroke1
public static final java.awt.BasicStroke StrokeDash1
public static final int COMMAND_MASK
public static final int CONTROL_MASK
public static java.awt.Font Arial8
public static java.awt.Font Arial10
public static java.awt.Font ArialBold10
public static java.awt.Font Arial11
public static java.awt.Font ArialBold11
public static java.awt.Font Arial12
public static java.awt.Font ArialBold12
public static java.awt.Font Arial14
public static java.awt.Font ArialBold14
public static java.awt.Font Helvetica10
public static java.awt.Font Helvetica11
public static java.awt.Font HelveticaBold11
public static java.awt.Font Helvetica12
public static java.awt.Font HelveticaBold12
public static boolean isCommandDown(java.awt.event.InputEvent anEvent)
public static boolean isControlDown(java.awt.event.InputEvent anEvent)
public static java.awt.BasicStroke getStroke(float aStrokeWidth)
public static void drawLine(java.awt.Graphics2D g, RMPoint p1, RMPoint p2)
public static void drawLine(java.awt.Graphics2D g, double p1x, double p1y, double p2x, double p2y)
public static void drawRect(java.awt.Graphics2D g, double x, double y, double w, double h)
public static void fillRect(java.awt.Graphics2D g, double x, double y, double w, double h)
public static void fill3DRect(java.awt.Graphics2D g, RMRect aRect, boolean isRaised)
public static void fill3DRect(java.awt.Graphics2D g, double x, double y, double w, double h, boolean isRaised)
public static void drawButton(java.awt.Graphics2D g, RMRect aRect, boolean isPressed)
public static void drawButton(java.awt.Graphics2D g, double x, double y, double w, double h, boolean isPressed)
public static boolean setAntialiasing(java.awt.Graphics2D g, boolean aFlag)
public static java.lang.String toStringInsets(java.awt.Insets theInsets)
public static java.awt.Insets fromStringInsets(java.lang.String aString)
public static java.lang.String toStringColor(java.awt.Color aColor)
public static java.awt.Color fromStringColor(java.lang.String aString)
public static java.awt.Cursor getResizeCursor(int anEdgeMask)
public static byte[] getBytesJPEG(java.awt.Image anImage)
public static byte[] getBytesPNG(java.awt.Image anImage)
public static java.awt.image.BufferedImage getBufferedImage(java.awt.Image anImage)
public static java.awt.image.BufferedImage getBufferedImage(java.awt.Image anImage, boolean withAlpha)
public static java.awt.image.BufferedImage getBufferedImage(int aWidth, int aHeight, boolean withAlpha)
public static java.awt.Image getImageForString(java.lang.String aString, java.awt.Font aFont)
public static java.awt.Cursor getHiddenCursor()