ee.ut.mrz.volumest
Class InputHandler

java.lang.Object
  extended by ee.ut.mrz.volumest.InputHandler
All Implemented Interfaces:
AdjustmentListener, MouseListener, MouseMotionListener, MouseWheelListener, EventListener

public class InputHandler
extends Object
implements MouseListener, MouseMotionListener, AdjustmentListener, MouseWheelListener

Processes inputs from user.

Author:
Markko Merzin, markko.merzin@ut.ee

Constructor Summary
InputHandler(Volumest volumest)
          Creates a new instance of MouseHandler
 
Method Summary
 void adjustmentValueChanged(AdjustmentEvent e)
          User drags scrollbar.
 void displayNextImageWithGrid()
          Finds next image with associated grid and displays it.
 void displayPrevImageWithGrid()
          Finds previous image with associated grid and displays it.
 void doRedo()
          Does redo and redraws image.
 void doUndo()
          Does undo and redraws image.
 boolean isScollbarmoved()
           
 void mouseClicked(MouseEvent mouseEvent)
          Processes one click.
 void mouseDragged(MouseEvent mouseEvent)
          Collects and draws dragline.
 void mouseEntered(MouseEvent mouseEvent)
          Does nothing.
 void mouseExited(MouseEvent mouseEvent)
          Does nothing.
 void mouseMoved(MouseEvent mouseEvent)
          Does nothing.
 void mousePressed(MouseEvent mouseEvent)
          Invoked when mouse is pressed.
 void mouseReleased(MouseEvent mouseEvent)
          Invoked when mouse button is released.
 void mouseWheelMoved(MouseWheelEvent e)
           
 void rerun()
          Reruns Volumest for another measurement on same stack.
 void restoreOriginalImage(ImageProcessor ip, String slice)
           
 void setScollbarmoved(boolean scollbarmoved)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputHandler

public InputHandler(Volumest volumest)
Creates a new instance of MouseHandler

Parameters:
volumest - Pointer to main worker.
Method Detail

mouseReleased

public void mouseReleased(MouseEvent mouseEvent)
Invoked when mouse button is released. When mouse was previously dragged then calls functions to process selection. Otherwise just updates display.

Specified by:
mouseReleased in interface MouseListener
Parameters:
mouseEvent - See: java.awt.event.MouseEvent.

mousePressed

public void mousePressed(MouseEvent mouseEvent)
Invoked when mouse is pressed. Eventually copies current pointset.

Specified by:
mousePressed in interface MouseListener
Parameters:
mouseEvent - See: java.awt.event.MouseEvent.

mouseMoved

public void mouseMoved(MouseEvent mouseEvent)
Does nothing.

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
mouseEvent - See: java.awt.event.MouseEvent.

mouseExited

public void mouseExited(MouseEvent mouseEvent)
Does nothing.

Specified by:
mouseExited in interface MouseListener
Parameters:
mouseEvent - See: java.awt.event.MouseEvent.

mouseEntered

public void mouseEntered(MouseEvent mouseEvent)
Does nothing.

Specified by:
mouseEntered in interface MouseListener
Parameters:
mouseEvent - See: java.awt.event.MouseEvent.

mouseDragged

public void mouseDragged(MouseEvent mouseEvent)
Collects and draws dragline.

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
mouseEvent - See: java.awt.event.MouseEvent.

mouseClicked

public void mouseClicked(MouseEvent mouseEvent)
Processes one click. Activates or deactivates one gridpoint or intersectionpoint.

Specified by:
mouseClicked in interface MouseListener
Parameters:
mouseEvent - See: java.awt.event.MouseEvent.

restoreOriginalImage

public void restoreOriginalImage(ImageProcessor ip,
                                 String slice)

doUndo

public void doUndo()
Does undo and redraws image.


doRedo

public void doRedo()
Does redo and redraws image.


displayNextImageWithGrid

public void displayNextImageWithGrid()
Finds next image with associated grid and displays it.


displayPrevImageWithGrid

public void displayPrevImageWithGrid()
Finds previous image with associated grid and displays it.


adjustmentValueChanged

public void adjustmentValueChanged(AdjustmentEvent e)
User drags scrollbar. Updating calculations.

Specified by:
adjustmentValueChanged in interface AdjustmentListener

isScollbarmoved

public boolean isScollbarmoved()

setScollbarmoved

public void setScollbarmoved(boolean scollbarmoved)

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface MouseWheelListener

rerun

public void rerun()
Reruns Volumest for another measurement on same stack.