org.nakedobjects.plugins.dnd.viewer
Class InteractionHandler

java.lang.Object
  extended by org.nakedobjects.plugins.dnd.viewer.InteractionHandler
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

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


Constructor Summary
InteractionHandler(XViewer viewer, XFeedbackManager feedbackManager, KeyboardManager keyboardManager, InteractionSpy spy)
           
 
Method Summary
 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 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)
          Responds 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractionHandler

public InteractionHandler(XViewer viewer,
                          XFeedbackManager feedbackManager,
                          KeyboardManager keyboardManager,
                          InteractionSpy spy)
Method Detail

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)

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)
Responds 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)


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.