Class ObserverCenter
- java.lang.Object
-
- jadex.extension.envsupport.observer.gui.ObserverCenter
-
- All Implemented Interfaces:
IObserverCenter
public class ObserverCenter extends java.lang.Object implements IObserverCenter
The default observer center.
-
-
Field Summary
Fields Modifier and Type Field Description protected IClockService
clock
protected IChangeListener
clocklistener
The clock listener for sync gui updates.protected boolean
disposed
Flag to indicate that observer is disposed.protected boolean
killonexit
Kill the application on exit.protected java.util.List
selectedObjectListeners
Selected object listeners
-
Constructor Summary
Constructors Constructor Description ObserverCenter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataView(java.lang.String name, IDataView dataview)
Adds an additional dataview.IFuture<java.lang.Void>
addPerspective(java.lang.String name, IPerspective perspective)
Adds a perspective.protected void
addPerspective(java.lang.String name, IPerspective perspective, Future<java.lang.Void> ret)
Adds a perspective.void
addSelectedObjectListener(javax.swing.event.ChangeListener listener)
Adds a listener for change of the selected objectvoid
dispose()
Dispose the observer center.void
fireSelectedObjectChange()
Fires a selected object change event.java.lang.ClassLoader
getClassLoader()
Get the class loader.java.util.Map
getDataViews()
Returns the available dataviews.java.util.Map
getPerspectives()
Returns the available perspectives.IDataView
getSelectedDataView()
Returns the selected dataview.java.lang.String
getSelectedDataViewName()
Returns the selected dataview name.IPerspective
getSelectedPerspective()
Returns the selected perspective.AbstractEnvironmentSpace
getSpace()
Returns the space.protected void
internalLoadPlugins(java.util.List customplugins)
void
loadPlugins(java.util.List customplugins)
Loads all available pluginsvoid
removeSelectedObjectListener(javax.swing.event.ChangeListener listener)
Removes a listener for change of the selected objectvoid
setOpenGLMode(java.lang.String name, boolean opengl)
Sets the OpenGL mode for a perspectivevoid
setSelectedDataView(java.lang.String name)
Sets the selected dataview.void
setSelectedPerspective(java.lang.String name)
Sets the selected perspective.void
startObserver(java.lang.String title, IEnvironmentSpace space, java.lang.ClassLoader classloader, boolean killonexit)
Starts an observer center.
-
-
-
Field Detail
-
selectedObjectListeners
protected java.util.List selectedObjectListeners
Selected object listeners
-
clocklistener
protected IChangeListener clocklistener
The clock listener for sync gui updates.
-
killonexit
protected boolean killonexit
Kill the application on exit.
-
clock
protected IClockService clock
-
disposed
protected boolean disposed
Flag to indicate that observer is disposed.
-
-
Method Detail
-
startObserver
public void startObserver(java.lang.String title, IEnvironmentSpace space, java.lang.ClassLoader classloader, boolean killonexit)
Starts an observer center.- Specified by:
startObserver
in interfaceIObserverCenter
- Parameters:
title
- title of the observer windowspace
- the space being observedclassloader
- the application class loader for loading resources (images etc.)plugins
- custom plugins used in the observer
-
addDataView
public void addDataView(java.lang.String name, IDataView dataview)
Adds an additional dataview.- Parameters:
name
- name of the dataviewdataview
- an additional dataview
-
getDataViews
public java.util.Map getDataViews()
Returns the available dataviews.- Returns:
- the available dataviews
-
getSelectedDataView
public IDataView getSelectedDataView()
Returns the selected dataview.- Specified by:
getSelectedDataView
in interfaceIObserverCenter
- Returns:
- the selected dataview
-
getSelectedDataViewName
public java.lang.String getSelectedDataViewName()
Returns the selected dataview name.- Returns:
- the selected dataview name
-
setSelectedDataView
public void setSelectedDataView(java.lang.String name)
Sets the selected dataview.- Parameters:
name
- name of the dataview to be selected
-
addPerspective
public IFuture<java.lang.Void> addPerspective(java.lang.String name, IPerspective perspective)
Adds a perspective.- Specified by:
addPerspective
in interfaceIObserverCenter
- Parameters:
name
- name of the perspectiveperspective
- the perspective
-
addPerspective
protected void addPerspective(java.lang.String name, IPerspective perspective, Future<java.lang.Void> ret)
Adds a perspective. Internal method only to be called on swing thread.- Parameters:
name
- name of the perspectiveperspective
- the perspective
-
getPerspectives
public java.util.Map getPerspectives()
Returns the available perspectives.- Returns:
- the available perspectives
-
getSelectedPerspective
public IPerspective getSelectedPerspective()
Returns the selected perspective.- Returns:
- the selected perspective
-
setSelectedPerspective
public void setSelectedPerspective(java.lang.String name)
Sets the selected perspective.- Parameters:
name
- name of the perspective
-
setOpenGLMode
public void setOpenGLMode(java.lang.String name, boolean opengl)
Sets the OpenGL mode for a perspective- Parameters:
name
- name of the perspectiveopengl
- true to activate OpenGL mode
-
getSpace
public AbstractEnvironmentSpace getSpace()
Returns the space.- Specified by:
getSpace
in interfaceIObserverCenter
- Returns:
- the space
-
addSelectedObjectListener
public void addSelectedObjectListener(javax.swing.event.ChangeListener listener)
Adds a listener for change of the selected object- Parameters:
object
- listener
-
removeSelectedObjectListener
public void removeSelectedObjectListener(javax.swing.event.ChangeListener listener)
Removes a listener for change of the selected object- Parameters:
object
- listener
-
fireSelectedObjectChange
public void fireSelectedObjectChange()
Fires a selected object change event.- Specified by:
fireSelectedObjectChange
in interfaceIObserverCenter
-
loadPlugins
public void loadPlugins(java.util.List customplugins)
Loads all available plugins- Specified by:
loadPlugins
in interfaceIObserverCenter
- Parameters:
customplugins
- custom plugins used in addition to standard plugins
-
internalLoadPlugins
protected void internalLoadPlugins(java.util.List customplugins)
-
dispose
public void dispose()
Dispose the observer center.- Specified by:
dispose
in interfaceIObserverCenter
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Get the class loader.- Specified by:
getClassLoader
in interfaceIObserverCenter
-
-