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.RectangleGets the bounds of axis tick.FontgetFont()Gets the font for tick labels.ColorGets the foreground color of axis tick.Gets the format for axis tick label.intGets the tick label angle.double[]Gets the tick label values.intGets the tick mark step hint in pixels.booleanGets the state indicating if tick marks are visible.voidsetFont(Font font) Sets the font for tick labels.voidsetForeground(Color color) Sets the foreground color of axis tick.voidSets the format for axis tick label.voidsetTickLabelAngle(int angle) Sets the tick label angle.voidsetTickMarkStepHint(int tickMarkStepHint) Sets the tick mark step hint in pixels.voidsetVisible(boolean isVisible) Sets the state indicating if tick marks are visible.protected voidUpdates the tick layout.voidupdateTick(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:IAxisTickSets the foreground color of axis tick.- Specified by:
setForegroundin interfaceIAxisTick- Parameters:
color- the foreground color of axis tick
-
getForeground
public Color getForeground()Description copied from interface:IAxisTickGets the foreground color of axis tick.- Specified by:
getForegroundin interfaceIAxisTick- Returns:
- the foreground color of axis tick
-
setFont
public void setFont(Font font) Description copied from interface:IAxisTickSets the font for tick labels. -
getFont
public Font getFont()Description copied from interface:IAxisTickGets the font for tick labels. -
isVisible
public boolean isVisible()Description copied from interface:IAxisTickGets the state indicating if tick marks are visible. -
setVisible
public void setVisible(boolean isVisible) Description copied from interface:IAxisTickSets the state indicating if tick marks are visible.- Specified by:
setVisiblein interfaceIAxisTick- Parameters:
isVisible- true to make the tick marks visible
-
getTickMarkStepHint
public int getTickMarkStepHint()Description copied from interface:IAxisTickGets the tick mark step hint in pixels.- Specified by:
getTickMarkStepHintin interfaceIAxisTick- Returns:
- the tick mark step hint in pixels
-
setTickMarkStepHint
public void setTickMarkStepHint(int tickMarkStepHint) Description copied from interface:IAxisTickSets the tick mark step hint in pixels.- Specified by:
setTickMarkStepHintin interfaceIAxisTick- Parameters:
tickMarkStepHint- the tick mark step hint with pixels (> IAxisTick.MIN_GRID_STEP_HINT)
-
getTickLabelAngle
public int getTickLabelAngle()Description copied from interface:IAxisTickGets the tick label angle.- Specified by:
getTickLabelAnglein interfaceIAxisTick- Returns:
- the tick label angle in degree
-
setTickLabelAngle
public void setTickLabelAngle(int angle) Description copied from interface:IAxisTickSets the tick label angle.- Specified by:
setTickLabelAnglein 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:IAxisTickSets the format for axis tick label. DecimalFormat and DateFormat should be used for double[] series and Date[] series respectively. -
getFormat
Description copied from interface:IAxisTickGets the format for axis tick label. -
getBounds
public Rectangle getBounds()Description copied from interface:IAxisTickGets 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:IAxisTickGets the tick label values.- Specified by:
getTickLabelValuesin 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.
-