Class Series

java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizix.prop.ui.chart.series.Series
All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IPropCnrBooleanSettings<SeriesOption>, IPropCnrColorSettings<SeriesColor>, IPropCnrFillSettings<SeriesFill>, IPropCnrFontSettings<SeriesFont>, IPropCnrStrokeSettings<SeriesStroke>, IChartContainer, IVSColumnBestValueListener, IVSColumnListener, IVSComponentListener, IVSComponentState, Cloneable
Direct Known Subclasses:
ESeries

A chart series consists of several series values properties in a defined order. The Designer chart series persists in XML and can be predefined and only modified at runtime with the required settings.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • Series

      public Series(String name)
      Constructs a new series from a name.
      Parameters:
      name - The name of the series. The name MUST be a valid Atom name.
      Throws:
      NullPointerException - If the name is null.
      IllegalArgumentException - If the name is invalid.
    • Series

      public Series(Atom atom)
      Constructs a new series from an Atom name.

      This constructor is used by the persistence framework and should not be used.

      Parameters:
      atom - The atom name.
    • Series

      public Series()
      Constructs a new series without a name.

      This constructor is used by the persistence framework and should not be used.

  • Method Details

    • usesPropIndex

      public final boolean usesPropIndex()
      Checks if index is relevant for this container, e.g. to keep the values in order.
      Specified by:
      usesPropIndex in interface IPropCnr
      Overrides:
      usesPropIndex in class PropCnr
      Returns:
      true, the series is index-sensitive.
    • getSeriesType

      public SeriesType getSeriesType()
      Gets the series type.
      Returns:
      The series type, or null if undefined.
    • getContainerType

      public final IChartContainer.Type getContainerType()
      Gets the type of container.
      Specified by:
      getContainerType in interface IChartContainer
      Returns:
      Type.SERIES.
    • clone

      public Series clone()
      Clone must be overridden.
      Overrides:
      clone in class PropCnr
    • getValuesList

      public List<GSeriesValue> getValuesList()
      Gets the series values as a list of values.
      Returns:
      A modifiable list with the values. Changing the array will not affect the series.
    • getValues

      public GSeriesValue[] getValues()
      Gets the series values as an array of values.
      Returns:
      An array with the values.
    • getValuesProp

      public SeriesValue getValuesProp(int index)
      Gets the series value property at specified index.
      Parameters:
      index - The index.
      Returns:
      The value property, or null if index is out of bounds.
    • getValue

      public GSeriesValue getValue(int index)
      Gets the series value at specified index.
    • addValue

      public Series addValue(GSeriesValue value)
      Adds a new data series value.
      Parameters:
      value - The new values to add.
      Returns:
      this instance for concatenation use.
    • addValues

      public Series addValues(GSeriesValue... values)
      Adds a new data series values.
      Parameters:
      values - The new values to add.
      Returns:
      this instance for concatenation use.
    • addValue

      public Series addValue(double value)
      Adds a new data series simple value.
      Parameters:
      value - The new simple value to add.
      Returns:
      this instance for concatenation use.
    • addValues

      public Series addValues(double... values)
      Adds a new data series simple values.
      Parameters:
      values - The new simple values to add.
      Returns:
      this instance for concatenation use.
    • addNoValue

      public Series addNoValue()
      Adds a new data point without value, i.e. a null value.
      Returns:
      this instance for concatenation use.
    • removeValue

      public boolean removeValue(int index)
      Remove a value at specified index.
      Parameters:
      index - The index of the value to remove.
      Returns:
      true for success, false for failure (index out of bounds).
    • getValueCount

      public int getValueCount()
      Gets the count of values in the series.
      Returns:
      The count.
    • removeAllValues

      public boolean removeAllValues()
      Removes all the values from the data series.
      Returns:
      true for changed, false for no change (no values present).
    • setPlot

      public Series setPlot(String name)
      Sets the plot name to associate this series with. If the plot name is not found in the chart, this setting will be ignored.
      Parameters:
      name - The plot name, must be an Atom-valid name. If set to null series will be unassigned from any potential previous plot.
      Returns:
      this instance for concatenation use.
      Throws:
      IllegalArgumentException - If the name is invalid (i.e. must be an Atom-valid name).
    • getPlot

      public String getPlot()
      Gets the plot name to associate this series with.
      Returns:
      The plot name, or null if unassigned.
    • verify

      public boolean verify(PropVerification verification)
      Verifies this property container. The check performed is the extension of classes and that no circular reference is present.
      Specified by:
      verify in interface IGProp<GProp<?>[]>
      Overrides:
      verify in class PropCnr
      Parameters:
      verification - The property verification class.
      Returns:
      true if verification should proceed, false if disposed of and verification should not take place.
    • hasConnection

      public boolean hasConnection(int vs)
      Returns whether this series is with or without VS table connection.
      Parameters:
      vs - The VS connection check: -1 = no matter what type of connection, 0 = no VS connection, 1 = with VS connection.
      Returns:
      true if the data series matches the VS connection check setting, always true when "vs=-1".
    • getVSTable

      public VSTable getVSTable()
      Returns the VS table connection.
      Returns:
      The VS table, or null for none.
    • onResolved

      public void onResolved(VSRelativeReference<?> reference, VSColumnHeader column)
      Called when the property reference has been resolved. UI components use this method to set its state according to the field.
      Specified by:
      onResolved in interface IVSColumnListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      column - The target reference.
    • onBroken

      public void onBroken(VSRelativeReference<?> reference, VSColumnHeader column)
      Called when the property reference has been broken, i.e. unresolved.
      Specified by:
      onBroken in interface IVSColumnListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      column - The target reference.
    • getBestVSColumnHeaderValueType

      public Value.Type getBestVSColumnHeaderValueType(VSRelativeReference<?> reference)
      Requests the value type that would best suit the listener.
      Specified by:
      getBestVSColumnHeaderValueType in interface IVSColumnBestValueListener
      Parameters:
      reference - The VSRelativeReference instance holding the reference.
      Returns:
      null if none is available.
    • onStateChanged

      public void onStateChanged(VSColumnHeader column, IVSComponentState.State state, boolean on)
      Called when the column changes state.
      Specified by:
      onStateChanged in interface IVSColumnListener
      Parameters:
      column - The VS table column.
      state - The state change, possible values ENABLED, READONLY, VISIBLE or SELECTED.
      on - New state.
    • onSingleSelectionChanged

      public void onSingleSelectionChanged(VSColumnHeader column, int rowIndex)
      Called when the row selection in table single-selection mode is changed to forward to column listeners.
      Specified by:
      onSingleSelectionChanged in interface IVSColumnListener
      Parameters:
      column - The column.
      rowIndex - The row index selected, -1 for none.
    • onSelectionChanged

      public void onSelectionChanged(VSColumnHeader column, VSRow row, int rowIndex, boolean isSelected)
      Called when the row selection is changed to forward to column listeners.
      Specified by:
      onSelectionChanged in interface IVSColumnListener
      Parameters:
      column - The column.
      row - The row that was changed.
      rowIndex - The row index.
      isSelected - The selected state.
    • onRowAdded

      public void onRowAdded(VSColumnHeader column, VSRow row, int rowIndex)
      Called when a row has been added to the table.
      Specified by:
      onRowAdded in interface IVSColumnListener
      Parameters:
      column - The column.
      row - The row that was added.
      rowIndex - The row index where it was inserted.
    • onRowRemoved

      public void onRowRemoved(VSColumnHeader column, VSRow row, int rowIndex)
      Called when a row has been removed from the table.
      Specified by:
      onRowRemoved in interface IVSColumnListener
      Parameters:
      column - The column.
      row - The row that was removed.
      rowIndex - The row index before removal.
    • onStateChanged

      public void onStateChanged(VSColumnHeader column, VSField cell, IVSComponentState.State state, boolean on)
      Called when a cell in the column changes state.
      Specified by:
      onStateChanged in interface IVSColumnListener
      Parameters:
      column - The VS column.
      cell - The VS field.
      state - The state change.
      on - New state.
    • onCellValueChanged

      public void onCellValueChanged(VSColumnHeader column, VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
      Called when the cell value is set in the column.
      Specified by:
      onCellValueChanged in interface IVSColumnListener
      Parameters:
      column - The VS column.
      cell - The VS field.
      value - The value, never null, but value.isNull() could be true.
      trigger - The trigger property that may be null.
      postProcessing - Post-processing instance.
    • onParentStateChanged

      public void onParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on)
      Called when the parent changes state.
      Specified by:
      onParentStateChanged in interface IVSComponentListener
      Parameters:
      parent - The parent who's state was changed.
      state - The state change, possible values PARENT_ENABLED, PARENT_READONLY, PARENT_VISIBLE.
      on - New state.
    • updateContents

      public void updateContents()
      Called to update the data series with new data from the connected VS table.