Back to index

wims  3.65+svn20090927
SaveJob.java
Go to the documentation of this file.
00001 package rene.zirkel.tools;
00002 
00003 // file: SetParameter.java
00004 
00005 import java.awt.event.*;
00006 
00007 import rene.zirkel.Zirkel;
00008 import rene.zirkel.ZirkelCanvas;
00009 import rene.zirkel.constructors.*;
00010 import rene.zirkel.objects.*;
00011 
00012 public class SaveJob extends ObjectConstructor
00013 {      public ConstructionObject Last;
00014        public void mousePressed (MouseEvent e, ZirkelCanvas zc)
00015        {      double x=zc.x(e.getX()),y=zc.y(e.getY());
00016               ConstructionObject o=zc.selectObject(e.getX(),e.getY());
00017               if (o==null) return;
00018               o.setSelected(true);
00019               if (Last==null) 
00020               {      Last=o;
00021                      zc.setJob(Last);
00022                      showStatus(zc);
00023               }
00024               else
00025               {      if (e.isShiftDown()) zc.addJobTarget(o,true);
00026                      else zc.addJobTarget(o,false);
00027               }
00028               zc.repaint();
00029        }
00030        public void mouseMoved (MouseEvent e, ZirkelCanvas zc, boolean simple)
00031        {      zc.indicateObjects(e.getX(),e.getY());
00032        }
00033 
00034        public void reset (ZirkelCanvas zc)
00035        {      super.reset(zc);
00036               zc.clearSelected();
00037               zc.getConstruction().clearTargets();
00038               zc.clearTargets();
00039               Last=null;
00040               showStatus(zc);
00041               zc.clearJob();
00042        }
00043        public void showStatus (ZirkelCanvas zc)
00044        {      if (Last==null)
00045                      zc.showStatus(
00046                             Zirkel.name("message.savejob.first"));
00047               else
00048                      zc.showStatus(
00049                             Zirkel.name("message.savejob.second"));
00050        }
00051        public boolean useSmartBoard ()
00052        {      return false;
00053        }
00054 }