RulerModelpublic 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 | Description |
|---|---|
DefaultRulerModel() |
Default constructor.
|
| Modifier and Type | Method | 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.
|
int |
getSubticksNumber() |
Number of subticks.
|
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 |
setSubticksNumber(int N) |
Set number of subticks.
|
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()
RulerModelgetFirstValue in interface RulerModelpublic void setFirstValue(double firstValue)
firstValue - the new first value.public double getSecondValue()
RulerModelgetSecondValue in interface RulerModelpublic 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()
RulerModelgetFirstPoint in interface RulerModelpublic void setFirstPoint(Vector3d firstPoint)
firstPoint - the new first point.public Vector3d getSecondPoint()
RulerModelgetSecondPoint in interface RulerModelpublic 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()
RulerModelgetTicksDirection in interface RulerModelpublic void setTicksDirection(Vector3d ticksDirection)
ticksDirection - the new ticks direction.public int getTicksLength()
RulerModelgetTicksLength in interface RulerModelpublic void setTicksLength(int ticksLength)
ticksLength - the new tick length in pixels.public int getSubTicksLength()
RulerModelgetSubTicksLength in interface RulerModelpublic void setSubTicksLength(int subTicksLength)
subTicksLength - the new sub-tick length in pixels.public Graduations getGraduations()
RulerModelgetGraduations in interface RulerModelpublic void setUserGraduation(Graduations graduations)
graduations - the new user-defined graduations.public Vector3d getPosition(double value)
RulerModelgetPosition in interface RulerModelvalue - the given value.public double getMargin()
RulerModelgetMargin in interface RulerModelpublic void setMargin(double margin)
margin - the new margin value.public boolean isLineVisible()
RulerModelisLineVisible in interface RulerModelpublic void setLineVisible(boolean lineVisible)
lineVisible - the new line visibility status.public boolean isAutoTicks()
RulerModelisAutoTicks in interface RulerModelpublic void setAutoTicks(boolean isAutoTicks)
false, the user defined graduation will be used.isAutoTicks - the new auto-ticks status.public boolean isLogarithmic()
RulerModelisLogarithmic in interface RulerModelpublic void setLogarithmic(boolean isLogarithmic)
isLogarithmic - the new logarithmic status.public int getSpriteDistance()
RulerModelgetSpriteDistance in interface RulerModelpublic void setSpriteDistance(int spriteDistance)
spriteDistance - the new sprite distance to the main ticks in pixel.public double getMinimalSubTicksDistance()
RulerModelgetMinimalSubTicksDistance in interface RulerModelpublic void setMinimalSubTicksDistance(double minimalSubTicksDistance)
minimalSubTicksDistance - the new minimal accepted distance between sub-ticks.public Color getColor()
RulerModelgetColor in interface RulerModelpublic void setColor(Color color)
color - the new rule color.public double getLineWidth()
RulerModelgetLineWidth in interface RulerModelpublic void setLineWidth(double lineWidth)
lineWidth - the new line widthpublic int getSubticksNumber()
RulerModelgetSubticksNumber in interface RulerModelpublic void setSubticksNumber(int N)
N - the number of subticks or -1 if the computation is automatic.