|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectHashMap
net.moioli.drawables.Histogram
public class Histogram
A nice class to draw a histogram out of a Map table of data.
It will draw a histogram with the values and will use the Map keys as lables.
Attention: this class expects you use Number derived objects as the map
values (like Double or Integer). Not doing so might raise
ClassCastExceptions.
Number
,
Map
Constructor Summary | |
---|---|
Histogram()
Constructs a new, empty Histogram. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Histogram()
Method Detail |
---|
public double minY(double minX, double maxX)
DrawableI
minY
in interface DrawableI
minX
- the minimum x value represented in this DefaultChartmaxX
- the maximum x value represented in this DefaultChart
TODO: find a better
strategy to do this (use keys as values in a TreeMap?)
public double maxY(double minX, double maxX)
DrawableI
maxY
in interface DrawableI
minX
- the minimum x value represented in this DefaultChartmaxX
- the maximum x value represented in this DefaultChart
DrawableI.maxY(double, double)
public void drawMe(GraphicsI g, Scale s, java.lang.Object c)
DrawableI
drawMe
in interface DrawableI
g
- the surface where this object will be drawns
- the DefaultChart's Scale objectc
- the color to be used for drawingDrawableI.drawMe(GraphicsI, Scale, Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |