org.scilab.forge.scirenderer.ruler
Class DefaultRulerModel

java.lang.Object
  extended by org.scilab.forge.scirenderer.ruler.DefaultRulerModel
All Implemented Interfaces:
RulerModel

public final class DefaultRulerModel
extends java.lang.Object
implements RulerModel

Default ruler model.

Author:
Pierre Lando

Field Summary
 
Fields inherited from interface org.scilab.forge.scirenderer.ruler.RulerModel
DEFAULT_AUTO_TICKS_STATUS, DEFAULT_COLOR, DEFAULT_FIRST_POINT, DEFAULT_FIRST_VALUE, DEFAULT_LINE_VISIBLE, DEFAULT_LINE_WIDTH, DEFAULT_LOGARITHMIC_STATUS, DEFAULT_MARGIN, DEFAULT_MINIMAL_SUB_TICKS_DISTANCE, DEFAULT_SECOND_POINT, DEFAULT_SECOND_VALUE, DEFAULT_SPRITE_DISTANCE, DEFAULT_SUB_TICK_LENGTH, DEFAULT_TICK_LENGTH, DEFAULT_TICKS_DIRECTION
 
Constructor Summary
DefaultRulerModel()
          Default constructor.
 
Method Summary
 Color getColor()
          Color getter.
 Vector3d getFirstPoint()
          First point getter.
 double getFirstValue()
          First value getter.
 Graduations getGraduations()
          Return used graduation to draw this ruler.
 double getLineWidth()
          Line width getter.
 double getMargin()
          Return the accepted margin (in pixel) for label drawing.
 double getMinimalSubTicksDistance()
          Minimal accepted sub-ticks distance getter.
 Vector3d getPosition(double value)
          Return the position corresponding to the given value.
 Vector3d getSecondPoint()
          Second point getter.
 double getSecondValue()
          Second value getter.
 int getSpriteDistance()
          Sprite distance getter.
 int getSubTicksLength()
          Sub-ticks length getter.
 Vector3d getTicksDirection()
          Ticks direction getter.
 int getTicksLength()
          Ticks length getter.
 boolean isAutoTicks()
          Auto-ticking getter.
 boolean isLineVisible()
          Line visibility getter.
 boolean isLogarithmic()
          Logarithmic state getter.
 void setAutoTicks(boolean isAutoTicks)
          Auto-ticks parameter setter.
 void setColor(Color color)
          Ruler color setter.
 void setFirstPoint(Vector3d firstPoint)
          First point setter.
 void setFirstValue(double firstValue)
          First value setter.
 void setLineVisible(boolean lineVisible)
          Line visibility setter.
 void setLineWidth(double lineWidth)
          Ruler line width setter
 void setLogarithmic(boolean isLogarithmic)
          Logarithmic or linear setter
 void setMargin(double margin)
          Margin setter.
 void setMinimalSubTicksDistance(double minimalSubTicksDistance)
          Minimal accepted distance between sub-ticks setter.
 void setPoints(Vector3d firstPoint, Vector3d secondPoint)
          Point setter.
 void setSecondPoint(Vector3d secondPoint)
          Second point setter.
 void setSecondValue(double secondValue)
          Second value setter.
 void setSpriteDistance(int spriteDistance)
          Sprite distance setter.
 void setSubTicksLength(int subTicksLength)
          Sub-ticks length setter.
 void setTicksDirection(Vector3d ticksDirection)
          Ticks direction setter.
 void setTicksLength(int ticksLength)
          Ticks length setter.
 void setUserGraduation(Graduations graduations)
          User graduation setter.
 void setValues(double firstValue, double secondValue)
          Set the first and second value in one call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRulerModel

public DefaultRulerModel()
Default constructor.

Method Detail

getFirstValue

public double getFirstValue()
Description copied from interface: RulerModel
First value getter.

Specified by:
getFirstValue in interface RulerModel
Returns:
the first values.

setFirstValue

public void setFirstValue(double firstValue)
First value setter.

Parameters:
firstValue - the new first value.

getSecondValue

public double getSecondValue()
Description copied from interface: RulerModel
Second value getter.

Specified by:
getSecondValue in interface RulerModel
Returns:
the second values.

setSecondValue

public void setSecondValue(double secondValue)
Second value setter.

Parameters:
secondValue - the new second value.

setValues

public void setValues(double firstValue,
                      double secondValue)
Set the first and second value in one call.

Parameters:
firstValue - the first value.
secondValue - the second value.

getFirstPoint

public Vector3d getFirstPoint()
Description copied from interface: RulerModel
First point getter.

Specified by:
getFirstPoint in interface RulerModel
Returns:
the first point.

setFirstPoint

public void setFirstPoint(Vector3d firstPoint)
First point setter.

Parameters:
firstPoint - the new first point.

getSecondPoint

public Vector3d getSecondPoint()
Description copied from interface: RulerModel
Second point getter.

Specified by:
getSecondPoint in interface RulerModel
Returns:
the second point.

setSecondPoint

public void setSecondPoint(Vector3d secondPoint)
Second point setter.

Parameters:
secondPoint - the new second point.

setPoints

public void setPoints(Vector3d firstPoint,
                      Vector3d secondPoint)
Point setter.

Parameters:
firstPoint - the new first point.
secondPoint - the new second point.

getTicksDirection

public Vector3d getTicksDirection()
Description copied from interface: RulerModel
Ticks direction getter.

Specified by:
getTicksDirection in interface RulerModel
Returns:
the ticks direction.

setTicksDirection

public void setTicksDirection(Vector3d ticksDirection)
Ticks direction setter.

Parameters:
ticksDirection - the new ticks direction.

getTicksLength

public int getTicksLength()
Description copied from interface: RulerModel
Ticks length getter.

Specified by:
getTicksLength in interface RulerModel
Returns:
the ticks length in pixel.

setTicksLength

public void setTicksLength(int ticksLength)
Ticks length setter.

Parameters:
ticksLength - the new tick length in pixels.

getSubTicksLength

public int getSubTicksLength()
Description copied from interface: RulerModel
Sub-ticks length getter.

Specified by:
getSubTicksLength in interface RulerModel
Returns:
the sub-ticks length in pixel.

setSubTicksLength

public void setSubTicksLength(int subTicksLength)
Sub-ticks length setter.

Parameters:
subTicksLength - the new sub-tick length in pixels.

getGraduations

public Graduations getGraduations()
Description copied from interface: RulerModel
Return used graduation to draw this ruler.

Specified by:
getGraduations in interface RulerModel
Returns:
the used graduation to draw this ruler.

setUserGraduation

public void setUserGraduation(Graduations graduations)
User graduation setter.

Parameters:
graduations - the new user-defined graduations.

getPosition

public Vector3d getPosition(double value)
Description copied from interface: RulerModel
Return the position corresponding to the given value.

Specified by:
getPosition in interface RulerModel
Parameters:
value - the given value.
Returns:
the position corresponding to the given value.

getMargin

public double getMargin()
Description copied from interface: RulerModel
Return the accepted margin (in pixel) for label drawing.

Specified by:
getMargin in interface RulerModel
Returns:
the accepted margin (in pixel) for label drawing.

setMargin

public void setMargin(double margin)
Margin setter. The margin is minimal distance accepted between ticks labels.

Parameters:
margin - the new margin value.

isLineVisible

public boolean isLineVisible()
Description copied from interface: RulerModel
Line visibility getter.

Specified by:
isLineVisible in interface RulerModel
Returns:
the line visibility status.

setLineVisible

public void setLineVisible(boolean lineVisible)
Line visibility setter.

Parameters:
lineVisible - the new line visibility status.

isAutoTicks

public boolean isAutoTicks()
Description copied from interface: RulerModel
Auto-ticking getter.

Specified by:
isAutoTicks in interface RulerModel
Returns:
the auto-ticking status.

setAutoTicks

public void setAutoTicks(boolean isAutoTicks)
Auto-ticks parameter setter. If it set to false, the user defined graduation will be used.

Parameters:
isAutoTicks - the new auto-ticks status.

isLogarithmic

public boolean isLogarithmic()
Description copied from interface: RulerModel
Logarithmic state getter.

Specified by:
isLogarithmic in interface RulerModel
Returns:
the logarithmic state

setLogarithmic

public void setLogarithmic(boolean isLogarithmic)
Logarithmic or linear setter

Parameters:
isLogarithmic - the new logarithmic status.

getSpriteDistance

public int getSpriteDistance()
Description copied from interface: RulerModel
Sprite distance getter.

Specified by:
getSpriteDistance in interface RulerModel
Returns:
the sprite distance (in pixel) between the ruler line and the sprites edges.

setSpriteDistance

public void setSpriteDistance(int spriteDistance)
Sprite distance setter.

Parameters:
spriteDistance - the new sprite distance to the main ticks in pixel.

getMinimalSubTicksDistance

public double getMinimalSubTicksDistance()
Description copied from interface: RulerModel
Minimal accepted sub-ticks distance getter.

Specified by:
getMinimalSubTicksDistance in interface RulerModel
Returns:
the minimal accepted sub-ticks distance.

setMinimalSubTicksDistance

public void setMinimalSubTicksDistance(double minimalSubTicksDistance)
Minimal accepted distance between sub-ticks setter.

Parameters:
minimalSubTicksDistance - the new minimal accepted distance between sub-ticks.

getColor

public Color getColor()
Description copied from interface: RulerModel
Color getter.

Specified by:
getColor in interface RulerModel
Returns:
the color of ruler line and ticks.

setColor

public void setColor(Color color)
Ruler color setter.

Parameters:
color - the new rule color.

getLineWidth

public double getLineWidth()
Description copied from interface: RulerModel
Line width getter.

Specified by:
getLineWidth in interface RulerModel
Returns:
the line width of ruler line, grid and ticks.

setLineWidth

public void setLineWidth(double lineWidth)
Ruler line width setter

Parameters:
lineWidth - the new line width