Class LinearScaleTicks2
java.lang.Object
org.eclipse.nebula.visualization.xygraph.linearscale.LinearScaleTicks2
- All Implemented Interfaces:
ITicksProvider
public class LinearScaleTicks2 extends java.lang.Object implements ITicksProvider
Class to represent a major tick for axes with scientific notation.
This tick provider is used if a
DAxis
is created.-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<java.lang.Integer>
minorPositions
the array of minor tick positions in pixelsstatic java.lang.String
NAME
The name of this tick providerprotected IScaleProvider
scale
the scaleprotected java.util.List<Tick>
ticks
the list of ticks marks -
Constructor Summary
Constructors Constructor Description LinearScaleTicks2(DAxis scale)
constructor -
Method Summary
Modifier and Type Method Description java.lang.String
getDefaultFormatPattern(double min, double max)
int
getHeadMargin()
java.lang.String
getLabel(int index)
int
getLabelPosition(int index)
java.util.List<java.lang.String>
getLabels()
int
getMajorCount()
int
getMaxHeight()
int
getMaxWidth()
int
getMinorCount()
int
getMinorPosition(int index)
int
getPosition(int index)
java.util.List<java.lang.Integer>
getPositions()
Gets the tick positions.int
getTailMargin()
double
getValue(int index)
java.util.List<java.lang.Boolean>
getVisibilities()
boolean
isShowMaxLabel()
Shows the maximum value of the range as a labelboolean
isShowMinLabel()
Shows the minimum value of the range as a labelboolean
isVisible(int index)
void
setShowMaxLabel(boolean showMaxLabel)
sets the visibility of the maximum labelvoid
setShowMinLabel(boolean showMinLabel)
Sets the visibility of the minimum labelvoid
setTicksIndexBased(boolean isTicksIndexBased)
Range
update(double min, double max, int length)
Update ticks.
-
Field Details
-
NAME
public static final java.lang.String NAMEThe name of this tick provider- See Also:
- Constant Field Values
-
ticks
the list of ticks marks -
minorPositions
protected java.util.ArrayList<java.lang.Integer> minorPositionsthe array of minor tick positions in pixels -
scale
the scale
-
-
Constructor Details
-
LinearScaleTicks2
constructor- Parameters:
scale
-
-
-
Method Details
-
getPositions
public java.util.List<java.lang.Integer> getPositions()Description copied from interface:ITicksProvider
Gets the tick positions.- Specified by:
getPositions
in interfaceITicksProvider
- Returns:
- the tick positions
-
getVisibilities
public java.util.List<java.lang.Boolean> getVisibilities()- Specified by:
getVisibilities
in interfaceITicksProvider
- Returns:
- the tick visibilities
-
getLabels
public java.util.List<java.lang.String> getLabels()- Specified by:
getLabels
in interfaceITicksProvider
- Returns:
- the tick labels
-
getPosition
public int getPosition(int index)- Specified by:
getPosition
in interfaceITicksProvider
- Returns:
- tick position
-
getLabelPosition
public int getLabelPosition(int index)- Specified by:
getLabelPosition
in interfaceITicksProvider
- Returns:
- label position
-
getValue
public double getValue(int index)- Specified by:
getValue
in interfaceITicksProvider
- Returns:
- tick value
-
getLabel
public java.lang.String getLabel(int index)- Specified by:
getLabel
in interfaceITicksProvider
- Returns:
- tick label
-
isVisible
public boolean isVisible(int index)- Specified by:
isVisible
in interfaceITicksProvider
- Returns:
- true if tick is visible
-
getMajorCount
public int getMajorCount()- Specified by:
getMajorCount
in interfaceITicksProvider
- Returns:
- number of major ticks
-
getMinorCount
public int getMinorCount()- Specified by:
getMinorCount
in interfaceITicksProvider
- Returns:
- number of minor ticks
-
getMinorPosition
public int getMinorPosition(int index)- Specified by:
getMinorPosition
in interfaceITicksProvider
- Returns:
- minor tick position
-
getMaxWidth
public int getMaxWidth()- Specified by:
getMaxWidth
in interfaceITicksProvider
- Returns:
- maximum width in pixels of tick labels
-
getMaxHeight
public int getMaxHeight()- Specified by:
getMaxHeight
in interfaceITicksProvider
- Returns:
- maximum height in pixels of tick labels
-
isShowMaxLabel
public boolean isShowMaxLabel()Description copied from interface:ITicksProvider
Shows the maximum value of the range as a label- Specified by:
isShowMaxLabel
in interfaceITicksProvider
- Returns:
- true (default) if shown
-
setShowMaxLabel
public void setShowMaxLabel(boolean showMaxLabel)Description copied from interface:ITicksProvider
sets the visibility of the maximum label- Specified by:
setShowMaxLabel
in interfaceITicksProvider
-
isShowMinLabel
public boolean isShowMinLabel()Description copied from interface:ITicksProvider
Shows the minimum value of the range as a label- Specified by:
isShowMinLabel
in interfaceITicksProvider
- Returns:
- true (default) if shown
-
setShowMinLabel
public void setShowMinLabel(boolean showMinLabel)Description copied from interface:ITicksProvider
Sets the visibility of the minimum label- Specified by:
setShowMinLabel
in interfaceITicksProvider
-
update
Description copied from interface:ITicksProvider
Update ticks.- Specified by:
update
in interfaceITicksProvider
- Returns:
- null unless the provider has not had cause to change the range - in which case, the new range is returned.
-
getDefaultFormatPattern
public java.lang.String getDefaultFormatPattern(double min, double max)- Specified by:
getDefaultFormatPattern
in interfaceITicksProvider
- Returns:
- default format pattern for labels
-
getHeadMargin
public int getHeadMargin()- Specified by:
getHeadMargin
in interfaceITicksProvider
- Returns:
- margin in pixel between edge of client area and head of axis line
-
getTailMargin
public int getTailMargin()- Specified by:
getTailMargin
in interfaceITicksProvider
- Returns:
- margin in pixel between edge of client area and tail of axis line
-
setTicksIndexBased
public void setTicksIndexBased(boolean isTicksIndexBased)- Parameters:
isTicksIndexBased
- if true, make ticks based on axis dataset indexes
-