|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.graph.output.Output
public abstract class Output
The Output class is the abstract base class for all Output canvases in the graph Library. It defines some very primitive drawing methods (point, line, polygon and text) which need to be overridden by more concrete subclasses in order to render the graphs.
The main method in the Output
class of interest
to end-users is the render(org.faceless.graph.Graph)
method, which takes
a Graph as an argument and renders that graph to this output
stream.
Method Summary | |
---|---|
abstract boolean |
canPattern()
Return true if this subclass out Output can handle pattern fills. |
abstract boolean |
canRotate()
Return true if this subclass out Output can handle rotated text. |
abstract BoundingBox |
getCanvas()
Return the canvas as a BoundingBox . |
abstract Graph |
getGraph()
Return the graph being rendered. |
abstract BoundingBox |
getTextBox(String text,
Style style)
Return the bounding box for given string in the specified style. |
abstract void |
line(double x1,
double y1,
double x2,
double y2)
Draw a line from x1,y1 to x2,y2 on the canvas, in the current colour |
abstract void |
poly(String name,
double[] x,
double[] y,
int num)
Draw and fill a polygon on the canvas, in the current colour. |
abstract void |
render(Graph g)
Render the Graph to this Output object. |
abstract void |
setColor(Paint s)
Set the current pen, font and fill colour |
abstract void |
setLineDash(double on,
double off,
double phase)
Set the line dash pattern |
abstract void |
setLineThickness(double thickness)
Set the line thickness (1 being default, 2 twice as thick, etc.) on platforms that support it. |
abstract void |
text(String text,
double x,
double y,
Style s)
Draw a line of text at the specified position in the specified style. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract BoundingBox getTextBox(String text, Style style)
text
- The string to return the size for.style
- The style to apply to the text before returning it's size.
The aspects of the style that may affect this include font, rotation
and alignmentpublic abstract BoundingBox getCanvas()
BoundingBox
. The final graph
will be sized to fit this box.
public abstract boolean canRotate()
public abstract boolean canPattern()
public abstract void setColor(Paint s)
public abstract void setLineThickness(double thickness)
public abstract void setLineDash(double on, double off, double phase)
public abstract void text(String text, double x, double y, Style s)
text
- The line of text to draw.x
- The x position to place the text at, measured from the
left of the canvas.y
- The y position to place the text at, measured from the
bottom of the canvas.style
- The style to apply to the text. Aspects of the style
that will be used include Color, Font, Alignment and Rotationpublic abstract void line(double x1, double y1, double x2, double y2)
public abstract void poly(String name, double[] x, double[] y, int num)
name
- The name of the dataset that is being drawn. Not
used in the current release, but will eventually be user for
interaction with rendered graphsx
- the array of X co-ordinatesy
- the array of Y co-ordinatesnum
- the number of co-ordinates in the arraypublic abstract void render(Graph g) throws IOException
IOException
public abstract Graph getGraph()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |