Package org.swtchart.internal
Class Title
- java.lang.Object
-
- org.swtchart.internal.Title
-
- All Implemented Interfaces:
ITitle
- Direct Known Subclasses:
AxisTitle,ChartTitle
public class Title extends java.lang.Object implements ITitle
A base class for title.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Disposes the resources.RectanglegetBounds()Gets the bounds on chart panel.protected java.lang.StringgetDefaultText()Gets the default title text.FontgetFont()Gets the font.ColorgetForeground()Gets the foreground color.ChartLayoutDatagetLayoutData()Gets the layout data.StyleRange[]getStyleRanges()Gets the style ranges.java.lang.StringgetText()Gets the title text.protected booleanisHorizontal()Gets the state indicating if showing title horizontally.booleanisVisible()Gets the visibility state.voidpaintControl(PaintEvent e)voidsetBounds(int x, int y, int width, int height)Sets the bounds on chart panel.voidsetFont(Font font)Sets the font.voidsetForeground(Color color)Sets the foreground color.voidsetLayoutData(ChartLayoutData layoutData)Sets the layout data.voidsetStyleRanges(StyleRange[] ranges)Sets the style ranges.voidsetText(java.lang.String text)Sets the title text.voidsetVisible(boolean isVisible)Sets the visibility state of title.voidupdateLayoutData()Updates the title layout data.
-
-
-
Field Detail
-
chart
protected Chart chart
the chart
-
text
protected java.lang.String text
the title text
-
isVisible
protected boolean isVisible
the visibility state of axis
-
-
Constructor Detail
-
Title
public Title(Chart parent)
Constructor.- Parameters:
parent- the parent composite
-
-
Method Detail
-
setText
public void setText(java.lang.String text)
Description copied from interface:ITitleSets the title text.
-
getDefaultText
protected java.lang.String getDefaultText()
Gets the default title text.- Returns:
- the default title text
-
getText
public java.lang.String getText()
Description copied from interface:ITitleGets the title text.
-
setFont
public void setFont(Font font)
Sets the font.
-
getFont
public Font getFont()
Gets the font.
-
setForeground
public void setForeground(Color color)
Sets the foreground color.- Specified by:
setForegroundin interfaceITitle- Parameters:
color- the foreground color
-
getForeground
public Color getForeground()
Gets the foreground color.- Specified by:
getForegroundin interfaceITitle- Returns:
- the foreground color
-
setStyleRanges
public void setStyleRanges(StyleRange[] ranges)
Description copied from interface:ITitleSets the style ranges. When style ranges are set, the font and background color set by#setFont(Font)and#setForeground(Color)makes no effect. Instead, the font and background color in style ranges are used.- Specified by:
setStyleRangesin interfaceITitle- Parameters:
ranges- the style ranges, or null to clear the currently set style ranges.
-
getStyleRanges
public StyleRange[] getStyleRanges()
Description copied from interface:ITitleGets the style ranges.- Specified by:
getStyleRangesin interfaceITitle- Returns:
- the style ranges
-
setVisible
public void setVisible(boolean isVisible)
Description copied from interface:ITitleSets the visibility state of title.- Specified by:
setVisiblein interfaceITitle- Parameters:
isVisible- the visibility state
-
isVisible
public boolean isVisible()
Description copied from interface:ITitleGets the visibility state.
-
isHorizontal
protected boolean isHorizontal()
Gets the state indicating if showing title horizontally.- Returns:
- the state indicating if showing title horizontally
-
updateLayoutData
public void updateLayoutData()
Updates the title layout data.
-
setLayoutData
public void setLayoutData(ChartLayoutData layoutData)
Sets the layout data.- Parameters:
layoutData- the layout data
-
getLayoutData
public ChartLayoutData getLayoutData()
Gets the layout data.- Returns:
- the layout data
-
dispose
public void dispose()
Disposes the resources.
-
paintControl
public void paintControl(PaintEvent e)
-
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
public Rectangle getBounds()
Gets the bounds on chart panel.- Returns:
- the bounds on chart panel
-
-