|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfacets.util.Tracer
facets.util.NumberPolicy
facets.util.NumberPolicy.Ticked
public static class NumberPolicy.Ticked
Validation and tick-based display of numbers.
NumberPolicy.Ticked
supplies validation and display policy for
numbers displayed on a scale such as that of a slider.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class facets.util.NumberPolicy |
---|
NumberPolicy.Ticked, NumberPolicy.ValueVariable |
Field Summary | |
---|---|
static int |
LABEL_TICKS_DEFAULT
|
static int |
SNAP_LABELS
|
static int |
SNAP_NONE
|
static int |
SNAP_TICKS
|
static int |
TICKS_DEFAULT
|
Fields inherited from class facets.util.NumberPolicy |
---|
COLUMNS_DEFAULT, debug, FORMAT_DECIMALS_0, FORMAT_DECIMALS_1, FORMAT_DECIMALS_2, FORMAT_DECIMALS_3, FORMAT_DECIMALS_4, FORMAT_HEX, MAX_VALUE, MIN_VALUE, UNIT_JUMP_DEFAULT |
Constructor Summary | |
---|---|
NumberPolicy.Ticked()
Convenience constructor for a scale that dynamically defines its constraints. |
|
NumberPolicy.Ticked(double range)
Convenience constructor for a tick-based policy with local adjstment and infinite range. |
|
NumberPolicy.Ticked(double min,
double max)
Convenience constructor for a full-range tick scale. |
|
NumberPolicy.Ticked(double min,
double max,
double range)
Construct a tick-based policy that can optionally display the current value within a local adjustment range. |
Method Summary | |
---|---|
int |
labelSpacing()
The number of ticks between each label. |
NumberPolicy.Ticked |
localTicks()
Returns the policy to be used for local adjustment. |
double |
range()
The range of possible values. |
int |
snapType()
Defines the snap-to-ticks contentStyle. |
int |
tickSpacing()
The spacing between each tick, in the value returned by NumberPolicy.unit() . |
java.lang.String |
toString()
|
protected double |
unitJump()
Returns the multiple of unit defining the current minimum
valid value change, based on the current snap policy. |
double |
validValue(double existing,
double proposed)
Returns the nearest valid value to proposed . |
Methods inherited from class facets.util.NumberPolicy |
---|
canCycle, columns, debug, format, incrementTitles, max, min, reverseIncrements, unit, validIncrement |
Methods inherited from class facets.util.Tracer |
---|
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutput, traceOutputWithClass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SNAP_NONE
public static final int SNAP_TICKS
public static final int SNAP_LABELS
public static int TICKS_DEFAULT
public static int LABEL_TICKS_DEFAULT
Constructor Detail |
---|
public NumberPolicy.Ticked(double range)
public NumberPolicy.Ticked(double min, double max)
public NumberPolicy.Ticked(double min, double max, double range)
The policy is constructed from min
to max
as for its
superclass. If range
is other than NaN
, values
will be displayed within this adjustment range, which will centre on
the current value unless constrained by min
to max
.
public NumberPolicy.Ticked()
Method Detail |
---|
public double validValue(double existing, double proposed)
NumberPolicy
proposed
.
Though not used in the basic implementation, specifying existing
as a parameter allows for non-linear validation in subclasses.
validValue
in class NumberPolicy
public int labelSpacing()
public NumberPolicy.Ticked localTicks()
The default is to return the NumberPolicy.Ticked
itself; this can be
overridden to return a policy for local adjustment where the NumberPolicy.Ticked
is full-range but local adjustment is also required.
public double range()
Set immutably during construction but only accessed via this method, enabling subclasses to define it dynamically by overriding.
public int snapType()
The value returned should be one of
public int tickSpacing()
NumberPolicy.unit()
.
protected final double unitJump()
unit
defining the current minimum
valid value change, based on the current snap policy.
The value returned is determined by the values of snapType
and tickSpacing
.
unitJump
in class NumberPolicy
public java.lang.String toString()
toString
in class NumberPolicy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |