Logo Search packages:      
Sourcecode: wims version File versions

synchronized void ptolemy::plot::PlotBox::addLegend ( int  dataset,
String  legend 
) [inline]

Add a legend (displayed at the upper right) for the specified data set with the specified string. Short strings generally fit better than long strings. If the string is empty, or the argument is null, then no legend is added.

Parameters:
dataset The dataset index.
legend The label for the dataset.
See also:
renameLegend(int, String)

Reimplemented in ptolemy::plot::Histogram, and ptolemy::plot::Plot.

Definition at line 288 of file PlotBox.java.

References _legendDatasets, and _legendStrings.

                                                                   {
        // Changing legend means we need to repaint the offscreen buffer.
        _plotImage = null;

        if ((legend == null) || legend.equals("")) {
            return;
        }

        _legendStrings.addElement(legend);
        _legendDatasets.addElement(Integer.valueOf(dataset));
    }


Generated by  Doxygen 1.6.0   Back to index