Class SeriesValue

java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizix.prop.ui.chart.series.SeriesValue
All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IChartContainer, Cloneable
Direct Known Subclasses:
ESeriesValue

public class SeriesValue extends PropCnr implements IChartContainer
A series value property is a property container that contains NumberProp's, and optionally the text of the value. The following table indicates the value types and the expected property names:
  Type    Name(s)
  ------  --------------
  Simple  [v]
  X/Y     [x] [y]
  Bubble  [x] [y] [s]
  OHLC    [o] [h] [l] [c] [m]
  Text    [t]  (a KStringProp, with any type, see setText(String))
Author:
Christopher Mindus
  • Field Details

    • PN_TEXT

      public static final String PN_TEXT
      The name of the text of the value, a KStringProp (dojox text).
      See Also:
  • Constructor Details

    • SeriesValue

      public SeriesValue()
      Constructs a new series value without a name.

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

    • SeriesValue

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

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

      Parameters:
      atom - The atom name.
    • SeriesValue

      public SeriesValue(Atom atom, GSeriesValue value)
      Constructs a new series value from an Atom name.

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

      Parameters:
      atom - The atom name.
  • Method Details

    • getSeriesType

      public SeriesType getSeriesType()
      Gets the value as a 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 SeriesValue clone()
      Clone must be overridden.
      Overrides:
      clone in class PropCnr
    • getValue

      public GSeriesValue getValue()
      Gets the series value.
      Returns:
      The value.
    • setValue

      public void setValue(GSeriesValue value)
      Sets the series value. The text of the value, if any, stays.
      Parameters:
      value - The new value.
    • setText

      public boolean setText(String text) throws PropValidateException
      Sets the text of the value (dojox text): a pie draws it as the label of the slice instead of its percentage, a legend of a pie shows it as the entry of the slice, and the tooltip of the plot (PlotOption.TOOLTIP) shows it instead of the number. Plots with axes do not draw it. The text stays when the number of the value changes (setValue(GSeriesValue), Series.setValueText(int,String)).

      Example, the three bands of a pie named:

        Series bands=pie.getSeries("Bands");
        bands.addValues(12,30,18);
        bands.setValueText(0,"below 40");
        bands.setValueText(1,"40 to 80");
        bands.setValueText(2,"above 80");
      

      Parameters:
      text - The text, plain, or null to remove it.
      Returns:
      true if the text changed.
      Throws:
      PropValidateException - If the text is refused.
    • setText

      public boolean setText(KString text) throws PropValidateException
      Sets the text of the value as a KString, e.g. one of a text table for the languages of the application: see setText(String).
      Parameters:
      text - The text, or null to remove it.
      Returns:
      true if the text changed.
      Throws:
      PropValidateException - If the text is refused.
    • getText

      public KString getText()
      Gets the text of the value.
      Returns:
      The text, or null for none.
    • 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.