Back to index

wims  3.65+svn20090927
SettingsDialog.java
Go to the documentation of this file.
00001 /*
00002  * Created on 22.10.2005
00003  *
00004  */
00005 package rene.zirkel;
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.dialogs.HelpCloseDialog;
00019 
00020 class SettingsDialog extends HelpCloseDialog
00021 {      Frame F;
00022        
00023        Checkbox MoveName,MoveFixName,QSure,QPointOn,QIntersection,
00024               QChoice,Indicate,Simple,IconBarTop,IconBarTips,UTF,FD,
00025               SmartBoard,Backups,DoubleClick,SimpleGraphics,SquarePoints,
00026               SmallIcons,OldIcons,More,GermanPoints; 
00027        
00028        public SettingsDialog (Frame frame)
00029        {      super(frame,Zirkel.name("menu.options.other"),true); 
00030               F=frame;
00031               setLayout(new BorderLayout()); 
00032               
00033               Panel north=new MyPanel(); 
00034               north.setLayout(new GridLayout(0,1)); 
00035               
00036               MoveName=addcheck(north,"menu.settings.movename"); 
00037               MoveName.setState(Global.getParameter("options.movename",false)); 
00038               
00039               MoveFixName=addcheck(north,"menu.settings.movefixname"); 
00040               MoveFixName.setState(Global.getParameter("options.movefixname",true)); 
00041               
00042               QSure=addcheck(north,"menu.settings.sure"); 
00043               QSure.setState(Global.getParameter("options.sure",true)); 
00044               
00045               QPointOn=addcheck(north,"menu.settings.pointon"); 
00046               QPointOn.setState(Global.getParameter("options.pointon",false)); 
00047               
00048               QIntersection=addcheck(north,"menu.settings.intersection"); 
00049               QIntersection.setState(Global.getParameter("options.intersection",false)); 
00050               
00051               QChoice=addcheck(north,"menu.settings.choice"); 
00052               QChoice.setState(Global.getParameter("options.choice",true)); 
00053               
00054               Indicate=addcheck(north,"menu.settings.indicate"); 
00055               Indicate.setState(Global.getParameter("options.indicate",true)); 
00056               
00057               Simple=addcheck(north,"menu.settings.indicate.simple"); 
00058               Simple.setState(Global.getParameter("options.indicate.simple",false)); 
00059               
00060               IconBarTop=addcheck(north,"menu.settings.iconbartop"); 
00061               IconBarTop.setState(Global.getParameter("options.iconbartop",true)); 
00062               
00063               IconBarTips=addcheck(north,"menu.settings.showtips"); 
00064               IconBarTips.setState(Global.getParameter("iconbar.showtips",true)); 
00065               
00066               FD=addcheck(north,"menu.settings.filedialog"); 
00067               FD.setState(Global.getParameter("options.filedialog",true)); 
00068               
00069               UTF=addcheck(north,"menu.settings.utf"); 
00070               UTF.setState(Global.getParameter("options.utf",true)); 
00071               
00072               SmartBoard=addcheck(north,"menu.settings.smartboard"); 
00073               SmartBoard.setState(Global.getParameter("smartboard",false)); 
00074               
00075               Backups=addcheck(north,"menu.settings.backups"); 
00076               Backups.setState(Global.getParameter("options.backups",true)); 
00077               
00078               DoubleClick=addcheck(north,"menu.settings.doubleclick"); 
00079               DoubleClick.setState(Global.getParameter("options.doubleclick",false)); 
00080               
00081               SimpleGraphics=addcheck(north,"menu.settings.simplegraphics"); 
00082               SimpleGraphics.setState(Global.getParameter("simplegraphics",false)); 
00083               
00084               /*
00085               SquarePoints=addcheck(north,"menu.settings.squarepoints"); 
00086               SquarePoints.setState(Global.getParameter("options.squarepoints",false)); 
00087               */
00088               
00089               SmallIcons=addcheck(north,"menu.settings.smallicons"); 
00090               SmallIcons.setState(Global.getParameter("options.smallicons",false)); 
00091               
00092               OldIcons=addcheck(north,"menu.settings.oldicons"); 
00093               OldIcons.setState(Global.getParameter("options.oldicons",false)); 
00094               
00095               More=addcheck(north,"menu.settings.more"); 
00096               More.setState(Global.getParameter("options.more",false)); 
00097               
00098               GermanPoints=addcheck(north,"menu.settings.germanpoints"); 
00099               GermanPoints.setState(Global.getParameter("options.germanpoints",false)); 
00100               
00101               add("North",new Panel3D(north)); 
00102               
00103               Panel south=new MyPanel(); 
00104               
00105               south.add(new ButtonAction(this,Zirkel.name("ok"),"OK")); 
00106               south.add(new ButtonAction(this,Zirkel.name("abort"),"Close"));
00107               addHelp(south,"settings"); 
00108               
00109               add("South",new Panel3D(south)); 
00110               
00111               pack(); 
00112               center(frame); 
00113               setVisible(true); 
00114        }
00115        
00116        public void doAction (String s)
00117        {      if (s.equals("OK"))
00118               {      Global.setParameter("options.movename",MoveName.getState()); 
00119                      Global.setParameter("options.movefixname",MoveFixName.getState()); 
00120                      Global.setParameter("options.pointon",QPointOn.getState()); 
00121                      Global.setParameter("options.sure",QSure.getState()); 
00122                      Global.setParameter("options.intersection",QIntersection.getState()); 
00123                      Global.setParameter("options.choice",QChoice.getState()); 
00124                      Global.setParameter("options.indicate",Indicate.getState()); 
00125                      Global.setParameter("options.indicate.simple",Simple.getState()); 
00126                      Global.setParameter("options.iconbartop",IconBarTop.getState()); 
00127                      Global.setParameter("iconbar.showtips",IconBarTips.getState()); 
00128                      Global.setParameter("options.filedialog",FD.getState()); 
00129                      Global.setParameter("options.utf",UTF.getState()); 
00130                      Global.setParameter("smartboard",SmartBoard.getState()); 
00131                      Global.setParameter("options.backups",Backups.getState()); 
00132                      Global.setParameter("options.doubleclick",DoubleClick.getState()); 
00133                      if (SimpleGraphics!=null)
00134                             Global.setParameter("simplegraphics",SimpleGraphics.getState()); 
00135                      // Global.setParameter("options.squarepoints",SquarePoints.getState()); 
00136                      Global.setParameter("options.smallicons",SmallIcons.getState()); 
00137                      Global.setParameter("options.oldicons",OldIcons.getState()); 
00138                      Global.setParameter("options.more",More.getState()); 
00139                      Global.setParameter("options.germanpoints",GermanPoints.getState()); 
00140                      doclose(); 
00141               }
00142               else super.doAction(s); 
00143        }
00144        
00145        public Checkbox addcheck (Panel p, String name)
00146        {      Checkbox c=new CheckboxAction(this,Zirkel.name(name),name); 
00147               p.add(c); 
00148               return c; 
00149        }
00150 }
00151 
00152