public final class DefaultRulerModel extends java.lang.Object implements 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 and Description |
---|
DefaultRulerModel()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public double getFirstValue()
RulerModel
getFirstValue
in interface RulerModel
public void setFirstValue(double firstValue)
firstValue
- the new first value.public double getSecondValue()
RulerModel
getSecondValue
in interface RulerModel
public void setSecondValue(double secondValue)
secondValue
- the new second value.public void setValues(double firstValue, double secondValue)
firstValue
- the first value.secondValue
- the second value.public Vector3d getFirstPoint()
RulerModel
getFirstPoint
in interface RulerModel
public void setFirstPoint(Vector3d firstPoint)
firstPoint
- the new first point.public Vector3d getSecondPoint()
RulerModel
getSecondPoint
in interface RulerModel
public void setSecondPoint(Vector3d secondPoint)
secondPoint
- the new second point.public void setPoints(Vector3d firstPoint, Vector3d secondPoint)
firstPoint
- the new first point.secondPoint
- the new second point.public Vector3d getTicksDirection()
RulerModel
getTicksDirection
in interface RulerModel
public void setTicksDirection(Vector3d ticksDirection)
ticksDirection
- the new ticks direction.public int getTicksLength()
RulerModel
getTicksLength
in interface RulerModel
public void setTicksLength(int ticksLength)
ticksLength
- the new tick length in pixels.public int getSubTicksLength()
RulerModel
getSubTicksLength
in interface RulerModel
public void setSubTicksLength(int subTicksLength)
subTicksLength
- the new sub-tick length in pixels.public Graduations getGraduations()
RulerModel
getGraduations
in interface RulerModel
public void setUserGraduation(Graduations graduations)
graduations
- the new user-defined graduations.public Vector3d getPosition(double value)
RulerModel
getPosition
in interface RulerModel
value
- the given value.public double getMargin()
RulerModel
getMargin
in interface RulerModel
public void setMargin(double margin)
margin
- the new margin value.public boolean isLineVisible()
RulerModel
isLineVisible
in interface RulerModel
public void setLineVisible(boolean lineVisible)
lineVisible
- the new line visibility status.public boolean isAutoTicks()
RulerModel
isAutoTicks
in interface RulerModel
public void setAutoTicks(boolean isAutoTicks)
false
, the user defined graduation will be used.isAutoTicks
- the new auto-ticks status.public boolean isLogarithmic()
RulerModel
isLogarithmic
in interface RulerModel
public void setLogarithmic(boolean isLogarithmic)
isLogarithmic
- the new logarithmic status.public int getSpriteDistance()
RulerModel
getSpriteDistance
in interface RulerModel
public void setSpriteDistance(int spriteDistance)
spriteDistance
- the new sprite distance to the main ticks in pixel.public double getMinimalSubTicksDistance()
RulerModel
getMinimalSubTicksDistance
in interface RulerModel
public void setMinimalSubTicksDistance(double minimalSubTicksDistance)
minimalSubTicksDistance
- the new minimal accepted distance between sub-ticks.public Color getColor()
RulerModel
getColor
in interface RulerModel
public void setColor(Color color)
color
- the new rule color.public double getLineWidth()
RulerModel
getLineWidth
in interface RulerModel
public void setLineWidth(double lineWidth)
lineWidth
- the new line width