org.argouml.cognitive.ui
Class ToDoPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.argouml.cognitive.ui.ToDoPane
All Implemented Interfaces:
Accessible, EventListener, ImageObserver, ItemListener, MenuContainer, MouseListener, QuadrantPanel, Serializable, ToDoListListener, TreeSelectionListener

public class ToDoPane
extends JPanel
implements ItemListener, TreeSelectionListener, MouseListener, ToDoListListener, QuadrantPanel

The lower-left pane of the main ArgoUML window, which shows the list of active critics and todo items.

This pane shows a list or tree of all the "to do" items that the designer should consider.

This class is similar to the NavigatorPane. It uses the same treemodel class and JTree implementation.

Perspectives are now built here.

Future plans may involve:
1)DecisionModelListener implementation
2)GoalListener implementation
?

 possible future additions:
  ToDoPerspective difficulty = new ToDoByDifficulty();
  ToDoPerspective skill = new ToDoBySkill();

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 static Color ALARM_COLOR
           
private static int ALARM_THRESHOLD
           
private static int clicksInToDoPane
           
private  JComboBox combo
           
private  JLabel countLabel
           
private  ToDoPerspective curPerspective
           
private static int dblClicksInToDoPane
           
private  char dir
           
private  JToggleButton flatButton
           
private  Object lastSel
           
private static Logger LOG
           
private  int oldSize
           
private  ProjectBrowser pb
          shouldn't need this
private  Vector perspectives
          vector of TreeModels
private  ToDoList root
           
private static int toDoPerspectivesChanged
           
private  org.tigris.gef.ui.ToolBar toolbar
           
private  JTree tree
           
private static Color WARN_COLOR
           
private static int WARN_THRESHOLD
           
 
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.argouml.application.api.QuadrantPanel
Q_BOTTOM, Q_BOTTOM_LEFT, Q_BOTTOM_RIGHT, Q_LEFT, Q_RIGHT, Q_TOP, Q_TOP_LEFT, Q_TOP_RIGHT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ToDoPane(boolean doSplash)
          The constructor.
 
Method Summary
private static Vector buildPerspectives()
          The perspectives to be chosen in the combobox are built here.
private static String formatCountLabel(int size)
           
 ToDoPerspective getCurPerspective()
           
 Vector getPerspectives()
           
 int getQuadrant()
          This shall return a corner indentification.
 ToDoList getRoot()
           
 Object getSelectedObject()
           
 void itemStateChanged(ItemEvent e)
          Called when the user selects a perspective from the perspective combo.
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void myDoubleClick(int row, TreePath path)
          Called when the user clicks twice on an item in the tree.
static void mySingleClick(int row, TreePath path)
          Called when the user clicks once on an item in the tree.
 void selectItem(ToDoItem item)
           
 void setCurPerspective(TreeModel per)
           
 void setPerspectives(Vector pers)
           
 void setRoot(ToDoList r)
           
 void toDoItemsAdded(ToDoListEvent tde)
           
 void toDoItemsChanged(ToDoListEvent tde)
           
 void toDoItemsRemoved(ToDoListEvent tde)
           
 void toDoListChanged(ToDoListEvent tde)
           
 void updateCountLabel()
          Update the count label.
protected  void updateTree()
          Update the todo tree.
 void valueChanged(TreeSelectionEvent e)
          Called when the user selects an item in the tree, by clicking or otherwise.
 
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

LOG

private static final Logger LOG

WARN_THRESHOLD

private static final int WARN_THRESHOLD
See Also:
Constant Field Values

ALARM_THRESHOLD

private static final int ALARM_THRESHOLD
See Also:
Constant Field Values

WARN_COLOR

private static final Color WARN_COLOR

ALARM_COLOR

private static final Color ALARM_COLOR

clicksInToDoPane

private static int clicksInToDoPane

dblClicksInToDoPane

private static int dblClicksInToDoPane

toDoPerspectivesChanged

private static int toDoPerspectivesChanged

tree

private JTree tree

toolbar

private org.tigris.gef.ui.ToolBar toolbar

combo

private JComboBox combo

perspectives

private Vector perspectives
vector of TreeModels


curPerspective

private ToDoPerspective curPerspective

root

private ToDoList root

flatButton

private JToggleButton flatButton

countLabel

private JLabel countLabel

lastSel

private Object lastSel

oldSize

private int oldSize

dir

private char dir

pb

private ProjectBrowser pb
shouldn't need this

Constructor Detail

ToDoPane

public ToDoPane(boolean doSplash)
The constructor.

Parameters:
doSplash - if true, then we have to show progress in the splash
Method Detail

setRoot

public void setRoot(ToDoList r)
Parameters:
r - the root

getRoot

public ToDoList getRoot()
Returns:
the root

getPerspectives

public Vector getPerspectives()
Returns:
the perspectives treemodels

setPerspectives

public void setPerspectives(Vector pers)
Parameters:
pers - the perspectives

getCurPerspective

public ToDoPerspective getCurPerspective()
Returns:
the current perspectives

setCurPerspective

public void setCurPerspective(TreeModel per)
Parameters:
per - the current perspective

getSelectedObject

public Object getSelectedObject()
Returns:
the last Object in the first selected node's TreePath, or null if nothing is selected

selectItem

public void selectItem(ToDoItem item)
Parameters:
item - the item to be selected

itemStateChanged

public void itemStateChanged(ItemEvent e)
Called when the user selects a perspective from the perspective combo.

Param e is the event.

Specified by:
itemStateChanged in interface ItemListener
See Also:
ItemListener.itemStateChanged(java.awt.event.ItemEvent)

valueChanged

public void valueChanged(TreeSelectionEvent e)
Called when the user selects an item in the tree, by clicking or otherwise.

Param e is the event.

Specified by:
valueChanged in interface TreeSelectionListener
See Also:
TreeSelectionListener.valueChanged(javax.swing.event.TreeSelectionEvent)

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener
See Also:
Empty implementation.

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener
See Also:
Empty implementation.

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener
See Also:
Empty implementation.

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener
See Also:
Empty implementation.

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

toDoItemsChanged

public void toDoItemsChanged(ToDoListEvent tde)
Specified by:
toDoItemsChanged in interface ToDoListListener
Parameters:
tde - the todo list event
See Also:
ToDoListListener.toDoItemsChanged(org.argouml.cognitive.ToDoListEvent)

toDoItemsAdded

public void toDoItemsAdded(ToDoListEvent tde)
Specified by:
toDoItemsAdded in interface ToDoListListener
Parameters:
tde - the todo list event
See Also:
ToDoListListener.toDoItemsAdded(org.argouml.cognitive.ToDoListEvent)

toDoItemsRemoved

public void toDoItemsRemoved(ToDoListEvent tde)
Specified by:
toDoItemsRemoved in interface ToDoListListener
Parameters:
tde - the todo list event
See Also:
ToDoListListener.toDoItemsRemoved(org.argouml.cognitive.ToDoListEvent)

toDoListChanged

public void toDoListChanged(ToDoListEvent tde)
Specified by:
toDoListChanged in interface ToDoListListener
Parameters:
tde - the todo list event
See Also:
ToDoListListener.toDoListChanged(org.argouml.cognitive.ToDoListEvent)

formatCountLabel

private static String formatCountLabel(int size)

updateCountLabel

public void updateCountLabel()
Update the count label.


updateTree

protected void updateTree()
Update the todo tree.


getQuadrant

public int getQuadrant()
Description copied from interface: QuadrantPanel
This shall return a corner indentification.

Specified by:
getQuadrant in interface QuadrantPanel
Returns:
one of Q_TOP_LEFT, Q_TOP_RIGHT, Q_BOTTOM_LEFT, Q_BOTTOM_RIGHT
See Also:
QuadrantPanel.getQuadrant()

mySingleClick

public static void mySingleClick(int row,
                                 TreePath path)
Called when the user clicks once on an item in the tree.

Q: What should the difference be between a single and double click?

A: A single click selects the todo item in the tree, shows the red indication on the diagram, and selects the todo tab in the details panel. A double click additionally selects the offender in the explorer, and selects the offender in the diagram (blue selection), and selects the properties tab in the details panel. In both cases, the focus (for keyboard actions) remains in the todo tree.

Parameters:
row - the selected row in the tree
path - the path in the tree of the selected item

myDoubleClick

public void myDoubleClick(int row,
                          TreePath path)
Called when the user clicks twice on an item in the tree. myDoubleClick will invoke the action() on the ToDoItem.

Parameters:
row - the selected row in the tree
path - the path in the tree of the selected item

buildPerspectives

private static Vector buildPerspectives()
The perspectives to be chosen in the combobox are built here.



ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook