Back to index

wims  3.65+svn20090927
EditGridDialog.java
Go to the documentation of this file.
00001 /*
00002  * Created on 26.10.2005
00003  *
00004  */
00005 package rene.zirkel.dialogs;
00006 
00007 import java.awt.*;
00008 
00009 import rene.gui.*;
00010 import rene.zirkel.Zirkel;
00011 import rene.zirkel.objects.*;
00012 
00018 public class EditGridDialog extends HelpCloseDialog
00019 {      IconBar ColorIB,ThicknessIB,StyleIB;      
00020        
00024        public EditGridDialog (Frame f)
00025        {      super(f,Zirkel.name("ccordinates.title"),true);
00026        
00027               Panel center=new MyPanel();
00028               center.setLayout(new BorderLayout());
00029               
00030               add("Center",new Panel3D(center));
00031               
00032               Panel P=new Panel();
00033               P.setLayout(new GridLayout(0,2));
00034               
00035               ColorIB=new IconBar(f);
00036               ColorIB.addToggleGroupLeft("color",6);
00037               ColorIB.toggle("color",Global.getParameter("grid.colorindex",0));
00038               P.add(new MyLabel("")); P.add(ColorIB);
00039 
00040               ThicknessIB=new IconBar(f);
00041               ThicknessIB.addToggleGroupLeft("thickness",4);
00042               ThicknessIB.toggle("thickness",Global.getParameter("grid.thickness",ConstructionObject.THIN));
00043               P.add(new MyLabel("")); P.add(ThicknessIB);
00044               
00045               StyleIB=new IconBar(f);
00046               StyleIB.addOnOffLeft("showname");
00047               StyleIB.setState("showname",Global.getParameter("grid.labels",true));
00048               StyleIB.addOnOffLeft("bold");
00049               StyleIB.setState("bold",Global.getParameter("grid.bold",false));
00050               StyleIB.addOnOffLeft("large");
00051               StyleIB.setState("large",Global.getParameter("grid.large",false));
00052               P.add(new MyLabel("")); P.add(StyleIB);
00053               
00054               center.add("South",P);
00055        
00056               Panel p=new MyPanel();
00057               p.add(new ButtonAction(this,Zirkel.name("ok"),"OK"));
00058               p.add(new ButtonAction(this,Zirkel.name("cancel"),"Close"));
00059               addHelp(p,"grid");
00060               add("South",new Panel3D(p));
00061               
00062               pack();
00063               center(f);
00064               setVisible(true);
00065        }
00066        
00067        public void doAction (String o)
00068        {      Aborted=true;
00069               if (o.equals("OK"))
00070               {      Aborted=false;
00071                      Global.setParameter("grid.colorindex",ColorIB.getToggleState("color"));
00072                      Global.setParameter("grid.thickness",ThicknessIB.getToggleState("thickness"));
00073                      Global.setParameter("grid.labels",StyleIB.getState("showname"));
00074                      Global.setParameter("grid.bold",StyleIB.getState("bold"));
00075                      Global.setParameter("grid.large",StyleIB.getState("large"));
00076                      doclose();
00077               }
00078               else super.doAction(o);
00079        }
00080        
00081 }
00082 
00083