org.moyoman.client.reference.debug
Class DebugPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.moyoman.client.reference.debug.DebugPanel
All Implemented Interfaces:
Accessible, IGUIConstants, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
AggregateDebugPanel, ContinuousDebugPanel, DiscreteDebugPanel, ForestDebugPanel, GroupRatingDebugPanel, LegendDebugPanel, SOIDebugPanel

public abstract class DebugPanel
extends JPanel
implements IGUIConstants

Provides a debug panel base class.

Since:
v0.01
Version:
v0.17
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  ActionManager _actionManager
          Handle to the action manager.
private  Board _board
          Board.
protected  JLabel _dataLabel
          Data label.
protected  JList _dataUI
          Data list.
private  Debug _debugInfo
          Current debug info.
private  DebugType _debugType
          The debug type.
private  String _header
          Debug header.
private  JLabel _headerUI
          The header widget.
private  JButton _infoUI
          Debug information widget.
private  String _module
          The module.
 
Fields inherited from class javax.swing.JPanel
 
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 org.moyoman.client.reference.util.IGUIConstants
DEBUG, DIRTY_PROPERTY, GAP, MARGIN, TRANSPARENT_COLOR
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
protected DebugPanel()
          Construct this panel.
 
Method Summary
 void clear()
          Clear the data from this panel.
protected  void clearAnnotations()
          Clear the board annotations.
static DebugPanel create(String module, DebugType debugType, String header)
          Factory method to create new debug panels based upon the given debug type and given module.
protected  void createBoard()
          Create the board.
protected  JComponent createEastComponent()
          Create the East component.
protected  JPanel createHeaderPanel()
          Create the header panel.
 void debugInfoActionPerformed(ActionEvent event)
          Callback for the debug info action.
protected  ActionManager getActionManager()
          Return the action manager, creating it if necessary.
protected  Board getBoard()
          Return the board.
 DebugType getDebugType()
          Return the debug type.
protected  Color getForegroundFor(Stone stone)
          Return the appropriate foreground color based upon the given stone.
 String getHeader()
          Return the debug header.
protected abstract  String getHelpTextKey()
          Return the key for the help text.
protected  Action getInfoAction()
          Return the info action.
 String getModule()
          Return the module.
protected  void init()
          Initialize this panel.
 void setBoardState(List state)
          Set board state.
 void setDebugInfo(Debug debugInfo)
          Set the debug info.
 void setDebugType(DebugType debugType)
          Set the debug type.
 void setEnabled(boolean isEnabled)
          Set the enabled state.
 void setHeader(String header)
          Set the debug header.
 void setLanguageName(String languageName)
          Set the language name.
protected  void setListData(Object[] listData)
          Set the list data.
 void setModule(String module)
          Set the module.
 
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, 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

_dataLabel

protected JLabel _dataLabel
Data label.


_dataUI

protected JList _dataUI
Data list.


_actionManager

private ActionManager _actionManager
Handle to the action manager.


_board

private Board _board
Board.


_debugInfo

private Debug _debugInfo
Current debug info.


_debugType

private DebugType _debugType
The debug type.


_infoUI

private JButton _infoUI
Debug information widget.


_headerUI

private JLabel _headerUI
The header widget.


_header

private String _header
Debug header.


_module

private String _module
The module.

Constructor Detail

DebugPanel

protected DebugPanel()
Construct this panel.

Since:
v0.01
Method Detail

setBoardState

public void setBoardState(List state)
Set board state.

Since:
v0.01

setDebugInfo

public void setDebugInfo(Debug debugInfo)
Set the debug info.

Since:
v0.01

setDebugType

public void setDebugType(DebugType debugType)
Set the debug type.

Since:
v0.01

getDebugType

public DebugType getDebugType()
Return the debug type.

Since:
v0.01

setEnabled

public void setEnabled(boolean isEnabled)
Set the enabled state.

Overrides:
setEnabled in class JComponent
Since:
v0.03

setHeader

public void setHeader(String header)
Set the debug header.

Since:
v0.17

getHeader

public String getHeader()
Return the debug header.

Since:
v0.17

setLanguageName

public void setLanguageName(String languageName)
Set the language name.

Since:
v0.03

setModule

public void setModule(String module)
Set the module.

Since:
v0.01

getModule

public String getModule()
Return the module.

Since:
v0.01

clear

public void clear()
Clear the data from this panel.

Since:
v0.03

create

public static DebugPanel create(String module,
                                DebugType debugType,
                                String header)
Factory method to create new debug panels based upon the given debug type and given module.

Since:
v0.01

debugInfoActionPerformed

public void debugInfoActionPerformed(ActionEvent event)
Callback for the debug info action.

Since:
v0.16

getBoard

protected Board getBoard()
Return the board.

Since:
v0.01

getHelpTextKey

protected abstract String getHelpTextKey()
Return the key for the help text.

Since:
v0.01

getActionManager

protected ActionManager getActionManager()
Return the action manager, creating it if necessary.

Since:
v0.16

getForegroundFor

protected Color getForegroundFor(Stone stone)
Return the appropriate foreground color based upon the given stone.

Since:
v0.01

getInfoAction

protected Action getInfoAction()
Return the info action.

Since:
v0.16

setListData

protected void setListData(Object[] listData)
Set the list data.

Since:
v0.01

clearAnnotations

protected void clearAnnotations()
Clear the board annotations.

Since:
v0.01

createBoard

protected void createBoard()
Create the board.

Since:
v0.01

createEastComponent

protected JComponent createEastComponent()
Create the East component.

Since:
v0.01

createHeaderPanel

protected JPanel createHeaderPanel()
Create the header panel.

Since:
v0.16

init

protected void init()
Initialize this panel.

Since:
v0.01