cobaUI
Class ControlText

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycobaUI.ControlText
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

class ControlText
extends javax.swing.JPanel

ControlText is a panel with the current settings display and toggle buttons, an informative message in the event of a syntax or inconsistency error in the input, or a new KB in the preview list, and a button for executing a belief change scenario.

Author:
Daphne Liu, daphnel@sfu.ca

Nested Class Summary
(package private)  class ControlText.AlgoListener
          An action listener for the button for switching between AllDetEQ1 and AllDetEQ2.
(package private)  class ControlText.AllChangeListener
          An action listener for carrying out parallel change on a belief change scenario.
(package private)  class ControlText.ChangesListener
          An action listener for the button for switching between skeptical change and choice change.
(package private)  class ControlText.ConsListener
          An action listener for the button for switching consistency check on and off.
(package private)  class ControlText.MergeListener
          An action listener for the button for switching between default merge and projection merge.
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private) static java.awt.Font BIG
          A reference to a Font object used to set the font for all the panels of the enclosing applet.
(package private) static int DECISION_PENDING
          An int indicating the decision pending type of message.
(package private)  javax.swing.JButton execButton
          The button for executing a belief change scenario.
(package private) static int INCONSISTENT_ENTRY
          An int indicating the inconsistency error type of message.
(package private)  COBAApplet ParentApplet
          A reference to the enclosing applet.
(package private)  MainPanel ParentPanel
          A reference to the enclosing panel.
(package private) static int SYNTAX_ERROR
          An int indicating the syntax error type of message.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
(package private) ControlText(COBAApplet _parentApp, MainPanel _parent)
          Constructs a new ControlText for the enclosing panel _parent contained in _parentApp.
 
Method Summary
 void paintComponent(java.awt.Graphics g)
          Resizes, repositions, and redraws all UI components of this ControlText.
(package private)  boolean previewNewKB()
          Takes the KB(s), revision(s) and contraction(s), the CB IC(s), and the EB IC(s), performs merging, revision, contraction, or a combination thereof, and produces a new KB in the new KB preview list.
(package private)  void setAlgo(boolean isAll1)
          Sets the search algorithm caption and the tooltip text for the search algorithm toggle button.
(package private)  void setChange(boolean isChoice)
          Sets the change type caption and the tooltip text for the change type toggle button.
(package private)  void setCons(boolean isOn)
          Sets the consistency check caption and the tooltip text for the consistency check toggle button.
(package private)  void setMerge(boolean isProj)
          Sets the merge type caption and the tooltip text for the merge type toggle button.
(package private)  void setWarning(int i)
          Sets the type of informative message to display to i.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ParentPanel

MainPanel ParentPanel
A reference to the enclosing panel.


ParentApplet

COBAApplet ParentApplet
A reference to the enclosing applet.


SYNTAX_ERROR

static final int SYNTAX_ERROR
An int indicating the syntax error type of message.

See Also:
Constant Field Values

INCONSISTENT_ENTRY

static final int INCONSISTENT_ENTRY
An int indicating the inconsistency error type of message.

See Also:
Constant Field Values

DECISION_PENDING

static final int DECISION_PENDING
An int indicating the decision pending type of message.

See Also:
Constant Field Values

BIG

static final java.awt.Font BIG
A reference to a Font object used to set the font for all the panels of the enclosing applet.


execButton

javax.swing.JButton execButton
The button for executing a belief change scenario.

Constructor Detail

ControlText

ControlText(COBAApplet _parentApp,
            MainPanel _parent)
Constructs a new ControlText for the enclosing panel _parent contained in _parentApp.

Parameters:
_parent - a reference to the enclosing panel.
_parentApp - a reference to the enclosing applet.
Method Detail

setWarning

void setWarning(int i)
Sets the type of informative message to display to i.

Parameters:
i - an int indicating the type of informative message to display.

paintComponent

public void paintComponent(java.awt.Graphics g)
Resizes, repositions, and redraws all UI components of this ControlText.


previewNewKB

boolean previewNewKB()
Takes the KB(s), revision(s) and contraction(s), the CB IC(s), and the EB IC(s), performs merging, revision, contraction, or a combination thereof, and produces a new KB in the new KB preview list.

Returns:
true to indicate success in generating a new KB for preview, false otherwise.

setChange

void setChange(boolean isChoice)
Sets the change type caption and the tooltip text for the change type toggle button.

This method is called by the inner class ChangeListener and by the settings menu listener.


setAlgo

void setAlgo(boolean isAll1)
Sets the search algorithm caption and the tooltip text for the search algorithm toggle button.

This method is called by the inner class AlgoListener and by the settings menu listener.


setMerge

void setMerge(boolean isProj)
Sets the merge type caption and the tooltip text for the merge type toggle button.

This method is called by the inner class MergeListener and by the settings menu listener.


setCons

void setCons(boolean isOn)
Sets the consistency check caption and the tooltip text for the consistency check toggle button.

This method is called by the inner class ConsListener and by the settings menu listener.