public abstract class Chart extends Object
Constructor and Description |
---|
Chart()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addRefreshListener(RefreshListener listener)
Adds a refresh listener that is called whenever this
Chart needs to be
redrawn by the GUI. |
Chart |
backgroundColor(int newBackgroundColor)
Sets the color as ARGB int, e.g.
|
Area |
calculateGraphArea(double width,
double height)
Calculates the graph area by removing the
ChartPart s from the entire width
and height. |
int |
getBackgroundColor()
Returns the color as ARGB int, e.g.
|
Border |
getBorder()
Returns the border this chart has.
|
Title |
getTitle()
Returns the title this chart has.
|
void |
paintOn(GraphicContext gc,
PaintInstructions instructions)
Paints the current content onto the graphic context.
|
void |
removeRefreshListener(RefreshListener listener)
Removes a refresh listener that was called whenever this
Chart needed to be
redrawn by the GUI. |
void |
setBackgroundColor(int backgroundColor)
Sets the color as ARGB int, e.g.
|
public void paintOn(GraphicContext gc, PaintInstructions instructions)
gc
- graphic context; coordinates are relative to the screeninstructions
- additional instructions like the area to paint onpublic Area calculateGraphArea(double width, double height)
ChartPart
s from the entire width
and height.width
- the entire widthheight
- the entire heightpublic void addRefreshListener(RefreshListener listener)
Chart
needs to be
redrawn by the GUI.listener
- a listenerpublic void removeRefreshListener(RefreshListener listener)
Chart
needed to be
redrawn by the GUI. Does nothing if the listener was never added.listener
- a listenerpublic Border getBorder()
public Title getTitle()
public int getBackgroundColor()
0xFFFF0000
and blue is
0xFF0000FF
.public Chart backgroundColor(int newBackgroundColor)
0xFFFF0000
and blue is
0xFF0000FF
.newBackgroundColor
- the colorpublic void setBackgroundColor(int backgroundColor)
0xFFFF0000
and blue is
0xFF0000FF
.backgroundColor
- the colorCopyright © 2020. All rights reserved.