|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.objectplanet.chart.Renderer
public class Renderer
This class is the abstract superclass of all renderers.
| Field Summary | |
|---|---|
protected GenericChart |
chart
The chart object |
static java.awt.Cursor |
DEFAULT_CURSOR
|
protected static int |
DOUBLE_CLICK_TIME
|
static java.awt.Cursor |
GRID_CURSOR_HORZ
|
static java.awt.Cursor |
GRID_CURSOR_VERT
|
static java.awt.Cursor |
HAND_CURSOR
|
static java.awt.Cursor |
RESIZE_CURSOR
|
static java.awt.Cursor |
RESIZE_HOR_CURSOR
|
| Constructor Summary | |
|---|---|
Renderer()
Default constructor. |
|
Renderer(GenericChart chart)
Creates a basic renderer. |
|
| Method Summary | |
|---|---|
protected void |
clearBackground(java.awt.Graphics g,
java.awt.Dimension size)
Clears the backgrond making it transparent. |
static void |
fifo_add(java.lang.Object[] image_and_key)
Adds a new object at the end of the fifo queue. |
static void |
fifo_clear()
Clears the image queue and cache and flushes the images. |
static java.lang.Object[] |
fifo_remove()
Returns and removes the first object in the fifo queue. |
static java.util.Hashtable |
getAngledLabelCache()
Getter for the angledLabelCache where the angled labels are stored. |
protected java.awt.Dimension |
getAngledLabelSize(java.awt.Dimension size,
int angle)
Calculates the size of the angled label size. |
protected static java.awt.Color |
getBrighter(java.awt.Color color)
Creates a new Color that is a brighter version of this Color. |
protected static java.awt.Color |
getDarker(java.awt.Color color)
Creates a new Color that is a darker version of this Color. |
static int |
getfifo_count()
Getter for the fifo_count. |
static java.lang.Object[] |
getfifo_queue()
Getter for the fifo_queue. |
protected java.awt.Font |
getFont(java.lang.String label)
Gets the font for the specified label. |
protected java.awt.FontMetrics |
getFontMetrics(java.awt.Font font)
Gets the font metrics for the specified font. |
protected java.awt.Dimension |
getImageSize(java.lang.String name)
Calculates the size of an image. |
protected java.lang.String |
getLabel(java.lang.String name)
Gets the specified label from the chart. |
protected int |
getLabelAngle(java.lang.String name)
Gets the angle of the specified label. |
protected java.awt.Dimension |
getLabelSize(java.lang.String label,
java.awt.FontMetrics fm)
Calculates the size of a multiline label. |
protected int |
getSampleCount()
Gets the number of samples. |
protected int |
getSeriesCount()
Gets the number of series. |
static int |
hashCode(java.lang.String s)
Returns a hashcode for the specified string. |
protected void |
paintBox(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int w,
int h,
boolean pushed)
Paints a 3D box with the specified size. |
protected void |
paintLabel(java.awt.Graphics g,
java.lang.String label,
int label_x,
int label_y,
java.awt.Dimension size,
int style,
int angle,
boolean underlined)
Paints a normal, multiline, and angled label. |
static void |
setLabelAngleCacheSize(int count)
Sets the angled label cache size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GenericChart chart
public static java.awt.Cursor DEFAULT_CURSOR
protected static final int DOUBLE_CLICK_TIME
public static java.awt.Cursor GRID_CURSOR_HORZ
public static java.awt.Cursor GRID_CURSOR_VERT
public static java.awt.Cursor HAND_CURSOR
public static java.awt.Cursor RESIZE_CURSOR
public static java.awt.Cursor RESIZE_HOR_CURSOR
| Constructor Detail |
|---|
public Renderer()
public Renderer(GenericChart chart)
chart - The chart object attached to this renderer.| Method Detail |
|---|
protected void clearBackground(java.awt.Graphics g,
java.awt.Dimension size)
g - The graphics context used to paint with.size - The size of the chart component.public static void fifo_add(java.lang.Object[] image_and_key)
image_and_key - An array with the key in [0] and the image in [1]public static void fifo_clear()
public static java.lang.Object[] fifo_remove()
public static java.util.Hashtable getAngledLabelCache()
protected java.awt.Dimension getAngledLabelSize(java.awt.Dimension size,
int angle)
size - The unrotated size.angle - The angle of the label to be painted.
protected static java.awt.Color getBrighter(java.awt.Color color)
color - The source Color.
protected static java.awt.Color getDarker(java.awt.Color color)
color - The source Color.
public static int getfifo_count()
public static java.lang.Object[] getfifo_queue()
protected java.awt.Font getFont(java.lang.String label)
label - The name of the label.
protected java.awt.FontMetrics getFontMetrics(java.awt.Font font)
font - The name of the font.
protected java.awt.Dimension getImageSize(java.lang.String name)
name - The name of the image to check size for.
protected java.lang.String getLabel(java.lang.String name)
name - The name of the label.
protected int getLabelAngle(java.lang.String name)
name - The name of the label.
protected java.awt.Dimension getLabelSize(java.lang.String label,
java.awt.FontMetrics fm)
label - The label to check the size of.fm - The font metrics used to measure labels with.
protected int getSampleCount()
protected int getSeriesCount()
public static int hashCode(java.lang.String s)
s - The string to calculate hash code for.
protected void paintBox(java.awt.Graphics g,
java.awt.Color c,
int x,
int y,
int w,
int h,
boolean pushed)
g - The graphics context used to paint with.c - The background color of the button.x - The x position of the upper left corner.y - The y position of the upper left corner.w - The box width.h - The box height.pushed - True if button should be pushed.
protected void paintLabel(java.awt.Graphics g,
java.lang.String label,
int label_x,
int label_y,
java.awt.Dimension size,
int style,
int angle,
boolean underlined)
g - The graphics context used to paint with.label - The label to paint.label_x - The x position of the label.label_y - The y position of the label.size - The size of the unrotated label.style - -1 for left, 0 for center, 1 for right.angle - The degrees to turn the label (only 0, 90, 180, 270 works fine).underlined - If true the label is underlined (can be used for URLs, ony for non-angled labels).public static void setLabelAngleCacheSize(int count)
count - The image cache count, less than 0 to turn it off.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||