Record Class Stroke
java.lang.Object
java.lang.Record
org.inspirenxe.strata.api.extension.Stroke
- Record Components:
width- the width in UI units, centered on the path for lines, polylines and shapes; 0 draws nothingcap- the shape of the ends of an open pathjoin- the shape of the corners where two segments meet
How a line or an outline is drawn: its width, the shape of its open ends and the shape of its corners. Make one
once and keep it in a field; it is a value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe shape of the ends of an open path.static enumThe shape of the corner where two segments of a path meet. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncap()Returns the value of thecaprecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.join()Returns the value of thejoinrecord component.static Strokeof(float width) Returns a stroke of a width withStroke.Cap.BUTTends andStroke.Join.MITERcorners.final StringtoString()Returns a string representation of this record class.floatwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
Stroke
Checks the arguments.- Throws:
IllegalArgumentException- if the width is negative or not finite
-
-
Method Details
-
of
Returns a stroke of a width withStroke.Cap.BUTTends andStroke.Join.MITERcorners.- Parameters:
width- the width in UI units- Returns:
- the stroke
- Throws:
IllegalArgumentException- if the width is negative or not finite
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
width
-
cap
-
join
-