Class VisualizerContext

  • All Implemented Interfaces:
    DataStoreListener

    public class VisualizerContext
    extends java.lang.Object
    implements DataStoreListener
    Map to store context information for the visualizer. This can be any data that should to be shared among plots, such as line colors, styles etc.
    Since:
    0.3
    Author:
    Erich Schubert
    • Field Detail

      • LOG

        private static final Logging LOG
        Logger.
      • listenerList

        private java.util.ArrayList<DataStoreListener> listenerList
        The event listeners for this context.
      • baseResult

        private java.lang.Object baseResult
        Starting point of the result tree, may be null.
    • Constructor Detail

      • VisualizerContext

        public VisualizerContext​(java.lang.Object start,
                                 StyleLibrary stylelib,
                                 java.util.Collection<VisualizationProcessor> factories)
        Constructor. We currently require a Database and a Result.
        Parameters:
        start - Starting result
        stylelib - Style library
        factories - Visualizer Factories to use
    • Method Detail

      • makeStyleResult

        protected void makeStyleResult​(StyleLibrary stylelib)
        Generate a new style result for the given style library.
        Parameters:
        stylelib - Style library
      • getStylingPolicy

        public StylingPolicy getStylingPolicy()
        Get the active styling policy
        Returns:
        Styling policy
      • setStylingPolicy

        public void setStylingPolicy​(StylingPolicy policy)
        Set the active styling policy
        Parameters:
        policy - new Styling policy
      • getStyleLibrary

        public StyleLibrary getStyleLibrary()
        Get the style library
        Returns:
        Style library
      • setStyleLibrary

        public void setStyleLibrary​(StyleLibrary library)
        Get the style library
        Parameters:
        library - Style library
      • generateDefaultClustering

        private Clustering<Model> generateDefaultClustering()
        Generate a default (fallback) clustering.
        Returns:
        generated clustering
      • getSelectionResult

        public SelectionResult getSelectionResult()
        Get the current selection result.
        Returns:
        selection result
      • getSelection

        public DBIDSelection getSelection()
        Get the current selection.
        Returns:
        selection
      • setSelection

        public void setSelection​(DBIDSelection sel)
        Set a new selection.
        Parameters:
        sel - Selection
      • addResultListener

        public void addResultListener​(ResultListener listener)
        Register a result listener.
        Parameters:
        listener - Result listener.
      • removeResultListener

        public void removeResultListener​(ResultListener listener)
        Remove a result listener.
        Parameters:
        listener - Result listener.
      • addVisualizationListener

        public void addVisualizationListener​(VisualizationListener listener)
        Add a listener.
        Parameters:
        listener - Listener to add
      • removeVisualizationListener

        public void removeVisualizationListener​(VisualizationListener listener)
        Add a listener.
        Parameters:
        listener - Listener to remove
      • getLongName

        public java.lang.String getLongName()
      • getShortName

        public java.lang.String getShortName()
      • getBaseResult

        public java.lang.Object getBaseResult()
        Starting point for visualization, may be null.
        Returns:
        Starting point in the result tree, may be null.
      • addVis

        public void addVis​(java.lang.Object parent,
                           VisualizationItem vis)
        Add (register) a visualization.
        Parameters:
        parent - Parent object
        vis - Visualization
      • visChanged

        public void visChanged​(VisualizationItem item)
        A visualization item has changed.
        Parameters:
        item - Item that has changed
      • notifyFactories

        private void notifyFactories​(java.lang.Object item)
        Notify factories of a change.
        Parameters:
        item - Item that has changed.