Klasse ValueLegend

Alle implementierten Schnittstellen:
DataListener, Container, Drawable, Legend, Iterable<Drawable>
Bekannte direkte Unterklassen:
BarPlot.BarPlotLegend, BoxPlot.BoxPlotLegend, PiePlot.PiePlotLegend

public abstract class ValueLegend extends AbstractLegend implements DataListener

A legend that shows one entry per row of a data source rather than one per source. This is what a PiePlot needs, since there each row is a slice and the source as a whole has no single symbol.

The label text of an entry is taken from a configurable column of the row and formatted with a java.text.Format, so a pie can be labeled with a separate column of names instead of with its values.

Siehe auch:
  • Konstruktordetails

    • ValueLegend

      public ValueLegend()
      Initializes a new instance with default values.
  • Methodendetails

    • getEntries

      protected Iterable<Row> getEntries(DataSource source)
      Returns a sequence of items for the specified data source that should be added to the legend.
      Parameter:
      source - Data source.
      Gibt zurück:
      A sequence of items for the specified data source.
    • getLabel

      protected String getLabel(Row row)
      Returns the label text for the specified row.
      Parameter:
      row - Data row.
      Gibt zurück:
      Label text.
    • add

      public void add(DataSource source)
      Beschreibung aus Klasse kopiert: AbstractLegend
      Adds the specified data source in order to display it.
      Angegeben von:
      add in Schnittstelle Legend
      Setzt außer Kraft:
      add in Klasse AbstractLegend
      Parameter:
      source - data source to be added.
    • remove

      public void remove(DataSource source)
      Beschreibung aus Klasse kopiert: AbstractLegend
      Removes the specified data source.
      Angegeben von:
      remove in Schnittstelle Legend
      Setzt außer Kraft:
      remove in Klasse AbstractLegend
      Parameter:
      source - Data source to be removed.
    • dataAdded

      public void dataAdded(DataSource source, DataChangeEvent... events)
      Method that is invoked when data has been added. This method is invoked by objects that provide support for DataListeners and should not be called manually.
      Angegeben von:
      dataAdded in Schnittstelle DataListener
      Parameter:
      source - Data source that has been changed.
      events - Optional event object describing the data values that have been added.
    • dataUpdated

      public void dataUpdated(DataSource source, DataChangeEvent... events)
      Method that is invoked when data has been updated. This method is invoked by objects that provide support for DataListeners and should not be called manually.
      Angegeben von:
      dataUpdated in Schnittstelle DataListener
      Parameter:
      source - Data source that has been changed.
      events - Optional event object describing the data values that have been updated.
    • dataRemoved

      public void dataRemoved(DataSource source, DataChangeEvent... events)
      Method that is invoked when data has been removed. This method is invoked by objects that provide support for DataListeners and should not be called manually.
      Angegeben von:
      dataRemoved in Schnittstelle DataListener
      Parameter:
      source - Data source that has been changed.
      events - Optional event object describing the data values that have been removed.
    • getLabelColumn

      public int getLabelColumn()
      Returns the index of the column that contains the labels for the values.
      Gibt zurück:
      Column index containing the labels.
    • setLabelColumn

      public void setLabelColumn(int labelColumn)
      Sets the index of the column that contains the labels for the values.
      Parameter:
      labelColumn - Column index containing the labels.
    • getLabelFormat

      public Format getLabelFormat()
      Returns the format used to display data values.
      Gibt zurück:
      Format for data to label text conversion.
    • setLabelFormat

      public void setLabelFormat(Format labelFormat)
      Sets the format used to display data values.
      Parameter:
      labelFormat - Format for data to label text conversion.
    • getSymbol

      protected abstract Drawable getSymbol(Row row)
      Returns a symbol for rendering a legend item.
      Parameter:
      row - Data row.
      Gibt zurück:
      A drawable object that can be used to display the symbol.