Class Title

java.lang.Object
org.swtchart.internal.Title
All Implemented Interfaces:
EventListener, org.eclipse.swt.events.PaintListener, org.eclipse.swt.internal.SWTEventListener, ITitle
Direct Known Subclasses:
AxisTitle, ChartTitle

public class Title extends Object implements ITitle, org.eclipse.swt.events.PaintListener
A base class for title.
  • Field Details

    • chart

      protected Chart chart
      the chart
    • text

      protected String text
      the title text
    • isVisible

      protected boolean isVisible
      the visibility state of axis
  • Constructor Details

    • Title

      public Title(Chart parent)
      Constructor.
      Parameters:
      parent - the parent composite
  • Method Details

    • setText

      public void setText(String text)
      Description copied from interface: ITitle
      Sets the title text.
      Specified by:
      setText in interface ITitle
      Parameters:
      text - the title text
    • getDefaultText

      protected String getDefaultText()
      Gets the default title text.
      Returns:
      the default title text
    • getText

      public 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(org.eclipse.swt.graphics.Font font)
      Sets the font.
      Specified by:
      setFont in interface ITitle
      Parameters:
      font - the font
    • getFont

      public org.eclipse.swt.graphics.Font getFont()
      Gets the font.
      Specified by:
      getFont in interface ITitle
      Returns:
      the font
    • setForeground

      public void setForeground(org.eclipse.swt.graphics.Color color)
      Sets the foreground color.
      Specified by:
      setForeground in interface ITitle
      Parameters:
      color - the foreground color
    • getForeground

      public org.eclipse.swt.graphics.Color getForeground()
      Gets the foreground color.
      Specified by:
      getForeground in interface ITitle
      Returns:
      the foreground color
    • setStyleRanges

      public void setStyleRanges(org.eclipse.swt.custom.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 org.eclipse.swt.custom.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.
    • 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(org.eclipse.swt.events.PaintEvent e)
      Specified by:
      paintControl in interface org.eclipse.swt.events.PaintListener
    • setBounds

      public void setBounds(int x, int y, int width, int height)
      Sets the bounds on chart panel.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      width - the width
      height - the height
    • getBounds

      public org.eclipse.swt.graphics.Rectangle getBounds()
      Gets the bounds on chart panel.
      Returns:
      the bounds on chart panel