org.nakedobjects.viewer.lightweight
Class ViewManager

java.lang.Object
  extended byorg.nakedobjects.viewer.lightweight.ViewManager
All Implemented Interfaces:
java.util.EventListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class ViewManager
extends java.lang.Object
implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.awt.event.KeyListener


Field Summary
 KeyboardAccessible keyboardFocus
           
 
Method Summary
protected  DragView getDraggingView()
           
 DragHandler getDragHandler()
           
 void keyPressed(java.awt.event.KeyEvent ke)
          Listener for key presses.
 void keyReleased(java.awt.event.KeyEvent ke)
          Listener for key releases and forward them to the view that has the keyboard focus.
 void keyTyped(java.awt.event.KeyEvent ke)
          Listener for key press, and subsequent release, and forward it as one event to the view that has the keyboard focus.
 void makeFocus(KeyboardAccessible view)
           
 void mouseClicked(java.awt.event.MouseEvent me)
          Responds to mouse click events by calling firstClick, secondClick, and thirdClick on the view that the mouse is over.
 void mouseDragged(java.awt.event.MouseEvent me)
          Responds to mouse dragged according to the button used.
 void mouseEntered(java.awt.event.MouseEvent arg0)
          event ignored
 void mouseExited(java.awt.event.MouseEvent arg0)
          event ignored
 void mouseMoved(java.awt.event.MouseEvent me)
          responds to mouse moved event by setting the view found underneath the mouse as the idetified view.
 void mousePressed(java.awt.event.MouseEvent me)
          Responds to the mouse pressed event (with the left button pressed) by initiating a drag.
 void mouseReleased(java.awt.event.MouseEvent me)
          Repsonds to the mouse released event (with the left button pressed) by telling the identified view (the drop zone) that the dragged object is being dropped on it (via the views drop method).
 void saveCurrentFieldEntry()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyboardFocus

public KeyboardAccessible keyboardFocus
Method Detail

getDragHandler

public DragHandler getDragHandler()

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Listener for key presses. Cancels popup and drags, and forwards key presses to the view that has the keyboard focus.

Specified by:
keyPressed in interface java.awt.event.KeyListener
See Also:
KeyListener.keyPressed(KeyEvent)

keyReleased

public void keyReleased(java.awt.event.KeyEvent ke)
Listener for key releases and forward them to the view that has the keyboard focus.

Specified by:
keyReleased in interface java.awt.event.KeyListener
See Also:
KeyListener.keyReleased(KeyEvent)

keyTyped

public void keyTyped(java.awt.event.KeyEvent ke)
Listener for key press, and subsequent release, and forward it as one event to the view that has the keyboard focus.

Specified by:
keyTyped in interface java.awt.event.KeyListener
See Also:
KeyListener.keyTyped(KeyEvent)

makeFocus

public void makeFocus(KeyboardAccessible view)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Responds to mouse click events by calling firstClick, secondClick, and thirdClick on the view that the mouse is over. Ignored if the mouse is not over a view.

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

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Responds to mouse dragged according to the button used. If the left button then identified view is moved.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseDragged(MouseEvent)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent arg0)
event ignored

Specified by:
mouseEntered in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseEntered(MouseEvent)

mouseExited

public void mouseExited(java.awt.event.MouseEvent arg0)
event ignored

Specified by:
mouseExited in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseExited(MouseEvent)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)
responds to mouse moved event by setting the view found underneath the mouse as the idetified view. Views normally respond by changing the colour of themselves so they are visual distinct and hence shows itself as special compared to the rest.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseMoved(MouseEvent)

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Responds to the mouse pressed event (with the left button pressed) by initiating a drag. This sets up the View's dragging state to the view that the mouse was over when the button was pressed.

Specified by:
mousePressed in interface java.awt.event.MouseListener
See Also:
MouseListener.mousePressed(MouseEvent)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Repsonds to the mouse released event (with the left button pressed) by telling the identified view (the drop zone) that the dragged object is being dropped on it (via the views drop method). If the drop takes place outside of all of the other views then the workspaceDrop method is called instead to indicate a drop onto the workspace.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseReleased(MouseEvent)

saveCurrentFieldEntry

public void saveCurrentFieldEntry()

getDraggingView

protected DragView getDraggingView()