|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--com.jinsight.jetchart.GradientPanel | +--com.jinsight.jetchart.GenericGraph
The chart context is a subclass of java.awt.Panel or javax.swing.JPanel, depending
on whether AWT or Swing applications are developed with JetChart.
The GenericGraph class is the super class of all different chart contexts available
in the JetChart package. Currently there are three types of chart contexts, as
below:
Graph
,
ScatterGraph
,
PieGraph
, Serialized FormInner classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static int |
CENTER
Constant used to place the background image at the center of the chart. |
static int |
TILE
Constant used to arrange the background image side by side. |
static int |
TOP_LEFT
Constant used to place the background image at the top left corner of the chart area. |
Fields inherited from class com.jinsight.jetchart.GradientPanel |
BOTTOM_TO_TOP, LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM |
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 |
Method Summary | |
void |
addLegend(Legend l)
Adds a new Legend box to the chart context. |
void |
addNote(Note note)
Adds a Note object to the chart context. |
void |
addSerie(AbstractSerie serie)
Adds series objects to the chart context. |
void |
addSerieListener(SerieListener serieListener)
Adds a series event listener to handle series events. |
protected void |
finalize()
|
BottomTitle |
getBottomTitle()
Returns a reference to the BottomTitle object. |
LeftTitle |
getLeftTitle()
Returns a reference to the LeftTitle object. |
Legend |
getLegend()
Deprecated. |
Legend |
getLegend(int index)
Returns the legend box with the given index. |
RightTitle |
getRightTitle()
Returns a reference to the RightTitle object. |
java.util.Vector |
getSeries()
Returns a collection of references to series added to the graphic context. |
ToolTip |
getToolTip()
Returns a reference to the ToolTip object. |
boolean |
isPainted()
Deprecated. |
protected void |
processMouseEvent(java.awt.event.MouseEvent evt)
Overrides the processMouseEvent method to control dispatch of mouse events. |
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent evt)
Overrides the processMouseMotionEvent method to control dispatch of mouse motion events. |
void |
readXMLData(java.io.Reader reader)
Reads chart properties from an xml character stream. |
void |
refresh()
Refreshes chart. |
void |
removeAllNotes()
Removes all Note objects from the chart context. |
void |
removeAllSeries()
Removes all series from the graphic context. |
void |
removeLegend(Legend l)
Removes a Legend box. |
void |
removeNote(Note note)
Removes a Note object from the chart context. |
void |
removeSerie(AbstractSerie serie)
Removes a series from the graphic context. |
void |
removeSerieListener(SerieListener serieListener)
Removes a series event listener. |
void |
set3DEnabled(boolean is3DEnabled)
Enables/disables 3D chart. |
void |
setBackgroundImage(java.awt.Image backgroundImage,
int imagePosition)
Defines an image to be painted as the chart background. |
void |
setBottomMargin(int bottomMargin)
Sets chart bottom margin, in pixels. |
void |
setBufferedImageEnabled(boolean isBufferedImageEnabled,
int bufferedImageType)
Enables/disables generation of offscreen images on a BufferedImage object. |
void |
setConnection(java.lang.String jdbcURL,
java.lang.String user,
java.lang.String password)
Sets the database URL, user name and password to connect to a database and get chart labels and series values. |
void |
setDefaultCursor(java.awt.Cursor defaultCursor)
Sets the default cursor of this component. |
void |
setDraggingBoxColor(java.awt.Color draggingBoxColor)
Sets the dragging box color. |
void |
setDraggingEnabled(boolean isDraggingEnabled)
Enables/disables chart dragging. |
void |
setDriver(java.lang.String jdbcDriver)
Sets a JDBC driver to connect to a database and get chart labels and series values. |
void |
setLabelsQuery(java.lang.String labelsQuery)
Sets a sql statement to access a database and get chart labels. |
void |
setLeftMargin(int leftMargin)
Sets chart left margin, in pixels. |
void |
setLegendEnabled(boolean isLegendEnabled)
Enables/disables display of the primary Legend object. |
void |
setOffScreenGraphEnabled(boolean isOffScreenGraphEnabled)
Enables chart image generation from an offscreen application. |
void |
setRightMargin(int rightMargin)
Sets chart right margin, in pixels. |
void |
setTitle(java.lang.String[] title)
Sets chart title. |
void |
setTitleFont(java.awt.Font font)
Sets chart title font. |
void |
setTitleForeground(java.awt.Color titleForeground)
Sets chart title color. |
void |
setTitleGap(int titleGap)
Sets the chart title gap. |
void |
setTopMargin(int topMargin)
Sets chart top margin, in pixels. |
void |
setValueFormat(java.lang.String valueFormat)
Deprecated. |
Methods inherited from class com.jinsight.jetchart.GradientPanel |
paint, setGradientColors, setGradientOrientation |
Methods inherited from class java.awt.Panel |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int TILE
public static final int TOP_LEFT
public static final int CENTER
Method Detail |
public void addSerieListener(SerieListener serieListener)
serieListener
- A SerieListener object.removeSerieListener(com.jinsight.jetchart.SerieListener)
,
SerieListener
,
SerieEvent
public void removeSerieListener(SerieListener serieListener)
serieListener
- A SerieListener object.addSerieListener(com.jinsight.jetchart.SerieListener)
,
SerieListener
,
SerieEvent
public void addSerie(AbstractSerie serie)
Only series belonging to the same type of chart context can be combined. For example, a line series can be combined with another line series, a bar series, an area series, etc., but can not be combined with an xy series, whose chart context is ScatterGraph.
serie
- Any series that extends the AbstractSerie class.AbstractSerie
,
GraphException
public java.util.Vector getSeries()
public void removeSerie(AbstractSerie serie)
serie
- Any series that extends the AbstractSerie class and that was previously added
to the chart context.AbstractSerie
public void removeAllSeries()
public void addLegend(Legend l)
l
- A Legend object.removeLegend(com.jinsight.jetchart.Legend)
,
Legend
public void removeLegend(Legend l)
l
- A Legend object.addLegend(com.jinsight.jetchart.Legend)
,
Legend
public Legend getLegend(int index)
index
- An integer number.addLegend(com.jinsight.jetchart.Legend)
,
removeLegend(com.jinsight.jetchart.Legend)
,
Legend
public void addNote(Note note)
note
- A Note object.Note
public void removeNote(Note note)
note
- A Note object.Note
public void removeAllNotes()
Note
public void setOffScreenGraphEnabled(boolean isOffScreenGraphEnabled)
setSize()
method.setBufferedImageEnabled
is set
to true, a BufferedImage object is used to paint chart, rather than a
invisible Frame object.isOffScreenGraphEnabled
- A boolean value(true/false).ChartEncoder
,
setBufferedImageEnabled(boolean, int)
public void setBufferedImageEnabled(boolean isBufferedImageEnabled, int bufferedImageType)
Component.createImage(int width,int
height)
method. If this method is set to true, a BufferedImage
object is used instead.GenericGraph.createImage
when producing the left and
right rotated titles, the bottom title and the rotated vertical
labels, as well as when a chart is encoded into a GIF, JPEG or PNG
image using the ChartEncoder class. Unless the GenericGraph instance
is laid out on a valid container, like a Frame object, a null Image is
returned and a NullPointerException is raised during execution of any
of the processes above mentioned.GenericGraph.createImage
raises a NullPointerException. If this method is set to true, the
offscreen images are created using the BufferedImage class, and no
exception is raised.isBufferedImageEnabled
- A boolean value(true/false).bufferedImageType
- The image type, which can be one of the constants
defined in the BufferedImage class.setOffScreenGraphEnabled(boolean)
,
ChartEncoder
,
BufferedImage
public void setDraggingEnabled(boolean isDraggingEnabled)
Pie chart dragging is performed by clicking the area outside a pie series bounds. Chart dragging is disabled, by default.
isDraggingEnabled
- A boolean value(true/false).PieSerie
public void setTitleGap(int titleGap)
titleGap
- An integer number.public void setBackgroundImage(java.awt.Image backgroundImage, int imagePosition)
backgroundImage
- An Image object.imagePosition
- One of the following constants: GenericGraph.TILE,
GenericGraph.TOP_LEFT, GenericGraph.CENTER.TILE
,
TOP_LEFT
,
CENTER
public boolean isPainted()
public void setDefaultCursor(java.awt.Cursor defaultCursor)
defaultCursor
- A Cursor object.public void setLabelsQuery(java.lang.String labelsQuery)
labelsQuery
- A sql statement.setDriver(java.lang.String)
,
setConnection(java.lang.String, java.lang.String, java.lang.String)
public void setDriver(java.lang.String jdbcDriver)
jdbcDriver
- A JDBC driver to connect to a database.setConnection(java.lang.String, java.lang.String, java.lang.String)
,
Graph.setLabelsQuery(java.lang.String)
,
AbstractSerie.setValuesQuery(java.lang.String)
public void setConnection(java.lang.String jdbcURL, java.lang.String user, java.lang.String password)
jdbcURL
- The database URLuser
- The user namepassword
- The user passwordsetDriver(java.lang.String)
,
Graph.setLabelsQuery(java.lang.String)
,
AbstractSerie.setValuesQuery(java.lang.String)
public void setTitle(java.lang.String[] title)
title
- An array of strings.public void setTitleForeground(java.awt.Color titleForeground)
titleForeground
- A Color object.public void setTitleFont(java.awt.Font font)
font
- A Font object.public void setValueFormat(java.lang.String valueFormat)
AbstractSerie.setValueFormat(java.lang.String)
public void setLeftMargin(int leftMargin)
leftMargin
- An integer representing left margin.public void setRightMargin(int rightMargin)
rightMargin
- An integer representing right margin.public void setTopMargin(int topMargin)
topMargin
- An integer representing top margin.public void setBottomMargin(int bottomMargin)
bottomMargin
- An integer representing bottom margin.public void set3DEnabled(boolean is3DEnabled)
is3DEnabled
- A boolean value(true/false).public Legend getLegend()
getLegend(int index)
,
Legend
public ToolTip getToolTip()
ToolTip
public LeftTitle getLeftTitle()
LeftTitle
public RightTitle getRightTitle()
RightTitle
public BottomTitle getBottomTitle()
BottomTitle
public void setLegendEnabled(boolean isLegendEnabled)
isLegendEnabled
- A boolean value(true/false).addLegend(com.jinsight.jetchart.Legend)
,
removeLegend(com.jinsight.jetchart.Legend)
,
Legend
public void setDraggingBoxColor(java.awt.Color draggingBoxColor)
draggingBoxColor
- A Color object.setDraggingEnabled(boolean)
public void readXMLData(java.io.Reader reader) throws java.io.IOException
reader
- The reader from which to retrieve the XML data.java.io.IOException
- If an error occured while reading the input.GraphException
- If the XML data does not follow certain rules related to the definition
of acceptable tags.AbstractSerie.getId()
public void refresh()
protected void processMouseEvent(java.awt.event.MouseEvent evt)
processMouseEvent
in class java.awt.Component
protected void processMouseMotionEvent(java.awt.event.MouseEvent evt)
processMouseMotionEvent
in class java.awt.Component
protected void finalize() throws java.lang.Throwable
finalize
in class GradientPanel
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |