The Meta-Environment API

nl.cwi.sen1.visbase.factbrowser
Class FactBrowser

java.lang.Object
  extended by nl.cwi.sen1.gui.plugin.DefaultStudioPlugin
      extended by nl.cwi.sen1.visbase.factbrowser.FactBrowser
All Implemented Interfaces:
nl.cwi.sen1.gui.plugin.StudioPlugin, FactbrowserTif

public class FactBrowser
extends nl.cwi.sen1.gui.plugin.DefaultStudioPlugin
implements FactbrowserTif

This class is the main entry point for the toolbus FactBrowserInterface script. It also listens to event from the FactBrowserWindow with the visual tree containing the RStores DataManager This method has a dataManager which takes care of the registration of new Rstores/Facts/FactTypes and VisualisationPlugins. RTypes decoding For the decoding of the given Facts with Rtypes, the rstore-container FactInfoList()is used. This will get a container class with all the nessecary information about the Facts.

Author:
Renze de Vries

Field Summary
private  FactbrowserBridge bridge
           
private  nl.cwi.sen1.gui.component.StudioComponent component
           
private  nl.cwi.sen1.configapi.Factory configFactory
           
private  FactBrowserDataManager dataManager
           
private static int DOUBLE_CLICK
           
private  FactBrowserWindow factBrowserWindow
           
private static org.apache.commons.logging.Log log
           
private  nl.cwi.sen1.util.DefaultPopupImpl popup
           
private  nl.cwi.sen1.gui.Studio studio
           
private static java.lang.String TOOL_NAME
           
 
Constructor Summary
FactBrowser()
          This is the default constructor it creates the dataManager and the visualisationClass
 
Method Summary
private  void addFactBrowserComponent()
          This method will initialize the layout and add it to the MetaStudio environment
private  aterm.ATerm createEventId(aterm.ATerm moduleId)
           
 void fbAddVisualizationPlugin(aterm.ATerm pluginType, int pluginIdentifier, java.lang.String pluginName)
          ToolbusInterface This method is a toolBus interface required implementation.
 void fbRstoreUnloaded(int rstoreIdentifier)
          Removes the rstore with the specified rstoreIdentifier from the tree.
 void fbShowRstoreFacts(java.lang.String rstoreName, int rstoreIdentifier, aterm.ATerm rstoreFacts)
          ToolbusInterface This method is an interface for the toolbus communications.
 java.lang.String getName()
          This method returns the name of this Tool for the metaStudio.
 aterm.ATerm getSelectedRstoreid()
           
private  aterm.ATerm getSelectedRStoreId()
           
 void initStudioPlugin(nl.cwi.sen1.gui.Studio metaStudio)
          This is the entry method for the FactBrowser.
private  void mouseDoubleClick(java.awt.event.MouseEvent mouseEvent)
          Handles the double click actions on a rstore tree node and a visualization treenode.
 void recAckEvent(aterm.ATerm t0)
          Method must be implemented as part of toolbus compliance
 void recTerminate(aterm.ATerm t0)
          Method will be called when the connection with the toolbus is terminated
 void showPopup(int RStoreId, aterm.ATerm menuList)
           
 
Methods inherited from class nl.cwi.sen1.gui.plugin.DefaultStudioPlugin
addStudioPluginListener, fireStudioPluginClosed, removeStudioPluginListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOUBLE_CLICK

private static final int DOUBLE_CLICK
See Also:
Constant Field Values

dataManager

private FactBrowserDataManager dataManager

TOOL_NAME

private static final java.lang.String TOOL_NAME
See Also:
Constant Field Values

log

private static final org.apache.commons.logging.Log log

configFactory

private nl.cwi.sen1.configapi.Factory configFactory

studio

private nl.cwi.sen1.gui.Studio studio

component

private nl.cwi.sen1.gui.component.StudioComponent component

bridge

private FactbrowserBridge bridge

factBrowserWindow

private FactBrowserWindow factBrowserWindow

popup

private nl.cwi.sen1.util.DefaultPopupImpl popup
Constructor Detail

FactBrowser

public FactBrowser()
This is the default constructor it creates the dataManager and the visualisationClass

Method Detail

fbAddVisualizationPlugin

public void fbAddVisualizationPlugin(aterm.ATerm pluginType,
                                     int pluginIdentifier,
                                     java.lang.String pluginName)
ToolbusInterface This method is a toolBus interface required implementation. It gets as parameters the type of the visualisation, name and the identifier for the plugin. It passes the visualisation to the dataManager and signals the visualisationWindow to redraw.

Specified by:
fbAddVisualizationPlugin in interface FactbrowserTif
Parameters:
pluginType -
pluginIdentifier -
pluginName1 -

fbShowRstoreFacts

public void fbShowRstoreFacts(java.lang.String rstoreName,
                              int rstoreIdentifier,
                              aterm.ATerm rstoreFacts)
ToolbusInterface This method is an interface for the toolbus communications. It's task is to add a passed Rstore with all it's children facts to the dataStore which is managed by the (caching) dataManager.

Specified by:
fbShowRstoreFacts in interface FactbrowserTif
Parameters:
rstoreName -
rstoreIdentifier -
rstoreFacts -

fbRstoreUnloaded

public void fbRstoreUnloaded(int rstoreIdentifier)
Removes the rstore with the specified rstoreIdentifier from the tree.

Specified by:
fbRstoreUnloaded in interface FactbrowserTif
Parameters:
rstoreIdentifier -

recAckEvent

public void recAckEvent(aterm.ATerm t0)
Method must be implemented as part of toolbus compliance

Specified by:
recAckEvent in interface FactbrowserTif

recTerminate

public void recTerminate(aterm.ATerm t0)
Method will be called when the connection with the toolbus is terminated

Specified by:
recTerminate in interface FactbrowserTif

getName

public java.lang.String getName()
This method returns the name of this Tool for the metaStudio.

Specified by:
getName in interface nl.cwi.sen1.gui.plugin.StudioPlugin

createEventId

private aterm.ATerm createEventId(aterm.ATerm moduleId)

initStudioPlugin

public void initStudioPlugin(nl.cwi.sen1.gui.Studio metaStudio)
This is the entry method for the FactBrowser. When the meta-environment is started this will be called to add the factBrowser to the studio. It calls a method which will load the layout with the menu's.

Specified by:
initStudioPlugin in interface nl.cwi.sen1.gui.plugin.StudioPlugin
Parameters:
metaStudio - This is the instance of the metaStudio

addFactBrowserComponent

private void addFactBrowserComponent()
This method will initialize the layout and add it to the MetaStudio environment


mouseDoubleClick

private void mouseDoubleClick(java.awt.event.MouseEvent mouseEvent)
Handles the double click actions on a rstore tree node and a visualization treenode. Only the messages will be send, the data itself will not be handled here. Scenario 1: If the user double clicks on a rstore tree node a message will be send to the toolbus and requests all the facts within the rstore. Scenario 2: If the user double clicks on a fact tree node a message will be send to the toolbus to request all the possible visualizations for the given fact.


showPopup

public void showPopup(int RStoreId,
                      aterm.ATerm menuList)
Specified by:
showPopup in interface FactbrowserTif

getSelectedRstoreid

public aterm.ATerm getSelectedRstoreid()
Specified by:
getSelectedRstoreid in interface FactbrowserTif

getSelectedRStoreId

private aterm.ATerm getSelectedRStoreId()

The Meta-Environment API