Package org.pepstock.charba.client.enums
Enum DefaultScaleId
- java.lang.Object
-
- java.lang.Enum<DefaultScaleId>
-
- org.pepstock.charba.client.enums.DefaultScaleId
-
- All Implemented Interfaces:
Serializable
,Comparable<DefaultScaleId>
,Key
,PropertyKey
,ScaleId
public enum DefaultScaleId extends Enum<DefaultScaleId> implements ScaleId
Enumerates the default scale id.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_X_FOR_BAR_AND_LINE_OPTIONS
Default scale id for X scale defined in the chart defaults forChartType.BAR
andChartType.LINE
.static String
DEFAULT_Y_FOR_BAR_AND_LINE_OPTIONS
Default scale id for Y scale defined in the chart defaults forChartType.BAR
andChartType.LINE
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AxisKind
getAxisKind()
Returns the default axis kind for this default scale id.static AxisKind
getAxisKindByScaleId(String scaleId, AxisKind defaultValue)
Returns the axis kind inferring from the first character of the scale id which should be 'x', 'y' or 'r'.static AxisKind
getAxisKindByScaleId(Key scaleId, AxisKind defaultValue)
Returns the axis kind inferring from the first character of the scale id which should be 'x', 'y' or 'r'.static ScaleId
getByAxisKind(AxisKind kind, ScaleId defaultValue)
Returns the default scale id instance by axis kind, otherwise will returnnull
if not found.boolean
is(String scaleId)
Returnstrue
if the scale id is related to this axis id.boolean
is(ScaleId scaleId)
Returnstrue
if the scale id is related to this axis id.String
value()
Returns the name value of propertystatic DefaultScaleId
valueOf(String name)
Returns the enum constant of this type with the specified name.static DefaultScaleId[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
X
public static final DefaultScaleId X
Default scale id for X cartesian axis.
-
Y
public static final DefaultScaleId Y
Default scale id for Y cartesian axis.
-
R
public static final DefaultScaleId R
Default scale id for radial linear axis.
-
UNKNOWN
public static final DefaultScaleId UNKNOWN
Default scale id for chart with a single axis.
-
-
Field Detail
-
DEFAULT_X_FOR_BAR_AND_LINE_OPTIONS
public static final String DEFAULT_X_FOR_BAR_AND_LINE_OPTIONS
Default scale id for X scale defined in the chart defaults forChartType.BAR
andChartType.LINE
.- See Also:
- Constant Field Values
-
DEFAULT_Y_FOR_BAR_AND_LINE_OPTIONS
public static final String DEFAULT_Y_FOR_BAR_AND_LINE_OPTIONS
Default scale id for Y scale defined in the chart defaults forChartType.BAR
andChartType.LINE
.- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static DefaultScaleId[] 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 (DefaultScaleId c : DefaultScaleId.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DefaultScaleId valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
value
public String value()
Description copied from interface:Key
Returns the name value of property
-
getAxisKind
public AxisKind getAxisKind()
Description copied from interface:ScaleId
Returns the default axis kind for this default scale id.- Specified by:
getAxisKind
in interfaceScaleId
- Returns:
- the default axis kind for this default scale id
-
is
public boolean is(String scaleId)
Returnstrue
if the scale id is related to this axis id.- Parameters:
scaleId
- scale id to be checked- Returns:
true
if the scale id is related to this axis id
-
is
public boolean is(ScaleId scaleId)
Returnstrue
if the scale id is related to this axis id.- Parameters:
scaleId
- scale id to be checked- Returns:
true
if the scale id is related to this axis id
-
getByAxisKind
public static ScaleId getByAxisKind(AxisKind kind, ScaleId defaultValue)
Returns the default scale id instance by axis kind, otherwise will returnnull
if not found.- Parameters:
kind
- axis kind to use to get the related default scale iddefaultValue
- default axis id to use if it's not matching- Returns:
- the default scale id instance, otherwise will return
null
if not found
-
getAxisKindByScaleId
public static AxisKind getAxisKindByScaleId(Key scaleId, AxisKind defaultValue)
Returns the axis kind inferring from the first character of the scale id which should be 'x', 'y' or 'r'.- Parameters:
scaleId
- scale iddefaultValue
- default value for axis kind when it can not be recognized by scale id- Returns:
- the axis kind inferring from the first character of the scale id which should be 'x', 'y' or 'r'
-
getAxisKindByScaleId
public static AxisKind getAxisKindByScaleId(String scaleId, AxisKind defaultValue)
Returns the axis kind inferring from the first character of the scale id which should be 'x', 'y' or 'r'.- Parameters:
scaleId
- scale iddefaultValue
- default value for axis kind when it can not be recognized by scale id- Returns:
- the axis kind inferring from the first character of the scale id which should be 'x' or 'y'
-
-