Class DefaultRulerModel
- java.lang.Object
-
- 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
Constructors Constructor Description DefaultRulerModel()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetColor()Color getter.Vector3dgetFirstPoint()First point getter.doublegetFirstValue()First value getter.GraduationsgetGraduations()Return used graduation to draw this ruler.doublegetLineWidth()Line width getter.doublegetMargin()Return the accepted margin (in pixel) for label drawing.doublegetMinimalSubTicksDistance()Minimal accepted sub-ticks distance getter.Vector3dgetPosition(double value)Return the position corresponding to the given value.Vector3dgetSecondPoint()Second point getter.doublegetSecondValue()Second value getter.intgetSpriteDistance()Sprite distance getter.intgetSubTicksLength()Sub-ticks length getter.intgetSubticksNumber()Number of subticks.Vector3dgetTicksDirection()Ticks direction getter.intgetTicksLength()Ticks length getter.booleanisAutoTicks()Auto-ticking getter.booleanisLineVisible()Line visibility getter.booleanisLogarithmic()Logarithmic state getter.voidsetAutoTicks(boolean isAutoTicks)Auto-ticks parameter setter.voidsetColor(Color color)Ruler color setter.voidsetFirstPoint(Vector3d firstPoint)First point setter.voidsetFirstValue(double firstValue)First value setter.voidsetLineVisible(boolean lineVisible)Line visibility setter.voidsetLineWidth(double lineWidth)Ruler line width settervoidsetLogarithmic(boolean isLogarithmic)Logarithmic or linear settervoidsetMargin(double margin)Margin setter.voidsetMinimalSubTicksDistance(double minimalSubTicksDistance)Minimal accepted distance between sub-ticks setter.voidsetPoints(Vector3d firstPoint, Vector3d secondPoint)Point setter.voidsetSecondPoint(Vector3d secondPoint)Second point setter.voidsetSecondValue(double secondValue)Second value setter.voidsetSpriteDistance(int spriteDistance)Sprite distance setter.voidsetSubTicksLength(int subTicksLength)Sub-ticks length setter.voidsetSubticksNumber(int N)Set number of subticks.voidsetTicksDirection(Vector3d ticksDirection)Ticks direction setter.voidsetTicksLength(int ticksLength)Ticks length setter.voidsetUserGraduation(Graduations graduations)User graduation setter.voidsetValues(double firstValue, double secondValue)Set the first and second value in one call.
-
-
-
Method Detail
-
getFirstValue
public double getFirstValue()
Description copied from interface:RulerModelFirst value getter.- Specified by:
getFirstValuein interfaceRulerModel- 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:RulerModelSecond value getter.- Specified by:
getSecondValuein interfaceRulerModel- 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:RulerModelFirst point getter.- Specified by:
getFirstPointin interfaceRulerModel- 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:RulerModelSecond point getter.- Specified by:
getSecondPointin interfaceRulerModel- 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:RulerModelTicks direction getter.- Specified by:
getTicksDirectionin interfaceRulerModel- 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:RulerModelTicks length getter.- Specified by:
getTicksLengthin interfaceRulerModel- 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:RulerModelSub-ticks length getter.- Specified by:
getSubTicksLengthin interfaceRulerModel- 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:RulerModelReturn used graduation to draw this ruler.- Specified by:
getGraduationsin interfaceRulerModel- 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:RulerModelReturn the position corresponding to the given value.- Specified by:
getPositionin interfaceRulerModel- Parameters:
value- the given value.- Returns:
- the position corresponding to the given value.
-
getMargin
public double getMargin()
Description copied from interface:RulerModelReturn the accepted margin (in pixel) for label drawing.- Specified by:
getMarginin interfaceRulerModel- 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:RulerModelLine visibility getter.- Specified by:
isLineVisiblein interfaceRulerModel- 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:RulerModelAuto-ticking getter.- Specified by:
isAutoTicksin interfaceRulerModel- Returns:
- the auto-ticking status.
-
setAutoTicks
public void setAutoTicks(boolean isAutoTicks)
Auto-ticks parameter setter. If it set tofalse, the user defined graduation will be used.- Parameters:
isAutoTicks- the new auto-ticks status.
-
isLogarithmic
public boolean isLogarithmic()
Description copied from interface:RulerModelLogarithmic state getter.- Specified by:
isLogarithmicin interfaceRulerModel- 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:RulerModelSprite distance getter.- Specified by:
getSpriteDistancein interfaceRulerModel- 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:RulerModelMinimal accepted sub-ticks distance getter.- Specified by:
getMinimalSubTicksDistancein interfaceRulerModel- 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:RulerModelColor getter.- Specified by:
getColorin interfaceRulerModel- 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:RulerModelLine width getter.- Specified by:
getLineWidthin interfaceRulerModel- 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
-
getSubticksNumber
public int getSubticksNumber()
Description copied from interface:RulerModelNumber of subticks.- Specified by:
getSubticksNumberin interfaceRulerModel- Returns:
- the number of subticks or -1 if the computation is automatic.
-
setSubticksNumber
public void setSubticksNumber(int N)
Set number of subticks.- Parameters:
N- the number of subticks or -1 if the computation is automatic.
-
-