|
WebCab JGraph v2.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Canvas
|
+--com.webcab.beans.newchart.Graph
This class can be used to represent discrete data sets as graphs using several interpolation methods. Multiple series are supported. The data set is read from a database. A JDBC driver is required to connect to the database. The graphs are fully customizable, the component offering options for almost every visual detail.
| 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 | |
Graph()
This is the non-zero constructor required by the java.beans.Bean class in order to instantiate the bean. |
|
| Method Summary | |
void |
actionPerformed(ActionEvent e)
|
void |
componentHidden(ComponentEvent e)
|
void |
componentMoved(ComponentEvent e)
|
void |
componentResized(ComponentEvent e)
|
void |
componentShown(ComponentEvent e)
|
boolean |
getAntialias()
Returns true if antilaias is used while drawing. |
double |
getCenterX()
Gets the x center value. |
double |
getCenterY()
Gets the y center value. |
Color[] |
getColors()
|
boolean |
getDisplayAxis()
Returns true if the axis are displayed. |
boolean |
getDisplayGrid()
Returns true if the gird is displayed. |
boolean |
getDisplayImage()
Returns true if an image is used as background. |
boolean |
getDisplayPoints()
Returns true if the interpolation points are displayed. |
boolean |
getDraggGraphEnabled()
Returns true if the graph can be dragged. |
boolean |
getDraggPointsEnabled()
Returns true if the interpolation points can be dragged. |
int |
getDraggTolerance()
Gets the current tolerance. |
int |
getFirstDerivative()
Gets the value of the first deivative for the first interpolation point. |
Color |
getGridColor()
Gets the grid color. |
double |
getGridY()
Gets the grid y value. |
String |
getImageUrl()
Gets the string representation of the URL where to find the background image. |
String |
getJDBCDriver()
Gets the current JDBC driver. |
String |
getJDBCPassword()
Gets the current JDBC password. |
String |
getJDBCQuery()
Gets the current JDBC query. |
String |
getJDBCUrl()
Gets the current JDBC URL. |
String |
getJDBCUser()
Gets the current JDBC user. |
int |
getLastDerivative()
Gets the value of the first deivative for the last interpolation point. |
int |
getLegendPosition()
Returns the current legend alignment. |
float |
getLineWidth()
Gets the current line width. |
Dimension |
getMinimumSize()
|
String |
getName()
Gets the name of the graph. |
int |
getPointsWidth()
Gets the width for the interpolation points. |
boolean |
getRoundPoints()
Returns true if the points are represented as cirlces. |
double |
getScaleX()
Gets the scale x value. |
double |
getScaleY()
Gets the scale y value. |
boolean |
getSnapToGrid()
Returns true is snap to grid is used. |
Color |
getTipBackground()
Gets the background color for tips. |
int |
getTipDelayMillis()
Gets the delay in milliseconds before displaying the tip. |
Color |
getTipForeground()
Gets the foregound color for tips. |
int |
getType()
Gets the current interpolation method. |
int |
getTypeOfImage()
Gets the type of image alignament. |
boolean |
getUseToolTip()
Returns true if a tooltip is used. |
Color |
getXAxColor()
Gets the x ax color. |
String |
getXLabel()
Gets the x ax label. |
Color |
getXLabelColor()
Gets the x ax label color. |
int |
getXValuesAngle()
Gets the angles in degrees of the x ax values. |
Color |
getYAxColor()
Gets the y ax color. |
String |
getYLabel()
Gets the y ax label. |
Color |
getYLabelColor()
Gets the y ax label color. |
int |
getYValuesAngle()
Gets the angle in degrees of the y ax values. |
double |
getZoom()
Gets the zoom value in percentages. |
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
paint(Graphics g)
|
void |
setAntialias(boolean value)
Sets whether antialias is used while drawing. |
void |
setCenterX(double value)
Sets the x center value. |
void |
setCenterY(double value)
Sets the y center value. |
void |
setColors(Color[] col)
|
void |
setDisplayAxis(boolean value)
Sets whether axis are displayed. |
void |
setDisplayGrid(boolean value)
Sets whether the gird is displayed. |
void |
setDisplayImage(boolean value)
Sets whether an image should be used as background. |
void |
setDisplayPoints(boolean value)
Sets whether the interpolation points are displayed. |
void |
setDraggGraphEnabled(boolean value)
Sets whether the whole graph can be dragged. |
void |
setDraggPointsEnabled(boolean value)
Sets whether the interpolation points can be dragged. |
void |
setDraggTolerance(int value)
Sets the tolerance in pixels, when dragging interpolation points. |
void |
setFirstDerivative(int value)
Sets the value of the first deivative for the first interpolation point. |
void |
setGridColor(Color value)
Sets the grid color. |
void |
setGridX(double value)
Sets the grid x value. |
void |
setGridY(double value)
Sets the grid y value. |
void |
setImageUrl(String url)
Sets the string representation of the URL where the program should find an valid image to use as background. |
void |
setJDBCDriver(String driver)
This method only sends a new driver to the JavaBeans component. |
void |
setJDBCPassword(String value)
This method only registers this password as the next password to use when sending the next query. |
void |
setJDBCQuery(String query)
This method tries to send the specified query to the JDBC server (as previously registered with the setJDBCDriver and the setJDBCUrl methods. |
void |
setJDBCUrl(String url)
This method only registers this url as the next url to use when sending the next query. |
void |
setJDBCUser(String value)
This method only registers this user as the next user to use when sending the next query. |
void |
setLastDerivative(int value)
Sets the value of the first deivative for the last interpolation point. |
void |
setLegendPosition(int value)
Sets the legend alignment. |
void |
setLineWidth(float value)
Sets the line width in pixels. |
void |
setName(String value)
Sets the name of the Graph. |
void |
setPointsWidth(int value)
Sets the width for the interpolation points. |
void |
setRoundPoints(boolean value)
Sets whether the interpolation points should be represented as circles instead of sqaures. |
void |
setScaleX(double value)
Sets the scale x value. |
void |
setScaleY(double value)
Sets the scale y value. |
void |
setSnapToGrid(boolean value)
Sets whether the points will be snapped to grid when drawing. |
void |
setTipBackground(Color value)
Sets the background color for tips. |
void |
setTipDelayMillis(int value)
Sets the delay in milliseconds before displaying the tip. |
void |
setTipForeground(Color value)
Sets the foreground color for tips. |
void |
setType(int value)
Gets the grid x value. |
void |
setTypeOfImage(int type)
Sets the type of alignament for the image used as background. |
void |
setUseToolTip(boolean value)
Sets whether a tooltip is used. |
void |
setXAxColor(Color value)
Sets the x ax color. |
void |
setXLabel(String value)
Sets the x ax label. |
void |
setXLabelColor(Color value)
Sets the x ax label color. |
void |
setXValuesAngle(int value)
Sets the angle in degrees of the x ax values. |
void |
setYAxColor(Color value)
Sets the y ax color. |
void |
setYLabel(String value)
Sets the y ax label. |
void |
setYLabelColor(Color value)
Sets the y ax label color. |
void |
setYValuesAngle(int value)
Sets the angle in degrees of the y ax values. |
void |
setZoom(double value)
Sets the zoom value in percentages. |
void |
update(Graphics g)
|
| Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Graph()
| Method Detail |
public void setDraggPointsEnabled(boolean value)
value - true if the points can be dragged; false otherwise.public boolean getDraggPointsEnabled()
public void setDraggGraphEnabled(boolean value)
value - true if the graph can be dragged.public boolean getDraggGraphEnabled()
public void setSnapToGrid(boolean value)
value - true if snap to grid is used; false otherwise.public boolean getSnapToGrid()
public void setDraggTolerance(int value)
value - the tolerance in pixels.public int getDraggTolerance()
public void setDisplayImage(boolean value)
value - true if an image is used as background; false otherwise.public boolean getDisplayImage()
public void setTypeOfImage(int type)
type - the type of alignament.public int getTypeOfImage()
public void setImageUrl(String url)
url - the string representation of the url.public String getImageUrl()
public void setLineWidth(float value)
value - the line width.public float getLineWidth()
public void setRoundPoints(boolean value)
value - true if the points are represented as circles; false otherwise.public boolean getRoundPoints()
public void setYValuesAngle(int value)
value - the angle in degrees.public int getYValuesAngle()
public void setXValuesAngle(int value)
value - the angle in degrees.public int getXValuesAngle()
public void setPointsWidth(int value)
value - the width to be used.public int getPointsWidth()
public void setLastDerivative(int value)
value - the value of the first derivative.public int getLastDerivative()
public void setFirstDerivative(int value)
value - the value of the first derivative.public int getFirstDerivative()
value - the value of the first derivative.public void setTipForeground(Color value)
the - color to be used.public Color getTipForeground()
public void setTipBackground(Color value)
the - color to be used.public Color getTipBackground()
public void setTipDelayMillis(int value)
value - the delay in milliseconds.public int getTipDelayMillis()
public void setUseToolTip(boolean value)
true - if tooltip is used; false otherwise.public boolean getUseToolTip()
public void setGridColor(Color value)
value - the color to be used.public Color getGridColor()
public void setXAxColor(Color value)
value - the color to be used.public Color getXAxColor()
public void setYAxColor(Color value)
value - the color to be used.public Color getYAxColor()
public void setDisplayAxis(boolean value)
value - true if axis are displayed; false otherwise.public boolean getDisplayAxis()
public void setName(String value)
setName in class Componentvalue - the name of the Graph.public String getName()
getName in class Componentpublic void setDisplayPoints(boolean value)
value - true if the interpolation points are displayed; false otherwise.public boolean getDisplayPoints()
public void setDisplayGrid(boolean value)
value - true if the grid is displayed; false otherwise.public boolean getDisplayGrid()
public void setAntialias(boolean value)
value - true if antialias is used; false othwerwise.public boolean getAntialias()
public void setLegendPosition(int value)
value - the legend alignment.public int getLegendPosition()
public void setXLabel(String value)
the - x ax label.public String getXLabel()
public void setYLabel(String value)
the - y ax label.public String getYLabel()
public void setXLabelColor(Color value)
value - the color to be used.public Color getXLabelColor()
public void setYLabelColor(Color value)
value - the color to be used.public Color getYLabelColor()
public void setScaleX(double value)
value - the scale x value.public double getScaleX()
public void setCenterX(double value)
value - the value to be usedpublic double getCenterX()
public void setCenterY(double value)
value - the value to be usedpublic double getCenterY()
public void setZoom(double value)
the - zoom value.public double getZoom()
public void setScaleY(double value)
value - the scale x value.public double getScaleY()
public void setGridX(double value)
value - the grid value.public void setType(int value)
value - the index of the interpolation.public int getType()
public void setGridY(double value)
value - the grid value.public double getGridY()
public void setJDBCDriver(String driver)
public void setJDBCUrl(String url)
setJDBCQuery method is actually run.public void setJDBCQuery(String query)
setJDBCDriver and the setJDBCUrl methods. It requires
that the query return a ResultSet containing such:
1. double (the x coordinate) 2. double (the y coordinate)
The method will not throw an exception, instead it will print its stack-trace. Please send a request if you wish it to be in any other way.
public String getJDBCDriver()
public String getJDBCUrl()
public String getJDBCQuery()
public void setJDBCUser(String value)
setJDBCQuery method is actually run.public String getJDBCUser()
public void setJDBCPassword(String value)
setJDBCQuery method is actually run.public String getJDBCPassword()
public Dimension getMinimumSize()
getMinimumSize in class Componentpublic void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListenerpublic void componentShown(ComponentEvent e)
componentShown in interface ComponentListenerpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void setColors(Color[] col)
public Color[] getColors()
public void paint(Graphics g)
paint in class Canvaspublic void update(Graphics g)
update in class Component
|
WebCab JGraph v2.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||