Back to index

wims  3.65+svn20090927
DigitsDialog.java
Go to the documentation of this file.
00001 /*
00002  * Created on 22.10.2005
00003  *
00004  */
00005 package rene.zirkel.dialogs;
00006 
00007 import java.awt.BorderLayout;
00008 import java.awt.Frame;
00009 import java.awt.GridLayout;
00010 import java.awt.Panel;
00011 
00012 import rene.gui.ButtonAction;
00013 import rene.gui.CloseDialog;
00014 import rene.gui.Global;
00015 import rene.gui.IntField;
00016 import rene.gui.MyLabel;
00017 import rene.gui.MyPanel;
00018 import rene.gui.Panel3D;
00019 import rene.zirkel.Zirkel;
00020 
00021 public class DigitsDialog extends CloseDialog
00022 {      IntField Edit,Lengths,Angles;
00023        
00024        public DigitsDialog (Frame f)
00025        {      super(f,Zirkel.name("digits.title"),true); 
00026               setLayout(new BorderLayout()); 
00027               
00028               Panel c=new MyPanel(); 
00029               c.setLayout(new GridLayout(0,2)); 
00030               
00031               c.add(new MyLabel(Zirkel.name("digits.edit"))); 
00032               c.add(Edit=new IntField(this,"Edit",
00033                      Global.getParameter("digits.edit",5),20)); 
00034               
00035               c.add(new MyLabel(Zirkel.name("digits.lengths"))); 
00036               c.add(Lengths=new IntField(this,"Lengths",
00037                      Global.getParameter("digits.lengths",5))); 
00038               
00039               c.add(new MyLabel(Zirkel.name("digits.angles"))); 
00040               c.add(Angles=new IntField(this,"Angles",
00041                      Global.getParameter("digits.angles",0))); 
00042               
00043               add("Center",new Panel3D(c)); 
00044               
00045               Panel s=new MyPanel(); 
00046               s.add(new ButtonAction(this,Zirkel.name("ok"),"OK")); 
00047               s.add(new ButtonAction(this,Zirkel.name("abort"),"Close")); 
00048               add("South",new Panel3D(s)); 
00049               
00050               pack(); 
00051               center(f); 
00052               setVisible(true); 
00053        }
00054        
00055        public void doAction (String o)
00056        {      if (o.equals("OK"))
00057               {      Global.setParameter("digits.edit",Edit.value(2,20)); 
00058                      Global.setParameter("digits.lengths",Lengths.value(0,10)); 
00059                      Global.setParameter("digits.angles",Angles.value(0,10)); 
00060                      doclose(); 
00061               }
00062               else super.doAction(o); 
00063        }
00064 }
00065