|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
com.objectplanet.chart.ext.GaugeChart
| Nested Class Summary |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static int |
GRADIENT_PAINT_DIAGONAL1
Gradient paint from top left to bottom right |
static int |
GRADIENT_PAINT_DIAGONAL2
Gradient paint from bottom left to top right |
static int |
GRADIENT_PAINT_HORIZONTAL
Horizontal gradient paint |
static int |
GRADIENT_PAINT_VERTICAL
Vertical gradient paint |
static int |
POINTER_STYLE_ARROW
Used to display pointer as an arrow |
static int |
POINTER_STYLE_LINE
Used to display pointer as a line |
static int |
POINTER_STYLE_TRIANGLE
Used to display pointer as a triangle |
static int |
RANGE_LABEL_INSIDE
Range labels display inside the gauge. |
static int |
RANGE_LABEL_OUTSIDE
Range labels display outside the gauge. |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
GaugeChart()
Creates a gauge chart. |
|
| Method Summary | |
void |
addItemListener(java.awt.event.ItemListener l)
Adds an item listener to the chart. |
void |
autoRepaint()
Calls repaint() if the automaticRepaintOn is turned on. |
java.awt.Image |
createImage(int width,
int height)
Creates an offscreen image. |
java.lang.String |
formatRangeNumber(int index,
double value)
Formats a floating number to the number of decimals given for the specified range. |
java.awt.Color |
getBackground2()
Gets the secondary background of the chart component. |
java.awt.Color |
getBorderColor(int index)
Gets color of the specified border. |
int |
getBorderWidth(int index)
Gets width of the specified border. |
java.awt.Color |
getChartBackground()
Gets the color of the chart background itself. |
java.awt.Color |
getChartBackground2()
Gets the secondary background of the chart grid itself. |
java.awt.Color |
getChartForeground()
Gets the color of the chart foreground itself. |
int |
getEndAngle()
Gets the end angle of the gauge. |
java.awt.Font |
getFont(java.lang.String label)
Gets the font for the specified label. |
java.lang.String |
getLabel(java.lang.String name)
Gets the specified label from the chart. |
double |
getLowerRange()
Gets the lower value of the range. |
java.awt.Dimension |
getMinimumSize()
This method returns the minimum size of the chart. |
double |
getPointer(int index)
Gets value of the pointer with specified index. |
java.awt.Color |
getPointerColor(int index)
Gets color of the pointer with specified index. |
double |
getPointerStyle(int index)
Gets style of the pointer with specified index. |
java.awt.Dimension |
getPreferredSize()
This method is called by the awt, and returns the preferred size of the chart. |
double |
getRange()
Gets the upper value of the range. |
java.awt.Color |
getRangeColor(int range)
Returns color of the given range. |
int |
getRangeDecimalCount(int index)
Gets the number of decimals used in the range values. |
java.awt.Color |
getRangeHighlight()
Gets the range highlight color. |
java.awt.Color |
getRangeLabelColor(int range)
Returns color of the range labels. |
int |
getRangeLabelStyle()
Gets style of the range labels. |
java.awt.Color |
getSectorColor(int index)
Gets color of the sector with specified index. |
double[] |
getSectorHighlight(int index)
Gets the start and the end values of the specified sector. |
int |
getStartAngle()
Gets the start angle of the gauge. |
java.lang.String |
getTitle()
Gets the chart title. |
static java.lang.String |
getVersion()
Returns the current version of the charts. |
boolean |
isRangeLabelsOn(int range)
Returns true if the range labels are turned on, false otherwise. |
boolean |
isTitleOn()
Checks if the title is turned on. |
void |
paint(java.awt.Graphics g)
This method is overridden to paint the chart using double buffering. |
protected void |
processEvent(java.awt.AWTEvent event)
Handles the chart events. |
void |
removeBorder(int index)
Removes border with the specified index. |
void |
removeExternalGraphics()
Removes external graphics context if there is one. |
void |
removeItemListener(java.awt.event.ItemListener l)
Removes the specified item listener from the chart. |
void |
removePointer(int index)
Removes pointer with the specified index. |
void |
render(java.awt.Graphics g)
Renders the bar chart according to the current chart attributes and which charts features are turned on or off. |
void |
render(java.awt.Graphics g,
boolean offscreenOn)
Renders the gauge chart according to the current gauge attributes and which charts features are turned on or off. |
protected void |
renderOffScreen(java.awt.Graphics g)
A subclass should override this method to paint on top of the chart before it is painted to the AWT component. |
void |
setBackground(java.awt.Color color)
Sets the chart component background color, outside the gauge. |
void |
setBackground2(java.awt.Color color)
Sets the secondary chart component background color, outside the chart grid. |
void |
setBorder(int index,
int width)
Sets a border with the specified width (0-based). |
void |
setBorderColor(int index,
java.awt.Color color)
Sets color for the specified border. |
void |
setChartBackground(java.awt.Color color)
Sets the background color of the chart itself. |
void |
setChartBackground2(java.awt.Color color)
Sets the secondary background color of the chart itself. |
void |
setChartForeground(java.awt.Color color)
Sets the foreground color of the chart itself. |
void |
setEndAngle(int angle)
Sets the end angle of the gauge. |
void |
setExternalGraphics(java.awt.Graphics g,
java.awt.Image image)
Sets an external graphics context to paint with. |
void |
setFont(java.lang.String label,
java.awt.Font font)
Sets the font for the specified label. |
void |
setForeground(java.awt.Color color)
Sets the color of the labels. |
void |
setLabel(java.lang.String name,
java.lang.String label)
Sets the specified label in the chart. |
void |
setLowerRange(double value)
Sets the lower value of the range. |
void |
setPointer(int index,
double value)
Sets a pointer with the specified index (0-based). |
void |
setPointerColor(int index,
java.awt.Color color)
Sets color for a pointer with the specified index (0-based). |
void |
setPointerStyle(int index,
int style)
Sets style for the pointer with specified index (0-based). |
void |
setPreferredSize(int width,
int height)
Sets the preferred size of the chart. |
void |
setRange(double value)
Sets the upper value of the range. |
void |
setRangeColor(int range,
java.awt.Color color)
Sets color of the range. |
void |
setRangeDecimalCount(int index,
int count)
Sets the number of decimals to use in the range label values. |
void |
setRangeHighlight(java.awt.Color color)
Sets the range highlight color |
void |
setRangeLabelColor(int range,
java.awt.Color color)
Sets color of the range labels. |
void |
setRangeLabelsOn(int range,
boolean on)
Turns labels of the given range on or off. |
void |
setRangeLabelStyle(int style)
Sets style of the range labels. |
void |
setSectorColor(int index,
java.awt.Color color)
Sets color for a specified highlight sector. |
void |
setSectorHighlight(int index,
double start,
double end)
Sets a highlighted sector with the specified start and end values in the gauge's range. |
void |
setStartAngle(int angle)
Sets the start angle of the gauge. |
void |
setTitle(java.lang.String title)
Sets the chart title. |
void |
setTitleOn(boolean on)
Turns on or off the chart title. |
void |
update(java.awt.Graphics g)
This method is overridden to avoid flicker when the chart is repainted. |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int GRADIENT_PAINT_DIAGONAL1
public static final int GRADIENT_PAINT_DIAGONAL2
public static final int GRADIENT_PAINT_HORIZONTAL
public static final int GRADIENT_PAINT_VERTICAL
public static final int POINTER_STYLE_ARROW
public static final int POINTER_STYLE_LINE
public static final int POINTER_STYLE_TRIANGLE
public static final int RANGE_LABEL_INSIDE
public static final int RANGE_LABEL_OUTSIDE
| Constructor Detail |
public GaugeChart()
| Method Detail |
public void addItemListener(java.awt.event.ItemListener l)
l - The item listener to add.removeItemListener(java.awt.event.ItemListener)public void autoRepaint()
public java.awt.Image createImage(int width,
int height)
width - The width of the image in pixels.height - The height of the image in pixels.
public java.lang.String formatRangeNumber(int index,
double value)
index - The range index.value - The value to format.
public java.awt.Color getBackground2()
public java.awt.Color getBorderColor(int index)
index - The index of the border (0-based).
public int getBorderWidth(int index)
index - The index of the border (0-based).
java.lang.IllegalArgumentException - if the index is invalid.public java.awt.Color getChartBackground()
public java.awt.Color getChartBackground2()
public java.awt.Color getChartForeground()
public int getEndAngle()
public java.awt.Font getFont(java.lang.String label)
label - The name of the label.
public java.lang.String getLabel(java.lang.String name)
name - The name of the label.
setLabel(java.lang.String, java.lang.String)public double getLowerRange()
public java.awt.Dimension getMinimumSize()
public double getPointer(int index)
index - The index of the pointer (0-based).
java.lang.IllegalArgumentException - if the index is invalid.public java.awt.Color getPointerColor(int index)
index - The index of the pointer (0-based).
public double getPointerStyle(int index)
index - The index of the pointer (0-based).
java.lang.IllegalArgumentException - if the index is invalid.public java.awt.Dimension getPreferredSize()
public double getRange()
public java.awt.Color getRangeColor(int range)
range - Index of the range.
public int getRangeDecimalCount(int index)
index - The index of the range.public java.awt.Color getRangeHighlight()
public java.awt.Color getRangeLabelColor(int range)
range - Index of the range.
public int getRangeLabelStyle()
public java.awt.Color getSectorColor(int index)
index - The index of the highlighted sector (0-based).
public double[] getSectorHighlight(int index)
index - The index of the highlighted sector (0-based).
java.lang.IllegalArgumentException - if the index is invalid.public int getStartAngle()
public java.lang.String getTitle()
setTitle(java.lang.String)public static java.lang.String getVersion()
public boolean isRangeLabelsOn(int range)
range - Index of the range.
public boolean isTitleOn()
public final void paint(java.awt.Graphics g)
protected void processEvent(java.awt.AWTEvent event)
event - The event to process.public void removeBorder(int index)
index - The index of the border (0-based).
java.lang.IllegalArgumentException - if the index is invalid.public void removeExternalGraphics()
setExternalGraphics(java.awt.Graphics, java.awt.Image)public void removeItemListener(java.awt.event.ItemListener l)
l - The item listener to remove.addItemListener(java.awt.event.ItemListener)public void removePointer(int index)
index - The index of the pointer (0-based).
java.lang.IllegalArgumentException - if the index is invalid.public void render(java.awt.Graphics g)
public final void render(java.awt.Graphics g,
boolean offscreenOn)
protected void renderOffScreen(java.awt.Graphics g)
g - The graphics context used to paint with.public void setBackground(java.awt.Color color)
color - The color to use.public void setBackground2(java.awt.Color color)
color - The color to use.setChartBackground(java.awt.Color)
public void setBorder(int index,
int width)
index - The index of the border.width - The width of the border
public void setBorderColor(int index,
java.awt.Color color)
index - The index of the border.color - The color of the border.public void setChartBackground(java.awt.Color color)
color - The color to use.public void setChartBackground2(java.awt.Color color)
color - The color to use.public void setChartForeground(java.awt.Color color)
color - The color to use.public void setEndAngle(int angle)
angle - The end angle.
public void setExternalGraphics(java.awt.Graphics g,
java.awt.Image image)
g - The graphics context used for painting.image - The image to which graphics context belongs.
See here for an example.
public void setFont(java.lang.String label,
java.awt.Font font)
label - "titleFont" or "rangeLabelFont".font - The font to set for the label.public void setForeground(java.awt.Color color)
color - The color to use.
public void setLabel(java.lang.String name,
java.lang.String label)
name - The name of the label.label - The label to use, null for no label.public void setLowerRange(double value)
value - The range value to set.
public void setPointer(int index,
double value)
index - The index of the pointer (0-based).value - The value of the pointer.
public void setPointerColor(int index,
java.awt.Color color)
index - The index of the pointer (0-based).color - The color of the pointer.
public void setPointerStyle(int index,
int style)
index - The index of the pointer (0-based).style - The type of the pointer (POINTER_TYPE_LINE, POINTER_TYPE_TRIANGLE,
POINTER_TYPE_ARROW).
public void setPreferredSize(int width,
int height)
width - The preferred width.height - The preferred height.public void setRange(double value)
value - The range value to set.
public void setRangeColor(int range,
java.awt.Color color)
range - Index of the range.color - Color of the range.
public void setRangeDecimalCount(int index,
int count)
index - The index of the range (0 or 1).count - The number of decimals to use.public void setRangeHighlight(java.awt.Color color)
color - The color highlight the range with
public void setRangeLabelColor(int range,
java.awt.Color color)
range - Index of the range.color - Color of the range labels.
public void setRangeLabelsOn(int range,
boolean on)
range - Index of the range.on - True if the reange labels should be turned on, false otherwise.public void setRangeLabelStyle(int style)
style - The style of the range labels (INSIDE | OUTSIDE).
public void setSectorColor(int index,
java.awt.Color color)
index - The index of the sector.color - The color of the sector.
public void setSectorHighlight(int index,
double start,
double end)
index - The index of the sector.start - The start value of the sector.end - The end value of the sector.public void setStartAngle(int angle)
angle - The start angle.public void setTitle(java.lang.String title)
title - The title to set.getTitle(),
setTitleOn(boolean)public void setTitleOn(boolean on)
on - True for on, false for off.setTitle(java.lang.String)public final void update(java.awt.Graphics g)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||