Package com.reportmill.base
Class RMAWTUtils
- java.lang.Object
- 
- com.reportmill.base.RMObject
- 
- com.reportmill.base.RMAWTUtils
 
 
- 
- All Implemented Interfaces:
- RMArchiver.Archiving,- java.lang.Cloneable
 
 public class RMAWTUtils extends RMObject This class has a bunch of convenience utility methods from drawing lines, RMRects, buttons, etc.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.awt.FontArial8static intCOMMAND_MASKstatic intCONTROL_MASKstatic java.awt.FontHelvetica10static java.awt.FontHelvetica11static java.awt.FontHelvetica12static java.awt.FontHelvetica14static java.awt.FontHelveticaBold10static java.awt.FontHelveticaBold11static java.awt.FontHelveticaBold12static java.awt.FontHelveticaBold14static java.awt.BasicStrokeStroke1static java.awt.BasicStrokeStrokeDash1
 - 
Constructor SummaryConstructors Constructor Description RMAWTUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddrawButton(java.awt.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(java.awt.Graphics2D g, RMRect aRect, boolean isPressed)Draws a button for the given rect with an option for pressed.static voiddrawLine(java.awt.Graphics2D g, float p1x, float p1y, float p2x, float p2y)Draws a line between the given points.static voiddrawLine(java.awt.Graphics2D g, RMPoint p1, RMPoint p2)Draws a line between the given points.static voiddrawRect(java.awt.Graphics2D g, float x, float y, float w, float h)Strokes the given rect.static voidfill3DRect(java.awt.Graphics2D g, float x, float y, float w, float h, boolean isRaised)Fills the given rect with simple 3D button effect.static voidfill3DRect(java.awt.Graphics2D g, RMRect aRect, boolean isRaised)Fills the given rect with simple 3D button effect.static voidfillRect(java.awt.Graphics2D g, float x, float y, float w, float h)Fills the given rect.static java.awt.image.BufferedImagegetBufferedImage(java.awt.Image anImage)Returns a buffered image for an AWT image.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.BasicStrokegetStroke(float aStrokeWidth)Returns a basic stroke with the given stroke width.static booleanisCommandDown(java.awt.event.InputEvent anEvent)Returns whether the given event has command down.static booleanisControlDown(java.awt.event.InputEvent anEvent)Returns whether the given input event has control down.static voidsetAntialiasing(java.awt.Graphics2D g, boolean aFlag)Turns antialiasing on or off for a given graphics.- 
Methods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
 
- 
 
- 
- 
- 
Field Detail- 
Stroke1public static final java.awt.BasicStroke Stroke1 
 - 
StrokeDash1public static final java.awt.BasicStroke StrokeDash1 
 - 
COMMAND_MASKpublic static final int COMMAND_MASK 
 - 
CONTROL_MASKpublic static final int CONTROL_MASK 
 - 
Arial8public static java.awt.Font Arial8 
 - 
Helvetica10public static java.awt.Font Helvetica10 
 - 
HelveticaBold10public static java.awt.Font HelveticaBold10 
 - 
Helvetica11public static java.awt.Font Helvetica11 
 - 
HelveticaBold11public static java.awt.Font HelveticaBold11 
 - 
Helvetica12public static java.awt.Font Helvetica12 
 - 
HelveticaBold12public static java.awt.Font HelveticaBold12 
 - 
Helvetica14public static java.awt.Font Helvetica14 
 - 
HelveticaBold14public static java.awt.Font HelveticaBold14 
 
- 
 - 
Method Detail- 
isCommandDownpublic static boolean isCommandDown(java.awt.event.InputEvent anEvent) Returns whether the given event has command down.
 - 
isControlDownpublic static boolean isControlDown(java.awt.event.InputEvent anEvent) Returns whether the given input event has control down.
 - 
getStrokepublic static java.awt.BasicStroke getStroke(float aStrokeWidth) Returns a basic stroke with the given stroke width.
 - 
drawLinepublic static void drawLine(java.awt.Graphics2D g, RMPoint p1, RMPoint p2)Draws a line between the given points.
 - 
drawLinepublic static void drawLine(java.awt.Graphics2D g, float p1x, float p1y, float p2x, float p2y)Draws a line between the given points.
 - 
drawRectpublic static void drawRect(java.awt.Graphics2D g, float x, float y, float w, float h)Strokes the given rect.
 - 
fillRectpublic static void fillRect(java.awt.Graphics2D g, float x, float y, float w, float h)Fills the given rect.
 - 
fill3DRectpublic static void fill3DRect(java.awt.Graphics2D g, RMRect aRect, boolean isRaised)Fills the given rect with simple 3D button effect.
 - 
fill3DRectpublic static void fill3DRect(java.awt.Graphics2D g, float x, float y, float w, float h, boolean isRaised)Fills the given rect with simple 3D button effect.
 - 
drawButtonpublic static void drawButton(java.awt.Graphics2D g, RMRect aRect, boolean isPressed)Draws a button for the given rect with an option for pressed.
 - 
drawButtonpublic static void drawButton(java.awt.Graphics2D g, float x, float y, float w, float h, boolean isPressed)Draws a button for the given rect with an option for pressed.
 - 
setAntialiasingpublic static void setAntialiasing(java.awt.Graphics2D g, boolean aFlag)Turns antialiasing on or off for a given graphics.
 - 
getBytesJPEGpublic static byte[] getBytesJPEG(java.awt.Image anImage) Returns a JPeg byte array for the given buffered image.
 - 
getBytesPNGpublic static byte[] getBytesPNG(java.awt.Image anImage) Returns a PNG byte array for the given buffered image.
 - 
getBufferedImagepublic static java.awt.image.BufferedImage getBufferedImage(java.awt.Image anImage) Returns a buffered image for an AWT image.
 
- 
 
-