Class VisualizationTree

  • All Implemented Interfaces:
    Hierarchy<java.lang.Object>, ModifiableHierarchy<java.lang.Object>

    public class VisualizationTree
    extends HashMapHierarchy<java.lang.Object>
    Tree - actually a forest - to manage visualizations.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Detail

      • vlistenerList

        private java.util.ArrayList<VisualizationListener> vlistenerList
        The event listeners for this context.
    • Constructor Detail

      • VisualizationTree

        public VisualizationTree()
        Constructor.
    • Method Detail

      • 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
      • visChanged

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

        public static It<java.lang.Object> findVis​(VisualizerContext context)
        Filtered iteration over a stacked hierarchy.

        This is really messy because the visualization hierarchy is typed Object.

        Parameters:
        context - Visualization context
        Returns:
        Iterator of results.
      • findVis

        public static It<java.lang.Object> findVis​(VisualizerContext context,
                                                   java.lang.Object start)
        Filtered iteration over a stacked hierarchy.

        This is really messy because the visualization hierarchy is typed Object.

        Parameters:
        context - Visualization context
        start - Starting object (in primary hierarchy!)
        Returns:
        Iterator of results.
      • findNewResults

        public static It<java.lang.Object> findNewResults​(VisualizerContext context,
                                                          java.lang.Object start)
        Iterate over the primary result tree.
        Parameters:
        context - Visualization context
        start - Starting object (in primary hierarchy!)
        Returns:
        Iterator of results.
      • findNewSiblings

        public static <A,​B extends VisualizationItem> void findNewSiblings​(VisualizerContext context,
                                                                                 java.lang.Object start,
                                                                                 java.lang.Class<? super A> type1,
                                                                                 java.lang.Class<? super B> type2,
                                                                                 java.util.function.BiConsumer<A,​B> handler)
        Process new result combinations of an object type1 (in first hierarchy) and any child of type2 (in second hierarchy) This is a bit painful, because we have two hierarchies with different types: results, and visualizations.
        Parameters:
        context - Context
        start - Starting point
        type1 - First type, in first hierarchy
        type2 - Second type, in second hierarchy
        handler - Handler
      • findNewResultVis

        public static <A,​B extends VisualizationItem> void findNewResultVis​(VisualizerContext context,
                                                                                  java.lang.Object start,
                                                                                  java.lang.Class<? super A> type1,
                                                                                  java.lang.Class<? super B> type2,
                                                                                  java.util.function.BiConsumer<A,​B> handler)
        Process new result combinations of an object type1 (in first hierarchy) having a child of type2 (in second hierarchy). This is a bit painful, because we have two hierarchies with different types: results, and visualizations.
        Parameters:
        context - Context
        start - Starting point
        type1 - First type, in first hierarchy
        type2 - Second type, in second hierarchy
        handler - Handler
      • setVisible

        public static void setVisible​(VisualizerContext context,
                                      VisualizationTask task,
                                      boolean visibility)
        Utility function to change Visualizer visibility.
        Parameters:
        context - Visualization context
        task - Visualization task
        visibility - Visibility value