Enum DashPattern
- java.lang.Object
-
- java.lang.Enum<DashPattern>
-
- ca.cgjennings.apps.arkham.deck.item.DashPattern
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DashPattern>
public enum DashPattern extends java.lang.Enum<DashPattern>
The standard dash patterns available to draw paths and outlines.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DASH_DASH_DOT
DASH_DASH_DOT_DOT
DASH_DOT
DASH_DOT_DOT
DASHED
DASHED_LARGE
DASHED_MEDIUM
DOTTED
LDASH_DASH
LDASH_DOT_DASH_DOT
LDASH_DOT_DOT_DOT
SOLID
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description float[]
createDashArray(float penWidth)
Returns an array of dash segment lengths suitable for representing this dash pattern at the specified stroke width.abstract float[]
createDashArray(float penWidth, float capSpread)
Returns an array of dash segment lengths suitable for representing this dash pattern at the specified stroke width.static javax.swing.JComboBox<DashPattern>
createSelector(javax.swing.JComboBox<?> comboBox)
Applies a model and renderer to a combo box so that the combo box can be used to select a dash pattern.static DashPattern
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static DashPattern[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SOLID
public static final DashPattern SOLID
-
DASHED_LARGE
public static final DashPattern DASHED_LARGE
-
DASHED_MEDIUM
public static final DashPattern DASHED_MEDIUM
-
DASHED
public static final DashPattern DASHED
-
DOTTED
public static final DashPattern DOTTED
-
DASH_DOT
public static final DashPattern DASH_DOT
-
DASH_DOT_DOT
public static final DashPattern DASH_DOT_DOT
-
DASH_DASH_DOT
public static final DashPattern DASH_DASH_DOT
-
LDASH_DASH
public static final DashPattern LDASH_DASH
-
DASH_DASH_DOT_DOT
public static final DashPattern DASH_DASH_DOT_DOT
-
LDASH_DOT_DASH_DOT
public static final DashPattern LDASH_DOT_DASH_DOT
-
LDASH_DOT_DOT_DOT
public static final DashPattern LDASH_DOT_DOT_DOT
-
-
Method Detail
-
values
public static DashPattern[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DashPattern c : DashPattern.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DashPattern valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
createDashArray
public final float[] createDashArray(float penWidth)
Returns an array of dash segment lengths suitable for representing this dash pattern at the specified stroke width. The lengths of the dash segments will be padded to account for a line end cap length of half the stroke width (on each end of a stroke).- Parameters:
penWidth
- the stroke width- Returns:
- an array of dash segment lengths for the dash pattern
-
createDashArray
public abstract float[] createDashArray(float penWidth, float capSpread)
Returns an array of dash segment lengths suitable for representing this dash pattern at the specified stroke width.- Parameters:
penWidth
- the stroke widthcapSpread
- the amount to pad dash segment lengths by in order to account for the line's end caps- Returns:
- an array of dash segment lengths for the dash pattern
-
createSelector
public static javax.swing.JComboBox<DashPattern> createSelector(javax.swing.JComboBox<?> comboBox)
Applies a model and renderer to a combo box so that the combo box can be used to select a dash pattern.- Returns:
- the modified combo box
-
-