public class IlvDefaultStepsDefinition extends IlvStepsDefinition
IlvDefaultStepsDefinition
is the default class used
to specify the steps of a scale. It uses the following attributes, which
can be explicitly specified or automatically computed:
Modifier and Type | Field and Description |
---|---|
static int |
COMPLEX_MODE
Type for complex automatic mode.
|
static int |
SIMPLE_MODE
Type for simple automatic mode.
|
Constructor and Description |
---|
IlvDefaultStepsDefinition()
Creates a new
IlvDefaultStepsDefinition that automatically
computes the step and substep units. |
IlvDefaultStepsDefinition(int mode)
Creates a new
IlvDefaultStepsDefinition that automatically
computes the step and substep units with the specified mode. |
Modifier and Type | Method and Description |
---|---|
static void |
adjustRange(IlvDataInterval range)
Adjusts the specified range so that its limits are snapped to unit values.
|
String |
computeLabel(double value)
Computes the label associated to the specified value.
|
protected double |
computeStepUnit()
Invoked to compute the step unit when the automatic mode is enabled.
|
int |
getAutoMode()
Returns the mode for the automatic calculation of the step unit.
|
NumberFormat |
getNumberFormat()
Returns the format used to translate step values into labels.
|
double |
getStepUnit()
Returns the step unit.
|
int |
getSubStepCount()
Returns the number of substeps.
|
double |
getSubStepUnit()
Returns the substep unit.
|
boolean |
hasSubStep()
Indicates whether this object defines substeps.
|
double |
incrementStep(double v)
Returns the next step value.
|
double |
incrementSubStep(double v)
Returns the next substep value.
|
boolean |
isAutoNumberFormat()
Indicates whether the number format is automatically computed.
|
boolean |
isAutoStepUnit()
Indicates whether the step unit is automatically computed.
|
boolean |
isAutoSubStepUnit()
Indicates whether the substep unit is automatically computed.
|
double |
previousStep(double v)
Returns the step value immediately before the specified value.
|
double |
previousSubStep(double v)
Returns the substep value immediately before the specified value.
|
void |
setAutoMode(int mode)
Sets the mode for the automatic calculation of the step unit.
|
void |
setAutoNumberFormat(boolean autoNumberFormat)
Toggles the automatic calculation of the number format.
|
void |
setAutoStepUnit(boolean auto)
Toggles the automatic calculation of the step unit.
|
void |
setAutoSubStepUnit(boolean auto)
Toggles the automatic calculation of the substep unit.
|
void |
setNumberFormat(NumberFormat fmt)
Specifies the format used to translate step values into labels.
|
void |
setStepUnit(double stepUnit)
Specifies the step unit.
|
void |
setSubStepCount(int count)
Sets the number of substeps.
|
void |
setSubStepUnit(double subStepUnit)
Specifies the substep unit.
|
void |
update()
Called before values are computed.
|
getLocale, getScale, getULocale, hasNext, localeChanged, nextStep, nextSubStep
public static final int SIMPLE_MODE
setAutoMode(int)
,
Constant Field Valuespublic static final int COMPLEX_MODE
setAutoMode(int)
,
Constant Field Valuespublic IlvDefaultStepsDefinition()
IlvDefaultStepsDefinition
that automatically
computes the step and substep units.public IlvDefaultStepsDefinition(int mode)
IlvDefaultStepsDefinition
that automatically
computes the step and substep units with the specified mode.setAutoMode(int)
public final boolean isAutoNumberFormat()
setAutoNumberFormat(boolean)
public void setAutoNumberFormat(boolean autoNumberFormat)
true
, the format used
to convert values into string is automatically computed.
Note: The bean property "autoNumberFormat" must not be specified together with the bean property "numberFormat".
public NumberFormat getNumberFormat()
setNumberFormat(java.text.NumberFormat)
public void setNumberFormat(NumberFormat fmt)
Note: setNumberFormat(null)
sets the format to a locale
dependent default format.
Note: The bean property "numberFormat" must not be specified together with the bean property "autoNumberFormat".
setAutoNumberFormat(boolean)
,
getNumberFormat()
public final int getAutoMode()
SIMPLE_MODE
.SIMPLE_MODE
,
COMPLEX_MODE
,
setAutoStepUnit(boolean)
,
setAutoMode(int)
public void setAutoMode(int mode)
SIMPLE_MODE
,
COMPLEX_MODE
,
setAutoStepUnit(boolean)
,
getAutoMode()
public final boolean isAutoStepUnit()
setAutoStepUnit(boolean)
public void setAutoStepUnit(boolean auto)
true
, the step unit is
automatically computed according to the visible range shown by the
scale.
Note: The bean property "autoStepUnit" must not be specified together with the bean property "stepUnit".
isAutoStepUnit()
,
setStepUnit(double)
public final boolean isAutoSubStepUnit()
setAutoSubStepUnit(boolean)
public void setAutoSubStepUnit(boolean auto)
true
, the substep unit is
automatically computed according to the step unit.
Note: The bean property "autoSubStepUnit" must not be specified together with the bean properties "subStepUnit" or "subStepCount".
setSubStepUnit(double)
public final double getStepUnit()
setStepUnit(double)
public void setStepUnit(double stepUnit)
Note: The bean property "stepUnit" must not be specified together with the bean property "autoStepUnit".
isAutoStepUnit()
,
getStepUnit()
public boolean hasSubStep()
true
if the substep unit is strictly greater than 0
.hasSubStep
in class IlvStepsDefinition
public final double getSubStepUnit()
setSubStepUnit(double)
,
setSubStepCount(int)
public void setSubStepUnit(double subStepUnit)
Note: The bean property "subStepUnit" must not be specified together with the bean properties "autoSubStepUnit" or "subStepCount".
isAutoSubStepUnit()
,
getSubStepUnit()
public int getSubStepCount()
setSubStepCount(int)
public void setSubStepCount(int count)
Note: The bean property "subStepCount" must not be specified together with the bean properties "autoSubStepUnit" or "subStepUnit".
public void update()
update
in class IlvStepsDefinition
setAutoStepUnit(boolean)
,
setAutoSubStepUnit(boolean)
protected double computeStepUnit()
setAutoStepUnit(boolean)
public String computeLabel(double value)
setNumberFormat(java.text.NumberFormat)
method.computeLabel
in class IlvStepsDefinition
value
- Numeric coordinate value.public double previousStep(double v)
previousStep
in class IlvStepsDefinition
public double incrementStep(double v)
incrementStep
in class IlvStepsDefinition
public double previousSubStep(double v)
previousSubStep
in class IlvStepsDefinition
IlvStepsDefinition.hasSubStep()
public double incrementSubStep(double v)
incrementSubStep
in class IlvStepsDefinition
IlvStepsDefinition.hasSubStep()
public static void adjustRange(IlvDataInterval range)
SIMPLE_MODE
mode.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.