Back to index

moin  1.9.0~rc2
ActionTool.java
Go to the documentation of this file.
00001 /*
00002  * @(#)ActionTool.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.standard;
00007 
00008 import CH.ifa.draw.framework.*;
00009 
00010 import java.awt.*;
00011 import java.awt.event.MouseEvent;
00012 
00017 public abstract class ActionTool extends AbstractTool {
00018 
00019     public ActionTool(DrawingView itsView) {
00020         super(itsView);
00021     }
00022 
00027     public void mouseDown(MouseEvent e, int x, int y) {
00028         Figure target = drawing().findFigure(x, y);
00029         if (target != null) {
00030             view().addToSelection(target);
00031             action(target);
00032         }
00033     }
00034 
00035     public void mouseUp(MouseEvent e, int x, int y) {
00036         editor().toolDone();
00037     }
00038 
00042     public abstract void action(Figure figure);
00043 }