Class IndividualBarSimulationPlotter

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, EventListener

public class IndividualBarSimulationPlotter extends JInternalFrame implements EventListener
A bar chart plotter showing elements manually added by user. It is based on JFreeChart library. It is compatible with the microsim.statistics.* classes.

Title: JAS

Description: Java Agent-based Simulation library

Copyright (C) 2002-13 Michele Sonnessa

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
Author:
Michele Sonnessa
See Also:
  • Constructor Details

    • IndividualBarSimulationPlotter

      public IndividualBarSimulationPlotter(String title, String yaxis)
  • Method Details

    • onEvent

      public void onEvent(Enum<?> type)
      Specified by:
      onEvent in interface EventListener
    • update

      public void update()
    • addSources

      public void addSources(String legend, IDoubleSource plottableObject)
      Build a series retrieving data from a IDoubleSource object, using the default variableId.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IDoubleSource interface.
    • addSources

      public void addSources(String legend, Object target, String variableName, boolean getFromMethod)
      Build a series from a generic object.
      Parameters:
      legend - The legend name of the series.
      target - The data source object.
      variableName - The variable or method name of the source object.
      getFromMethod - Specifies if the variableName is a field or a method.
    • addSources

      public void addSources(String legend, IDoubleSource plottableObject, Color color)
      Build a series retrieving data from a IDoubleSource object, using the default variableId and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IDoubleSource interface.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, IDoubleSource plottableObject, Enum<?> variableID, Color color)
      Build a series retrieving data from a IDoubleSource object and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IDoubleSource interface.
      variableID - The variable id of the source object.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, IFloatSource plottableObject, Color color)
      Build a series from a IFloatSource object, using the default variableId and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IFloatSource interface.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, IFloatSource plottableObject, Enum<?> variableID, Color color)
      Build a series from a IFloatSource object and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IFloatSource interface.
      variableID - The variable id of the source object.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, ILongSource plottableObject, Color color)
      Build a series from a ILongSource object, using the default variableId and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the ILongSource interface.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, ILongSource plottableObject, Enum<?> variableID, Color color)
      Build a series from a ILongSource object and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IDblSource interface.
      variableID - The variable id of the source object.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, IIntSource plottableObject, Color color)
      Build a series from a IIntSource object, using the default variableId and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IIntSource interface.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, IIntSource plottableObject, Enum<?> variableID, Color color)
      Build a series from a IIntSource object and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      plottableObject - The data source object implementing the IIntSource interface.
      variableID - The variable id of the source object.
      color - Specifies the color of the bar
    • addSources

      public void addSources(String legend, Object target, String variableName, boolean getFromMethod, Color color)
      Build a series from a generic object and specifying the colour.
      Parameters:
      legend - The legend name of the series.
      target - The data source object.
      variableName - The variable or method name of the source object.
      getFromMethod - Specifies if the variableName is a field or a method.
      color - Specifies the color of the bar