facets.util.geom
Class AnglePolicy

java.lang.Object
  extended by facets.util.Tracer
      extended by facets.util.NumberPolicy
          extended by facets.util.NumberPolicy.Ticked
              extended by facets.util.geom.AnglePolicy

public class AnglePolicy
extends NumberPolicy.Ticked

Validation and display of angle values.

AnglePolicy supplies policy for angle values on a tick-based scale that can offer either full-range or local adjustment.


Nested Class Summary
 
Nested classes/interfaces inherited from class facets.util.NumberPolicy
NumberPolicy.Ticked, NumberPolicy.ValueVariable
 
Field Summary
 
Fields inherited from class facets.util.NumberPolicy.Ticked
LABEL_TICKS_DEFAULT, SNAP_LABELS, SNAP_NONE, SNAP_TICKS, 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
AnglePolicy()
          Unique public constructor.
 
Method Summary
 boolean canCycle()
          Re-implementation to return true.
 int format()
          Hint on formatting the number.
 java.lang.String[] incrementTitles()
          Human-readable description of increment directions.
 int labelSpacing()
          The number of ticks between each label.
 NumberPolicy.Ticked localTicks()
          Returns a local adjustment policy with a 60 range and its snap type coupled to that of its parent.
protected  boolean reverseIncrements()
          Reverses the normal increment direction.
 int snapType()
          Defines the snap-to-ticks contentStyle.
 int tickSpacing()
          The spacing between each tick, in the value returned by NumberPolicy.unit().
 
Methods inherited from class facets.util.NumberPolicy.Ticked
range, toString, unitJump, validValue
 
Methods inherited from class facets.util.NumberPolicy
columns, debug, max, min, 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
 

Constructor Detail

AnglePolicy

public AnglePolicy()
Unique public constructor.

Constructs a full-range policy displaying -180 to +180 degrees.

Method Detail

canCycle

public final boolean canCycle()
Re-implementation to return true.

Overrides:
canCycle in class NumberPolicy

format

public final int format()
Description copied from class: NumberPolicy
Hint on formatting the number.

These are defined by the class FORMAT_x constants, which are mutually exclusive.

For FORMAT_PLACES_x constants the format should normally be consistent with unit.

Overrides:
format in class NumberPolicy

incrementTitles

public java.lang.String[] incrementTitles()
Description copied from class: NumberPolicy
Human-readable description of increment directions.

Overrides:
incrementTitles in class NumberPolicy

labelSpacing

public int labelSpacing()
Description copied from class: NumberPolicy.Ticked
The number of ticks between each label.

Overrides:
labelSpacing in class NumberPolicy.Ticked

localTicks

public NumberPolicy.Ticked localTicks()
Returns a local adjustment policy with a 60 range and its snap type coupled to that of its parent.

Overrides:
localTicks in class NumberPolicy.Ticked
See Also:
NumberPolicy.Ticked.labelSpacing()

snapType

public int snapType()
Description copied from class: NumberPolicy.Ticked
Defines the snap-to-ticks contentStyle.

The value returned should be one of

Overrides:
snapType in class NumberPolicy.Ticked

tickSpacing

public int tickSpacing()
Description copied from class: NumberPolicy.Ticked
The spacing between each tick, in the value returned by NumberPolicy.unit().

Overrides:
tickSpacing in class NumberPolicy.Ticked

reverseIncrements

protected final boolean reverseIncrements()
Description copied from class: NumberPolicy
Reverses the normal increment direction.

Used by validIncrement, default is false.

Overrides:
reverseIncrements in class NumberPolicy