twaver.gis.gadget.inputhandler
Class DistanceInputHandler

java.lang.Object
  extended bytwaver.network.inputhandler.InputAdapter
      extended bytwaver.gis.gadget.inputhandler.DistanceInputHandler
All Implemented Interfaces:
twaver.network.CanvasMarker, java.util.EventListener, twaver.network.inputhandler.InputHandler, java.awt.event.KeyListener, javax.swing.event.MouseInputListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class DistanceInputHandler
extends twaver.network.inputhandler.InputAdapter
implements twaver.network.CanvasMarker

This handler is used to deal with the mouse event on network canvas when the map mode is MAPMODEL_DISTANCE.

When the mouse is clicked once time, the point where the mouse is clicked will be stored into a list. When the mouse is double clicked, the list storing points will be cleared. If the list is filled with points, when the mouse moved on the network canvas, the mouse's track will be drawn.


Constructor Summary
DistanceInputHandler(twaver.network.TNetwork network)
           
DistanceInputHandler(twaver.network.TNetwork network, GeographyMap map)
           
 
Method Summary
 void clear()
           
 void mark(java.awt.Graphics2D g)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 
Methods inherited from class twaver.network.inputhandler.InputAdapter
cleanup, init, keyPressed, keyReleased, keyTyped, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistanceInputHandler

public DistanceInputHandler(twaver.network.TNetwork network,
                            GeographyMap map)

DistanceInputHandler

public DistanceInputHandler(twaver.network.TNetwork network)
Method Detail

mouseClicked

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

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mark

public void mark(java.awt.Graphics2D g)
Specified by:
mark in interface twaver.network.CanvasMarker

clear

public void clear()