Package elki.visualization
Class VisualizationTree
- java.lang.Object
-
- elki.utilities.datastructures.hierarchy.HashMapHierarchy<java.lang.Object>
-
- elki.visualization.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 Summary
Fields Modifier and Type Field Description private java.util.ArrayList<VisualizationListener>
vlistenerList
The event listeners for this context.
-
Constructor Summary
Constructors Constructor Description VisualizationTree()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addVisualizationListener(VisualizationListener listener)
Add a listener.static It<java.lang.Object>
findNewResults(VisualizerContext context, java.lang.Object start)
Iterate over the primary result tree.static <A,B extends VisualizationItem>
voidfindNewResultVis(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).static <A,B extends VisualizationItem>
voidfindNewSiblings(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.static It<java.lang.Object>
findVis(VisualizerContext context)
Filtered iteration over a stacked hierarchy.static It<java.lang.Object>
findVis(VisualizerContext context, java.lang.Object start)
Filtered iteration over a stacked hierarchy.void
removeVisualizationListener(VisualizationListener listener)
Add a listener.static void
setVisible(VisualizerContext context, VisualizationTask task, boolean visibility)
Utility function to change Visualizer visibility.void
visChanged(VisualizationItem item)
A visualization item has changed.-
Methods inherited from class elki.utilities.datastructures.hierarchy.HashMapHierarchy
add, add, contains, iterAll, iterAncestors, iterAncestorsSelf, iterChildren, iterChildrenReverse, iterDescendants, iterDescendantsSelf, iterParents, iterParentsReverse, numChildren, numParents, remove, remove, removeSubtree, size
-
-
-
-
Field Detail
-
vlistenerList
private java.util.ArrayList<VisualizationListener> vlistenerList
The event listeners for this context.
-
-
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 contextstart
- 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 contextstart
- 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
- Contextstart
- Starting pointtype1
- First type, in first hierarchytype2
- Second type, in second hierarchyhandler
- 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
- Contextstart
- Starting pointtype1
- First type, in first hierarchytype2
- Second type, in second hierarchyhandler
- Handler
-
setVisible
public static void setVisible(VisualizerContext context, VisualizationTask task, boolean visibility)
Utility function to change Visualizer visibility.- Parameters:
context
- Visualization contexttask
- Visualization taskvisibility
- Visibility value
-
-