Class Plugins

  • All Implemented Interfaces:
    ConfigurationElement

    public final class Plugins
    extends Object
    implements ConfigurationElement
    Is the manager of plugins which can manage the list of plugins and returns them as java script object to store in the chart configuration.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Summary

      Constructors 
      Constructor Description
      Plugins()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Plugin plugin)
      Adds a new plugin to the chart.
      If another plugin instance with the same id has been already loaded, it will remove, storing the new one.
      If the chart is already initialized, to get this update the chart must be drawn again.
      void add​(PluginContainer container)
      Adds a new plugin to the chart, by a container
      void add​(SmartPlugin plugin)
      Adds a new plugin to the chart.
      If another plugin instance with the same id has been already loaded, it will remove, storing the new one.
      If the chart is already initialized, to get this update the chart must be drawn again.
      void add​(SmartPluginContainer container)
      Adds a new plugin to the chart, by a container
      boolean has​(String id)
      Returns true if a plugin is already added, otherwise false.
      void load​(IsChart chart, Configuration configuration)
      Called to enable to load in the a configuration object the specific configuration item (by native object).
      void onChartConfigure​(Configuration config, IsChart chart)
      Invokes the on configuration method to inform the plugins that the chart is going to be initialized.
      void remove​(String pluginId)
      Removes a plugin from the chart.
      If the chart is already initialized, to get this update the chart must be drawn again.
    • Constructor Detail

      • Plugins

        public Plugins()
    • Method Detail

      • add

        public void add​(PluginContainer container)
        Adds a new plugin to the chart, by a container
        Parameters:
        container - plugin container instance
      • add

        public void add​(Plugin plugin)
        Adds a new plugin to the chart.
        If another plugin instance with the same id has been already loaded, it will remove, storing the new one.
        If the chart is already initialized, to get this update the chart must be drawn again.
        Parameters:
        plugin - plugin instance
      • add

        public void add​(SmartPluginContainer container)
        Adds a new plugin to the chart, by a container
        Parameters:
        container - plugin container instance
      • add

        public void add​(SmartPlugin plugin)
        Adds a new plugin to the chart.
        If another plugin instance with the same id has been already loaded, it will remove, storing the new one.
        If the chart is already initialized, to get this update the chart must be drawn again.
        Parameters:
        plugin - plugin instance
      • has

        public boolean has​(String id)
        Returns true if a plugin is already added, otherwise false.
        Parameters:
        id - plugin id to search.
        Returns:
        true if a plugin is already added, otherwise false
      • remove

        public void remove​(String pluginId)
        Removes a plugin from the chart.
        If the chart is already initialized, to get this update the chart must be drawn again.
        Parameters:
        pluginId - plugin id to remove.
      • onChartConfigure

        public void onChartConfigure​(Configuration config,
                                     IsChart chart)
        Invokes the on configuration method to inform the plugins that the chart is going to be initialized.
        Parameters:
        config - configuration item. Added only to reduce visibility of public method.
        chart - instance of the chart
      • load

        public void load​(IsChart chart,
                         Configuration configuration)
        Description copied from interface: ConfigurationElement
        Called to enable to load in the a configuration object the specific configuration item (by native object).
        Specified by:
        load in interface ConfigurationElement
        Parameters:
        chart - chart instance
        configuration - chart configuration instance