public class VisualizerContext extends Object implements DataStoreListener, Result
Modifier and Type | Field and Description |
---|---|
private Collection<VisFactory> |
factories
Factories to use
|
private EventListenerList |
listenerList
The event listeners for this context.
|
private static Logging |
LOG
Logger.
|
private Collection<ProjectorFactory> |
projectors
Projectors to use
|
private HierarchicalResult |
result
The full result object
|
private SelectionResult |
selection
Selection result
|
private StyleResult |
styleresult
Styling result
|
Constructor and Description |
---|
VisualizerContext(HierarchicalResult result,
StyleLibrary stylelib,
Collection<ProjectorFactory> projectors,
Collection<VisFactory> 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 |
contentChanged(DataStoreEvent e)
Proxy datastore event to child listeners.
|
private Clustering<Model> |
generateDefaultClustering()
Generate a default (fallback) clustering.
|
ResultHierarchy |
getHierarchy()
Get the hierarchy object
|
String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
HierarchicalResult |
getResult()
Get the full result object
|
DBIDSelection |
getSelection()
Get the current selection.
|
String |
getShortName()
A short name for the result, useful for file names.
|
StyleResult |
getStyleResult()
Get the style result.
|
protected void |
makeStyleResult(StyleLibrary stylelib)
Generate a new style result for the given style library.
|
private void |
processNewResult(HierarchicalResult baseResult,
Result newResult)
Process a particular result.
|
void |
removeDataStoreListener(DataStoreListener l)
Removes a listener previously added with
addDataStoreListener . |
void |
removeResultListener(ResultListener listener)
Remove a result listener.
|
void |
setSelection(DBIDSelection sel)
Set a new selection.
|
private static final Logging LOG
private HierarchicalResult result
private EventListenerList listenerList
private Collection<ProjectorFactory> projectors
private Collection<VisFactory> factories
private SelectionResult selection
private StyleResult styleresult
public VisualizerContext(HierarchicalResult result, StyleLibrary stylelib, Collection<ProjectorFactory> projectors, Collection<VisFactory> factories)
result
- Resultprojectors
- Projectors to usefactories
- Visualizer Factories to useprotected void makeStyleResult(StyleLibrary stylelib)
stylelib
- Style librarypublic HierarchicalResult getResult()
public ResultHierarchy getHierarchy()
public StyleResult getStyleResult()
private Clustering<Model> generateDefaultClustering()
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 eventprivate void processNewResult(HierarchicalResult baseResult, Result newResult)
baseResult
- Base ResultnewResult
- Newly added Resultpublic void addResultListener(ResultListener listener)
listener
- Result listener.public void removeResultListener(ResultListener listener)
listener
- Result listener.public String getLongName()
Result
getLongName
in interface Result
public String getShortName()
Result
getShortName
in interface Result