Package org.swtchart.internal.axis
Class AxisTickLabels
- java.lang.Object
-
- org.swtchart.internal.axis.AxisTickLabels
-
- All Implemented Interfaces:
java.util.EventListener,org.eclipse.swt.events.PaintListener,org.eclipse.swt.internal.SWTEventListener
public class AxisTickLabels extends java.lang.Object implements org.eclipse.swt.events.PaintListenerAxis tick labels.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAxisTickLabels(Chart chart, Axis axis)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddispose()Disposes the resources.protected org.eclipse.swt.graphics.RectanglegetBounds()Gets the bounds on chart panel.org.eclipse.swt.graphics.FontgetFont()Gets the font.protected org.eclipse.swt.graphics.ColorgetForeground()Gets the foreground color.protected java.text.FormatgetFormat()Gets the format for axis tick label.ChartLayoutDatagetLayoutData()Gets the layout data.intgetLeftMarginHint(int length)Updates the left margin hint.intgetRightMarginHint(int length)Gets the right margin hint.intgetTickLabelMaxLength()Gets the max length of tick label.java.util.ArrayList<java.lang.Integer>getTickLabelPositions()Gets the tick label positions.protected java.util.ArrayList<java.lang.Double>getTickLabelValues()Gets the tick label values.voidpaintControl(org.eclipse.swt.events.PaintEvent e)voidsetBounds(int x, int y, int width, int height)Sets the bounds on chart panel.protected voidsetFont(org.eclipse.swt.graphics.Font font)Sets the font.voidsetForeground(org.eclipse.swt.graphics.Color color)Sets the foreground color.protected voidsetFormat(java.text.Format format)Sets the format for axis tick label.protected voidupdate(int length)Updates the tick labels.protected voidupdateLayoutData()Updates the tick labels layout.
-
-
-
Method Detail
-
setForeground
public void setForeground(org.eclipse.swt.graphics.Color color)
Sets the foreground color.- Parameters:
color- the foreground color
-
getForeground
protected org.eclipse.swt.graphics.Color getForeground()
Gets the foreground color.- Returns:
- the foreground color
-
update
protected void update(int length)
Updates the tick labels.- Parameters:
length- the axis length
-
getRightMarginHint
public int getRightMarginHint(int length)
Gets the right margin hint.- Parameters:
length- the axis length- Returns:
- the right margin hint
-
getLeftMarginHint
public int getLeftMarginHint(int length)
Updates the left margin hint.- Parameters:
length- the axis length- Returns:
- the left margin hint
-
getTickLabelMaxLength
public int getTickLabelMaxLength()
Gets the max length of tick label.- Returns:
- the max length of tick label
-
getTickLabelPositions
public java.util.ArrayList<java.lang.Integer> getTickLabelPositions()
Gets the tick label positions.- Returns:
- the tick label positions
-
getTickLabelValues
protected java.util.ArrayList<java.lang.Double> getTickLabelValues()
Gets the tick label values.- Returns:
- the tick label values
-
setFont
protected void setFont(org.eclipse.swt.graphics.Font font)
Sets the font.- Parameters:
font- the font
-
getFont
public org.eclipse.swt.graphics.Font getFont()
Gets the font.- Returns:
- the font
-
getLayoutData
public ChartLayoutData getLayoutData()
Gets the layout data.- Returns:
- the layout data
-
setBounds
public void setBounds(int x, int y, int width, int height)Sets the bounds on chart panel.- Parameters:
x- the x coordinatey- the y coordinatewidth- the widthheight- the height
-
getBounds
protected org.eclipse.swt.graphics.Rectangle getBounds()
Gets the bounds on chart panel.- Returns:
- the bounds on chart panel
-
dispose
protected void dispose()
Disposes the resources.
-
updateLayoutData
protected void updateLayoutData()
Updates the tick labels layout.
-
paintControl
public void paintControl(org.eclipse.swt.events.PaintEvent e)
- Specified by:
paintControlin interfaceorg.eclipse.swt.events.PaintListener
-
setFormat
protected void setFormat(java.text.Format format)
Sets the format for axis tick label. DecimalFormat and DateFormat should be used for double[] series and Data[] series respectively.If null is set, default format will be used.
- Parameters:
format- the format
-
getFormat
protected java.text.Format getFormat()
Gets the format for axis tick label.- Returns:
- the format
-
-