public class AxisTickMarks
extends java.lang.Object
implements org.eclipse.swt.events.PaintListener
Modifier and Type | Field and Description |
---|---|
private Axis |
axis
the axis
|
private org.eclipse.swt.graphics.Rectangle |
bounds
the bounds of tick marks area
|
private Chart |
chart
the chart
|
private static int |
DEFAULT_FOREGROUND
the default foreground
|
private org.eclipse.swt.graphics.Color |
foreground
the foreground color
|
private int |
heightHint
the height hint of tick marks area
|
protected static int |
LINE_WIDTH
the line width
|
static int |
TICK_LENGTH
the tick length
|
private int |
widthHint
the width hint of tick marks area
|
Constructor and Description |
---|
AxisTickMarks(Chart chart,
Axis axis)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
dispose()
Disposes the resources.
|
private void |
drawXTickMarks(org.eclipse.swt.graphics.GC gc,
java.util.ArrayList<java.lang.Integer> tickLabelPositions,
IAxis.Position position)
Draw the X tick marks.
|
private void |
drawYTickMarks(org.eclipse.swt.graphics.GC gc,
java.util.ArrayList<java.lang.Integer> tickLabelPositions,
IAxis.Position position)
Draw the Y tick marks.
|
Axis |
getAxis()
Gets the associated axis.
|
protected org.eclipse.swt.graphics.Rectangle |
getBounds()
Gets the bounds on chart panel.
|
protected org.eclipse.swt.graphics.Color |
getForeground()
Gets the foreground color.
|
ChartLayoutData |
getLayoutData()
Gets the layout data.
|
void |
paintControl(org.eclipse.swt.events.PaintEvent e) |
void |
setBounds(int x,
int y,
int width,
int height)
Sets the bounds on chart panel.
|
void |
setForeground(org.eclipse.swt.graphics.Color color)
Sets the foreground color.
|
protected void |
updateLayoutData()
Updates tick marks layout.
|
private Chart chart
private Axis axis
private org.eclipse.swt.graphics.Color foreground
private int widthHint
private int heightHint
private org.eclipse.swt.graphics.Rectangle bounds
protected static final int LINE_WIDTH
public static final int TICK_LENGTH
private static final int DEFAULT_FOREGROUND
public void setForeground(org.eclipse.swt.graphics.Color color)
color
- the foreground colorprotected org.eclipse.swt.graphics.Color getForeground()
public Axis getAxis()
protected void updateLayoutData()
public ChartLayoutData getLayoutData()
public void setBounds(int x, int y, int width, int height)
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightprotected org.eclipse.swt.graphics.Rectangle getBounds()
protected void dispose()
public void paintControl(org.eclipse.swt.events.PaintEvent e)
paintControl
in interface org.eclipse.swt.events.PaintListener
private void drawXTickMarks(org.eclipse.swt.graphics.GC gc, java.util.ArrayList<java.lang.Integer> tickLabelPositions, IAxis.Position position)
tickLabelPositions
- the tick label positionsposition
- the axis positiongc
- the graphics contextprivate void drawYTickMarks(org.eclipse.swt.graphics.GC gc, java.util.ArrayList<java.lang.Integer> tickLabelPositions, IAxis.Position position)
tickLabelPositions
- the tick label positionsposition
- the axis positiongc
- the graphics context