Class ObserverCenter

  • All Implemented Interfaces:
    IObserverCenter

    public class ObserverCenter
    extends java.lang.Object
    implements IObserverCenter
    The default 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.
      • disposed

        protected boolean disposed
        Flag to indicate that observer is disposed.
    • Constructor Detail

      • ObserverCenter

        public ObserverCenter()
    • 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 interface IObserverCenter
        Parameters:
        title - title of the observer window
        space - the space being observed
        classloader - 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 dataview
        dataview - an additional dataview
      • getDataViews

        public java.util.Map getDataViews()
        Returns the available dataviews.
        Returns:
        the available dataviews
      • 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 interface IObserverCenter
        Parameters:
        name - name of the perspective
        perspective - 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 perspective
        perspective - 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 perspective
        opengl - true to activate OpenGL mode
      • 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
      • loadPlugins

        public void loadPlugins​(java.util.List customplugins)
        Loads all available plugins
        Specified by:
        loadPlugins in interface IObserverCenter
        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 interface IObserverCenter
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Get the class loader.
        Specified by:
        getClassLoader in interface IObserverCenter