Enum HitPointType
- java.lang.Object
-
- java.lang.Enum<HitPointType>
-
- jmri.jmrit.display.layoutEditor.HitPointType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<HitPointType>
public enum HitPointType extends java.lang.Enum<HitPointType>
Enum denoting the different behaviors of different types of "HitPoints".Extracted from static in constants in LayoutEditor
-
-
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description static int
NUM_BEZIER_CONTROL_POINTS
static int
NUM_SHAPE_POINTS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
bezierPointIndex()
Find the 0-8 index with respect to BEZIER_CONTROL_POINT_0 of this enum entry.protected static HitPointType
bezierPointIndexedValue(int i)
Return a specific BEZIER_CONTROL_POINT from its 0-8 index.protected static boolean
isBezierHitType(HitPointType hitType)
protected static boolean
isConnectionHitType(HitPointType hitType)
protected static boolean
isControlHitType(HitPointType hitType)
protected static boolean
isLevelXingHitType(HitPointType hitType)
protected static boolean
isPopupHitType(HitPointType hitType)
protected static boolean
isShapePointOffsetHitPointType(HitPointType t)
protected static boolean
isSlipHitType(HitPointType hitType)
protected static boolean
isTurnoutHitType(HitPointType hitType)
protected static boolean
isTurntableRayHitType(HitPointType hitType)
protected int
shapePointIndex()
Find the 0-9 index with respect to SHAPE_POINT_0 of a given enum entry.protected static HitPointType
shapePointIndexedValue(int i)
Return a specific SHAPE_POINT from its 0-9 index.protected static HitPointType[]
shapePointValues()
Return an array of the valid SHAPE_POINT enum values.protected int
turntableTrackIndex()
Find the 0-63 index with respect to TURNTABLE_RAY_0 of a given enum entry.protected static HitPointType
turntableTrackIndexedValue(int i)
Return a specific TURNTABLE_RAY from its 0-63 index.protected static HitPointType[]
turntableValues()
Return an array of the valid TURNTABLE_RAY enum values.static HitPointType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static HitPointType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final HitPointType NONE
-
POS_POINT
public static final HitPointType POS_POINT
-
TURNOUT_A
public static final HitPointType TURNOUT_A
-
TURNOUT_B
public static final HitPointType TURNOUT_B
-
TURNOUT_C
public static final HitPointType TURNOUT_C
-
TURNOUT_D
public static final HitPointType TURNOUT_D
-
LEVEL_XING_A
public static final HitPointType LEVEL_XING_A
-
LEVEL_XING_B
public static final HitPointType LEVEL_XING_B
-
LEVEL_XING_C
public static final HitPointType LEVEL_XING_C
-
LEVEL_XING_D
public static final HitPointType LEVEL_XING_D
-
TRACK
public static final HitPointType TRACK
-
TURNOUT_CENTER
public static final HitPointType TURNOUT_CENTER
-
LEVEL_XING_CENTER
public static final HitPointType LEVEL_XING_CENTER
-
TURNTABLE_CENTER
public static final HitPointType TURNTABLE_CENTER
-
LAYOUT_POS_LABEL
public static final HitPointType LAYOUT_POS_LABEL
-
LAYOUT_POS_JCOMP
public static final HitPointType LAYOUT_POS_JCOMP
-
MULTI_SENSOR
public static final HitPointType MULTI_SENSOR
-
MARKER
public static final HitPointType MARKER
-
TRACK_CIRCLE_CENTRE
public static final HitPointType TRACK_CIRCLE_CENTRE
-
UNUSED_19
public static final HitPointType UNUSED_19
-
SLIP_CENTER
public static final HitPointType SLIP_CENTER
-
SLIP_A
public static final HitPointType SLIP_A
-
SLIP_B
public static final HitPointType SLIP_B
-
SLIP_C
public static final HitPointType SLIP_C
-
SLIP_D
public static final HitPointType SLIP_D
-
SLIP_LEFT
public static final HitPointType SLIP_LEFT
-
SLIP_RIGHT
public static final HitPointType SLIP_RIGHT
-
UNUSED_27
public static final HitPointType UNUSED_27
-
UNUSED_28
public static final HitPointType UNUSED_28
-
UNUSED_29
public static final HitPointType UNUSED_29
-
BEZIER_CONTROL_POINT_0
public static final HitPointType BEZIER_CONTROL_POINT_0
-
BEZIER_CONTROL_POINT_1
public static final HitPointType BEZIER_CONTROL_POINT_1
-
BEZIER_CONTROL_POINT_2
public static final HitPointType BEZIER_CONTROL_POINT_2
-
BEZIER_CONTROL_POINT_3
public static final HitPointType BEZIER_CONTROL_POINT_3
-
BEZIER_CONTROL_POINT_4
public static final HitPointType BEZIER_CONTROL_POINT_4
-
BEZIER_CONTROL_POINT_5
public static final HitPointType BEZIER_CONTROL_POINT_5
-
BEZIER_CONTROL_POINT_6
public static final HitPointType BEZIER_CONTROL_POINT_6
-
BEZIER_CONTROL_POINT_7
public static final HitPointType BEZIER_CONTROL_POINT_7
-
BEZIER_CONTROL_POINT_8
public static final HitPointType BEZIER_CONTROL_POINT_8
-
SHAPE_CENTER
public static final HitPointType SHAPE_CENTER
-
SHAPE_POINT_0
public static final HitPointType SHAPE_POINT_0
-
SHAPE_POINT_1
public static final HitPointType SHAPE_POINT_1
-
SHAPE_POINT_2
public static final HitPointType SHAPE_POINT_2
-
SHAPE_POINT_3
public static final HitPointType SHAPE_POINT_3
-
SHAPE_POINT_4
public static final HitPointType SHAPE_POINT_4
-
SHAPE_POINT_5
public static final HitPointType SHAPE_POINT_5
-
SHAPE_POINT_6
public static final HitPointType SHAPE_POINT_6
-
SHAPE_POINT_7
public static final HitPointType SHAPE_POINT_7
-
SHAPE_POINT_8
public static final HitPointType SHAPE_POINT_8
-
SHAPE_POINT_9
public static final HitPointType SHAPE_POINT_9
-
TURNTABLE_RAY_0
public static final HitPointType TURNTABLE_RAY_0
-
TURNTABLE_RAY_1
public static final HitPointType TURNTABLE_RAY_1
-
TURNTABLE_RAY_2
public static final HitPointType TURNTABLE_RAY_2
-
TURNTABLE_RAY_3
public static final HitPointType TURNTABLE_RAY_3
-
TURNTABLE_RAY_4
public static final HitPointType TURNTABLE_RAY_4
-
TURNTABLE_RAY_5
public static final HitPointType TURNTABLE_RAY_5
-
TURNTABLE_RAY_6
public static final HitPointType TURNTABLE_RAY_6
-
TURNTABLE_RAY_7
public static final HitPointType TURNTABLE_RAY_7
-
TURNTABLE_RAY_8
public static final HitPointType TURNTABLE_RAY_8
-
TURNTABLE_RAY_9
public static final HitPointType TURNTABLE_RAY_9
-
TURNTABLE_RAY_10
public static final HitPointType TURNTABLE_RAY_10
-
TURNTABLE_RAY_11
public static final HitPointType TURNTABLE_RAY_11
-
TURNTABLE_RAY_12
public static final HitPointType TURNTABLE_RAY_12
-
TURNTABLE_RAY_13
public static final HitPointType TURNTABLE_RAY_13
-
TURNTABLE_RAY_14
public static final HitPointType TURNTABLE_RAY_14
-
TURNTABLE_RAY_15
public static final HitPointType TURNTABLE_RAY_15
-
TURNTABLE_RAY_16
public static final HitPointType TURNTABLE_RAY_16
-
TURNTABLE_RAY_17
public static final HitPointType TURNTABLE_RAY_17
-
TURNTABLE_RAY_18
public static final HitPointType TURNTABLE_RAY_18
-
TURNTABLE_RAY_19
public static final HitPointType TURNTABLE_RAY_19
-
TURNTABLE_RAY_20
public static final HitPointType TURNTABLE_RAY_20
-
TURNTABLE_RAY_21
public static final HitPointType TURNTABLE_RAY_21
-
TURNTABLE_RAY_22
public static final HitPointType TURNTABLE_RAY_22
-
TURNTABLE_RAY_23
public static final HitPointType TURNTABLE_RAY_23
-
TURNTABLE_RAY_24
public static final HitPointType TURNTABLE_RAY_24
-
TURNTABLE_RAY_25
public static final HitPointType TURNTABLE_RAY_25
-
TURNTABLE_RAY_26
public static final HitPointType TURNTABLE_RAY_26
-
TURNTABLE_RAY_27
public static final HitPointType TURNTABLE_RAY_27
-
TURNTABLE_RAY_28
public static final HitPointType TURNTABLE_RAY_28
-
TURNTABLE_RAY_29
public static final HitPointType TURNTABLE_RAY_29
-
TURNTABLE_RAY_30
public static final HitPointType TURNTABLE_RAY_30
-
TURNTABLE_RAY_31
public static final HitPointType TURNTABLE_RAY_31
-
TURNTABLE_RAY_32
public static final HitPointType TURNTABLE_RAY_32
-
TURNTABLE_RAY_33
public static final HitPointType TURNTABLE_RAY_33
-
TURNTABLE_RAY_34
public static final HitPointType TURNTABLE_RAY_34
-
TURNTABLE_RAY_35
public static final HitPointType TURNTABLE_RAY_35
-
TURNTABLE_RAY_36
public static final HitPointType TURNTABLE_RAY_36
-
TURNTABLE_RAY_37
public static final HitPointType TURNTABLE_RAY_37
-
TURNTABLE_RAY_38
public static final HitPointType TURNTABLE_RAY_38
-
TURNTABLE_RAY_39
public static final HitPointType TURNTABLE_RAY_39
-
TURNTABLE_RAY_40
public static final HitPointType TURNTABLE_RAY_40
-
TURNTABLE_RAY_41
public static final HitPointType TURNTABLE_RAY_41
-
TURNTABLE_RAY_42
public static final HitPointType TURNTABLE_RAY_42
-
TURNTABLE_RAY_43
public static final HitPointType TURNTABLE_RAY_43
-
TURNTABLE_RAY_44
public static final HitPointType TURNTABLE_RAY_44
-
TURNTABLE_RAY_45
public static final HitPointType TURNTABLE_RAY_45
-
TURNTABLE_RAY_46
public static final HitPointType TURNTABLE_RAY_46
-
TURNTABLE_RAY_47
public static final HitPointType TURNTABLE_RAY_47
-
TURNTABLE_RAY_48
public static final HitPointType TURNTABLE_RAY_48
-
TURNTABLE_RAY_49
public static final HitPointType TURNTABLE_RAY_49
-
TURNTABLE_RAY_50
public static final HitPointType TURNTABLE_RAY_50
-
TURNTABLE_RAY_51
public static final HitPointType TURNTABLE_RAY_51
-
TURNTABLE_RAY_52
public static final HitPointType TURNTABLE_RAY_52
-
TURNTABLE_RAY_53
public static final HitPointType TURNTABLE_RAY_53
-
TURNTABLE_RAY_54
public static final HitPointType TURNTABLE_RAY_54
-
TURNTABLE_RAY_55
public static final HitPointType TURNTABLE_RAY_55
-
TURNTABLE_RAY_56
public static final HitPointType TURNTABLE_RAY_56
-
TURNTABLE_RAY_57
public static final HitPointType TURNTABLE_RAY_57
-
TURNTABLE_RAY_58
public static final HitPointType TURNTABLE_RAY_58
-
TURNTABLE_RAY_59
public static final HitPointType TURNTABLE_RAY_59
-
TURNTABLE_RAY_60
public static final HitPointType TURNTABLE_RAY_60
-
TURNTABLE_RAY_61
public static final HitPointType TURNTABLE_RAY_61
-
TURNTABLE_RAY_62
public static final HitPointType TURNTABLE_RAY_62
-
TURNTABLE_RAY_63
public static final HitPointType TURNTABLE_RAY_63
-
-
Field Detail
-
NUM_SHAPE_POINTS
public static final int NUM_SHAPE_POINTS
- See Also:
- Constant Field Values
-
NUM_BEZIER_CONTROL_POINTS
public static final int NUM_BEZIER_CONTROL_POINTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static HitPointType[] 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 (HitPointType c : HitPointType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HitPointType 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
-
isConnectionHitType
protected static boolean isConnectionHitType(HitPointType hitType)
- Parameters:
hitType
- the hit point type- Returns:
- true if this is for a connection to a LayoutTrack
-
isControlHitType
protected static boolean isControlHitType(HitPointType hitType)
- Parameters:
hitType
- the hit point type- Returns:
- true if this hit type is for a layout control
-
isTurnoutHitType
protected static boolean isTurnoutHitType(HitPointType hitType)
-
isSlipHitType
protected static boolean isSlipHitType(HitPointType hitType)
-
isBezierHitType
protected static boolean isBezierHitType(HitPointType hitType)
-
isLevelXingHitType
protected static boolean isLevelXingHitType(HitPointType hitType)
-
isTurntableRayHitType
protected static boolean isTurntableRayHitType(HitPointType hitType)
-
isPopupHitType
protected static boolean isPopupHitType(HitPointType hitType)
- Parameters:
hitType
- the hit point type- Returns:
- true if this is for a popup menu
-
turntableTrackIndex
protected int turntableTrackIndex()
Find the 0-63 index with respect to TURNTABLE_RAY_0 of a given enum entry. ThrowsIllegalArgumentException
if the given enum value isn't one of the TURNTABLE_RAY_n entries.Ideally, this would be replaced by turntable code that works directly with the enum values as a step toward using objects to implement hit points.
- Returns:
- (Temporary) 0-63 index of the enum element
-
turntableTrackIndexedValue
protected static HitPointType turntableTrackIndexedValue(int i)
Return a specific TURNTABLE_RAY from its 0-63 index. ThrowsIllegalArgumentException
if the given index value isn't valid for the TURNTABLE_RAY entries.Ideally, this would be replaced by turntable code that works directly with the enum values as a step toward using objects to implement hit points.
- Parameters:
i
- (Temporary) 0-63 index of the enum element- Returns:
- Requested enum element
-
turntableValues
protected static HitPointType[] turntableValues()
Return an array of the valid TURNTABLE_RAY enum values. Meant for interations over the set of rays. Order is from 0 to 63.- Returns:
- (Temporary) Array containing TURNTABLE_RAY_0 through TURNTABLE_RAY_63
-
shapePointIndex
protected int shapePointIndex()
Find the 0-9 index with respect to SHAPE_POINT_0 of a given enum entry. ThrowsIllegalArgumentException
if the given enum value isn't one of the SHAPE_POINT_n entries.Ideally, this would be replaced by shape code that works directly with the enum values as a step toward using objects to implement hit points.
- Returns:
- (Temporary) 0-9 index of the enum element
-
shapePointIndexedValue
protected static HitPointType shapePointIndexedValue(int i)
Return a specific SHAPE_POINT from its 0-9 index. ThrowsIllegalArgumentException
if the given index value isn't valid for the SHAPE_POINT entries.Ideally, this would be replaced by shape code that works directly with the enum values as a step toward using objects to implement hit points.
- Parameters:
i
- (Temporary) 0-9 index of the enum element- Returns:
- Requested enum element
-
shapePointValues
protected static HitPointType[] shapePointValues()
Return an array of the valid SHAPE_POINT enum values. Meant for interations over the set of points. Order is from 0 to 9.- Returns:
- (Temporary) Array containing SHAPE_POINT_0 through SHAPE_POINT_9
-
isShapePointOffsetHitPointType
protected static boolean isShapePointOffsetHitPointType(HitPointType t)
-
bezierPointIndex
protected int bezierPointIndex()
Find the 0-8 index with respect to BEZIER_CONTROL_POINT_0 of this enum entry. ThrowsIllegalArgumentException
if the enum value isn't one of the BEZIER_CONTROL_POINT_n entries.Ideally, this would be replaced by bezier code that works directly with the enum values as a step toward using objects to implement hit points.
- Returns:
- (Temporary) 0-8 index of this enum
-
bezierPointIndexedValue
protected static HitPointType bezierPointIndexedValue(int i)
Return a specific BEZIER_CONTROL_POINT from its 0-8 index. ThrowsIllegalArgumentException
if the given index value isn't valid for the SHAPE_POINT entries.Ideally, this would be replaced by shape code that works directly with the enum values as a step toward using objects to implement hit points.
- Parameters:
i
- (Temporary) 0-8 index of the enum element- Returns:
- Requested enum element
-
-