public class Title extends java.lang.Object implements ITitle, org.eclipse.swt.events.PaintListener
| Modifier and Type | Field and Description |
|---|---|
private org.eclipse.swt.graphics.Rectangle |
bounds
the bounds of title
|
protected Chart |
chart
the chart
|
private static int |
DEFAULT_FONT_SIZE
the default font size
|
private static int |
DEFAULT_FOREGROUND
the default color
|
private static java.lang.String |
DEFAULT_TEXT
the default text
|
private org.eclipse.swt.graphics.Font |
defaultFont
the default font
|
private org.eclipse.swt.graphics.Font |
font
the font
|
private org.eclipse.swt.graphics.Color |
foreground
the foreground color
|
protected boolean |
isVisible
the visibility state of axis
|
private ChartLayoutData |
layoutData
the layout data
|
private org.eclipse.swt.custom.StyleRange[] |
styleRanges
the style ranges
|
protected java.lang.String |
text
the title text
|
private org.eclipse.swt.graphics.TextLayout |
textLayout
The text layout
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes the resources.
|
private void |
drawHorizontalTitle(org.eclipse.swt.graphics.GC gc)
Draws the horizontal title.
|
private void |
drawVerticalTitle(org.eclipse.swt.graphics.GC gc)
Draws the vertical title.
|
org.eclipse.swt.graphics.Rectangle |
getBounds()
Gets the bounds on chart panel.
|
protected java.lang.String |
getDefaultText()
Gets the default title text.
|
org.eclipse.swt.graphics.Font |
getFont()
Gets the font.
|
org.eclipse.swt.graphics.Color |
getForeground()
Gets the foreground color.
|
ChartLayoutData |
getLayoutData()
Gets the layout data.
|
org.eclipse.swt.custom.StyleRange[] |
getStyleRanges()
Gets the style ranges.
|
java.lang.String |
getText()
Gets the title text.
|
protected boolean |
isHorizontal()
Gets the state indicating if showing title horizontally.
|
boolean |
isVisible()
Gets the visibility state.
|
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 |
setFont(org.eclipse.swt.graphics.Font font)
Sets the font.
|
void |
setForeground(org.eclipse.swt.graphics.Color color)
Sets the foreground color.
|
void |
setLayoutData(ChartLayoutData layoutData)
Sets the layout data.
|
void |
setStyleRanges(org.eclipse.swt.custom.StyleRange[] ranges)
Sets the style ranges.
|
void |
setText(java.lang.String text)
Sets the title text.
|
void |
setVisible(boolean isVisible)
Sets the visibility state of title.
|
void |
updateLayoutData()
Updates the title layout data.
|
protected Chart chart
protected java.lang.String text
private org.eclipse.swt.graphics.Color foreground
private org.eclipse.swt.graphics.Font font
private org.eclipse.swt.custom.StyleRange[] styleRanges
private final org.eclipse.swt.graphics.TextLayout textLayout
protected boolean isVisible
private final org.eclipse.swt.graphics.Font defaultFont
private org.eclipse.swt.graphics.Rectangle bounds
private ChartLayoutData layoutData
private static final int DEFAULT_FONT_SIZE
private static final int DEFAULT_FOREGROUND
private static final java.lang.String DEFAULT_TEXT
public Title(Chart parent)
parent - the parent compositepublic void setText(java.lang.String text)
ITitleprotected java.lang.String getDefaultText()
public java.lang.String getText()
ITitlepublic void setFont(org.eclipse.swt.graphics.Font font)
public org.eclipse.swt.graphics.Font getFont()
public void setForeground(org.eclipse.swt.graphics.Color color)
setForeground in interface ITitlecolor - the foreground colorpublic org.eclipse.swt.graphics.Color getForeground()
getForeground in interface ITitlepublic void setStyleRanges(org.eclipse.swt.custom.StyleRange[] ranges)
ITitleITitle.setFont(Font) and ITitle.setForeground(Color)
makes no effect. Instead, the font and background color in style ranges
are used.setStyleRanges in interface ITitleranges - the style ranges, or null to clear the currently set
style ranges.public org.eclipse.swt.custom.StyleRange[] getStyleRanges()
ITitlegetStyleRanges in interface ITitlepublic void setVisible(boolean isVisible)
ITitlesetVisible in interface ITitleisVisible - the visibility statepublic boolean isVisible()
ITitleprotected boolean isHorizontal()
public void updateLayoutData()
public void setLayoutData(ChartLayoutData layoutData)
layoutData - the layout datapublic ChartLayoutData getLayoutData()
public void dispose()
public void paintControl(org.eclipse.swt.events.PaintEvent e)
paintControl in interface org.eclipse.swt.events.PaintListenerpublic void setBounds(int x,
int y,
int width,
int height)
x - the x coordinatey - the y coordinatewidth - the widthheight - the heightpublic org.eclipse.swt.graphics.Rectangle getBounds()
private void drawHorizontalTitle(org.eclipse.swt.graphics.GC gc)
gc - The graphics contextprivate void drawVerticalTitle(org.eclipse.swt.graphics.GC gc)
gc - The graphics context