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 StringDEFAULT_X_FOR_BAR_AND_LINE_OPTIONSDefault scale id for X scale defined in the chart defaults forChartType.BARandChartType.LINE.static StringDEFAULT_Y_FOR_BAR_AND_LINE_OPTIONSDefault scale id for Y scale defined in the chart defaults forChartType.BARandChartType.LINE.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AxisKindgetAxisKind()Returns the default axis kind for this default scale id.static AxisKindgetAxisKindByScaleId(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 AxisKindgetAxisKindByScaleId(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 ScaleIdgetByAxisKind(AxisKind kind, ScaleId defaultValue)Returns the default scale id instance by axis kind, otherwise will returnnullif not found.booleanis(String scaleId)Returnstrueif the scale id is related to this axis id.booleanis(ScaleId scaleId)Returnstrueif the scale id is related to this axis id.Stringvalue()Returns the name value of propertystatic DefaultScaleIdvalueOf(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.BARandChartType.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.BARandChartType.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:KeyReturns the name value of property
-
getAxisKind
public AxisKind getAxisKind()
Description copied from interface:ScaleIdReturns the default axis kind for this default scale id.- Specified by:
getAxisKindin interfaceScaleId- Returns:
- the default axis kind for this default scale id
-
is
public boolean is(String scaleId)
Returnstrueif the scale id is related to this axis id.- Parameters:
scaleId- scale id to be checked- Returns:
trueif the scale id is related to this axis id
-
is
public boolean is(ScaleId scaleId)
Returnstrueif the scale id is related to this axis id.- Parameters:
scaleId- scale id to be checked- Returns:
trueif 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 returnnullif 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
nullif 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'
-
-