|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.image.WebImage
public class WebImage
Field Summary | |
---|---|
protected boolean |
antiAliased
Use an IndexColorModel. |
protected static java.lang.String |
ARG_CANNOT_BE_NULL
|
java.awt.Color |
backgroundColor
Background color for the image. |
int |
bottomBorder
Height of the image border on the bottom side of the image |
protected static java.awt.Color |
DEFAULT_BACKGROUND_COLOR
|
protected static java.lang.String |
DEFAULT_BOLD_TYPEFACE
|
protected static java.awt.Color |
DEFAULT_BORDER_COLOR
|
protected static int |
DEFAULT_BORDER_SIZE
|
protected static java.awt.Font |
DEFAULT_FONT
|
protected static java.awt.FontMetrics |
DEFAULT_FONT_METRICS
|
protected static int |
DEFAULT_HEIGHT
|
protected static java.lang.String |
DEFAULT_PLAIN_TYPEFACE
|
protected static int |
DEFAULT_SHADOW_WIDTH
|
protected static java.awt.Color |
DEFAULT_TEXT_COLOR
|
protected static int |
DEFAULT_WIDTH
|
java.awt.Font |
font
Text font. |
boolean |
frameImage
Draws a two pixel light gray frame at the edge of the image |
int |
height
Height of the image. |
protected boolean |
indexColors
Anti-alias shapes and text. |
int |
leftBorder
Width of the image border on the left side of the image |
protected java.awt.Graphics2D |
m_graphics
|
int |
rightBorder
Width of the image border on the right side of the image |
int |
shadowWidth
Width of the shadow around the image. |
static java.awt.Font |
SMALL_FONT
|
java.awt.Color |
textColor
Color for text in the image. |
int |
topBorder
Height of the image border on the top side of the image |
int |
width
Width of the image. |
Constructor Summary | |
---|---|
protected |
WebImage(int width,
int height)
|
Method Summary | |
---|---|
protected void |
draw(java.awt.Graphics2D g)
|
java.awt.FontMetrics |
getFontMetrics()
Retrieves the font metrics. |
java.awt.Image |
getImage()
Retrieves the image as a java.awt.Image object. |
protected java.awt.Point |
getTextCenter(java.lang.String text)
|
protected java.awt.Point |
getTextCenter(java.lang.String text,
java.awt.Rectangle rect)
|
protected static java.awt.Point |
getTextCenter(java.lang.String text,
java.awt.Rectangle rect,
java.awt.FontMetrics metrics)
|
static boolean |
isRunnable()
Determine if a graphics environment is available. |
protected void |
postInit(java.awt.Graphics2D graphics)
|
protected void |
preInit()
|
void |
setBorder(int border)
Sets the size of the top, left, right and bottom borders. |
void |
writeJpegImage(java.io.OutputStream stream)
Writes the chart image as a JPEG image. |
void |
writeJpegImage(java.lang.String filename)
Writes the chart image as a JPEG image. |
void |
writePngImage(java.io.OutputStream stream)
Writes the chart image as a PNG image. |
void |
writePngImage(java.lang.String filename)
Writes the chart image as a PNG image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String ARG_CANNOT_BE_NULL
protected static final int DEFAULT_HEIGHT
protected static final int DEFAULT_WIDTH
protected static final java.awt.Color DEFAULT_BACKGROUND_COLOR
protected static final int DEFAULT_BORDER_SIZE
protected static final java.awt.Color DEFAULT_BORDER_COLOR
protected static final java.awt.Color DEFAULT_TEXT_COLOR
protected static final int DEFAULT_SHADOW_WIDTH
protected static final java.lang.String DEFAULT_BOLD_TYPEFACE
protected static final java.lang.String DEFAULT_PLAIN_TYPEFACE
protected static final java.awt.Font DEFAULT_FONT
protected static final java.awt.FontMetrics DEFAULT_FONT_METRICS
public static final java.awt.Font SMALL_FONT
protected java.awt.Graphics2D m_graphics
public java.awt.Font font
public int height
public int width
public int leftBorder
public int topBorder
public int rightBorder
public int bottomBorder
public boolean frameImage
public java.awt.Color backgroundColor
public java.awt.Color textColor
public int shadowWidth
protected boolean antiAliased
protected boolean indexColors
Constructor Detail |
---|
protected WebImage(int width, int height)
Method Detail |
---|
protected void draw(java.awt.Graphics2D g)
protected void preInit()
protected void postInit(java.awt.Graphics2D graphics)
public void setBorder(int border)
border
- The size to set the borders to.#LeftBorder
public java.awt.FontMetrics getFontMetrics()
Font
public java.awt.Image getImage()
Image
public void writeJpegImage(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
- The path and filename that specifies where the PNG image should be
written.
java.io.FileNotFoundException
- If the filename is not a valid name for a file.
java.io.IOException
- If there is an IO error while writing to the file.
java.lang.IllegalArgumentException
- If the filename parameter is null.public void writeJpegImage(java.io.OutputStream stream) throws java.io.IOException
stream
- The java.io.OutputStream to write the PNG image to.
java.io.IOException
- If there is an IO error while streaming the PNG image.
java.lang.IllegalArgumentException
- If the stream parameter is null.OutputStream
public void writePngImage(java.lang.String filename) throws java.io.FileNotFoundException, java.io.IOException
filename
- The path and filename that specifies where the PNG image should be
written.
java.io.FileNotFoundException
- If the filename is not a valid name for a file.
java.io.IOException
- If there is an IO error while writing to the file.
java.lang.IllegalArgumentException
- If the filename parameter is null.public void writePngImage(java.io.OutputStream stream) throws java.io.IOException
stream
- The java.io.OutputStream to write the PNG image to.
java.io.IOException
- If there is an IO error while streaming the PNG image.
java.lang.IllegalArgumentException
- If the stream parameter is null.OutputStream
protected java.awt.Point getTextCenter(java.lang.String text)
protected java.awt.Point getTextCenter(java.lang.String text, java.awt.Rectangle rect)
protected static java.awt.Point getTextCenter(java.lang.String text, java.awt.Rectangle rect, java.awt.FontMetrics metrics)
public static boolean isRunnable()
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |