Package com.reportmill.base
Class RMAWTUtils
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.base.RMAWTUtils
- All Implemented Interfaces:
RMArchiver.Archiving,Cloneable
This class has a bunch of convenience utility methods from drawing lines, RMRects, buttons, etc.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddrawButton(Graphics2D g, float x, float y, float w, float h, boolean isPressed) Draws a button for the given rect with an option for pressed.static voiddrawButton(Graphics2D g, RMRect aRect, boolean isPressed) Draws a button for the given rect with an option for pressed.static voiddrawLine(Graphics2D g, float p1x, float p1y, float p2x, float p2y) Draws a line between the given points.static voiddrawLine(Graphics2D g, RMPoint p1, RMPoint p2) Draws a line between the given points.static voiddrawRect(Graphics2D g, float x, float y, float w, float h) Strokes the given rect.static voidfill3DRect(Graphics2D g, float x, float y, float w, float h, boolean isRaised) Fills the given rect with simple 3D button effect.static voidfill3DRect(Graphics2D g, RMRect aRect, boolean isRaised) Fills the given rect with simple 3D button effect.static voidfillRect(Graphics2D g, float x, float y, float w, float h) Fills the given rect.static BufferedImagegetBufferedImage(Image anImage) Returns a buffered image for an AWT image.static byte[]getBytesJPEG(Image anImage) Returns a JPeg byte array for the given buffered image.static byte[]getBytesPNG(Image anImage) Returns a PNG byte array for the given buffered image.static BasicStrokegetStroke(float aStrokeWidth) Returns a basic stroke with the given stroke width.static booleanisCommandDown(InputEvent anEvent) Returns whether the given event has command down.static booleanisControlDown(InputEvent anEvent) Returns whether the given input event has control down.static voidsetAntialiasing(Graphics2D g, boolean aFlag) Turns antialiasing on or off for a given graphics.Methods inherited from class com.reportmill.base.RMObject
clone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
-
Field Details
-
Stroke1
-
StrokeDash1
-
COMMAND_MASK
public static final int COMMAND_MASK -
CONTROL_MASK
public static final int CONTROL_MASK -
Arial8
-
Helvetica10
-
HelveticaBold10
-
Helvetica11
-
HelveticaBold11
-
Helvetica12
-
HelveticaBold12
-
Helvetica14
-
HelveticaBold14
-
-
Constructor Details
-
RMAWTUtils
public RMAWTUtils()
-
-
Method Details
-
isCommandDown
Returns whether the given event has command down. -
isControlDown
Returns whether the given input event has control down. -
getStroke
Returns a basic stroke with the given stroke width. -
drawLine
Draws a line between the given points. -
drawLine
Draws a line between the given points. -
drawRect
Strokes the given rect. -
fillRect
Fills the given rect. -
fill3DRect
Fills the given rect with simple 3D button effect. -
fill3DRect
Fills the given rect with simple 3D button effect. -
drawButton
Draws a button for the given rect with an option for pressed. -
drawButton
Draws a button for the given rect with an option for pressed. -
setAntialiasing
Turns antialiasing on or off for a given graphics. -
getBytesJPEG
Returns a JPeg byte array for the given buffered image. -
getBytesPNG
Returns a PNG byte array for the given buffered image. -
getBufferedImage
Returns a buffered image for an AWT image.
-