Class LineElement
java.lang.Object
org.openscience.cdk.renderer.elements.LineElement
- All Implemented Interfaces:
IRenderingElement
- Direct Known Subclasses:
WedgeLineElement
A line between two points.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ColorThe color of the line.final doubleThe x-coordinate of the first point.final doubleThe y-coordinate of the first point.final doubleThe x-coordinate of the second point.final doubleThe y-coordinate of the second point.final doubleThe width of the line. -
Constructor Summary
ConstructorsConstructorDescriptionLineElement(double firstPointX, double firstPointY, double secondPointX, double secondPointY, double width, Color color) Make a line element. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IRenderingVisitor visitor) Converts thisTextElementinto widget specific objects.toArea()Convert the Line to an awt.Area, by default the line will have an approximation of rounded end caps.toArea(boolean endCaps) Convert the Line to an awt.Area specifying whether to include the end caps or not.
-
Field Details
-
firstPointX
public final double firstPointXThe x-coordinate of the first point. -
firstPointY
public final double firstPointYThe y-coordinate of the first point. -
secondPointX
public final double secondPointXThe x-coordinate of the second point. -
secondPointY
public final double secondPointYThe y-coordinate of the second point. -
width
public final double widthThe width of the line. -
color
The color of the line.
-
-
Constructor Details
-
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 Details
-
accept
Converts thisTextElementinto widget specific objects.- Specified by:
acceptin interfaceIRenderingElement- Parameters:
visitor- Toolkit specific widget factory.
-
toArea
Convert the Line to an awt.Area, by default the line will have an approximation of rounded end caps.- Returns:
- the area
-
toArea
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
-