ubiware.core.visualizer
Class VisualizerPrototype

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by ubiware.core.visualizer.VisualizerPrototypeForm
                          extended by ubiware.core.visualizer.VisualizerPrototype
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListSelectionListener, javax.swing.event.TreeSelectionListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants, Debugger, SAPLTreeCellRenderer.UserPreferencies

public class VisualizerPrototype
extends VisualizerPrototypeForm
implements SAPLTreeCellRenderer.UserPreferencies, Debugger

This class implements the "logical" functionality of the visualizer.

There are the concepts of "properties" which are values of significance and they represent higher-level options for the user. For each one of those properties, there are PropertyChangeEvents fired whenever there is a vlaue change. Those values are the following:

The string representing those properties in the fired events is the same as the strings above. They are also available as public fields. The class also provides accessors for those properties. The setters fire the change events if there is an actual value change.

Author:
Nikos Mouchtaris
See Also:
Serialized Form

Nested Class Summary
static interface VisualizerPrototype.Predicate<T>
          Classes implementing this interface can act as predicates, accepting or rejecting elements of type T.
 
Nested classes/interfaces inherited from class ubiware.core.visualizer.VisualizerPrototypeForm
VisualizerPrototypeForm.AdvancedBeliefSearchArguments, VisualizerPrototypeForm.BeliefSearchArguments, VisualizerPrototypeForm.BeliefSearchType, VisualizerPrototypeForm.SimpleTextualMatchBeliefSearchArguments
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String agentLifeCyclesPropertyName
          The name of the property change for the property change event that is thrown when property "agentLifeCycles" is changed.
static java.lang.String aliasNamespacesPropertyName
          The name of the property change for the property change event that is thrown when property "aliasNamespaces" is changed.
static java.lang.String expandableEmptyBeliefContainersPropertyName
          The name of the property change for the property change event that is thrown when property "expandableEmptyBeliefContainers" is changed.
static java.lang.String showExpandedBeliefContainerIconPropertyName
          The name of the property change for the property change event that is thrown when property "showExpandedBeliefContainerIcon" is changed.
static java.lang.String showExpandedBeliefContainerTextPropertyName
          The name of the property change for the property change event that is thrown when property "showExpandedBeliefContainerText" is changed.
static java.lang.String showSettingsPropertyName
          The name of the property change for the property change event that is thrown when property "showSettings" is changed.
static java.lang.String waitingUntilAgentLifeCyclePropertyName
          The name of the property change for the property change event that is thrown when property "waitingUntilAgentLifeCycle" is changed.
static java.lang.String waitUntilAgentLifeCyclePropertyName
          The name of the property change for the property change event that is thrown when property "waitUntilAgentLifeCycle" is changed.
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VisualizerPrototype(UbiwareAgent agi, DebugBehavior rabi)
           Constructs a new Visualizer instance for the given agent, using the given behavior to access beliefs.
 
Method Summary
protected  void alias_namespaces_changed(boolean alias)
          Indicates that the user preference about aliasing namespaces has changed.
protected  void expandable_belief_containers_changed(boolean expandable)
          Indicates that the user has changed her preferenece about empty belief container nodes to be expandable.
 long getAgentLifeCycles()
          Returns the life cycles the agent has lived up to now.
 java.awt.Font getDisplayFont()
           Provides access to the Font which is used to display information to the user.
 long getWaitUntilAgentLifeCycle()
          Returns the life cycle number of the agent that the visualizer is waiting for.
 boolean isAliasNamespaces()
          Returns true if the user has given the notion that she would like namespaces to be printed as short aliases.
 boolean isEmptyBeliefContainersExpandable()
          Indicates the user's preference about whether a node which are belief containers and expanded should also have its icon displayed.
 boolean isExpandableEmptyBeliefContainers()
          Returns whether the user prefers that empty belief containers are expandable or not.
 boolean isShowExpandedBeliefContainerIcon()
          Returns whether the user prefers that expanded belief container nodes display their icon or not.
 boolean isShowExpandedBeliefContainerText()
          Returns whether the user prefers that expanded belief container nodes display their text or not.
 boolean isShowSettings()
          Returns whether the user has made some gesture which implies that she whould like the settings pane to be shown.
 boolean isWaitingUntilAgentLifeCycle()
          Returns whether the visualizer is waiting for the completion of some agent life cycle.
 void notifyGoingSleep()
          Method specified by the Ubiware agent Debugger.
 void notifyLiveIterationEnded(long cycle)
          Method specified by the Ubiware agent Debugger.
protected  void rebuildBeliefTree()
           Convenience method which equals calling rebuildBeliefTree( new BeliefContainerTreeModel(null, rabi, UbiwareAgent.GENERAL_CONTEXT).
protected  void search_requested(VisualizerPrototypeForm.BeliefSearchArguments arguments, VisualizerPrototypeForm.BeliefSearchType search_type)
           Called when the user has requested a search on the belief tree to be made.
protected  void search_result_selected(javax.swing.tree.TreePath path)
          Called when the user has selected a specific tree path from the list of search results.
static java.util.Set<javax.swing.tree.TreePath> searchTree(javax.swing.tree.TreeModel tm, VisualizerPrototype.Predicate<javax.swing.tree.TreePath> predicate, javax.swing.tree.TreePath parent)
          Calls searchTree(javax.swing.tree.TreeModel, ubiware.core.visualizer.VisualizerPrototype.Predicate, javax.swing.tree.TreePath, java.util.logging.Logger) with a logger that writes to nowhere.
static java.util.Set<javax.swing.tree.TreePath> searchTree(javax.swing.tree.TreeModel tm, VisualizerPrototype.Predicate<javax.swing.tree.TreePath> predicate, javax.swing.tree.TreePath parent, java.util.logging.Logger logger)
           Traverses the subtree of the given tree model whose root is indicated by the given tree path.
protected  void setAgentLifeCycles(long agentLifeCycles)
          Sets the internal belief about in which life cycle the agent is right now.
protected  void setAliasNamespaces(boolean aliasNamespaces)
          Sets whether namespaces should aliased as prefixes or not.
protected  void setExpandableEmptyBeliefContainers(boolean expandableEmptyBeliefContainers)
          Sets whether empty belief containers should be expandable on the tree.
protected  void setShowExpandedBeliefContainerIcon(boolean showExpandedBeliefContainerIcon)
          Sets whether expanded belief container nodes should display their icon or not.
protected  void setShowExpandedBeliefContainerText(boolean showExpandedBeliefContainerText)
          Sets whether expanded belief container nodes should display their text or not.
protected  void setShowSettings(boolean showSettings)
          Sets whether settings panel should be displayed or not.
protected  void setWaitingUntilAgentLifeCycle(boolean waitingUntilAgentLifeCycle)
           Sets whether the visualizer is expecting for a specific agent life cycle to be completed or not.
protected  void setWaitUntilAgentLifeCycle(long lifeCycle)
           Sets the agent life cycle number that the visualizer is waiting for.
protected  void show_expanded_belief_containers_icon_changed(boolean show)
          Indicates that the user has changed her preference about showing expanded belief container nodes' icon.
protected  void show_expanded_belief_containers_text_changed(boolean show)
          Indicates that the user has changed her preference about showing expanded belief container nodes' text.
protected  void show_in_N3_requested(java.lang.Object node)
          Called when the user has requested a specific node of the tree to be rendered in N3 notation.
protected  void show_settings_panel_changed(boolean show)
          Indicates that the user preference about showing or hiding the settings panel has changed.
protected  void stop_agent_changed(boolean stopped)
          Indicates that the user has changed her preference about stopping the agent.
protected  java.lang.String treeNodeToN3(javax.swing.tree.TreeModel node)
          Produces an N3 string from the given node, which must be either BeliefTreeModel or BeliefContainerTreeModel.
protected  void wait_until_agent_life_cycle_changed(boolean wait, int cycles)
          Will arrange everything so that the visualizer will wait for a number of specified life cycles.
 
Methods inherited from class ubiware.core.visualizer.VisualizerPrototypeForm
actionPerformed, disableAgentProgressControls, disableWaitingForLifeCycleLabels, enableAgentProgressControls, enableWaitingForLifeCycleLabels, focusGained, focusLost, for_all_treepaths, getAgentLifeCycleText, getWaitingForLifeCycleText, isMessageFromShowable, itemStateChanged, keyPressed, keyReleased, keyTyped, make_displayed, propertyChange, rebuildBeliefTree, repaintBeliefTree, request_focus, setBeliefTreeCellRenderer, setMessageFromShowable, setSearcResultsListCellRenderer, show_treepath_list, showMessage, showMessage, showMessage, showN3, showSettingsPanel, valueChanged, valueChanged
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ubiware.core.visualizer.SAPLTreeCellRenderer.UserPreferencies
getGraphics
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

aliasNamespacesPropertyName

public static final java.lang.String aliasNamespacesPropertyName
The name of the property change for the property change event that is thrown when property "aliasNamespaces" is changed.

See Also:
Constant Field Values

showSettingsPropertyName

public static final java.lang.String showSettingsPropertyName
The name of the property change for the property change event that is thrown when property "showSettings" is changed.

See Also:
Constant Field Values

agentLifeCyclesPropertyName

public static final java.lang.String agentLifeCyclesPropertyName
The name of the property change for the property change event that is thrown when property "agentLifeCycles" is changed.

See Also:
Constant Field Values

waitUntilAgentLifeCyclePropertyName

public static final java.lang.String waitUntilAgentLifeCyclePropertyName
The name of the property change for the property change event that is thrown when property "waitUntilAgentLifeCycle" is changed.

See Also:
Constant Field Values

waitingUntilAgentLifeCyclePropertyName

public static final java.lang.String waitingUntilAgentLifeCyclePropertyName
The name of the property change for the property change event that is thrown when property "waitingUntilAgentLifeCycle" is changed.

See Also:
Constant Field Values

expandableEmptyBeliefContainersPropertyName

public static final java.lang.String expandableEmptyBeliefContainersPropertyName
The name of the property change for the property change event that is thrown when property "expandableEmptyBeliefContainers" is changed.

See Also:
Constant Field Values

showExpandedBeliefContainerIconPropertyName

public static final java.lang.String showExpandedBeliefContainerIconPropertyName
The name of the property change for the property change event that is thrown when property "showExpandedBeliefContainerIcon" is changed.

See Also:
Constant Field Values

showExpandedBeliefContainerTextPropertyName

public static final java.lang.String showExpandedBeliefContainerTextPropertyName
The name of the property change for the property change event that is thrown when property "showExpandedBeliefContainerText" is changed.

See Also:
Constant Field Values
Constructor Detail

VisualizerPrototype

public VisualizerPrototype(UbiwareAgent agi,
                           DebugBehavior rabi)

Constructs a new Visualizer instance for the given agent, using the given behavior to access beliefs.

Parameters:
agi - the Agent's whose beliefs we are messing with
rabi - a RAB whose parent agent must be agi
Method Detail

searchTree

public static java.util.Set<javax.swing.tree.TreePath> searchTree(javax.swing.tree.TreeModel tm,
                                                                  VisualizerPrototype.Predicate<javax.swing.tree.TreePath> predicate,
                                                                  javax.swing.tree.TreePath parent,
                                                                  java.util.logging.Logger logger)

Traverses the subtree of the given tree model whose root is indicated by the given tree path.

Each node (not only leaves) are tested with the given predicate and if accepted, they are included in the resulting Set.

If parent is null, then the whole tree is checked.

Parameters:
tm - the tree model to traverse
parent - the parent of the subtree to check
predicate - a predicate for TreePaths of objects in the tree model
logger - an optional logger to log actions to
Returns:
a set of accepted tree paths

searchTree

public static java.util.Set<javax.swing.tree.TreePath> searchTree(javax.swing.tree.TreeModel tm,
                                                                  VisualizerPrototype.Predicate<javax.swing.tree.TreePath> predicate,
                                                                  javax.swing.tree.TreePath parent)
Calls searchTree(javax.swing.tree.TreeModel, ubiware.core.visualizer.VisualizerPrototype.Predicate, javax.swing.tree.TreePath, java.util.logging.Logger) with a logger that writes to nowhere.

Parameters:
tm - see searchTree(javax.swing.tree.TreeModel, ubiware.core.visualizer.VisualizerPrototype.Predicate, javax.swing.tree.TreePath, java.util.logging.Logger)
predicate - see searchTree(javax.swing.tree.TreeModel, ubiware.core.visualizer.VisualizerPrototype.Predicate, javax.swing.tree.TreePath, java.util.logging.Logger)
parent - see searchTree(javax.swing.tree.TreeModel, ubiware.core.visualizer.VisualizerPrototype.Predicate, javax.swing.tree.TreePath, java.util.logging.Logger)
Returns:
see searchTree(javax.swing.tree.TreeModel, ubiware.core.visualizer.VisualizerPrototype.Predicate, javax.swing.tree.TreePath, java.util.logging.Logger)

isAliasNamespaces

public boolean isAliasNamespaces()
Returns true if the user has given the notion that she would like namespaces to be printed as short aliases.

Specified by:
isAliasNamespaces in interface SAPLTreeCellRenderer.UserPreferencies
Returns:
true if the user has given the notion that she would like namespaces to be printed as short aliases.

getDisplayFont

public java.awt.Font getDisplayFont()

Provides access to the Font which is used to display information to the user. This method is a "best effort" method to determine which font is used to display text. It is possible (especially if this method is invoked before the initialization of the component) that it returns null as a result. The sources that it looks for a font are the following, in the order they are presented:

  1. this.getFont()
  2. this.getGraphics.getFont() unless getGraphics() returns null.

If all of the above return null, then this method will return null as well.

Specified by:
getDisplayFont in interface SAPLTreeCellRenderer.UserPreferencies
Returns:
the Font which is used to display information to the user or null.

isEmptyBeliefContainersExpandable

public boolean isEmptyBeliefContainersExpandable()
Description copied from interface: SAPLTreeCellRenderer.UserPreferencies
Indicates the user's preference about whether a node which are belief containers and expanded should also have its icon displayed. If this method returns false then expanded belief container nodes should show no icon.

Specified by:
isEmptyBeliefContainersExpandable in interface SAPLTreeCellRenderer.UserPreferencies
Returns:
true if the user wants icons, false otherwise

notifyLiveIterationEnded

public void notifyLiveIterationEnded(long cycle)
Method specified by the Ubiware agent Debugger. When the agent notifies the visualizer instance through this method, the visualizer will update information about in which cycle the Agent is currently in. It will also rebuild the belief tree if this is a cycle that the visualizer is waiting for.

Specified by:
notifyLiveIterationEnded in interface Debugger
Parameters:
cycle - number of cycles the agent has lived

notifyGoingSleep

public void notifyGoingSleep()
Method specified by the Ubiware agent Debugger. When the agent notifies the visualizer instance through this method, the visualizer will re-read all the belief storage of the agent and will update the displayed belief tree.

Specified by:
notifyGoingSleep in interface Debugger

setAliasNamespaces

protected void setAliasNamespaces(boolean aliasNamespaces)
Sets whether namespaces should aliased as prefixes or not. If there is an actual value change, it fires a property change for property "aliasNamespaces".

Parameters:
aliasNamespaces - alias namespaces?

setShowSettings

protected void setShowSettings(boolean showSettings)
Sets whether settings panel should be displayed or not. If there is an actual value change, it fires a property change for property "showSettings".

Parameters:
showSettings - show settings panel?

setAgentLifeCycles

protected void setAgentLifeCycles(long agentLifeCycles)
Sets the internal belief about in which life cycle the agent is right now. If there is an actual value change, it fires a property change for property "agentLifeCycles".

Parameters:
agentLifeCycles - the current agent life cycle

setExpandableEmptyBeliefContainers

protected void setExpandableEmptyBeliefContainers(boolean expandableEmptyBeliefContainers)
Sets whether empty belief containers should be expandable on the tree. If there is an actual value change, it fires a property change for property "expandableEmptyBeliefContainers".

Parameters:
expandableEmptyBeliefContainers - should empty belief containers be expandable?

setShowExpandedBeliefContainerText

protected void setShowExpandedBeliefContainerText(boolean showExpandedBeliefContainerText)
Sets whether expanded belief container nodes should display their text or not. If there is an actual value change, it fires a property change for property "showExpandedBeliefContainerText".

Parameters:
showExpandedBeliefContainerText - should expanded belief containers display their text?

setShowExpandedBeliefContainerIcon

protected void setShowExpandedBeliefContainerIcon(boolean showExpandedBeliefContainerIcon)
Sets whether expanded belief container nodes should display their icon or not. If there is an actual value change, it fires a property change for property "showExpandedBeliefContainerIcon".

Parameters:
showExpandedBeliefContainerIcon - should expanded belief containers display their icon?

setWaitUntilAgentLifeCycle

protected void setWaitUntilAgentLifeCycle(long lifeCycle)
                                   throws java.lang.IllegalArgumentException

Sets the agent life cycle number that the visualizer is waiting for.

If parameter lifeCycle is a negative number, an exception is thrown.

If this method is called with a valid argument, setWaitingUntilAgentLifeCycle(true) is automatically called.

If there is an actual value change, a property change event is fired for property "waitUntilAgentLifeCycle".

Parameters:
lifeCycle - the life cycle to wait for
Throws:
java.lang.IllegalArgumentException - if parameter lifeCycle is a negative number

setWaitingUntilAgentLifeCycle

protected void setWaitingUntilAgentLifeCycle(boolean waitingUntilAgentLifeCycle)

Sets whether the visualizer is expecting for a specific agent life cycle to be completed or not. If false is passed as a parameter to this method, then the value of property "waitUntilAgentLifeCycle" is ignored.

This method is automatically called from setWaitUntilAgentLifeCycle(long) with argument true and there is no need to call is separately after calling setWaitUntilAgentLifeCycle.

If there is an actual value change, this method fires a property change event for property "waitingUntilAgentLifeCycle".

Parameters:
waitingUntilAgentLifeCycle - wait until agent life cycle x ?

isWaitingUntilAgentLifeCycle

public boolean isWaitingUntilAgentLifeCycle()
Returns whether the visualizer is waiting for the completion of some agent life cycle.

Returns:
whether the visualizer is waiting for the completion of some agent life cycle

getWaitUntilAgentLifeCycle

public long getWaitUntilAgentLifeCycle()
Returns the life cycle number of the agent that the visualizer is waiting for. This is implies that isWaitingUntilAgentLifeCycle() == true.

Returns:
the life cycle number of the agent that the visualizer is waiting for

isShowExpandedBeliefContainerIcon

public boolean isShowExpandedBeliefContainerIcon()
Returns whether the user prefers that expanded belief container nodes display their icon or not.

Specified by:
isShowExpandedBeliefContainerIcon in interface SAPLTreeCellRenderer.UserPreferencies
Returns:
whether expanded belief container nodes display their icon

isShowExpandedBeliefContainerText

public boolean isShowExpandedBeliefContainerText()
Returns whether the user prefers that expanded belief container nodes display their text or not.

Specified by:
isShowExpandedBeliefContainerText in interface SAPLTreeCellRenderer.UserPreferencies
Returns:
whether expanded belief container nodes display their text

isExpandableEmptyBeliefContainers

public boolean isExpandableEmptyBeliefContainers()
Returns whether the user prefers that empty belief containers are expandable or not.

Returns:
whether empty belief containers are expandable

isShowSettings

public boolean isShowSettings()
Returns whether the user has made some gesture which implies that she whould like the settings pane to be shown.

Returns:
whether the user has made some gesture which implies that she whould like the settings pane to be shown

getAgentLifeCycles

public long getAgentLifeCycles()
Returns the life cycles the agent has lived up to now.

Returns:
the life cycles the agent has lived up to now

alias_namespaces_changed

protected void alias_namespaces_changed(boolean alias)
Description copied from class: VisualizerPrototypeForm
Indicates that the user preference about aliasing namespaces has changed.

Specified by:
alias_namespaces_changed in class VisualizerPrototypeForm
Parameters:
alias - alias namespaces?

show_settings_panel_changed

protected void show_settings_panel_changed(boolean show)
Description copied from class: VisualizerPrototypeForm
Indicates that the user preference about showing or hiding the settings panel has changed.

Specified by:
show_settings_panel_changed in class VisualizerPrototypeForm
Parameters:
show - show settings panel?

wait_until_agent_life_cycle_changed

protected void wait_until_agent_life_cycle_changed(boolean wait,
                                                   int cycles)
Will arrange everything so that the visualizer will wait for a number of specified life cycles. If lifeCycle is a negative number or zero an exception is thrown.

Specified by:
wait_until_agent_life_cycle_changed in class VisualizerPrototypeForm
Parameters:
wait - should we wait until a certain life cycle?
cycles - the life cycles to wait for (if wait is true)
Throws:
java.lang.IllegalArgumentException - when argument lifeCycle is &lt;= 0

stop_agent_changed

protected void stop_agent_changed(boolean stopped)
Description copied from class: VisualizerPrototypeForm
Indicates that the user has changed her preference about stopping the agent. If argument stopped is true then the user would like to stop the agent, resume it otherwise.

Specified by:
stop_agent_changed in class VisualizerPrototypeForm
Parameters:
stopped - stop the agent? or resume?

expandable_belief_containers_changed

protected void expandable_belief_containers_changed(boolean expandable)
Description copied from class: VisualizerPrototypeForm
Indicates that the user has changed her preferenece about empty belief container nodes to be expandable.

Specified by:
expandable_belief_containers_changed in class VisualizerPrototypeForm
Parameters:
expandable - should they be expandable?

show_expanded_belief_containers_icon_changed

protected void show_expanded_belief_containers_icon_changed(boolean show)
Description copied from class: VisualizerPrototypeForm
Indicates that the user has changed her preference about showing expanded belief container nodes' icon.

Specified by:
show_expanded_belief_containers_icon_changed in class VisualizerPrototypeForm
Parameters:
show - show them?

show_expanded_belief_containers_text_changed

protected void show_expanded_belief_containers_text_changed(boolean show)
Description copied from class: VisualizerPrototypeForm
Indicates that the user has changed her preference about showing expanded belief container nodes' text.

Specified by:
show_expanded_belief_containers_text_changed in class VisualizerPrototypeForm
Parameters:
show - show them?

show_in_N3_requested

protected void show_in_N3_requested(java.lang.Object node)
Description copied from class: VisualizerPrototypeForm
Called when the user has requested a specific node of the tree to be rendered in N3 notation.

Specified by:
show_in_N3_requested in class VisualizerPrototypeForm
Parameters:
node - the node to be rendered in N3

search_requested

protected void search_requested(VisualizerPrototypeForm.BeliefSearchArguments arguments,
                                VisualizerPrototypeForm.BeliefSearchType search_type)
Description copied from class: VisualizerPrototypeForm

Called when the user has requested a search on the belief tree to be made.

The args argument is depended on the search_type. For more information about the specific arguments-structure for each search-type, refere to the VisualizerPrototypeForm.BeliefSearchType documentation.

Specified by:
search_requested in class VisualizerPrototypeForm
Parameters:
arguments - the arguments the user has entered - this is search-type depended.
search_type - what type of search is it, what does the given string signify

search_result_selected

protected void search_result_selected(javax.swing.tree.TreePath path)
Description copied from class: VisualizerPrototypeForm
Called when the user has selected a specific tree path from the list of search results.

Specified by:
search_result_selected in class VisualizerPrototypeForm
Parameters:
path - the path the user selected

rebuildBeliefTree

protected void rebuildBeliefTree()

Convenience method which equals calling rebuildBeliefTree( new BeliefContainerTreeModel(null, rabi, UbiwareAgent.GENERAL_CONTEXT).


treeNodeToN3

protected java.lang.String treeNodeToN3(javax.swing.tree.TreeModel node)
                                 throws java.lang.IllegalArgumentException
Produces an N3 string from the given node, which must be either BeliefTreeModel or BeliefContainerTreeModel.

Parameters:
node - the node
Returns:
an N3 representation of the given node
Throws:
java.lang.IllegalArgumentException - when node is a BeliefTreeModel