public class VisualizerContext extends Object implements DataStoreListener, Result
Modifier and Type | Field and Description |
---|---|
private Result |
baseResult
Starting point of the result tree, may be
null . |
private Collection<VisualizationProcessor> |
factories
Factories to use
|
private ResultHierarchy |
hier
The full result object
|
private ArrayList<DataStoreListener> |
listenerList
The event listeners for this context.
|
private static Logging |
LOG
Logger.
|
private Relation<?> |
relation
Relation currently visualized.
|
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,
Relation<?> relation,
StyleLibrary stylelib,
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(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
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
Relation<?> |
getRelation()
Current relation.
|
DBIDSelection |
getSelection()
Get the current selection.
|
SelectionResult |
getSelectionResult()
Get the current selection result.
|
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() |
List<VisualizationTask> |
getVisTasks(VisualizationItem item) |
protected void |
makeStyleResult(StyleLibrary stylelib)
Generate a new style result for the given style library.
|
private void |
notifyFactories(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 |
setRelation(Relation<?> rel)
Set the current relation.
|
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 ArrayList<DataStoreListener> listenerList
private Collection<VisualizationProcessor> factories
private SelectionResult selection
StylingPolicy stylepolicy
StyleLibrary stylelibrary
private Result baseResult
null
.private Relation<?> relation
public VisualizerContext(ResultHierarchy hier, Result start, Relation<?> relation, StyleLibrary stylelib, Collection<VisualizationProcessor> factories)
hier
- Result hierarchystart
- Starting resultfactories
- 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 Relation<?> getRelation()
public void setRelation(Relation<?> rel)
rel
- Relationpublic 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 String getLongName()
Result
getLongName
in interface Result
public String getShortName()
Result
getShortName
in interface Result
public Result getBaseResult()
null
.null
.public void addVis(Object parent, VisualizationItem vis)
parent
- Parent objectvis
- Visualizationpublic void visChanged(VisualizationItem item)
item
- Item that has changedprivate void notifyFactories(Object item)
item
- Item that has changed.public List<VisualizationTask> getVisTasks(VisualizationItem item)
public VisualizationTree getVisHierarchy()
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.