Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Public Attributes | Package Attributes
rene.zirkel.dialogs.Replay Class Reference
Inheritance diagram for rene.zirkel.dialogs.Replay:
Inheritance graph
[legend]
Collaboration diagram for rene.zirkel.dialogs.Replay:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Replay (Frame f, ZirkelCanvas zc)
void iconPressed (String o)
void start ()
void doclose ()
 Closes the dialog.
void checkLast ()
void setLast ()
boolean haveBreaks ()
void windowActivated (WindowEvent e)
void windowClosed (WindowEvent e)
void windowClosing (WindowEvent e)
void windowDeactivated (WindowEvent e)
void windowDeiconified (WindowEvent e)
void windowIconified (WindowEvent e)
void windowOpened (WindowEvent e)
boolean close ()
boolean escape ()
 Calls close(), when the escape key is pressed.
void actionPerformed (ActionEvent e)
void doAction (String o)
void showHelp ()
void itemAction (String o, boolean flag)
void keyPressed (KeyEvent e)
void keyReleased (KeyEvent e)
void keyTyped (KeyEvent e)
void center (Frame f)
void center ()
void centerOut (Frame f)
void notePosition (String name)
 Note window position in Global.
void setPosition (String name)
 Set window position and size.
void focusGained (FocusEvent e)
 Override to set the focus somewhere.
void focusLost (FocusEvent e)
void noteSize (String name)
 Note window size in Global.
void setSize (String name)
 Set window size.
void setDispose (boolean flag)
 This inihibits dispose(), when the dialog is closed.
boolean isAborted ()
void addHelp (Panel p, String subject)
 To add a help button to children.

Static Public Member Functions

static void center (Frame f, Dialog dialog)

Public Attributes

boolean Aborted = false
String Subject = ""
ActionEvent E

Package Attributes

ZirkelCanvas ZC
int Last
Construction C
Vector V
IconBar IB
boolean HaveBreaks
ConstructionObject O = null
boolean Dispose = true
Frame F

Detailed Description

Definition at line 20 of file Replay.java.


Constructor & Destructor Documentation

rene.zirkel.dialogs.Replay.Replay ( Frame  f,
ZirkelCanvas  zc 
) [inline]

Definition at line 29 of file Replay.java.

       {      super(f,Global.name("replay.title"),true);
              ZC=zc;
              add(new ButtonAction(this,"Vor"));
              
              setLayout(new BorderLayout());
              
              IB=new IconBar(f);
              IB.addLeft("allback");
              IB.addLeft("fastback");
              IB.addLeft("oneback");
              IB.addLeft("oneforward");
              IB.addLeft("fastforward");
              IB.addLeft("allforward");
              IB.addSeparatorLeft();
              IB.addLeft("nextbreak");
              IB.addToggleLeft("setbreak");
              IB.addSeparatorLeft();
              IB.addLeft("close");
              IB.setIconBarListener(this);
              
              add("Center",new Panel3D(IB));
              
              C=zc.getConstruction();
              
              // Collect all visible Elements:
              V=new Vector();
              Enumeration e=C.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (!o.mustHide(ZC) || o.isBreakHide() || 
                                   (o instanceof TextObject && o.valid() && !o.isSuperHidden()))
                     {      V.addElement(o);
                     }
              }

              HaveBreaks=haveBreaks();

              Last=0;
              setLast();
              setEnabled(true);
              
              pack();
              Dimension d=f.getSize();
              Dimension ds=getSize();
              Point l=f.getLocation();
              setLocation(l.x+d.width-ds.width-5,l.y+d.height/5);
       }

Here is the call graph for this function:


Member Function Documentation

void rene.gui.CloseDialog.actionPerformed ( ActionEvent  e) [inline, inherited]
void rene.gui.CloseDialog.addHelp ( Panel  p,
String  subject 
) [inline, inherited]

To add a help button to children.

Parameters:
p
subject

Definition at line 231 of file CloseDialog.java.

       {      p.add(new MyLabel(""));
              p.add(new ButtonAction(this,Global.name("help"),"Help"));
              Subject=subject;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.center ( Frame  f) [inline, inherited]

Reimplemented in rene.dialogs.MyFileDialog.

Definition at line 104 of file CloseDialog.java.

       {      Dimension 
                     si=f.getSize(),
                     d=getSize(),
                     dscreen=getToolkit().getScreenSize();
              Point lo=f.getLocation();
              int x=lo.x+si.width/2-d.width/2;
              int y=lo.y+si.height/2-d.height/2;
              if (x+d.width>dscreen.width) x=dscreen.width-d.width-10;
              if (x<10) x=10;
              if (y+d.height>dscreen.height) y=dscreen.height-d.height-10;
              if (y<10) y=10;
              setLocation(x,y);
       }

Here is the caller graph for this function:

static void rene.gui.CloseDialog.center ( Frame  f,
Dialog  dialog 
) [inline, static, inherited]

Definition at line 118 of file CloseDialog.java.

       {      Dimension 
                     si=f.getSize(),
                     d=dialog.getSize(),
                     dscreen=f.getToolkit().getScreenSize();
              Point lo=f.getLocation();
              int x=lo.x+si.width/2-d.width/2;
              int y=lo.y+si.height/2-d.height/2;
              if (x+d.width>dscreen.width) x=dscreen.width-d.width-10;
              if (x<10) x=10;
              if (y+d.height>dscreen.height) y=dscreen.height-d.height-10;
              if (y<10) y=10;
              dialog.setLocation(x,y);
       }
void rene.gui.CloseDialog.center ( ) [inline, inherited]

Definition at line 144 of file CloseDialog.java.

       {      Dimension d=getSize(),dscreen=getToolkit().getScreenSize();
              setLocation((dscreen.width-d.width)/2,
                     (dscreen.height-d.height)/2);
       }

Here is the caller graph for this function:

void rene.gui.CloseDialog.centerOut ( Frame  f) [inline, inherited]

Definition at line 132 of file CloseDialog.java.

       {      Dimension si=f.getSize(),d=getSize(),
                     dscreen=getToolkit().getScreenSize();
              Point lo=f.getLocation();
              int x=lo.x+si.width-getSize().width+20;
              int y=lo.y+si.height/2+40;
              if (x+d.width>dscreen.width) x=dscreen.width-d.width-10;
              if (x<10) x=10;
              if (y+d.height>dscreen.height) y=dscreen.height-d.height-10;
              if (y<10) y=10;
              setLocation(x,y);
       }

Definition at line 165 of file Replay.java.

       {      if (O!=null) ((TextObject)O).setDoShow(false); 
              O=null;
              if (Last>V.size()-1) return;
              O=(ConstructionObject)V.elementAt(Last);
              if (O!=null && (O instanceof TextObject))
                     ((TextObject)O).setDoShow(true);
              else O=null;
       }

Here is the caller graph for this function:

boolean rene.gui.CloseDialog.close ( ) [inline, inherited]
Returns:
true if the dialog is closed.

Reimplemented in rene.dialogs.SearchFileDialog.

Definition at line 47 of file CloseDialog.java.

       {      return true;
       }

Here is the caller graph for this function:

void rene.gui.CloseDialog.doAction ( String  o) [inline, inherited]

Implements rene.gui.DoActionListener.

Reimplemented in rene.dialogs.InfoDialog, rene.dialogs.MyFileDialog, rene.zirkel.dialogs.ExportDialog, rene.zirkel.dialogs.ObjectsEditDialog, rene.dialogs.ItemEditor, rene.zirkel.dialogs.ExportScaler, rene.dialogs.SearchFileDialog, rene.zirkel.objects.PointEditDialog, rene.zirkel.dialogs.ObjectEditDialog, rene.zirkel.construction.ConstructionDisplay, rene.zirkel.dialogs.ExportTemplateDialog, rene.dialogs.FontEditor, rene.zirkel.SettingsDialog, rene.zirkel.objects.CurveEditDialog, rene.zirkel.dialogs.EditConditionals, rene.zirkel.macro.MacroSelectDialog, rene.zirkel.dialogs.CircleEditDialog, rene.zirkel.dialogs.EditIconBar, rene.dialogs.ColorEditor, rene.zirkel.objects.TextEditDialog, rene.zirkel.dialogs.DefineMacro, rene.zirkel.objects.ExpressionEditDialog, rene.zirkel.objects.LineEditDialog, rene.zirkel.dialogs.EditGridDialog, rene.zirkel.dialogs.LatexSettingsDialog, rene.zirkel.dialogs.SelectDialog, rene.zirkel.macro.MacroPrompt, rene.dialogs.GetParameter, rene.dialogs.Question, rene.zirkel.dialogs.DigitsDialog, rene.zirkel.dialogs.ExportSettingsDialog, rene.zirkel.dialogs.ReplaceMacroQuestion, rene.zirkel.dialogs.SizesDialog, rene.zirkel.objects.FixedAngleEditDialog, rene.zirkel.objects.TextObjectDialog, rene.zirkel.dialogs.EditRunDialog, rene.zirkel.objects.AngleEditDialog, rene.zirkel.dialogs.AgainQuestion, rene.zirkel.dialogs.RenameMacroDialog, and rene.zirkel.dialogs.CommentDialog.

Definition at line 65 of file CloseDialog.java.

       {   if ("Close".equals(o) && close())
              {      Aborted=true;
                     doclose();
              }
              else if (o.equals("Help"))
              {      showHelp();
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Closes the dialog.

This may be used in subclasses to do some action. Then call super.doclose()

Reimplemented from rene.gui.CloseDialog.

Definition at line 151 of file Replay.java.

       {      ZC.paintUntil(null);
              ZC.showStatus();
              Enumeration e=V.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o instanceof TextObject) ((TextObject)o).setDoShow(false);
              }
              ZC.repaint();
              super.doclose();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean rene.gui.CloseDialog.escape ( ) [inline, inherited]

Calls close(), when the escape key is pressed.

Returns:
true if the dialog may close.

Reimplemented in rene.zirkel.dialogs.CommentDialog.

Definition at line 55 of file CloseDialog.java.

       {      return close();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.focusGained ( FocusEvent  e) [inline, inherited]
void rene.gui.CloseDialog.focusLost ( FocusEvent  e) [inline, inherited]

Definition at line 191 of file CloseDialog.java.

{}

Definition at line 200 of file Replay.java.

       {      Enumeration e=V.elements();
              while (e.hasMoreElements())
              {      if (((ConstructionObject)e.nextElement()).isBreak())
                            return true;
              }
              return false;
       }

Here is the caller graph for this function:

void rene.zirkel.dialogs.Replay.iconPressed ( String  o) [inline]

Implements rene.gui.IconBarListener.

Definition at line 78 of file Replay.java.

       {      if (o.equals("close"))
              {      doclose();
              }
              else if (o.equals("allback"))
              {      Last=0; setLast();
              }
              else if (o.equals("allforward"))
              {      Last=V.size(); setLast();
              }
              else if (o.equals("fastback"))
              {      Last-=10; if (Last<0) Last=0;
                     setLast();
              }
              else if (o.equals("fastforward"))
              {      Last+=10; if (Last>V.size()) Last=V.size();
                     setLast();
              }
              else if (o.equals("oneforward"))
              {      Last++; if (Last>V.size()) Last=V.size();
                     setLast();
              }
              else if (o.equals("nextbreak"))
              {      while (true)
                     {      Last++;
                            if (Last>V.size()) { Last=V.size(); break; }
                            if (Last>=V.size() || 
                                   (Last>0 && ((ConstructionObject)V.elementAt(Last)).isBreak())) 
                                          break;
                     }
                     setLast();
              }
              else if (o.equals("setbreak"))
              {      if (Last>0)
                     {      ConstructionObject ob=(ConstructionObject)V.elementAt(Last);
                            ob.setBreak(!ob.isBreak());
                            IB.setState("setbreak",ob.isBreak());
                            if (ob.isBreak() && IB.isShiftPressed())
                                   ob.setHideBreak(true);
                     }
                     HaveBreaks=haveBreaks();
                     IB.setEnabled("nextbreak",HaveBreaks);
              }
              else if (o.equals("oneback"))
              {      Last--; if (Last<0) Last=0;
                     setLast();
              }
              start();
       }

Here is the call graph for this function:

boolean rene.gui.CloseDialog.isAborted ( ) [inline, inherited]
void rene.gui.CloseDialog.itemAction ( String  o,
boolean  flag 
) [inline, inherited]
void rene.gui.CloseDialog.keyPressed ( KeyEvent  e) [inline, inherited]

Definition at line 82 of file CloseDialog.java.

       {      if (e.getKeyCode()==KeyEvent.VK_ESCAPE && escape()) doclose();
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.keyReleased ( KeyEvent  e) [inline, inherited]

Definition at line 85 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.keyTyped ( KeyEvent  e) [inline, inherited]

Definition at line 86 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.notePosition ( String  name) [inline, inherited]

Note window position in Global.

Definition at line 153 of file CloseDialog.java.

       {      Point l=getLocation();
              Dimension d=getSize();
              Global.setParameter(name+".x",l.x);
              Global.setParameter(name+".y",l.y);
              Global.setParameter(name+".w",d.width);
              if (d.height-Global.getParameter(name+".h",0)!=19)
                     // works around a bug in Windows
                     Global.setParameter(name+".h",d.height);
              boolean maximized=false;
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.noteSize ( String  name) [inline, inherited]

Note window size in Global.

Definition at line 196 of file CloseDialog.java.

       {      Dimension d=getSize();
              Global.setParameter(name+".w",d.width);
              Global.setParameter(name+".h",d.height);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.setDispose ( boolean  flag) [inline, inherited]

This inihibits dispose(), when the dialog is closed.

Definition at line 218 of file CloseDialog.java.

       {      Dispose=flag;
       }

Definition at line 175 of file Replay.java.

       {      if (Last<V.size())
              {      ConstructionObject o=(ConstructionObject)V.elementAt(Last);
                     checkLast();
                     ZC.paintUntil(o);
              }
              else
              {      Last=V.size();
                     checkLast();
                     ZC.paintUntil(null);
              }
              if (Last>=0 && Last<V.size())
              {      ConstructionObject o=(ConstructionObject)V.elementAt(Last);
                     ZC.showStatus(o.getName()+" : "+o.getText());
                     IB.setState("setbreak",o.isBreak());
              }
              else
              {      IB.setState("setbreak",false);
              }
              if (Last>=V.size() || Last==0) IB.setEnabled("setbreak",false);
              else IB.setEnabled("setbreak",true);
              if (Last>=V.size() || !HaveBreaks) IB.setEnabled("nextbreak",false);
              else IB.setEnabled("nextbreak",true);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.setPosition ( String  name) [inline, inherited]

Set window position and size.

Definition at line 168 of file CloseDialog.java.

       {      Point l=getLocation();
              Dimension d=getSize();
              Dimension dscreen=getToolkit().getScreenSize();
              int x=Global.getParameter(name+".x",l.x);
              int y=Global.getParameter(name+".y",l.y);
              int w=Global.getParameter(name+".w",d.width);
              int h=Global.getParameter(name+".h",d.height);
              if (w>dscreen.width) w=dscreen.width;
              if (h>dscreen.height) h=dscreen.height;
              if (x<0) x=0;
              if (x+w>dscreen.width) x=dscreen.width-w;
              if (y<0) y=0;
              if (y+h>dscreen.height) y=dscreen.height-h;
              setLocation(x,y);
              setSize(w,h);
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.setSize ( String  name) [inline, inherited]

Set window size.

Definition at line 205 of file CloseDialog.java.

       {      if (!Global.haveParameter(name+".w")) pack();
              else
              {      Dimension d=getSize();
                     int w=Global.getParameter(name+".w",d.width);
                     int h=Global.getParameter(name+".h",d.height);
                     setSize(w,h);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.showHelp ( ) [inline, inherited]

Reimplemented in rene.zirkel.dialogs.HelpCloseDialog.

Definition at line 75 of file CloseDialog.java.

       {      InfoDialog.Subject=Subject;
              InfoDialog id=new InfoDialog(F);
       }

Here is the caller graph for this function:

Definition at line 128 of file Replay.java.

       {      if (Last==0)
              {      IB.setEnabled("allback",false);
                     IB.setEnabled("fastback",false);
                     IB.setEnabled("oneback",false);
              }
              else
              {      IB.setEnabled("allback",true);
                     IB.setEnabled("fastback",true);
                     IB.setEnabled("oneback",true);
              }
              if (Last<V.size())
              {      IB.setEnabled("allforward",true);
                     IB.setEnabled("fastforward",true);
                     IB.setEnabled("oneforward",true);
              }
              else
              {      IB.setEnabled("allforward",false);
                     IB.setEnabled("fastforward",false);
                     IB.setEnabled("oneforward",false);
              }
       }      

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.windowActivated ( WindowEvent  e) [inline, inherited]

Definition at line 34 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowClosed ( WindowEvent  e) [inline, inherited]

Definition at line 35 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowClosing ( WindowEvent  e) [inline, inherited]

Definition at line 36 of file CloseDialog.java.

       {   if (close()) doclose();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.windowDeactivated ( WindowEvent  e) [inline, inherited]

Definition at line 39 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowDeiconified ( WindowEvent  e) [inline, inherited]

Definition at line 40 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowIconified ( WindowEvent  e) [inline, inherited]

Definition at line 41 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowOpened ( WindowEvent  e) [inline, inherited]

Reimplemented in rene.zirkel.dialogs.DefineMacro.

Definition at line 42 of file CloseDialog.java.

{}

Member Data Documentation

Definition at line 24 of file Replay.java.

boolean rene.gui.CloseDialog.Dispose = true [package, inherited]

Definition at line 19 of file CloseDialog.java.

ActionEvent rene.gui.CloseDialog.E [inherited]

Reimplemented in rene.dialogs.FontEditor.

Definition at line 59 of file CloseDialog.java.

Frame rene.gui.CloseDialog.F [package, inherited]

Definition at line 27 of file Replay.java.

Definition at line 26 of file Replay.java.

Definition at line 23 of file Replay.java.

ConstructionObject rene.zirkel.dialogs.Replay.O = null [package]

Definition at line 163 of file Replay.java.

String rene.gui.CloseDialog.Subject = "" [inherited]

Reimplemented in rene.dialogs.InfoDialog.

Definition at line 22 of file CloseDialog.java.

Vector rene.zirkel.dialogs.Replay.V [package]

Definition at line 25 of file Replay.java.

Definition at line 22 of file Replay.java.


The documentation for this class was generated from the following file: