Back to index

wims  3.65+svn20090927
LatexSettingsDialog.java
Go to the documentation of this file.
00001 /*
00002  * Created on 30.3.2006
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 LatexSettingsDialog extends HelpCloseDialog
00021 {
00022        Checkbox BoundingBox,LatexInput,DoubleDollar,Dollar,NoDollar,FullPath; 
00023        
00024        public LatexSettingsDialog (Frame frame)
00025        {      super(frame,Zirkel.name("latexsettings.title"),true); 
00026               setLayout(new BorderLayout()); 
00027               
00028               Panel north=new MyPanel(); 
00029               north.setLayout(new GridLayout(0,1)); 
00030               
00031               BoundingBox=addcheck(north,"latexsettings.boundingbox"); 
00032               BoundingBox.setState(Global.getParameter("options.boundingbox",true)); 
00033               
00034               LatexInput=addcheck(north,"latexsettings.latexinput"); 
00035               LatexInput.setState(Global.getParameter("options.latexinput",true)); 
00036               
00037               DoubleDollar=addcheck(north,"latexsettings.doubledollar"); 
00038               DoubleDollar.setState(Global.getParameter("options.doubledollar",true)); 
00039               
00040               Dollar=addcheck(north,"latexsettings.dollar"); 
00041               Dollar.setState(Global.getParameter("options.dollar",true)); 
00042 
00043               NoDollar=addcheck(north,"latexsettings.nodollar"); 
00044               NoDollar.setState(Global.getParameter("options.nodollar",false)); 
00045               
00046               FullPath=addcheck(north,"latexsettings.fullpath"); 
00047               FullPath.setState(Global.getParameter("options.fullpath",true)); 
00048               
00049               add("North",new Panel3D(north)); 
00050               
00051               Panel south=new MyPanel(); 
00052               
00053               south.add(new ButtonAction(this,Zirkel.name("ok"),"OK")); 
00054               south.add(new ButtonAction(this,Zirkel.name("abort"),"Close")); 
00055               addHelp(south,"exportsettings");
00056               
00057               add("South",new Panel3D(south)); 
00058               
00059               pack(); 
00060               center(frame); 
00061               setVisible(true); 
00062        }
00063        
00064        public void doAction (String s)
00065        {      if (s.equals("OK"))
00066               {      Global.setParameter("options.boundingbox",BoundingBox.getState()); 
00067                      Global.setParameter("options.doubledollar",DoubleDollar.getState()); 
00068                      Global.setParameter("options.dollar",Dollar.getState()); 
00069                      Global.setParameter("options.nodollar",NoDollar.getState()); 
00070                      Global.setParameter("options.fullpath",FullPath.getState()); 
00071                      doclose(); 
00072               }
00073               else super.doAction(s); 
00074        }
00075        
00076        public Checkbox addcheck (Panel p, String name)
00077        {      Checkbox c=new CheckboxAction(this,Zirkel.name(name),name); 
00078               p.add(c); 
00079               return c; 
00080        }
00081 }
00082 
00083 
00084