Back to index

wims  3.65+svn20090927
SetCurveCenterTool.java
Go to the documentation of this file.
00001 /*
00002  * Created on 06.11.2005
00003  *
00004  */
00005 package rene.zirkel.tools;
00006 
00007 import java.awt.event.MouseEvent;
00008 
00009 import rene.zirkel.Zirkel;
00010 import rene.zirkel.ZirkelCanvas;
00011 import rene.zirkel.constructors.ObjectConstructor;
00012 import rene.zirkel.objects.*;
00013 
00014 public class SetCurveCenterTool extends ObjectConstructor
00015 {      ObjectConstructor OC;
00016        FunctionObject P;
00017        public SetCurveCenterTool (ZirkelCanvas zc, FunctionObject p,
00018               ObjectConstructor oc)
00019        {      P=p; OC=oc;
00020               P.setSelected(true);
00021               zc.repaint();
00022        }
00023        public void mousePressed (MouseEvent e, ZirkelCanvas zc)
00024        {      ConstructionObject o=zc.selectPoint(e.getX(),e.getY());
00025               if (o==null) return;
00026               P.setCenter(o.getName());
00027               reset(zc);
00028        }
00029        public void showStatus (ZirkelCanvas zc)
00030        {      zc.showStatus(
00031                      Zirkel.name("message.setcenter"));
00032        }
00033        public void reset (ZirkelCanvas zc)
00034        {      super.reset(zc);
00035               zc.setTool(OC);
00036               zc.validate();
00037               zc.repaint();
00038        }
00039        public boolean useSmartBoard ()
00040        {      return false;
00041        }
00042 }
00043