| jimm.datavision.Element jimm.datavision.Line
Line | public class Line extends Element (Code) | | A line is a visual report element. Lines are used in field
jimm.datavision.field.Border s and independently.
Note that currently, line thickness is ignored in the Java GUI (but not
in layout engines such as the LaTeXLE).
author: Jim Menard, jimm@io.com |
Constructor Summary | |
public | Line(Report report, Section section, double thickness, Color color, boolean visible) Constructor. | public | Line(Report report, Section section, double thickness, Color color, boolean visible, Point p0, Point p1) Constructor. |
Method Summary | |
public void | addEndPoint(double x, double y) Adds an end point to the line. | public Color | getColor() Returns the line's color. | public Point | getPoint(int index) Returns one of the two end points of the line. | public double | getThickness() Returns the line thickness. | public double | length() Returns the length of the line. | public void | setColor(Color c) Sets the line's color. | public void | setPoint(Point newPoint, int index) Sets one of the two end points. | public void | setThickness(double newThickness) Sets the line thickness. | public String | toString() Returns a string representation of this line. | public void | writeXML(XMLWriter out) Writes this line as an XML tag. |
DEFAULT_COLOR | final protected static Color DEFAULT_COLOR(Code) | | |
thickness | protected double thickness(Code) | | |
Line | public Line(Report report, Section section, double thickness, Color color, boolean visible)(Code) | | Constructor.
Parameters: report - the report containing this line Parameters: section - the section containing this line Parameters: thickness - the line thickness Parameters: color - may be null Parameters: visible - show/hide flag |
Line | public Line(Report report, Section section, double thickness, Color color, boolean visible, Point p0, Point p1)(Code) | | Constructor.
Parameters: report - the report containing this line Parameters: section - the section containing this line Parameters: thickness - the line thickness Parameters: color - may be null Parameters: visible - show/hide flag Parameters: p0 - one end point of the line Parameters: p1 - the other end point of the line |
addEndPoint | public void addEndPoint(double x, double y)(Code) | | Adds an end point to the line. Used when constructing a line from XML,
where we don't see the point until after creating this line.
Parameters: x - the x coordinate Parameters: y - the y coordinate |
getColor | public Color getColor()(Code) | | Returns the line's color. The return value will never be
null .
the line's color |
getPoint | public Point getPoint(int index)(Code) | | Returns one of the two end points of the line.
Parameters: index - either 0 or 1 a point |
getThickness | public double getThickness()(Code) | | Returns the line thickness.
the line thickness |
length | public double length()(Code) | | Returns the length of the line.
the distance between the two end points |
setColor | public void setColor(Color c)(Code) | | Sets the line's color. If c is null , then the
color is set to DEFAULT_COLOR .
Parameters: c - new line color; if null , color is set toDEFAULT_COLOR |
setPoint | public void setPoint(Point newPoint, int index)(Code) | | Sets one of the two end points.
Parameters: newPoint - a point Parameters: index - either 0 or 1 |
setThickness | public void setThickness(double newThickness)(Code) | | Sets the line thickness.
Parameters: newThickness - the new line thickness |
toString | public String toString()(Code) | | Returns a string representation of this line.
a string representing this line |
writeXML | public void writeXML(XMLWriter out)(Code) | | Writes this line as an XML tag.
Parameters: out - a writer that knows how to write XML |
|
|