Class LineElement
- java.lang.Object
-
- org.openscience.cdk.renderer.elements.LineElement
-
- All Implemented Interfaces:
IRenderingElement
- Direct Known Subclasses:
WedgeLineElement
public class LineElement extends Object implements IRenderingElement
A line between two points.- Source code:
- main
- Belongs to CDK module:
- renderbasic
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LineElement.LineType
The type of the line.
-
Field Summary
Fields Modifier and Type Field Description Color
color
The color of the line.double
firstPointX
The x-coordinate of the first point.double
firstPointY
The y-coordinate of the first point.double
secondPointX
The x-coordinate of the second point.double
secondPointY
The y-coordinate of the second point.double
width
The width of the line.
-
Constructor Summary
Constructors Constructor Description LineElement(double firstPointX, double firstPointY, double secondPointX, double secondPointY, double width, Color color)
Make a line element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(IRenderingVisitor visitor)
Converts thisTextElement
into widget specific objects.Area
toArea()
Convert the Line to an awt.Area, by default the line will have an approximation of rounded end caps.Area
toArea(boolean endCaps)
Convert the Line to an awt.Area specifying whether to include the end caps or not.
-
-
-
Field Detail
-
firstPointX
public final double firstPointX
The x-coordinate of the first point.
-
firstPointY
public final double firstPointY
The y-coordinate of the first point.
-
secondPointX
public final double secondPointX
The x-coordinate of the second point.
-
secondPointY
public final double secondPointY
The y-coordinate of the second point.
-
width
public final double width
The width of the line.
-
color
public final Color color
The color of the line.
-
-
Constructor Detail
-
LineElement
public LineElement(double firstPointX, double firstPointY, double secondPointX, double secondPointY, double width, Color color)
Make a line element.- Parameters:
firstPointX
- x-coordinate of the first pointfirstPointY
- y-coordinate of the first pointsecondPointX
- x-coordinate of the second pointsecondPointY
- y-coordinate of the second pointwidth
- the width of the linecolor
- the color of the line
-
-
Method Detail
-
accept
public void accept(IRenderingVisitor visitor)
Converts thisTextElement
into widget specific objects.- Specified by:
accept
in interfaceIRenderingElement
- Parameters:
visitor
- Toolkit specific widget factory.
-
toArea
public Area toArea()
Convert the Line to an awt.Area, by default the line will have an approximation of rounded end caps.- Returns:
- the area
-
toArea
public Area toArea(boolean endCaps)
Convert the Line to an awt.Area specifying whether to include the end caps or not.- Parameters:
endCaps
- include the end caps- Returns:
- the area
-
-