Modifier and Type | Class and Description |
---|---|
static class |
Title.Position
The position of the
Title . |
Constructor and Description |
---|
Title() |
Modifier and Type | Method and Description |
---|---|
void |
addRefreshListener(RefreshListener listener)
Adds a refresh listener that is called whenever this
Drawable needs to be
redrawn by the GUI. |
Title |
alignment(TextAlignment newAlignment)
Sets the alignment of the title.
|
Title |
color(int newColor)
Sets the color as ARGB int, e.g.
|
Title |
font(Font newFont)
Sets the font used to paint the title.
|
TextAlignment |
getAlignment()
Returns the alignment of the title.
|
int |
getColor()
Returns the color as ARGB int, e.g.
|
Font |
getFont()
Returns the font used to paint the title.
|
Title.Position |
getPosition()
Returns the position of the title.
|
double |
getSize()
Returns the height of the title, if one is drawn.
|
String |
getText()
Returns the text that is the title or
null to show there is no title. |
void |
paintOn(GraphicContext gc,
PaintInstructions instructions)
Paints the current content onto the graphic context.
|
Title |
position(Title.Position newPosition)
Sets the position of the title.
|
void |
removeRefreshListener(RefreshListener listener)
Removes a refresh listener that was called whenever this
Drawable needed to
be redrawn by the GUI. |
void |
setAlignment(TextAlignment alignment)
Sets the alignment of the title.
|
void |
setColor(int color)
Sets the color as ARGB int, e.g.
|
void |
setFont(Font font)
Sets the font used to paint the title.
|
void |
setPosition(Title.Position position)
Sets the position of the title.
|
void |
setSize(double size)
Sets the height of the title, if one is drawn.
|
void |
setText(String text)
Sets the text that is the title or
null to show there is no title. |
Title |
size(double newSize)
Sets the height of the title, if one is drawn.
|
Area |
snipNecessarySpace(Area existingArea)
This method removes space from the existing area to make room for this part.
|
Title |
text(String newText)
Sets the text that is the title or
null to show there is no title. |
String |
toString() |
public void paintOn(GraphicContext gc, PaintInstructions instructions)
ChartPart
public Area snipNecessarySpace(Area existingArea)
ChartPart
snipNecessarySpace
in interface ChartPart
existingArea
- the area this part could usepublic void addRefreshListener(RefreshListener listener)
Drawable
Drawable
needs to be
redrawn by the GUI.addRefreshListener
in interface Drawable
listener
- a listenerpublic void removeRefreshListener(RefreshListener listener)
Drawable
Drawable
needed to
be redrawn by the GUI. Does nothing if the listener was never added.removeRefreshListener
in interface Drawable
listener
- a listenerpublic String getText()
null
to show there is no title.public Title text(String newText)
null
to show there is no title.newText
- the textpublic void setText(String text)
null
to show there is no title.text
- the textpublic int getColor()
0xFFFF0000
and blue is
0xFF0000FF
.public Title color(int newColor)
0xFFFF0000
and blue is
0xFF0000FF
.newColor
- the colorpublic void setColor(int color)
0xFFFF0000
and blue is
0xFF0000FF
.color
- the colorpublic Font getFont()
public Title font(Font newFont)
newFont
- the font; cannot be nullpublic void setFont(Font font)
font
- the font; cannot be nullpublic double getSize()
public Title size(double newSize)
newSize
- the title's sizepublic void setSize(double size)
size
- the title's sizepublic Title.Position getPosition()
public Title position(Title.Position newPosition)
newPosition
- the position; cannot be nullpublic void setPosition(Title.Position position)
position
- the position; cannot be nullpublic TextAlignment getAlignment()
public Title alignment(TextAlignment newAlignment)
newAlignment
- the alignment; cannot be nullpublic void setAlignment(TextAlignment alignment)
alignment
- the alignment; cannot be nullCopyright © 2020. All rights reserved.