|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WWidget
eu.webtoolkit.jwt.WWebWidget
eu.webtoolkit.jwt.WInteractWidget
eu.webtoolkit.jwt.WPaintedWidget
eu.webtoolkit.jwt.chart.WAbstractChart
public abstract class WAbstractChart
Abstract base class for MVC-based charts.
This is an abstract class and should not be used directly.
As an abstract base for MVC-based charts, this class manages the model
setModel() and
provides virtual methods that listen to model changes. In addition, it gives
access to generic chart properties such as the title
setTitle() and title font
setTitleFont(), the
chart palette setPalette(), plot area padding
setPlotAreaPadding(), and the background fill color
setBackground().
Styling through CSS is not applicable.
WCartesianChart,
WPieChart| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WPaintedWidget |
|---|
WPaintedWidget.Method |
| Method Summary | |
|---|---|
WBrush |
getBackground()
Returns the background of the chart. |
WAbstractItemModel |
getModel()
Returns the model. |
WChartPalette |
getPalette()
Returns the palette for the chart. |
int |
getPlotAreaPadding(Side side)
Returns the internal margin for the main plot area. |
WString |
getTitle()
Return the chart title. |
WFont |
getTitleFont()
Returns the font for the chart title. |
protected void |
modelChanged()
Method called whenever the entire model was changed. |
protected abstract void |
modelColumnsInserted(WModelIndex parent,
int start,
int end)
Method called when colums have been inserted in the model. |
protected abstract void |
modelColumnsRemoved(WModelIndex parent,
int start,
int end)
Method called when colums have been removed from the model. |
protected abstract void |
modelDataChanged(WModelIndex topLeft,
WModelIndex bottomRight)
Method called when data has been changed in the model. |
protected void |
modelReset()
Method called whenever the entire model was reset. |
protected abstract void |
modelRowsInserted(WModelIndex parent,
int start,
int end)
Method called when rows have been inserted from the model. |
protected abstract void |
modelRowsRemoved(WModelIndex parent,
int start,
int end)
Method called when rows have been removed from the model. |
void |
paint(WPainter painter)
Paint the chart in a rectangle of the given painter. |
abstract void |
paint(WPainter painter,
WRectF rectangle)
Paint the chart in a rectangle of the given painter. |
void |
remove()
Destructor. |
void |
setBackground(WBrush background)
Sets a background for the chart. |
void |
setModel(WAbstractItemModel model)
Set the model. |
void |
setPalette(WChartPalette palette)
Set a palette for the chart. |
void |
setPlotAreaPadding(int padding)
Set an internal margin for the main plot area. |
void |
setPlotAreaPadding(int padding,
java.util.EnumSet<Side> sides)
Set an internal margin for the main plot area. |
void |
setPlotAreaPadding(int padding,
Side side,
Side... sides)
Set an internal margin for the main plot area. |
void |
setTitle(java.lang.CharSequence title)
Set a chart title. |
void |
setTitleFont(WFont titleFont)
Set the font for the chart title. |
| Methods inherited from class eu.webtoolkit.jwt.WPaintedWidget |
|---|
addArea, enableAjax, getArea, getAreas, getMethod, getPreferredMethod, insertArea, layoutSizeChanged, paintEvent, removeArea, resize, setPreferredMethod, update, update, update |
| Methods inherited from class eu.webtoolkit.jwt.WInteractWidget |
|---|
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, propagateSetEnabled, setDraggable, setDraggable, setDraggable, setDraggable, touchEnded, touchMoved, touchStarted |
| Methods inherited from class eu.webtoolkit.jwt.WWidget |
|---|
acceptDrops, acceptDrops, addCssRule, addCssRule, addStyleClass, animateHide, animateShow, boxBorder, boxPadding, containsExposed, disable, dropEvent, enable, getDrop, getJsRef, getParent, hide, htmlText, isLayoutSizeAware, positionAt, positionAt, removeStyleClass, resize, setClearSides, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getObjectName, setObjectName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void remove()
remove in class WPaintedWidgetWContainerWidget.removeWidget(WWidget widget)public void setModel(WAbstractItemModel model)
The model is used by the chart to get its data. Ownership of the model is not transferred, and if a previous model was set it is not deleted.
The default model is a 0 model.
getModel()public WAbstractItemModel getModel()
setModel(WAbstractItemModel model)public void setBackground(WBrush background)
Set the background color for the main plot area.
The default is a completely transparent background.
getBackground()public WBrush getBackground()
setBackground(WBrush background)public void setPalette(WChartPalette palette)
A palette is used to provide the style information to render the chart series. Ownership of the palette is transferred to the chart.
The default palette is dependent on the chart type.
getPalette()public WChartPalette getPalette()
setPalette(WChartPalette palette)
public void setPlotAreaPadding(int padding,
java.util.EnumSet<Side> sides)
This configures the area (in pixels) around the plot area that is available for axes, labels, and titles. You need to set this appropriately so that labels fit inside these margins.
The default is dependent on the chart type.
public final void setPlotAreaPadding(int padding,
Side side,
Side... sides)
Calls setPlotAreaPadding(padding, EnumSet.of(side, sides))
public final void setPlotAreaPadding(int padding)
Calls setPlotAreaPadding(padding, Side.All)
public int getPlotAreaPadding(Side side)
setPlotAreaPadding(int padding, EnumSet sides)public void setTitle(java.lang.CharSequence title)
The title is displayed on top of the chart, using the
getTitleFont().
The default title is an empty title ("").
getTitle()public WString getTitle()
getTitle()public void setTitleFont(WFont titleFont)
Changes the font for the chart title.
The default title font is a 15 point Sans Serif font.
getTitleFont(),
setTitle(CharSequence title)public WFont getTitleFont()
setTitleFont(WFont titleFont)
public abstract void paint(WPainter painter,
WRectF rectangle)
Paints the chart inside the painter, in the area indicated by
rectangle. When rectangle is a null rectangle, the entire
painter window is used.
public final void paint(WPainter painter)
Calls paint(painter,
new WRectF())
protected void modelChanged()
setModel(WAbstractItemModel model)protected void modelReset()
Bound to the WAbstractItemModel#modelReset() and
WAbstractItemModel#layoutChanged() signals.
protected abstract void modelColumnsInserted(WModelIndex parent,
int start,
int end)
WAbstractItemModel.columnsInserted()
protected abstract void modelColumnsRemoved(WModelIndex parent,
int start,
int end)
WAbstractItemModel.columnsRemoved()
protected abstract void modelRowsInserted(WModelIndex parent,
int start,
int end)
WAbstractItemModel.rowsInserted()
protected abstract void modelRowsRemoved(WModelIndex parent,
int start,
int end)
WAbstractItemModel.rowsRemoved()
protected abstract void modelDataChanged(WModelIndex topLeft,
WModelIndex bottomRight)
WAbstractItemModel.dataChanged()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||