Top Description Fields Constructors Methods
javafx.scene.layout

public final Class BorderStrokeStyle

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, javafx.beans.NamedArg, javafx.scene.shape.StrokeLineCap, .StrokeLineJoin, .StrokeType

Defines the style of the stroke to use on one side of a BorderStroke. There are several predefined styles, although the properties of these predefined styles may not match the settings used to ultimately draw them. Or you may create a new BorderStrokeStyle and define each of the stroke settings manually, similar to any javafx.scene.shape.Shape.
Since
JavaFX 8.0

Field Summary

Modifier and TypeField and Description
private final List<Double>
public static final BorderStrokeStyle
DASHED

A predefined dashed pattern to be used for stroking

private static final List<Double>
private final double
public static final BorderStrokeStyle
DOTTED

A predefined dotted pattern to be used for stroking

private static final List<Double>
private final int
hash

A cached hash code

private final StrokeLineCap
private final StrokeLineJoin
private final double
public static final BorderStrokeStyle
NONE

Indicates that no stroke should be drawn.

public static final BorderStrokeStyle
SOLID

A predefined solid line to be used for stroking

private final StrokeType

Constructor Summary

AccessConstructor and Description
public
BorderStrokeStyle(StrokeType
The type of stroke, whether rendered OUTSIDE, INSIDE, or CENTERED on the border line. If null, defaults to CENTERED.
type
,
StrokeLineJoin
The line join. If null, defaults to MITER
lineJoin
,
StrokeLineCap
The line cap. If null, defaults to BUTT.
lineCap
,
double
The miter limit. 10 is a good default value.
miterLimit
,
double
The dashOffset. 0 is a good default value.
dashOffset
,
List<Double>
The dash array. If null, defaults to an empty list.
dashArray
)

Creates a new BorderStrokeStyle.

Method Summary

Modifier and TypeMethod and Description
private static List<Double>
asList(double... items)

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public final List<Double>

Returns:

the array representing the lengths of the dash segments
getDashArray
()

Defines the array representing the lengths of the dash segments.

public final double

Returns:

the offset into the dashing pattern
getDashOffset
()

Defines a distance specified in user coordinates that represents an offset into the dashing pattern.

public final StrokeLineCap

Returns:

the end cap style
getLineCap
()

The end cap style of this Shape as one of the following values that define possible end cap styles: StrokeLineCap.BUTT, StrokeLineCap.ROUND, and StrokeLineCap.SQUARE.

public final StrokeLineJoin

Returns:

the decoration applied where path segments meet
getLineJoin
()

Defines the decoration applied where path segments meet.

public final double

Returns:

the limit for the StrokeLineJoin.MITER line join style
getMiterLimit
()

Defines the limit for the StrokeLineJoin.MITER line join style.

public final StrokeType

Returns:

the the direction that the strokeWidth is applied to the boundary of the shape
getType
()

Defines the direction (inside, outside, or both) that the strokeWidth is applied to the boundary of the shape.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

dashArrayback to summary
private final List<Double> dashArray
DASHEDback to summary
public static final BorderStrokeStyle DASHED

A predefined dashed pattern to be used for stroking

DASHED_LISTback to summary
private static final List<Double> DASHED_LIST
dashOffsetback to summary
private final double dashOffset
DOTTEDback to summary
public static final BorderStrokeStyle DOTTED

A predefined dotted pattern to be used for stroking

DOTTED_LISTback to summary
private static final List<Double> DOTTED_LIST
hashback to summary
private final int hash

A cached hash code

lineCapback to summary
private final StrokeLineCap lineCap
lineJoinback to summary
private final StrokeLineJoin lineJoin
miterLimitback to summary
private final double miterLimit
NONEback to summary
public static final BorderStrokeStyle NONE

Indicates that no stroke should be drawn.

SOLIDback to summary
public static final BorderStrokeStyle SOLID

A predefined solid line to be used for stroking

typeback to summary
private final StrokeType type

Constructor Detail

BorderStrokeStyleback to summary
public BorderStrokeStyle(StrokeType type, StrokeLineJoin lineJoin, StrokeLineCap lineCap, double miterLimit, double dashOffset, List<Double> dashArray)

Creates a new BorderStrokeStyle.

Parameters
type:StrokeType

The type of stroke, whether rendered OUTSIDE, INSIDE, or CENTERED on the border line. If null, defaults to CENTERED.

lineJoin:StrokeLineJoin

The line join. If null, defaults to MITER

lineCap:StrokeLineCap

The line cap. If null, defaults to BUTT.

miterLimit:double

The miter limit. 10 is a good default value.

dashOffset:double

The dashOffset. 0 is a good default value.

dashArray:List<Double>

The dash array. If null, defaults to an empty list.

Method Detail

asListback to summary
private static List<Double> asList(double... items)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getDashArrayback to summary
public final List<Double> getDashArray()

Defines the array representing the lengths of the dash segments. Alternate entries in the array represent the user space lengths of the opaque and transparent segments of the dashes. As the pen moves along the outline of the Shape to be stroked, the user space distance that the pen travels is accumulated. The distance value is used to index into the dash array. The pen is opaque when its current cumulative distance maps to an even element of the dash array and transparent otherwise. An empty dashArray indicates a solid line with no spaces.

Returns:List<Double>

the array representing the lengths of the dash segments

Default Value
empty
getDashOffsetback to summary
public final double getDashOffset()

Defines a distance specified in user coordinates that represents an offset into the dashing pattern. In other words, the dash phase defines the point in the dashing pattern that will correspond to the beginning of the stroke.

Returns:double

the offset into the dashing pattern

Default Value
0
getLineCapback to summary
public final StrokeLineCap getLineCap()

The end cap style of this Shape as one of the following values that define possible end cap styles: StrokeLineCap.BUTT, StrokeLineCap.ROUND, and StrokeLineCap.SQUARE.

Returns:StrokeLineCap

the end cap style

Default Value
SQUARE
getLineJoinback to summary
public final StrokeLineJoin getLineJoin()

Defines the decoration applied where path segments meet. The value must have one of the following values: StrokeLineJoin.BEVEL, StrokeLineJoin.MITER, and StrokeLineJoin.ROUND.

Returns:StrokeLineJoin

the decoration applied where path segments meet

Default Value
MITER
getMiterLimitback to summary
public final double getMiterLimit()

Defines the limit for the StrokeLineJoin.MITER line join style.

Returns:double

the limit for the StrokeLineJoin.MITER line join style

Default Value
10
getTypeback to summary
public final StrokeType getType()

Defines the direction (inside, outside, or both) that the strokeWidth is applied to the boundary of the shape.

Returns:StrokeType

the the direction that the strokeWidth is applied to the boundary of the shape

Default Value
CENTERED
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override