Package org.swtchart.internal
Class Title
java.lang.Object
org.swtchart.internal.Title
- All Implemented Interfaces:
ITitle
- Direct Known Subclasses:
AxisTitle
,ChartTitle
A base class for title.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes the resources.Rectangle
Gets the bounds on chart panel.protected String
Gets the default title text.Font
getFont()
Gets the font.Color
Gets the foreground color.Gets the layout data.StyleRange[]
Gets the style ranges.getText()
Gets the title text.protected boolean
Gets the state indicating if showing title horizontally.boolean
Gets the visibility state.void
paintControl
(PaintEvent e) void
setBounds
(int x, int y, int width, int height) Sets the bounds on chart panel.void
setFont
(Font font) Sets the font.void
setForeground
(Color color) Sets the foreground color.void
setLayoutData
(ChartLayoutData layoutData) Sets the layout data.void
setStyleRanges
(StyleRange[] ranges) Sets the style ranges.void
Sets the title text.void
setVisible
(boolean isVisible) Sets the visibility state of title.void
Updates the title layout data.
-
Field Details
-
chart
the chart -
text
the title text -
isVisible
protected boolean isVisiblethe visibility state of axis
-
-
Constructor Details
-
Title
Constructor.- Parameters:
parent
- the parent composite
-
-
Method Details
-
setText
Description copied from interface:ITitle
Sets the title text. -
getDefaultText
Gets the default title text.- Returns:
- the default title text
-
getText
Description copied from interface:ITitle
Gets 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:
setForeground
in interfaceITitle
- Parameters:
color
- the foreground color
-
getForeground
public Color getForeground()Gets the foreground color.- Specified by:
getForeground
in interfaceITitle
- Returns:
- the foreground color
-
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 byITitle.setFont(Font)
andITitle.setForeground(Color)
makes no effect. Instead, the font and background color in style ranges are used.- Specified by:
setStyleRanges
in interfaceITitle
- 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 interfaceITitle
- 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 interfaceITitle
- Parameters:
isVisible
- the visibility state
-
isVisible
public boolean isVisible()Description copied from interface:ITitle
Gets 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
Sets the layout data.- Parameters:
layoutData
- the layout data
-
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
-