net.moioli.chart
Interface DrawableI

All Known Subinterfaces:
FunctionByPointsI
All Known Implementing Classes:
AbstractDrawableFunction, AbstractDrawableSuccession, AbstractPlaneCurve, Axes, BigPoint, FunctionByPointsLines, Histogram, LegendElement, Logo, ParsedFunction, ParsedPlaneCurve, ParsedSeries, ParsedSuccession, Pie

public interface DrawableI

An object which can be drawn on a DefaultChart.

Version:
2005/10/5
Author:
Silvio Moioli

Method Summary
 void drawMe(GraphicsI g, Scale s, java.lang.Object c)
          This method is automatically called by DefaultChart to draw the objects it contains, so end users should never call drawMe directly.
 double maxY(double minX, double maxX)
          Returns the maximum y value that should be represented in the DefaultChart for this object to be drawn properly.
 double minY(double minX, double maxX)
          Returns the minimum y value that should be represented in the DefaultChart for this object to be drawn properly.
 

Method Detail

drawMe

void drawMe(GraphicsI g,
            Scale s,
            java.lang.Object c)
This method is automatically called by DefaultChart to draw the objects it contains, so end users should never call drawMe directly. Inside this method there must be all the code to draw the object on a DefaultChart, and all the operations which involve scaling should be done via the passed Scale object.

Parameters:
g - the surface where this object will be drawn
s - the DefaultChart's Scale object
c - the color to be used for drawing

minY

double minY(double minX,
            double maxX)
Returns the minimum y value that should be represented in the DefaultChart for this object to be drawn properly.
If the object will be drawn indipendently from the y values represented in the DefaultChart, this method should return Double.NaN.

Parameters:
minX - the minimum x value represented in this DefaultChart
maxX - the maximum x value represented in this DefaultChart
Returns:
the minimum y value or NaN

maxY

double maxY(double minX,
            double maxX)
Returns the maximum y value that should be represented in the DefaultChart for this object to be drawn properly.
If the object will be drawn indipendently from the y values represented in the DefaultChart, this method should return Double.NaN.

Parameters:
minX - the minimum x value represented in this DefaultChart
maxX - the maximum x value represented in this DefaultChart
Returns:
the maximum y value or NaN