All Downloads are FREE. Search and download functionalities are using the official Maven repository.

weka.gui.beans.ChartEvent Maven / Gradle / Ivy

Go to download

The Waikato Environment for Knowledge Analysis (WEKA), a machine learning workbench. This is the stable version. Apart from bugfixes, this version does not receive any other updates.

There is a newer version: 3.8.6
Show newest version
/*
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see .
 */

/*
 *    ChartEvent.java
 *    Copyright (C) 2002-2012 University of Waikato, Hamilton, New Zealand
 *
 */

package weka.gui.beans;

import java.util.EventObject;
import java.util.Vector;

/**
 * Event encapsulating info for plotting a data point on the StripChart
 * 
 * @author Mark Hall
 * @version $Revision: 10216 $
 */
public class ChartEvent extends EventObject {

  /** for serialization */
  private static final long serialVersionUID = 7812460715499569390L;

  private Vector m_legendText;
  private double m_max;
  private double m_min;

  private boolean m_reset;

  /**
   * Y values of the data points
   */
  private double[] m_dataPoint;

  /**
   * Creates a new ChartEvent instance.
   * 
   * @param source the source of the event
   * @param legendText a vector of strings to display in the legend
   * @param min minimum y value
   * @param max maximum y value
   * @param dataPoint an array of y values to plot
   * @param reset true if display is to be reset
   */
  public ChartEvent(Object source, Vector legendText, double min,
    double max, double[] dataPoint, boolean reset) {
    super(source);
    m_legendText = legendText;
    m_max = max;
    m_min = min;
    m_dataPoint = dataPoint;
    m_reset = reset;
  }

  /**
   * Creates a new ChartEvent instance.
   * 
   * @param source the source of the event
   */
  public ChartEvent(Object source) {
    super(source);
  }

  /**
   * Get the legend text vector
   * 
   * @return a Vector value
   */
  public Vector getLegendText() {
    return m_legendText;
  }

  /**
   * Set the legend text vector
   * 
   * @param lt a Vector value
   */
  public void setLegendText(Vector lt) {
    m_legendText = lt;
  }

  /**
   * Get the min y value
   * 
   * @return a double value
   */
  public double getMin() {
    return m_min;
  }

  /**
   * Set the min y value
   * 
   * @param m a double value
   */
  public void setMin(double m) {
    m_min = m;
  }

  /**
   * Get the max y value
   * 
   * @return a double value
   */
  public double getMax() {
    return m_max;
  }

  /**
   * Set the max y value
   * 
   * @param m a double value
   */
  public void setMax(double m) {
    m_max = m;
  }

  /**
   * Get the data point
   * 
   * @return a double[] value
   */
  public double[] getDataPoint() {
    return m_dataPoint;
  }

  /**
   * Set the data point
   * 
   * @param dp a double[] value
   */
  public void setDataPoint(double[] dp) {
    m_dataPoint = dp;
  }

  /**
   * Set the reset flag
   * 
   * @param reset a boolean value
   */
  public void setReset(boolean reset) {
    m_reset = reset;
  }

  /**
   * get the value of the reset flag
   * 
   * @return a boolean value
   */
  public boolean getReset() {
    return m_reset;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy