com.droplets.api
Class GraphAnnotation

java.lang.Object
  |
  +--com.droplets.api.GraphAnnotation

public class GraphAnnotation
extends java.lang.Object

Construct and add to a GraphPanel to annotate the graph. Draws lines specified style and thickness with hints.


Field Summary
static int ORIENT_HORIZONTAL
          specifies that the line is horizontal
static int ORIENT_VERTICAL
          specifies that the line is vertical
static int STYLE_DASHED
          The line should be dashed
static int STYLE_SOLID
          The line should be solid
static int UNITS_AXIS
          The thickness of the line is based on the units of the axis
static int UNITS_PIXELS
          The thickness of the line is given in pixels
 
Constructor Summary
GraphAnnotation(int orientation, IGraph g)
          Makes an annotation for the graph which is represented as either a vertical or horizontal line with a specified style, thickness, hint, and position
GraphAnnotation(int orientation, Window w)
          Makes an annotation for the graph which is represented as either a vertical or horizontal line with a specified style, thickness, hint, and position
 
Method Summary
 Color getColor()
          Get the color of the annotation
 java.lang.String getLegendText()
          Gets the legend text for this annotation
 double getPosition()
          Gets the position of the annotation on the graph.
 int getStyle()
          Gets the style of the line to either STYLE_SOLID or STYLE_DASHED
 double getThickness()
          Gets the thickness of the annotation.
 int getThicknessUnits()
          Gets the thickness units of the annotation.
 void setColor(Color c)
          Set the color of the annotation
 void setColor(Color c, java.lang.String skinName)
          Set the color of the annotation
 void setLegendText(java.lang.String t)
          Sets the legend text for this annotation
 void setLegendText(java.lang.String t, java.lang.String skinName)
          Sets the legend text for this annotation
 void setPosition(double p)
          Sets the position of the annotation on the graph.
 void setPosition(double p, java.lang.String skinName)
          Sets the position of the annotation on the graph.
 void setStyle(int style)
          Sets the style of the line to either STYLE_SOLID or STYLE_DASHED
 void setStyle(int style, java.lang.String skinName)
          Sets the style of the line to either STYLE_SOLID or STYLE_DASHED
 void setThickness(double t)
          Sets the thickness of the annotation.
 void setThickness(double t, java.lang.String skinName)
          Sets the thickness of the annotation.
 void setThicknessUnits(int u)
          Sets the thickness units of the annotation.
 void setThicknessUnits(int u, java.lang.String skinName)
          Sets the thickness units of the annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_SOLID

public static final int STYLE_SOLID
The line should be solid

STYLE_DASHED

public static final int STYLE_DASHED
The line should be dashed

UNITS_PIXELS

public static final int UNITS_PIXELS
The thickness of the line is given in pixels

UNITS_AXIS

public static final int UNITS_AXIS
The thickness of the line is based on the units of the axis

ORIENT_VERTICAL

public static final int ORIENT_VERTICAL
specifies that the line is vertical

ORIENT_HORIZONTAL

public static final int ORIENT_HORIZONTAL
specifies that the line is horizontal
Constructor Detail

GraphAnnotation

public GraphAnnotation(int orientation,
                       IGraph g)
Makes an annotation for the graph which is represented as either a vertical or horizontal line with a specified style, thickness, hint, and position
Parameters:
orientation - the orientation of the annotation. Must be either ORIENT_VERTICAL or ORIENT_HORIZONTAL
w - the Window that owns this annotation

GraphAnnotation

public GraphAnnotation(int orientation,
                       Window w)
Makes an annotation for the graph which is represented as either a vertical or horizontal line with a specified style, thickness, hint, and position
Parameters:
orientation - the orientation of the annotation. Must be either ORIENT_VERTICAL or ORIENT_HORIZONTAL
w - the Window that owns this annotation
Method Detail

getLegendText

public java.lang.String getLegendText()
Gets the legend text for this annotation
Returns:
the legend text for this annotation

setLegendText

public void setLegendText(java.lang.String t,
                          java.lang.String skinName)
Sets the legend text for this annotation
Parameters:
t - the legend text for this annotation
skinName - the skin name for this setting

setLegendText

public void setLegendText(java.lang.String t)
Sets the legend text for this annotation
Parameters:
t - the tooltip for this annotation

getColor

public Color getColor()
Get the color of the annotation
Returns:
the color of the annotation

setColor

public void setColor(Color c,
                     java.lang.String skinName)
Set the color of the annotation
Parameters:
c - the color of the annotation
skinName - the skin name for this setting

setColor

public void setColor(Color c)
Set the color of the annotation
Parameters:
c - the color of the annotation

getThickness

public double getThickness()
Gets the thickness of the annotation. It is interpreted considering the thickness units
Returns:
the thickness of the annotation in the specified units.
See Also:
setThicknessUnits(int)

setThickness

public void setThickness(double t,
                         java.lang.String skinName)
Sets the thickness of the annotation. It is interpreted considering the thickness units
Parameters:
t - the thickness of the annotation in the specified units.
skinName - the skin name for this setting
See Also:
setThicknessUnits(int)

setThickness

public void setThickness(double t)
Sets the thickness of the annotation. It is interpreted considering the thickness units
Parameters:
t - the thickness of the annotation in the specified units.
See Also:
setThicknessUnits(int)

getThicknessUnits

public int getThicknessUnits()
Gets the thickness units of the annotation. Must be either UNITS_PIXELS or UNITS_AXIS
Returns:
the thickness units of the annotation
See Also:
setThicknessUnits(int)

setThicknessUnits

public void setThicknessUnits(int u,
                              java.lang.String skinName)
Sets the thickness units of the annotation. Must be either UNITS_PIXELS or UNITS_AXIS
Parameters:
u - the thickness units of the annotation
skinName - the skin name for this setting
See Also:
setThicknessUnits(int)

setThicknessUnits

public void setThicknessUnits(int u)
Sets the thickness units of the annotation. Must be either UNITS_PIXELS or UNITS_AXIS
Parameters:
u - the thickness units of the annotation
See Also:
setThickness(double)

getPosition

public double getPosition()
Gets the position of the annotation on the graph. The value is based on the axis. If the axis is Date, the value is the getTime() of the desired date.
Parameters:
skinName - the skin name for this setting
Returns:
the position of the annotation

setPosition

public void setPosition(double p,
                        java.lang.String skinName)
Sets the position of the annotation on the graph. The value is based on the axis. If the axis is Date, pass the getTime() of the desired date.
Parameters:
p - the position of the annotation
skinName - the skin name for this setting

setPosition

public void setPosition(double p)
Sets the position of the annotation on the graph. The value is based on the axis. If the axis is Date, pass the getTime() of the desired date.
Parameters:
p - the position of the annotation

getStyle

public int getStyle()
Gets the style of the line to either STYLE_SOLID or STYLE_DASHED
Returns:
the style of the line. Either STYLE_SOLID or STYLE_DASHED

setStyle

public void setStyle(int style,
                     java.lang.String skinName)
Sets the style of the line to either STYLE_SOLID or STYLE_DASHED
Parameters:
style - the style of the line. Either STYLE_SOLID or STYLE_DASHED
skinName - the skin name for this setting

setStyle

public void setStyle(int style)
Sets the style of the line to either STYLE_SOLID or STYLE_DASHED
Parameters:
style - the style of the line. Either STYLE_SOLID or STYLE_DASHED


Copyright © Droplets, 2001. All Rights Reserved.