com.droplets.api
Interface IGraph

All Known Implementing Classes:
Graph, GraphPrinter

public interface IGraph


Inner Class Summary
static class IGraph.GraphImpl
           
static interface IGraph.GraphProxy
           
 
Field Summary
static int HALIGN_LEFT
          Left align
static int HALIGN_RIGHT
          Left align
static java.lang.String TYPE_DATE
          Indicates the type of the coordinates are Dates Use in setXAxisType and setYAxisType.
static java.lang.String TYPE_NUMERICAL
          Indicates the type of the coordinates are Numerical.
static int VALIGN_BOTTOM
          Bottom align
static int VALIGN_TOP
          Top align
 
Method Summary
 void addAnnotation(GraphAnnotation a)
          Adds an annotation to this Graph.
 void addPlot(PlotComponent plot)
          Adds a plot to this Graph.
 int getLegendHorizontalAlignment()
          Gets the horizontal alignment of the legend.
 int getLegendHorizontalMargin()
          Gets the distance from the horizontal alignment position in pixels.
 int getLegendVerticalAlignment()
          Gets the vertical alignment of the legend.
 int getLegendVerticalMargin()
          Gets the distance from the vertical alignment position in pixels.
 boolean getLegendVisible()
          Gets the visibility of the legend
 java.lang.String getXAxisDataType()
          Gets the type of the x-axis and x coordinate of the data points.
 java.lang.String[] getXTickLabels()
          Gets the x-tick labels
 java.lang.String getYAxisDataType()
          Gets the type of the y-axis and y coordinate of the data points.
 boolean getZoomable()
          Gets whether the graph is zoomable or not
 com.droplets.api.GraphAnnotation.AnnotationProxy makeAnnotationProxy(GraphAnnotation a, int orientation)
          Makes the appropriate PlotProxy class for this graph type.
 com.droplets.api.PlotComponent.PlotProxy makePlotProxy(PlotComponent plot, java.lang.String type)
          Makes the appropriate PlotProxy class for this graph type.
 void setAddedToWindow(boolean isAddedToWindow)
          Window uses this to inform the component that it is added to a window
 void setLegendHorizontalPosition(int halign, int margin)
          Sets the Horizontal position of the legend.
 void setLegendHorizontalPosition(int halign, int margin, java.lang.String skinName)
          Sets the Horizontal position of the legend.
 void setLegendVerticalPosition(int halign, int margin)
          Sets the Vertical position of the legend.
 void setLegendVerticalPosition(int halign, int margin, java.lang.String skinName)
          Sets the Vertical position of the legend.
 void setLegendVisible(boolean visible)
          Sets the visibility of the legend
 void setLegendVisible(boolean visible, java.lang.String skinName)
          Sets the visibility of the legend
 void setXAxisDataType(java.lang.String type)
          Sets the type of the x-axis and x coordinate of the data points.
 void setXTickLabels(java.lang.String[] ticks)
          Sets the x-tick labels
 void setXTickLabels(java.lang.String[] ticks, java.lang.String skinName)
          Sets the x-tick labels.
 void setYAxisDataType(java.lang.String type)
          Sets the type of the x-axis and x coordinate of the data points.
 void setZoomable(boolean z)
          Sets whether the graph is zoomable or not
 void setZoomable(boolean z, java.lang.String skinName)
          Sets whether the graph is zoomable or not
 

Field Detail

TYPE_NUMERICAL

public static final java.lang.String TYPE_NUMERICAL
Indicates the type of the coordinates are Numerical. Use in setXAxisType and setYAxisType.

TYPE_DATE

public static final java.lang.String TYPE_DATE
Indicates the type of the coordinates are Dates Use in setXAxisType and setYAxisType.

HALIGN_LEFT

public static final int HALIGN_LEFT
Left align

HALIGN_RIGHT

public static final int HALIGN_RIGHT
Left align

VALIGN_TOP

public static final int VALIGN_TOP
Top align

VALIGN_BOTTOM

public static final int VALIGN_BOTTOM
Bottom align
Method Detail

addPlot

public void addPlot(PlotComponent plot)
Adds a plot to this Graph.

addAnnotation

public void addAnnotation(GraphAnnotation a)
Adds an annotation to this Graph.

setAddedToWindow

public void setAddedToWindow(boolean isAddedToWindow)
Window uses this to inform the component that it is added to a window
Parameters:
isAddedToWindow - true if the component is in a window

getXAxisDataType

public java.lang.String getXAxisDataType()
Gets the type of the x-axis and x coordinate of the data points. The return will be either be a TYPE_* field from this class (e.g. TYPE_NUMERICAL)
Returns:
the type of the x-axis, chosen from the TYPE_* fields in this class

setXAxisDataType

public void setXAxisDataType(java.lang.String type)
Sets the type of the x-axis and x coordinate of the data points. Objects you pass to addDataPoint can have any numerical type (Integer, Double, etc.) The type parameter must be either be a TYPE_* field from this class (e.g. TYPE_NUMERICAL) This method cannot be called after plots or annotations are added to the Graph
Parameters:
type - the type of the x-axis, chosen from the TYPE_* fields in this class

getYAxisDataType

public java.lang.String getYAxisDataType()
Gets the type of the y-axis and y coordinate of the data points. The return will be either be a TYPE_* field from this class (e.g. TYPE_NUMERICAL)
Returns:
the type of the y-axis, chosen from the TYPE_* fields in this class

setYAxisDataType

public void setYAxisDataType(java.lang.String type)
Sets the type of the x-axis and x coordinate of the data points. Objects you pass to addDataPoint can have any numerical type (Integer, Double, etc.) The type parameter must be either be a TYPE_* field from this class (e.g. TYPE_NUMERICAL) This method cannot be called after plots or annotations are added to the Graph
Parameters:
type - the type of the x-axis, chosen from the TYPE_* fields in this class

getLegendVisible

public boolean getLegendVisible()
Gets the visibility of the legend
Returns:
true if the legend should be visible

setLegendVisible

public void setLegendVisible(boolean visible,
                             java.lang.String skinName)
Sets the visibility of the legend
Parameters:
visible - true if the legend should be visible
skinName - the skinName of this setting

setLegendVisible

public void setLegendVisible(boolean visible)
Sets the visibility of the legend
Parameters:
visible - true if the legend should be visible

getLegendHorizontalAlignment

public int getLegendHorizontalAlignment()
Gets the horizontal alignment of the legend. One of HALIGN_LEFT and HALIGN_RIGHT.
Returns:
the horizontal alignment of the legend

getLegendHorizontalMargin

public int getLegendHorizontalMargin()
Gets the distance from the horizontal alignment position in pixels.
Returns:
the distance from the alignment position in pixels.

setLegendHorizontalPosition

public void setLegendHorizontalPosition(int halign,
                                        int margin,
                                        java.lang.String skinName)
Sets the Horizontal position of the legend. The alignment gives the base position and the margin is the offset from that position.
Parameters:
halign - either HALIGN_LEFT or HALIGN_RIGHT
margin - the distance from the base position given by halign.
skinName - the skinName of this setting

setLegendHorizontalPosition

public void setLegendHorizontalPosition(int halign,
                                        int margin)
Sets the Horizontal position of the legend. The alignment gives the base position and the margin is the offset from that position.
Parameters:
halign - either HALIGN_LEFT or HALIGN_RIGHT
margin - the distance from the base position given by halign.

getLegendVerticalAlignment

public int getLegendVerticalAlignment()
Gets the vertical alignment of the legend. One of VALIGN_TOP and VALIGN_BOTTOM.
Returns:
the vertical alignment of the legend

getLegendVerticalMargin

public int getLegendVerticalMargin()
Gets the distance from the vertical alignment position in pixels.
Returns:
the distance from the alignment position in pixels.

setLegendVerticalPosition

public void setLegendVerticalPosition(int halign,
                                      int margin,
                                      java.lang.String skinName)
Sets the Vertical position of the legend. The alignment gives the base position and the margin is the offset from that position. Use a negative number to be left of the position and positive to be right of the position.
Parameters:
halign - either HALIGN_LEFT or HALIGN_RIGHT
margin - the distance from the base position given by halign. Use negative numbers to be left of that position and positive to be right
skinName - the skinName of this setting

setLegendVerticalPosition

public void setLegendVerticalPosition(int halign,
                                      int margin)
Sets the Vertical position of the legend. The alignment gives the base position and the margin is the offset from that position. Use a negative number to be left of the position and positive to be right of the position.
Parameters:
halign - either HALIGN_LEFT or HALIGN_RIGHT
margin - the distance from the base position given by halign. Use negative numbers to be left of that position and positive to be right

getXTickLabels

public java.lang.String[] getXTickLabels()
Gets the x-tick labels
Returns:
the labels used on the x-axis of the graph

setXTickLabels

public void setXTickLabels(java.lang.String[] ticks,
                           java.lang.String skinName)
Sets the x-tick labels. Normally the x-axis labels are determined automatically from the data. If you need named buckets instead, use this function to create them and then use the index of the label as the x value of the data points you add to the plot. You may add fractional x-values and they will be plotted between buckets.
Parameters:
ticks - labels to use on the x-axis
skinName - the skinName of this setting

setXTickLabels

public void setXTickLabels(java.lang.String[] ticks)
Sets the x-tick labels
Parameters:
ticks - labels to use on the x-axis
See Also:
setXTickLabels(String[], String)

getZoomable

public boolean getZoomable()
Gets whether the graph is zoomable or not
Returns:
true if the graph is zoomable, false otherwise

setZoomable

public void setZoomable(boolean z,
                        java.lang.String skinName)
Sets whether the graph is zoomable or not
Parameters:
z - true if the graph is zoomable, false otherwise
skinName - the skinName of this setting

setZoomable

public void setZoomable(boolean z)
Sets whether the graph is zoomable or not
Parameters:
z - true if the graph is zoomable, false otherwise

makePlotProxy

public com.droplets.api.PlotComponent.PlotProxy makePlotProxy(PlotComponent plot,
                                                              java.lang.String type)
Makes the appropriate PlotProxy class for this graph type.
Parameters:
plot - the plot for which to make a proxy
type - the type of the plot

makeAnnotationProxy

public com.droplets.api.GraphAnnotation.AnnotationProxy makeAnnotationProxy(GraphAnnotation a,
                                                                            int orientation)
Makes the appropriate PlotProxy class for this graph type.
Parameters:
plot - the plot for which to make a proxy
type - the type of the plot


Copyright © Droplets, 2001. All Rights Reserved.