Back to index

wims  3.65+svn20090927
ExportSettingsDialog.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.Checkbox;
00009 import java.awt.Frame;
00010 import java.awt.GridLayout;
00011 import java.awt.Panel;
00012 
00013 import rene.gui.ButtonAction;
00014 import rene.gui.CheckboxAction;
00015 import rene.gui.Global;
00016 import rene.gui.MyPanel;
00017 import rene.gui.Panel3D;
00018 import rene.zirkel.Zirkel;
00019 
00020 public class ExportSettingsDialog extends HelpCloseDialog
00021 {
00022        Checkbox BitmapBackground,MinPointSize,MinFontSize; 
00023        
00024        public ExportSettingsDialog (Frame frame)
00025        {      super(frame,Zirkel.name("menu.options.export"),true); 
00026               setLayout(new BorderLayout()); 
00027               
00028               Panel north=new MyPanel(); 
00029               north.setLayout(new GridLayout(0,1)); 
00030               
00031               MinPointSize=addcheck(north,"menu.settings.minpointsize"); 
00032               MinPointSize.setState(Global.getParameter("options.minpointsize",false)); 
00033               
00034               MinFontSize=addcheck(north,"menu.settings.minfontsize"); 
00035               MinFontSize.setState(Global.getParameter("options.minfontsize",false)); 
00036               
00037               BitmapBackground=addcheck(north,"menu.settings.bitmapbackground"); 
00038               BitmapBackground.setState(Global.getParameter("options.bitmapbackground",false)); 
00039               
00040               add("North",new Panel3D(north)); 
00041               
00042               Panel south=new MyPanel(); 
00043               
00044               south.add(new ButtonAction(this,Zirkel.name("ok"),"OK")); 
00045               south.add(new ButtonAction(this,Zirkel.name("abort"),"Close")); 
00046               addHelp(south,"exportsettings");
00047               
00048               add("South",new Panel3D(south)); 
00049               
00050               pack(); 
00051               center(frame); 
00052               setVisible(true); 
00053        }
00054        
00055        public void doAction (String s)
00056        {      if (s.equals("OK"))
00057               {      Global.setParameter("options.minpointsize",MinPointSize.getState()); 
00058                      Global.setParameter("options.minfontsize",MinFontSize.getState()); 
00059                      Global.setParameter("options.bitmapbackground",BitmapBackground.getState()); 
00060                      doclose(); 
00061               }
00062               else super.doAction(s); 
00063        }
00064        
00065        public Checkbox addcheck (Panel p, String name)
00066        {      Checkbox c=new CheckboxAction(this,Zirkel.name(name),name); 
00067               p.add(c); 
00068               return c; 
00069        }
00070 }
00071 
00072