Class WAbstractChartModel

java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.chart.WAbstractChartModel
Direct Known Subclasses:
WStandardChartProxyModel

public abstract class WAbstractChartModel
extends WObject
An abstract model for use with JWt's charts.

This abstract model is used by WAbstractChart as data model.

  • Nested Class Summary

    Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject

    WObject.FormData
  • Constructor Summary

    Constructors
    Constructor Description
    WAbstractChartModel()
    Creates a new chart model.
    WAbstractChartModel​(WObject parent)
    Creates a new chart model.
  • Method Summary

    Modifier and Type Method Description
    Signal changed()
    A signal that notifies of any change to the model.
    java.util.EnumSet<ItemFlag> flags​(int row, int column)
    Returns the item flags for the given row and column.
    WColor getBarBrushColor​(int row, int column)
    Returns the bar brush color to use for a given row and column.
    WColor getBarPenColor​(int row, int column)
    Returns the bar pen color to use for a given row and column.
    abstract int getColumnCount()
    Returns the number of columns.
    abstract double getData​(int row, int column)
    Returns data at a given row and column.
    WString getDisplayData​(int row, int column)
    Returns display data at a given row and column.
    WString getHeaderData​(int column)
    Returns the given column's header data.
    WColor getMarkerBrushColor​(int row, int column)
    Returns the marker brush color to use for a given row and column.
    WColor getMarkerPenColor​(int row, int column)
    Returns the marker pen color to use for a given row and column.
    java.lang.Double getMarkerScaleFactor​(int row, int column)
    Returns the marker scale factor to use for a given row and column.
    abstract int getRowCount()
    Returns the number of rows.
    WString getToolTip​(int row, int column)
    Returns the tooltip text to use on a given row and column.
    WLink link​(int row, int column)
    Returns the link for a given row and column.
    MarkerType markerType​(int row, int column)
    Returns the marker type to use for a given row and column.

    Methods inherited from class eu.webtoolkit.jwt.WObject

    addChild, getId, getObjectName, remove, setFormData, setObjectName, tr

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WAbstractChartModel

      public WAbstractChartModel​(WObject parent)
      Creates a new chart model.
    • WAbstractChartModel

      public WAbstractChartModel()
      Creates a new chart model.

      Calls this((WObject)null)

  • Method Details

    • getData

      public abstract double getData​(int row, int column)
      Returns data at a given row and column.

      This value determines the position of a data point on the chart.

    • getDisplayData

      public WString getDisplayData​(int row, int column)
      Returns display data at a given row and column.

      This value should be a textual representation of the value returned by getData(). This defaults to the string representation of the double returned by getData().

    • getHeaderData

      public WString getHeaderData​(int column)
      Returns the given column's header data.

      This is used as the name in the legend for a data series.

      Defaults to an empty string.

    • getToolTip

      public WString getToolTip​(int row, int column)
      Returns the tooltip text to use on a given row and column.

      Defaults to an empty string, signifying that no tooltip should be shown.

    • flags

      public java.util.EnumSet<ItemFlag> flags​(int row, int column)
      Returns the item flags for the given row and column.

      Only the ItemIsXHTMLText and ItemHasDeferredTooltip flags are supported for charts.

      ItemIsXHTMLText determines whether the tooltip text should be rendered as XHTML or as plain text, and ItemHasDeferredTooltip makes it so that tooltips are only loaded on demand.

      Note: An XHTML text tooltip will be forced to be deferred. Non-deferred XHTML tooltips are not supported.

      Note: When not using deferred tooltips, the HTML <area> tag will be used. If there are many tooltips and the chart is interactive this may cause client-side performance issues. If deferred tooltips are used, this will cause some load on the server, as it calculates server-side what marker or bar the user is hovering over.

      Note: If the chart is interactive, and tooltips are not deferred, they will be scaled according to the first Y axis, and thus multiple Y axes will not be supported in combination with plain tooltips.

    • link

      public WLink link​(int row, int column)
      Returns the link for a given row and column.

      Defaults to an empty link, signifying that no link should be shown.

    • getMarkerPenColor

      public WColor getMarkerPenColor​(int row, int column)
      Returns the marker pen color to use for a given row and column.

      This is used as the color of the outline of markers when drawing a PointSeries. The default is null, indicating that the default color, as determined by WDataSeries.getMarkerPen(), should be used.

      See Also:
      WDataSeries.setMarkerPen(WPen pen)
    • getMarkerBrushColor

      public WColor getMarkerBrushColor​(int row, int column)
      Returns the marker brush color to use for a given row and column.

      This is used as the color of the brush used when drawing a PointSeries. The default is null, indicating that the default color, as determined by WDataSeries.getMarkerBrush(), should be used.

      See Also:
      WDataSeries.setMarkerBrush(WBrush brush)
    • markerType

      public MarkerType markerType​(int row, int column)
      Returns the marker type to use for a given row and column.

      This is used as the shape of the marker used when drawing a PointSeries. The default is null, indicating that the default marker, as determined by WDataSeries.getMarker(), should be used.

      See Also:
      WDataSeries.setMarker(MarkerType marker)
    • getBarPenColor

      public WColor getBarPenColor​(int row, int column)
      Returns the bar pen color to use for a given row and column.

      This is used as the color of the outline of bars when drawing a BarSeries. The default is null, indicating that the default color, as determined by WDataSeries.getPen(), should be used.

      See Also:
      WDataSeries.setPen(WPen pen)
    • getBarBrushColor

      public WColor getBarBrushColor​(int row, int column)
      Returns the bar brush color to use for a given row and column.

      This is used as the color of the brush used when drawing a BarSeries. The default is null, indicating that the default color, as determined by WDataSeries.getBrush(), should be used.

      See Also:
      WDataSeries.setBrush(WBrush brush)
    • getMarkerScaleFactor

      public java.lang.Double getMarkerScaleFactor​(int row, int column)
      Returns the marker scale factor to use for a given row and column.

      This is used to scale the size of the marker when drawing a PointSeries. The default is null, indicating that the default scale should be used.

    • getColumnCount

      public abstract int getColumnCount()
      Returns the number of columns.

      See Also:
      getRowCount()
    • getRowCount

      public abstract int getRowCount()
      Returns the number of rows.

      See Also:
      getColumnCount()
    • changed

      public Signal changed()
      A signal that notifies of any change to the model.

      Implementations should trigger this signal in order to update the chart.