Back to index

wims  3.65+svn20090927
AgainQuestion.java
Go to the documentation of this file.
00001 package rene.zirkel.dialogs;
00002 
00003 // file: ZirkelFrame.java
00004 
00005 import java.awt.*;
00006 import java.awt.event.*;
00007 
00008 import rene.gui.*;
00009 
00010 public class AgainQuestion extends CloseDialog 
00011     implements ActionListener
00012 {      public int Result;
00013        Frame F;
00014        public static int NO=0,YES=1;
00015        Checkbox Again;
00016        public AgainQuestion (Frame f, String c, String title)
00017        {      super(f,title,true);
00018               F=f;
00019               Panel main=new MyPanel();
00020               main.setLayout(new GridLayout(0,1));
00021               Panel pc=new MyPanel();
00022               FlowLayout fl=new FlowLayout();
00023               pc.setLayout(fl);
00024               fl.setAlignment(FlowLayout.CENTER);
00025               pc.add(new MyLabel(" "+c+" "));
00026               main.add(pc);
00027               Panel pd=new MyPanel();
00028               pd.add(Again=new CheckboxAction(this,Global.name("question.again")));
00029               Again.setState(true);
00030               main.add(pd);
00031               add("Center",main);
00032               Panel p=new MyPanel();
00033               p.setLayout(new FlowLayout(FlowLayout.RIGHT));
00034               p.add(new ButtonAction(this,Global.name("yes"),"Yes"));
00035               p.add(new ButtonAction(this,Global.name("no"),"No"));
00036               add("South",p);
00037               pack();
00038        }
00039        public void doAction (String o)
00040        {      if (o.equals("Yes"))
00041               {      tell(YES);
00042               }
00043               else if (o.equals("No"))
00044               {      tell(NO);
00045               }
00046        }
00050        public void tell (int f)
00051        {      Result=f;
00052               doclose();
00053        }
00057        public boolean yes ()
00058        {      return Result==YES;
00059        }
00060        public int getResult ()
00061        {      return Result;
00062        }
00063        public boolean again ()
00064        {      return Again.getState();
00065        }
00066 }
00067