Class AbstractPluginOptions

    • Constructor Detail

      • AbstractPluginOptions

        protected AbstractPluginOptions​(String pluginId,
                                        NativeObject nativeObject)
        Creates new plugin options with plugin ID, using a native object instance.
        Parameters:
        pluginId - plugin ID
        nativeObject - native object which represents the plugin options as native object
      • AbstractPluginOptions

        protected AbstractPluginOptions​(String pluginId,
                                        NativeObject nativeObject,
                                        boolean createUniqueId)
        Creates new plugin options with plugin ID, using a native object instance and setting if a unique id must calculated
        Parameters:
        pluginId - plugin ID
        nativeObject - native object which represents the plugin options as native object
        createUniqueId - if true, a unique id will be created and stored in the object.
      • AbstractPluginOptions

        protected AbstractPluginOptions​(String pluginId,
                                        AbstractNode parent,
                                        Key childKey,
                                        NativeObject nativeObject,
                                        boolean createUniqueId)
        Creates the object with the parent, the key of this element, default values and native object to map java script properties.
        Parameters:
        pluginId - plugin ID
        parent - parent node to use to add this element where changed
        childKey - the property name of this element to use to add it to the parent.
        nativeObject - native object to map java script properties
        createUniqueId - if true, a unique id will be created and stored in the object.
    • Method Detail

      • getId

        public final String getId()
        Returns the unique ID of the options.
        Returns:
        the unique ID of the options.
      • getPluginId

        public final String getPluginId()
        Returns the plugin id related to this options.
        Returns:
        the plugin id related to this options
      • setEvents

        public void setEvents​(Event... events)
        Sets the browser events that the plugins should listen to.
        Parameters:
        events - the browser events that the plugins should listen to.
      • setEvents

        public void setEvents​(Set<Event> events)
        Sets the browser events that the legend should listen to.
        Parameters:
        events - the browser events that the legend should listen to.
      • getEvents

        public final Set<Event> getEvents()
        Returns the browser events that the plugins should listen to.
        Returns:
        the browser events that the plugins should listen to.
      • loadGlobalsPluginOptions

        protected final <T extends AbstractPluginOptions> T loadGlobalsPluginOptions​(AbstractPluginOptionsFactory<T> factory)
        Loads the default plugin options from defaults. If factory, passed as argument, is null, returns null.
        Type Parameters:
        T - type of native object container
        Parameters:
        factory - factory to load options
        Returns:
        the defaults plugin options or new options instance if not exist. If factory is null, returns null.
      • applyingDefaults

        public final void applyingDefaults​(ChartEnvelop<String> envelop)
        This is invoked before storing the plugins options as default.
        This is called set the options of plugin are stored as default, see GlobalOptions.getPlugins().
        Parameters:
        envelop - envelop needed to ensure that this public method can be called only by GlobalOptions
      • applyingDefaults

        protected void applyingDefaults()
        This is invoked before storing the plugins options as default.
      • store

        public final void store()
        Stores this options in the default global plugins options.
      • store

        public final void store​(IsChart chart)
        Stores this options in the chart plugins options.
        Parameters:
        chart - chart instance
      • store

        public final void store​(Type type)
        Stores this options in the global chart plugins options.
        Parameters:
        type - chart type to store options in the global chart options
      • store

        public final void store​(Dataset dataset)
        Stores this options in the dataset options.
        Parameters:
        dataset - dataset instance to store options