public class VisualizerContext extends java.lang.Object implements DataStoreListener, Result
Modifier and Type | Field and Description |
---|---|
private Result |
baseResult
Starting point of the result tree, may be
null . |
private java.util.Collection<VisualizationProcessor> |
factories
Factories to use
|
private ResultHierarchy |
hier
The full result object
|
private java.util.ArrayList<DataStoreListener> |
listenerList
The event listeners for this context.
|
private static Logging |
LOG
Logger.
|
private SelectionResult |
selection
Selection result
|
(package private) StyleLibrary |
stylelibrary
Style library
|
(package private) StylingPolicy |
stylepolicy
Styling policy
|
private VisualizationTree |
vistree
Tree of visualizations.
|
Constructor and Description |
---|
VisualizerContext(ResultHierarchy hier,
Result start,
StyleLibrary stylelib,
java.util.Collection<VisualizationProcessor> factories)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataStoreListener(DataStoreListener l)
Adds a listener for the
DataStoreEvent posted after the
content changes. |
void |
addResultListener(ResultListener listener)
Register a result listener.
|
void |
addVis(java.lang.Object parent,
VisualizationItem vis)
Add (register) a visualization.
|
void |
addVisualizationListener(VisualizationListener listener)
Add a listener.
|
void |
contentChanged(DataStoreEvent e)
Proxy datastore event to child listeners.
|
private Clustering<Model> |
generateDefaultClustering()
Generate a default (fallback) clustering.
|
Result |
getBaseResult()
Starting point for visualization, may be
null . |
ResultHierarchy |
getHierarchy()
Get the hierarchy object
|
java.lang.String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
DBIDSelection |
getSelection()
Get the current selection.
|
SelectionResult |
getSelectionResult()
Get the current selection result.
|
java.lang.String |
getShortName()
A short name for the result, useful for file names.
|
StyleLibrary |
getStyleLibrary()
Get the style library
|
StylingPolicy |
getStylingPolicy()
Get the active styling policy
|
VisualizationTree |
getVisHierarchy() |
java.util.List<VisualizationTask> |
getVisTasks(VisualizationItem item) |
protected void |
makeStyleResult(StyleLibrary stylelib)
Generate a new style result for the given style library.
|
private void |
notifyFactories(java.lang.Object item)
Notify factories of a change.
|
void |
removeDataStoreListener(DataStoreListener l)
Removes a listener previously added with
addDataStoreListener . |
void |
removeResultListener(ResultListener listener)
Remove a result listener.
|
void |
removeVisualizationListener(VisualizationListener listener)
Add a listener.
|
void |
setSelection(DBIDSelection sel)
Set a new selection.
|
void |
setStyleLibrary(StyleLibrary library)
Get the style library
|
void |
setStylingPolicy(StylingPolicy policy)
Set the active styling policy
|
void |
visChanged(VisualizationItem item)
A visualization item has changed.
|
private static final Logging LOG
private VisualizationTree vistree
private ResultHierarchy hier
private java.util.ArrayList<DataStoreListener> listenerList
private java.util.Collection<VisualizationProcessor> factories
private SelectionResult selection
StylingPolicy stylepolicy
StyleLibrary stylelibrary
private Result baseResult
null
.public VisualizerContext(ResultHierarchy hier, Result start, StyleLibrary stylelib, java.util.Collection<VisualizationProcessor> factories)
hier
- Result hierarchystart
- Starting resultstylelib
- Style libraryfactories
- Visualizer Factories to useprotected void makeStyleResult(StyleLibrary stylelib)
stylelib
- Style librarypublic ResultHierarchy getHierarchy()
public StylingPolicy getStylingPolicy()
public void setStylingPolicy(StylingPolicy policy)
policy
- new Styling policypublic StyleLibrary getStyleLibrary()
public void setStyleLibrary(StyleLibrary library)
library
- Style libraryprivate Clustering<Model> generateDefaultClustering()
public SelectionResult getSelectionResult()
public DBIDSelection getSelection()
public void setSelection(DBIDSelection sel)
sel
- Selectionpublic void addDataStoreListener(DataStoreListener l)
DataStoreEvent
posted after the
content changes.l
- the listener to addremoveDataStoreListener(de.lmu.ifi.dbs.elki.database.datastore.DataStoreListener)
public void removeDataStoreListener(DataStoreListener l)
addDataStoreListener
.l
- the listener to removeaddDataStoreListener(de.lmu.ifi.dbs.elki.database.datastore.DataStoreListener)
public void contentChanged(DataStoreEvent e)
contentChanged
in interface DataStoreListener
e
- the update eventpublic void addResultListener(ResultListener listener)
listener
- Result listener.public void removeResultListener(ResultListener listener)
listener
- Result listener.public void addVisualizationListener(VisualizationListener listener)
listener
- Listener to addpublic void removeVisualizationListener(VisualizationListener listener)
listener
- Listener to removepublic java.lang.String getLongName()
Result
getLongName
in interface Result
public java.lang.String getShortName()
Result
getShortName
in interface Result
public Result getBaseResult()
null
.null
.public void addVis(java.lang.Object parent, VisualizationItem vis)
parent
- Parent objectvis
- Visualizationpublic void visChanged(VisualizationItem item)
item
- Item that has changedprivate void notifyFactories(java.lang.Object item)
item
- Item that has changed.public java.util.List<VisualizationTask> getVisTasks(VisualizationItem item)
public VisualizationTree getVisHierarchy()
Copyright © 2019 ELKI Development Team. License information.