jcreek.gui.representation
Class CasePane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjcreek.gui.representation.FramePane
                  extended byjcreek.gui.representation.CasePane
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, ModelChangeListener, java.io.Serializable

public class CasePane
extends FramePane

GUI element for creating or manipulating a Creek case. An instance of this class encapsulates a Case (as defined in jcreek.representation) and allows the manipulation of it.

Version:
1.0
Author:
Frode Sørmo
See Also:
jcreek.representation.Case, Serialized Form

Nested Class Summary
 
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
protected  javax.swing.JComboBox addSolution
           
protected  javax.swing.JButton addSolutionButton
           
protected  javax.swing.JComponent addValue
           
static java.lang.String[] CASE_STATUS_NAMES
          The strings displayed for the different case statuses.
protected  javax.swing.JComponent caseStatus
           
protected  javax.swing.JTable caseTable
           
protected  CaseTableModel caseTableModel
           
protected  javax.swing.JPanel elementPanel
           
static int SOLVED_STATUS_EDITABLE
          The solved status of the case is visible and can be changed.
static int SOLVED_STATUS_HIDDEN
          The solved status of the case is not shown in the GUI element.
static int SOLVED_STATUS_VISIBLE
          The solved status of the case is visible but can't be changed.
 
Fields inherited from class jcreek.gui.representation.FramePane
addButton, addEntity, addPanel, addRelationType, addStrength, displayInherited, displayInheritedToggle, entityDescription, entityName, entityObjectClassSelector, frameTable, frameTableModel, isUpdatingGUI, myEntity, openNewWindow
 
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.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
CasePane(Case existingCase)
          Creates a new CasePane encapuslating an existing case.
CasePane(Case existingCase, boolean linker)
          Creates a new CasePane encapuslating an existing case.
CasePane(KnowledgeModel km)
          Creates a new CasePane for a new, empty case (instance of jcreek.representation.Case).
 
Method Summary
protected  void addElementFor(Relation r, CasePaneElement c)
           
protected  void buildFramePane()
          (Re)builds the pane.
 Case getCase()
          Returns the case displayed and modified by this CasePane.
 int getCaseStatusDisplay()
           
protected  CasePaneElement getElementFor(Relation r)
           
 boolean getShowCaseStatus()
           
protected  void initTable()
           
protected  void removeElementFor(Relation r)
           
 void setCase(Case existingCase)
          Sets the case to be displayed and modified by this CasePane.
 void setCaseStatusDisplay(int display)
          Sets if the status of the case should be hidden, visible or editable.
 void setEntity(Entity entity)
          Sets the entity to be displayed and modified by this FramePane.
 void setShowCaseStatus(boolean status)
           
 
Methods inherited from class jcreek.gui.representation.FramePane
addLinkListener, attach, buildEmptyPane, buildEntityObjectPane, buildHeaderPane, detach, getEntity, getFrameTable, getOpenNewWindowLinkListener, isAttached, isEditable, main, modelChanged, removeLinkListener, setEditable, setShowInheritedRelations, showInheritedRelations, showInheritedToggle, updatePane
 
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, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getWidth, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUI
 
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

SOLVED_STATUS_HIDDEN

public static final int SOLVED_STATUS_HIDDEN
The solved status of the case is not shown in the GUI element.

See Also:
Constant Field Values

SOLVED_STATUS_VISIBLE

public static final int SOLVED_STATUS_VISIBLE
The solved status of the case is visible but can't be changed.

See Also:
Constant Field Values

SOLVED_STATUS_EDITABLE

public static final int SOLVED_STATUS_EDITABLE
The solved status of the case is visible and can be changed.

See Also:
Constant Field Values

CASE_STATUS_NAMES

public static final java.lang.String[] CASE_STATUS_NAMES
The strings displayed for the different case statuses.


elementPanel

protected javax.swing.JPanel elementPanel

caseStatus

protected javax.swing.JComponent caseStatus

caseTableModel

protected CaseTableModel caseTableModel

addValue

protected javax.swing.JComponent addValue

caseTable

protected javax.swing.JTable caseTable

addSolutionButton

protected javax.swing.JButton addSolutionButton

addSolution

protected javax.swing.JComboBox addSolution
Constructor Detail

CasePane

public CasePane(Case existingCase,
                boolean linker)
Creates a new CasePane encapuslating an existing case. Changes done to this case in the GUI will be applied to this case.

Parameters:
existingCase - The case displayed by this CasePane
linker - If true, adds the default link listener that will open a new FramePane in a new JFrame when clicked.

CasePane

public CasePane(Case existingCase)
Creates a new CasePane encapuslating an existing case. Changes done to this case in the GUI will be applied to this case.

Parameters:
existingCase - The case displayed by this CasePane

CasePane

public CasePane(KnowledgeModel km)
Creates a new CasePane for a new, empty case (instance of jcreek.representation.Case). This case can be accessed through the getCase() method.

Parameters:
km - The KnowledgeModel the new case should be created in.
Method Detail

initTable

protected void initTable()
Overrides:
initTable in class FramePane

setShowCaseStatus

public void setShowCaseStatus(boolean status)

getShowCaseStatus

public boolean getShowCaseStatus()

setCase

public void setCase(Case existingCase)
Sets the case to be displayed and modified by this CasePane.

Parameters:
existingCase - The case object.

setEntity

public void setEntity(Entity entity)
Description copied from class: FramePane
Sets the entity to be displayed and modified by this FramePane.

Overrides:
setEntity in class FramePane
Parameters:
entity - The case object.

getCase

public Case getCase()
Returns the case displayed and modified by this CasePane.

Returns:
The case object.

setCaseStatusDisplay

public void setCaseStatusDisplay(int display)
Sets if the status of the case should be hidden, visible or editable. If it is hidden it will not be shown in the GUI element at all. If it is visible, it will be shown but impossible to change. If it is editable, it is visible and possible to change through the GUI. This value is separate from the setEditable() value.

Parameters:
display - One of CasePane.SOLVED_STATUS_EDITABLE, CasePane.SOLVED_STATUS_HIDDEN, or CasePane.SOLVED_STATUS_VISIBLE.

getCaseStatusDisplay

public int getCaseStatusDisplay()

addElementFor

protected void addElementFor(Relation r,
                             CasePaneElement c)

getElementFor

protected CasePaneElement getElementFor(Relation r)

removeElementFor

protected void removeElementFor(Relation r)

buildFramePane

protected void buildFramePane()
Description copied from class: FramePane
(Re)builds the pane.

Overrides:
buildFramePane in class FramePane


Created at IDI, NTNU by the Artificial Intelligence and Learning group