Package org.swtchart.internal.axis
Class AxisTick
java.lang.Object
org.swtchart.internal.axis.AxisTick
- All Implemented Interfaces:
IAxisTick
An axis tick.
-
Field Summary
Fields inherited from interface org.swtchart.IAxisTick
MIN_GRID_STEP_HINT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the axis tick labels.Gets the axis tick marks.Rectangle
Gets the bounds of axis tick.Font
getFont()
Gets the font for tick labels.Color
Gets the foreground color of axis tick.Gets the format for axis tick label.int
Gets the tick label angle.double[]
Gets the tick label values.int
Gets the tick mark step hint in pixels.boolean
Gets the state indicating if tick marks are visible.void
setFont
(Font font) Sets the font for tick labels.void
setForeground
(Color color) Sets the foreground color of axis tick.void
Sets the format for axis tick label.void
setTickLabelAngle
(int angle) Sets the tick label angle.void
setTickMarkStepHint
(int tickMarkStepHint) Sets the tick mark step hint in pixels.void
setVisible
(boolean isVisible) Sets the state indicating if tick marks are visible.protected void
Updates the tick layout.void
updateTick
(int length) Updates the tick around per 64 pixel.
-
Constructor Details
-
AxisTick
Constructor.- Parameters:
chart
- the chartaxis
- the axis
-
-
Method Details
-
getAxisTickMarks
Gets the axis tick marks.- Returns:
- the axis tick marks
-
getAxisTickLabels
Gets the axis tick labels.- Returns:
- the axis tick labels
-
setForeground
public void setForeground(Color color) Description copied from interface:IAxisTick
Sets the foreground color of axis tick.- Specified by:
setForeground
in interfaceIAxisTick
- Parameters:
color
- the foreground color of axis tick
-
getForeground
public Color getForeground()Description copied from interface:IAxisTick
Gets the foreground color of axis tick.- Specified by:
getForeground
in interfaceIAxisTick
- Returns:
- the foreground color of axis tick
-
setFont
public void setFont(Font font) Description copied from interface:IAxisTick
Sets the font for tick labels. -
getFont
public Font getFont()Description copied from interface:IAxisTick
Gets the font for tick labels. -
isVisible
public boolean isVisible()Description copied from interface:IAxisTick
Gets the state indicating if tick marks are visible. -
setVisible
public void setVisible(boolean isVisible) Description copied from interface:IAxisTick
Sets the state indicating if tick marks are visible.- Specified by:
setVisible
in interfaceIAxisTick
- Parameters:
isVisible
- true to make the tick marks visible
-
getTickMarkStepHint
public int getTickMarkStepHint()Description copied from interface:IAxisTick
Gets the tick mark step hint in pixels.- Specified by:
getTickMarkStepHint
in interfaceIAxisTick
- Returns:
- the tick mark step hint in pixels
-
setTickMarkStepHint
public void setTickMarkStepHint(int tickMarkStepHint) Description copied from interface:IAxisTick
Sets the tick mark step hint in pixels.- Specified by:
setTickMarkStepHint
in interfaceIAxisTick
- Parameters:
tickMarkStepHint
- the tick mark step hint with pixels (> IAxisTick.MIN_GRID_STEP_HINT)
-
getTickLabelAngle
public int getTickLabelAngle()Description copied from interface:IAxisTick
Gets the tick label angle.- Specified by:
getTickLabelAngle
in interfaceIAxisTick
- Returns:
- the tick label angle in degree
-
setTickLabelAngle
public void setTickLabelAngle(int angle) Description copied from interface:IAxisTick
Sets the tick label angle.- Specified by:
setTickLabelAngle
in interfaceIAxisTick
- Parameters:
angle
- the angle in degree between 0 and 90. The default value is 0. If setting 0, tick labels are horizontally shown. If setting 90, tick labels are vertically shown.
-
setFormat
Description copied from interface:IAxisTick
Sets the format for axis tick label. DecimalFormat and DateFormat should be used for double[] series and Date[] series respectively. -
getFormat
Description copied from interface:IAxisTick
Gets the format for axis tick label. -
getBounds
public Rectangle getBounds()Description copied from interface:IAxisTick
Gets the bounds of axis tick.This method is typically used for mouse listener to check whether mouse cursor is on axis tick. Mouse listener can be added to Chart.
-
getTickLabelValues
public double[] getTickLabelValues()Description copied from interface:IAxisTick
Gets the tick label values.- Specified by:
getTickLabelValues
in interfaceIAxisTick
- Returns:
- the tick label values
-
updateTick
public void updateTick(int length) Updates the tick around per 64 pixel.- Parameters:
length
- the axis length
-
updateLayoutData
protected void updateLayoutData()Updates the tick layout.
-