Back to index

moin  1.9.0~rc2
HandleTracker.java
Go to the documentation of this file.
00001 /*
00002  * @(#)HandleTracker.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.standard;
00007 
00008 import java.awt.*;
00009 import java.awt.event.MouseEvent;
00010 import CH.ifa.draw.framework.*;
00011 
00018 public class HandleTracker extends AbstractTool {
00019 
00020     private Handle  fAnchorHandle;
00021 
00022     public HandleTracker(DrawingView view, Handle anchorHandle) {
00023         super(view);
00024         fAnchorHandle = anchorHandle;
00025     }
00026 
00027     public void mouseDown(MouseEvent e, int x, int y) {
00028         super.mouseDown(e, x, y);
00029         fAnchorHandle.invokeStart(x, y, view());
00030     }
00031 
00032     public void mouseDrag(MouseEvent e, int x, int y) {
00033         super.mouseDrag(e, x, y);
00034         fAnchorHandle.invokeStep(x, y, fAnchorX, fAnchorY, view());
00035     }
00036 
00037     public void mouseUp(MouseEvent e, int x, int y) {
00038         super.mouseDrag(e, x, y);
00039         fAnchorHandle.invokeEnd(x, y, fAnchorX, fAnchorY, view());
00040     }
00041 }