org.swtchart.internal
Class Title

java.lang.Object
  extended by Canvas
      extended by org.swtchart.internal.Title
All Implemented Interfaces:
ITitle
Direct Known Subclasses:
AxisTitle, ChartTitle

public class Title
extends Canvas
implements ITitle

A base class for title.


Field Summary
protected  Chart chart
          the chart
protected  boolean isVisible
          the visibility state of axis
protected  java.lang.String text
          the title text
 
Constructor Summary
Title(Chart parent, int style)
          Constructor.
 
Method Summary
 void dispose()
           
protected  java.lang.String getDefaultText()
          Gets the default title text.
 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(PaintEvent e)
           
 void setFont(Font font)
          Sets the font for title text.
 void setForeground(Color color)
          Sets the foreground color of title.
 void setStyleRanges(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.swtchart.ITitle
getFont, getForeground
 

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,
             int style)
Constructor.

Parameters:
parent - the parent composite
style - the style
Method Detail

setText

public void setText(java.lang.String text)
Description copied from interface: ITitle
Sets the title text.

Specified by:
setText in interface ITitle
Parameters:
text - 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: ITitle
Gets the title text.

Specified by:
getText in interface ITitle
Returns:
the title text

setFont

public void setFont(Font font)
Description copied from interface: ITitle
Sets the font for title text.

Specified by:
setFont in interface ITitle
Parameters:
font - the font for title text

setForeground

public void setForeground(Color color)
Description copied from interface: ITitle
Sets the foreground color of title.

Specified by:
setForeground in interface ITitle
Parameters:
color - the foreground color of title

setStyleRanges

public void setStyleRanges(StyleRange[] ranges)
Description copied from interface: ITitle
Sets the style ranges. When style ranges are set, the font and background color set by ITitle.setFont(Font) and ITitle.setForeground(Color) makes no effect. Instead, the font and background color in style ranges are used.

Specified by:
setStyleRanges in interface ITitle
Parameters:
ranges - the style ranges, or null to clear the currently set style ranges.

getStyleRanges

public StyleRange[] getStyleRanges()
Description copied from interface: ITitle
Gets the style ranges.

Specified by:
getStyleRanges in interface ITitle
Returns:
the style ranges

setVisible

public void setVisible(boolean isVisible)
Description copied from interface: ITitle
Sets the visibility state of title.

Specified by:
setVisible in interface ITitle
Parameters:
isVisible - the visibility state

isVisible

public boolean isVisible()
Description copied from interface: ITitle
Gets the visibility state.

Specified by:
isVisible in interface ITitle
Returns:
true if title is visible

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.


dispose

public void dispose()

paintControl

public void paintControl(PaintEvent e)