|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
ubiware.core.visualizer.VisualizerPrototypeForm
public abstract class VisualizerPrototypeForm
The GUI part of the visualizer.
This part of the visualizer translates GUI events to semantic events, which are then supposed to be understood by implementing
subclasses. Those semantic events are signaled by protected abstract methods of this class.
This class is also listening for property change events which are thrown by this (effectively, by subclasses). When it catches a
recognizable property change, it will make sure that all visual components that represent or indicate the value of the changed property
will be updated and synchronized in order to display the actual value of the property. Recognizable properties are the following:
| Nested Class Summary | |
|---|---|
class |
VisualizerPrototypeForm.AdvancedBeliefSearchArguments
The argument structure for the advanced belief search. |
static class |
VisualizerPrototypeForm.BeliefSearchArguments
The base class for a belief search arguments structure. |
static class |
VisualizerPrototypeForm.BeliefSearchType
A collection of possible search types that a user can make. |
class |
VisualizerPrototypeForm.SimpleTextualMatchBeliefSearchArguments
The arguments structure for the simple textual matching search method. |
| 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 |
|---|
| 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 | |
|---|---|
VisualizerPrototypeForm(UbiwareAgent agi,
DebugBehavior rabi)
Creates new form VisualizerPrototypeForm. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
|
protected abstract void |
alias_namespaces_changed(boolean alias)
Indicates that the user preference about aliasing namespaces has changed. |
protected void |
disableAgentProgressControls()
Disables all the buttons that are related to controlling the agent. |
protected void |
disableWaitingForLifeCycleLabels()
Disables all labels that are related to displaying information about waiting for a life cycle. |
protected void |
enableAgentProgressControls()
Enables all the buttons that are related to controlling the agent. |
protected void |
enableWaitingForLifeCycleLabels()
Enables all labels that are related to displaying information about waiting for a life cycle. |
protected abstract void |
expandable_belief_containers_changed(boolean expandable)
Indicates that the user has changed her preferenece about empty belief container nodes to be expandable. |
void |
focusGained(java.awt.event.FocusEvent evt)
|
void |
focusLost(java.awt.event.FocusEvent evt)
|
static void |
for_all_treepaths(javax.swing.tree.TreeModel tm,
javax.swing.tree.TreePath root,
Lambda<?> f)
Passes each treepath in tm (ALL treepaths, not just leafs) to f. |
static java.lang.String |
getAgentLifeCycleText(long cycles)
Creates the appropriate label text to represent the given agent life cycles. |
static java.lang.String |
getWaitingForLifeCycleText(long cycle)
Creates a an appropriate string representation to display in the label about which agent life cycle the visualizer is waiting for. |
protected boolean |
isMessageFromShowable(java.lang.String from)
Returns true if messages from the given source are shown on the message area of the interface, false otherwise. |
void |
itemStateChanged(java.awt.event.ItemEvent evt)
|
void |
keyPressed(java.awt.event.KeyEvent evt)
|
void |
keyReleased(java.awt.event.KeyEvent evt)
|
void |
keyTyped(java.awt.event.KeyEvent evt)
|
protected void |
make_displayed(javax.swing.tree.TreePath tp)
Makes the specific tree path displayed. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
protected void |
rebuildBeliefTree(javax.swing.tree.TreeModel tree_model)
Rebuilds belief_tree after setting the new tree_model as its new tree model. |
protected void |
repaintBeliefTree()
Calls repaint on belief_tree. |
protected void |
request_focus(int window)
Tries to give focus to the window indicated by the argument. |
protected abstract void |
search_requested(VisualizerPrototypeForm.BeliefSearchArguments args,
VisualizerPrototypeForm.BeliefSearchType search_type)
Called when the user has requested a search on the belief tree to be made. |
protected abstract 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. |
protected void |
setBeliefTreeCellRenderer(javax.swing.tree.TreeCellRenderer r)
Sets this belief_tree's cell renderer. |
protected void |
setMessageFromShowable(java.lang.String from,
boolean s)
Causes messages comming from from to be shown if argument s is true, otherwise not. |
protected void |
setSearcResultsListCellRenderer(javax.swing.ListCellRenderer r)
Sets this search_results_list's cell renderer. |
protected abstract 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 abstract 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 abstract 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 abstract void |
show_settings_panel_changed(boolean show)
Indicates that the user preference about showing or hiding the settings panel has changed. |
protected void |
show_treepath_list(javax.swing.tree.TreePath[] tps,
java.lang.String ttl)
Displays the given array of treepaths in a window with title ttl and allows the user to select one of them. |
protected void |
showMessage(java.lang.String from,
java.lang.String msg)
Shows the given message on some message area on the gui. |
protected void |
showMessage(java.lang.String from,
java.lang.String msg,
boolean error)
Shows the given message on some message area on the gui. |
protected void |
showMessage(java.lang.String from,
java.lang.String msg,
int message_type)
Shows the given message on some message area on the gui. |
protected void |
showN3(java.lang.String n3)
Creates an internal frame which displays the given string. |
protected void |
showSettingsPanel(java.lang.Boolean show_settings)
Instructs this to show or hide the settings panel. |
protected abstract void |
stop_agent_changed(boolean stopped)
Indicates that the user has changed her preference about stopping the agent. |
void |
valueChanged(javax.swing.event.ListSelectionEvent evt)
|
void |
valueChanged(javax.swing.event.TreeSelectionEvent evt)
|
protected abstract void |
wait_until_agent_life_cycle_changed(boolean wait,
int cycles)
Indicates that the user has changed her preference about waiting until a certain life cycle. |
| 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 java.awt.MenuContainer |
|---|
getFont, postEvent |
| Constructor Detail |
|---|
public VisualizerPrototypeForm(UbiwareAgent agi,
DebugBehavior rabi)
agi - the agent for which this visualizer will berabi - the debug behavior which invoked this visualizer and which must be associated with the given agent| Method Detail |
|---|
public static void for_all_treepaths(javax.swing.tree.TreeModel tm,
javax.swing.tree.TreePath root,
Lambda<?> f)
tm - the treemodel to be traversedroot - the root from which to begin traversalf - the function to apply on all treepathspublic static java.lang.String getAgentLifeCycleText(long cycles)
cycles - the agent life cycles
public static java.lang.String getWaitingForLifeCycleText(long cycle)
Creates a an appropriate string representation to display in the label about which agent life cycle the visualizer is waiting for.
This does not set the actual text, it just returns the string that would actually be set as the label's text.
cycle - the life cycle to generate text for
protected void showMessage(java.lang.String from,
java.lang.String msg)
msg does not need to include new lines and other such separation
characters. In fact, it should not.
from - "who" is this message from?msg - the message text
protected void showMessage(java.lang.String from,
java.lang.String msg,
boolean error)
Shows the given message on some message area on the gui. msg does not need to include new lines and other such separation
characters. In fact, it should not.
If error is true, then the message is displayed in a more observable, notable and direct way.
from - "who" is this message from?msg - the message texterror - is this message an error message?
protected void showMessage(java.lang.String from,
java.lang.String msg,
int message_type)
Shows the given message on some message area on the gui. msg does not need to include new lines and other such separation
characters. In fact, it should not.
message_type is the same as the messag type for JOptionPane.showMessageDialog(Component,Object,String,int). If it is
anything else other than JOptionPane.PLAIN_MESSAGE then the message will be also displayed in a dialogue window of the
corresponding level.
from - "who" is this message from?msg - the message textmessage_type - is this message an error message?protected boolean isMessageFromShowable(java.lang.String from)
Returns true if messages from the given source are shown on the message area of the interface, false otherwise.
Messages are shown in the message area if they have been enabled by calling showMessage("sender", true).
from - the source of messages
true if messages from the given source are shown on the interface, false otherwise.
protected void setMessageFromShowable(java.lang.String from,
boolean s)
Causes messages comming from from to be shown if argument s is true, otherwise not.
from - the source to filtres - show messages from the secified source or not?protected void showSettingsPanel(java.lang.Boolean show_settings)
Instructs this to show or hide the settings panel.
show_settings - show settings?protected final void rebuildBeliefTree(javax.swing.tree.TreeModel tree_model)
belief_tree after setting the new tree_model as its new tree model.
tree_model - protected void disableAgentProgressControls()
protected void enableAgentProgressControls()
protected void disableWaitingForLifeCycleLabels()
protected void enableWaitingForLifeCycleLabels()
protected void showN3(java.lang.String n3)
n3 - the string (supposedly in N3) to displayprotected void make_displayed(javax.swing.tree.TreePath tp)
tp - the tree path to become displayed.
protected void show_treepath_list(javax.swing.tree.TreePath[] tps,
java.lang.String ttl)
ttl and allows the user to select one of them. When the user
does so, the selected path will be displayed on the belief tree (if there is such a path).
tps - the tree paths to listttl - the title to be displayed for this array of treepaths
protected void request_focus(int window)
throws java.lang.IllegalArgumentException
Tries to give focus to the window indicated by the argument. The argument is an integer which indicates which of the windows should gain focus. The semantics of this argument are not final and can change between versions.
window - one of the values specified above
java.lang.IllegalArgumentException - when argument window is not in one of the specified values above.protected final void setBeliefTreeCellRenderer(javax.swing.tree.TreeCellRenderer r)
belief_tree's cell renderer. Does not repaint anything.
r - the new cell renderer for the belief treeprotected final void repaintBeliefTree()
repaint on belief_tree.
protected final void setSearcResultsListCellRenderer(javax.swing.ListCellRenderer r)
search_results_list's cell renderer. Does not repaint anything.
r - the new cell renderer for the belief treeprotected abstract void alias_namespaces_changed(boolean alias)
alias - alias namespaces?protected abstract void show_settings_panel_changed(boolean show)
show - show settings panel?
protected abstract void wait_until_agent_life_cycle_changed(boolean wait,
int cycles)
wait is
false, then argument lifeCycle should be ignored. Parameter cycles is the number of cycles to wait for to
pass and is not an absolute life cycle number.
wait - should we wait until a certain life cycle?cycles - the life cycles to wait for (if wait is true)protected abstract void stop_agent_changed(boolean stopped)
stopped is true then the
user would like to stop the agent, resume it otherwise.
stopped - stop the agent? or resume?protected abstract void show_expanded_belief_containers_text_changed(boolean show)
show - show them?protected abstract void show_expanded_belief_containers_icon_changed(boolean show)
show - show them?protected abstract void expandable_belief_containers_changed(boolean expandable)
expandable - should they be expandable?protected abstract void show_in_N3_requested(java.lang.Object node)
node - the node to be rendered in N3
protected abstract void search_requested(VisualizerPrototypeForm.BeliefSearchArguments args,
VisualizerPrototypeForm.BeliefSearchType search_type)
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.
args - the arguments the user has entered - this is search-type depended.search_type - what type of search is it, what does the given string signifyprotected abstract void search_result_selected(javax.swing.tree.TreePath path)
path - the path the user selectedpublic void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed in interface java.awt.event.ActionListenerpublic void focusGained(java.awt.event.FocusEvent evt)
focusGained in interface java.awt.event.FocusListenerpublic void focusLost(java.awt.event.FocusEvent evt)
focusLost in interface java.awt.event.FocusListenerpublic void itemStateChanged(java.awt.event.ItemEvent evt)
itemStateChanged in interface java.awt.event.ItemListenerpublic void keyPressed(java.awt.event.KeyEvent evt)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent evt)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent evt)
keyTyped in interface java.awt.event.KeyListenerpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerpublic void valueChanged(javax.swing.event.ListSelectionEvent evt)
valueChanged in interface javax.swing.event.ListSelectionListenerpublic void valueChanged(javax.swing.event.TreeSelectionEvent evt)
valueChanged in interface javax.swing.event.TreeSelectionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||