cobaUI
Class HistoryPanel

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

class HistoryPanel
extends javax.swing.JPanel

HistoryPanel is a panel displaying (1) the old KB and change snapshots, (2) the old Entailment-based Integrity Constraint (EB IC) and change snapshots, and (3) old Consistency-based Integrity Constraint (CB IC) and change snapshots, as well as buttons for reverting to a selected snapshot.

For the KB, it logs all the removals, replacements, and changes committed; For the EB IC and the CB IC, it logs all the removals and replacements made. Each snapshot k records the list contents immediately before the corresponding change k is applied.

Author:
Daphne Liu, daphnel@sfu.ca

Nested Class Summary
(package private)  class HistoryPanel.CBRevertListener
          An action listener which confirms the user's decision to revert to an CB IC snapshot, logs the current consistency-based integrity constraints (CB IC), and replaces the CB IC with the selected snapshot.
(package private)  class HistoryPanel.EBRevertListener
          An action listener which confirms the user's decision to revert to an EB IC snapshot, logs the current entailment-based integrity constraints (EB IC), and replaces the EB IC with the selected snapshot.
(package private)  class HistoryPanel.KBRevertListener
          An action listener which confirms the user's decision to revert to a KB snapshot, logs the current knowledge base(s) (KB), and replaces the KB with the selected snapshot.
(package private)  class HistoryPanel.MyListDataListener
          A list data listener which enables the appropriate "save" menu item when the list contents change.
 
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)  javax.swing.DefaultListModel CBChangeModel
          The list model managing the corresponding CB IC changes oldCBChange.
(package private)  javax.swing.DefaultListModel CBModel
          The list model managing the CB IC snapshots oldCB.
(package private)  javax.swing.DefaultListModel EBChangeModel
          The list model managing the corresponding EB IC changes oldEBChange.
(package private)  javax.swing.DefaultListModel EBModel
          The list model managing the EB IC snapshots oldEB.
(package private)  javax.swing.DefaultListModel KBChangeModel
          The list model managing the corresponding KB changes oldKBChange.
(package private)  javax.swing.DefaultListModel KBModel
          The list model managing the KB snapshots oldKB.
(package private)  COBAApplet ParentApplet
          A reference to the enclosing applet.
 
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) HistoryPanel(COBAApplet _parent)
          Constructs a new HistoryPanel for the enclosing applet _parent and lays out all UI components.
 
Method Summary
(package private)  void activateAfterDecision()
          Enables all revert buttons after the user's decision to reject or commit the new KB.
(package private)  void deactivateBeforeDecision()
          Disables all revert buttons pending the user's decision to reject or commit the new KB.
(package private)  void logCBRemoval(java.util.Vector lsCB, java.lang.String removed)
          Logs the current consistency-based integrity constraints (CB IC) in lsCB and the removed sentence removed to the CB IC snapshot list and to the CB IC change history.
(package private)  void logCBReplacement(java.util.Vector lsCB, java.lang.String fileName)
          Logs the consistency-based integrity constraints (CB IC) in lsCB and the replacing file name fileName to the CB snapshot list and to the CB IC change history.
(package private)  void logCommit(java.util.Vector lsKB, java.util.Vector lsRev, java.util.Vector lsCont)
          Logs the current knowledge base(s), revision(s), contraction(s), links to the entailment-based and the consistency-based integrity constraint to the KB snapshot list and to KB change history.
(package private)  void logEBRemoval(java.util.Vector lsEB, java.lang.String removed)
          Logs the current entailment-based integrity constraints (EB IC) in lsEB and the removed sentence removed to the EB IC snapshot list and to the EB IC change history.
(package private)  void logEBReplacement(java.util.Vector lsEB, java.lang.String fileName)
          Logs the entailment-based integrity constraints (EB IC) in lsEB and the replacing file name fileName to the EB snapshot list and to the EB IC change history.
(package private)  void logKBRemoval(java.util.Vector lsKB, java.lang.String removed)
          Logs the current knowledge base(s) in lsKB and the removed sentence removed to the KB snapshot list and to the KB change history.
(package private)  void logKBReplacement(java.util.Vector lsKB, java.lang.String fileName)
          Logs the current knowledge base(s) in lsKB and the replacing file name fileName to the KB snapshot list and to the KB change history.
 
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, paintComponent, 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

ParentApplet

COBAApplet ParentApplet
A reference to the enclosing applet.


KBModel

javax.swing.DefaultListModel KBModel
The list model managing the KB snapshots oldKB.


KBChangeModel

javax.swing.DefaultListModel KBChangeModel
The list model managing the corresponding KB changes oldKBChange.


CBModel

javax.swing.DefaultListModel CBModel
The list model managing the CB IC snapshots oldCB.


CBChangeModel

javax.swing.DefaultListModel CBChangeModel
The list model managing the corresponding CB IC changes oldCBChange.


EBModel

javax.swing.DefaultListModel EBModel
The list model managing the EB IC snapshots oldEB.


EBChangeModel

javax.swing.DefaultListModel EBChangeModel
The list model managing the corresponding EB IC changes oldEBChange.

Constructor Detail

HistoryPanel

HistoryPanel(COBAApplet _parent)
Constructs a new HistoryPanel for the enclosing applet _parent and lays out all UI components.

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

deactivateBeforeDecision

void deactivateBeforeDecision()
Disables all revert buttons pending the user's decision to reject or commit the new KB.


activateAfterDecision

void activateAfterDecision()
Enables all revert buttons after the user's decision to reject or commit the new KB.


logCommit

void logCommit(java.util.Vector lsKB,
               java.util.Vector lsRev,
               java.util.Vector lsCont)
Logs the current knowledge base(s), revision(s), contraction(s), links to the entailment-based and the consistency-based integrity constraint to the KB snapshot list and to KB change history.

The method is invoked in the event of committing a new KB.

Parameters:
lsKB - the collection of knowledge bases to be logged.
lsRev - the collection of revisions to be logged.
lsCont - the collection of contractions to be logged.

logKBReplacement

void logKBReplacement(java.util.Vector lsKB,
                      java.lang.String fileName)
Logs the current knowledge base(s) in lsKB and the replacing file name fileName to the KB snapshot list and to the KB change history.

The method is invoked in the event of replacing the KB with an imported file.

Parameters:
lsKB - the collection of knowledge bases to be logged.
fileName - the name of the file used to replace the KB.

logEBReplacement

void logEBReplacement(java.util.Vector lsEB,
                      java.lang.String fileName)
Logs the entailment-based integrity constraints (EB IC) in lsEB and the replacing file name fileName to the EB snapshot list and to the EB IC change history.

The method is invoked in the event of replacing the EB IC with an imported file.

Parameters:
lsEB - the collection of EB IC to be logged.
fileName - the name of the file used to replace the EB IC.

logCBReplacement

void logCBReplacement(java.util.Vector lsCB,
                      java.lang.String fileName)
Logs the consistency-based integrity constraints (CB IC) in lsCB and the replacing file name fileName to the CB snapshot list and to the CB IC change history.

The method is invoked in the event of replacing the CB IC with an imported file.

Parameters:
lsCB - the collection of CB IC to be logged.
fileName - the name of the file used to replace the CB IC.

logKBRemoval

void logKBRemoval(java.util.Vector lsKB,
                  java.lang.String removed)
Logs the current knowledge base(s) in lsKB and the removed sentence removed to the KB snapshot list and to the KB change history.

The method is invoked in the event of removing a sentence from a KB.

Parameters:
lsKB - the collection of knowledge bases to be logged.
removed - the string representation of the removed sentence.

logEBRemoval

void logEBRemoval(java.util.Vector lsEB,
                  java.lang.String removed)
Logs the current entailment-based integrity constraints (EB IC) in lsEB and the removed sentence removed to the EB IC snapshot list and to the EB IC change history.

The method is invoked in the event of removing a sentence from the EB IC.

Parameters:
lsEB - the collection of EB IC to be logged.
removed - the string representation of the removed sentence.

logCBRemoval

void logCBRemoval(java.util.Vector lsCB,
                  java.lang.String removed)
Logs the current consistency-based integrity constraints (CB IC) in lsCB and the removed sentence removed to the CB IC snapshot list and to the CB IC change history.

The method is invoked in the event of removing a sentence from the CB IC.

Parameters:
lsCB - the collection of CB IC to be logged.
removed - the string representation of the removed sentence.