Back to index

wims  3.65+svn20090927
Public Member Functions | Static Public Member Functions | Public Attributes | Package Functions | Package Attributes
rene.dialogs.MyFileDialog Class Reference

This is a file dialog. More...

Inheritance diagram for rene.dialogs.MyFileDialog:
Inheritance graph
[legend]
Collaboration diagram for rene.dialogs.MyFileDialog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MyFileDialog (Frame f, String title, String action, boolean saving, boolean help)
 MyFileDialog (Frame f, String title, String action, boolean saving)
 MyFileDialog (Frame f, String title, boolean saving)
void mousePressed (MouseEvent e)
void mouseReleased (MouseEvent e)
void mouseClicked (MouseEvent e)
void mouseEntered (MouseEvent e)
void mouseExited (MouseEvent e)
void doAction (String o)
void actionPerformed (ActionEvent e)
void setFile (String s)
void dirup ()
void dirdown (String subdir)
boolean updateDir ()
 Update the directory list.
void addUndo (String dir)
 Note the directory in a history list.
String getUndo ()
 Get the undo directory and remove it.
void updateFiles ()
 Update the file list.
void setDirectory (String dir)
void setPattern (String pattern)
void setFilePath (String file)
boolean isAborted ()
 Check, if the dialog was aborted.
String getFilePath ()
void update (boolean recent)
 This should be called at the start.
void update ()
void setVisible (boolean flag)
void center (Frame f)
void focusGained (FocusEvent e)
 Override to set the focus somewhere.
boolean accept (File dir, String file)
 Can be overwritten by instances to accept only some files.
void loadHistories (boolean recent)
void loadHistories ()
void loadHistories (String dir, String pattern, String file)
 Loads the histories from the configuration file.
void setAppend (String dir, String pattern, String file)
 Histories are used for the directories, the files and the patterns.
void itemStateChanged (ItemEvent e)
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 showHelp ()
void itemAction (String o, boolean flag)
void keyPressed (KeyEvent e)
void keyReleased (KeyEvent e)
void keyTyped (KeyEvent e)
void doclose ()
 Closes the dialog.
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 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.
void addHelp (Panel p, String subject)
 To add a help button to children.

Static Public Member Functions

static void main (String args[])
static void center (Frame f, Dialog dialog)

Public Attributes

String Subject = ""
ActionEvent E

Package Functions

Panel linePanel (Component x, Component y)
void leave ()
 Leave the dialog and remember settings.

Package Attributes

Lister Dirs
Lister Files
HistoryTextField DirField
HistoryTextField FileField
HistoryTextField PatternField
HistoryTextFieldChoice DirHistory
HistoryTextFieldChoice FileHistory
TextField Chosen
String CurrentDir = "."
boolean Aborted = true
String DirAppend = ""
String PatternAppend = ""
String FileAppend = ""
Button Home
Frame F
FileDialog FD
boolean HomeShiftControl = false
MyVector Undo = new MyVector()
boolean Dispose = true

Detailed Description

This is a file dialog.

It is easy to handle, remembers its position and size, and performs pattern matching. The calls needs the rene.viewer.* class, unless you replace Lister with List everywhere. Moreover it needs the rene.gui.Global class to store field histories and determine the background color. Finally, it uses the FileList class to get the list of files.

The dialog does never check for files to exists. This must be done by the application.

There is a static main method, which demonstrates everything.

Definition at line 68 of file MyFileDialog.java.


Constructor & Destructor Documentation

rene.dialogs.MyFileDialog.MyFileDialog ( Frame  f,
String  title,
String  action,
boolean  saving,
boolean  help 
) [inline]
Parameters:
titleThe dialog title.
actionThe button string for the main action (e.g. Load)
savingTrue, if this is a saving dialog.

Definition at line 86 of file MyFileDialog.java.

       {      super(f,title,true);
              F=f;
              setLayout(new BorderLayout());
              
              // title prompt
              add("North",new Panel3D(Chosen=new TextFieldAction(this,"")));
              Chosen.setEditable(false);
              
              // center panels
              Panel center=new MyPanel();
              center.setLayout(new GridLayout(1,2,5,0));
              Dirs=new Lister();
              if (Global.NormalFont!=null) Dirs.setFont(Global.NormalFont);
              Dirs.addActionListener(this);
              Dirs.setMode(false,false,false,false);
              center.add(Dirs);
              Files=new Lister();
              if (Global.NormalFont!=null) Files.setFont(Global.NormalFont);
              Files.addActionListener(this);
              Files.setMode(false,false,true,false);
              center.add(Files);
              add("Center",new Panel3D(center));        
              
              // south panel
              Panel south=new MyPanel();
              south.setLayout(new BorderLayout());
              
              Panel px=new MyPanel();
              px.setLayout(new BorderLayout());
              
              Panel p0=new MyPanel();
              p0.setLayout(new GridLayout(0,1));
              
              Panel p1=new MyPanel();
              p1.setLayout(new BorderLayout());
              p1.add("North",linePanel(
                            new MyLabel(Global.name("myfiledialog.dir")),
                            DirField=
                                   new HistoryTextField(this,"Dir",32)
                                          {      public boolean filterHistory (String name)
                                                 // avoid a Windows bug with C: instead of c:
                                                 {      if (name.length()<2) return true;
                                                        if (name.charAt(1)==':' && 
                                                               Character.isUpperCase(name.charAt(0)))
                                                                      return false;
                                                        return true;
                                                 }
                                          }
                            ));
              DirField.setText(".");
              p1.add("South",linePanel(
                            new MyLabel(Global.name("myfiledialog.olddirs","")),
                            DirHistory=new HistoryTextFieldChoice(DirField)
                            ));
              p0.add(new Panel3D(p1));
              
              Panel p2=new MyPanel();
              p2.setLayout(new BorderLayout());
              p2.add("North",linePanel(
                            new MyLabel(Global.name("myfiledialog.file")),
                            FileField=new HistoryTextField(this,"File")
                            ));
              p2.add("South",linePanel(
                            new MyLabel(Global.name("myfiledialog.oldfiles","")),
                            FileHistory=new HistoryTextFieldChoice(FileField)
                            ));
              p0.add(new Panel3D(p2));
              
              px.add("Center",p0);
              
              px.add("South",new Panel3D(linePanel(
                            new MyLabel(Global.name("myfiledialog.pattern")),
                            PatternField=new HistoryTextField(this,"Pattern")
                            )));
              PatternField.setText("*");
              
              south.add("Center",px);
              
              Panel buttons=new MyPanel();
              buttons.setLayout(new FlowLayout(FlowLayout.RIGHT));
              buttons.add(Home=new ButtonAction(this,Global.name("myfiledialog.home","Home"),"Home"));
              buttons.add(new ButtonAction(this,Global.name("myfiledialog.mkdir","Create Directory"),"Create"));
              buttons.add(new ButtonAction(this,Global.name("myfiledialog.back","Back"),"Back"));
              buttons.add(new MyLabel(""));
              buttons.add(new ButtonAction(this,action,"Action"));
              buttons.add(new ButtonAction(this,Global.name("abort"),"Close"));
              if (help)
              {      addHelp(buttons,"filedialog");
              }
              
              south.add("South",buttons);
              
              add("South",new Panel3D(south));
              
              // set sizes
              pack();
              setSize("myfiledialog");
              addKeyListener(this);
              DirField.addKeyListener(this);
              DirField.setTrigger(true);
              FileHistory.setDoActionListener(new DirFieldListener(this));
              PatternField.addKeyListener(this);
              PatternField.setTrigger(true);
              FileField.addKeyListener(this);
              FileField.setTrigger(true);
              Home.addMouseListener(this);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

rene.dialogs.MyFileDialog.MyFileDialog ( Frame  f,
String  title,
String  action,
boolean  saving 
) [inline]

Definition at line 203 of file MyFileDialog.java.

       {      this(f,title,action,saving,false);
       }
rene.dialogs.MyFileDialog.MyFileDialog ( Frame  f,
String  title,
boolean  saving 
) [inline]

Definition at line 210 of file MyFileDialog.java.

       {      super(f,"",true);
              FD=new FileDialog(f,title,
                     saving?FileDialog.SAVE:FileDialog.LOAD);
       }

Member Function Documentation

boolean rene.dialogs.MyFileDialog.accept ( File  dir,
String  file 
) [inline]

Can be overwritten by instances to accept only some files.

Definition at line 513 of file MyFileDialog.java.

       {      return true;
       }
void rene.dialogs.MyFileDialog.actionPerformed ( ActionEvent  e) [inline]

Reimplemented from rene.gui.CloseDialog.

Definition at line 286 of file MyFileDialog.java.

       {      if (e.getSource()==Dirs)
              {      String s=Dirs.getSelectedItem();
                     if (s==null) return;
                     if (s.equals("..")) dirup();
                     else dirdown(s);
              }
              if (e.getSource()==Files)
              {      if (e instanceof ListerMouseEvent)
                     {      ListerMouseEvent em=(ListerMouseEvent)e;
                            if (em.clickCount()>=2) leave();
                            else
                            {      String s=Files.getSelectedItem();
                                   if (s!=null) FileField.setText(s);
                            }
                     }
              }
              else super.actionPerformed(e);
       }

Here is the call graph for this function:

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.dialogs.MyFileDialog.addUndo ( String  dir) [inline]

Note the directory in a history list.

Definition at line 368 of file MyFileDialog.java.

       {      if (Undo.size()>0 && 
                     ((String)Undo.elementAt(Undo.size()-1)).equals(dir)) return;
              Undo.addElement(dir);
       }

Here is the call graph for this function:

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.dialogs.MyFileDialog.center ( Frame  f) [inline]

Reimplemented from rene.gui.CloseDialog.

Definition at line 486 of file MyFileDialog.java.

       {      if (FD!=null) CloseDialog.center(f,FD);
              else super.center(f);
       }

Here is the call graph for this function:

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);
       }
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.dialogs.MyFileDialog.dirdown ( String  subdir) [inline]

Definition at line 320 of file MyFileDialog.java.

       {      DirField.setText(CurrentDir+File.separatorChar+subdir);
              if (updateDir()) updateFiles();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 313 of file MyFileDialog.java.

       {      DirField.setText(FileName.path(CurrentDir));
              if (DirField.getText().equals(""))
                     DirField.setText(""+File.separatorChar);
              if (updateDir()) updateFiles();           
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.dialogs.MyFileDialog.doAction ( String  o) [inline]

Reimplemented from rene.gui.CloseDialog.

Definition at line 227 of file MyFileDialog.java.

       {      if (o.equals("Dir") || o.equals("Pattern"))
              {      if (updateDir()) updateFiles();
                     PatternField.remember(PatternField.getText());
              }
              else if (o.equals("File") || o.equals("Action"))
              {      if (FileField.getText().equals("")) return;
                     leave();
              }
              else if (o.equals("Home"))
              {      if (HomeShiftControl)
                     {      String s=Global.getParameter("myfiledialog.homdir","");
                            if (s.equals(""))
                                   Global.setParameter("myfiledialog.homdir",DirField.getText());
                            else
                                   Global.setParameter("myfiledialog.homdir","");                        
                     }
                     try
                     {      String s=Global.getParameter("myfiledialog.homdir","");
                            if (s.equals(""))
                            {      String s1=System.getProperty("user.home");
                                   String s2=Global.name("myfiledialog.windowshome","");
                                   String s3=Global.name("myfiledialog.homedir","");
                                   String sep=System.getProperty("file.separator");
                                   if (new File(s1+sep+s2+sep+s3).exists())
                                          DirField.setText(s1+sep+s2+sep+s3);
                                   else if (new File(s1+sep+s2).exists())
                                          DirField.setText(s1+sep+s2);
                                   else
                                          DirField.setText(s1);
                            }
                            else DirField.setText(s);
                            updateDir();
                            updateFiles();
                     }
                     catch (Exception e) {}
              }
              else if (o.equals("Create"))
              {      try
                     {      File f=new File(DirField.getText());
                            if (!f.exists())
                            {      f.mkdir();
                            }
                            updateDir();
                            updateFiles();
                     }
                     catch (Exception e){}
              }
              else if (o.equals("Back"))
              {      String dir=getUndo();
                     if (!dir.equals(""))
                     {      DirField.setText(dir);
                            updateDir();
                            updateFiles();
                     }
              }
              else super.doAction(o);
       }

Here is the call graph for this function:

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

Closes the dialog.

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

Reimplemented in rene.dialogs.InfoDialog, rene.dialogs.SearchFileDialog, and rene.zirkel.dialogs.Replay.

Definition at line 92 of file CloseDialog.java.

       {      setVisible(false);
              // Because of a bug in Linux Java 1.4.2 etc.
              // dispose in a separate thread.
              Thread t=new Thread ()
              {      public void run ()
                     {      if (Dispose) dispose();
                     }
              };
              t.start();
       }

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.dialogs.MyFileDialog.focusGained ( FocusEvent  e) [inline]

Override to set the focus somewhere.

Reimplemented from rene.gui.CloseDialog.

Definition at line 506 of file MyFileDialog.java.

       {      FileField.requestFocus();
       }
void rene.gui.CloseDialog.focusLost ( FocusEvent  e) [inline, inherited]

Definition at line 191 of file CloseDialog.java.

{}
Returns:
The file plus its path.

Definition at line 457 of file MyFileDialog.java.

       {      if (FD!=null) 
              {      if (FD.getFile()!=null) return FD.getDirectory()+FD.getFile();
                     else return "";
              }
              String file=FileField.getText();
              if (!FileName.path(file).equals("")) return file;
              else return CurrentDir+File.separatorChar+FileField.getText();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

String rene.dialogs.MyFileDialog.getUndo ( ) [inline]

Get the undo directory and remove it.

Definition at line 377 of file MyFileDialog.java.

       {      if (Undo.size()<2) return "";
              String s=(String)Undo.elementAt(Undo.size()-2);
              Undo.truncate(Undo.size()-1);
              return s;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Check, if the dialog was aborted.

Reimplemented from rene.gui.CloseDialog.

Definition at line 449 of file MyFileDialog.java.

       {      if (FD!=null) return FD.getFile()==null || FD.getFile().equals("");
              else return Aborted;
       }

Here is the caller graph for this function:

void rene.gui.CloseDialog.itemAction ( String  o,
boolean  flag 
) [inline, inherited]
void rene.dialogs.MyFileDialog.itemStateChanged ( ItemEvent  e) [inline]

Definition at line 565 of file MyFileDialog.java.

                                                 {
       }
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.dialogs.MyFileDialog.leave ( ) [inline, package]

Leave the dialog and remember settings.

Definition at line 328 of file MyFileDialog.java.

       {      if (FD!=null) return;
              if (!FileField.getText().equals("")) Aborted=false;
              if (!Aborted)
              {      noteSize("myfiledialog");
                     DirField.remember(DirField.getText());
                     DirField.saveHistory("myfiledialog.dir.history"+DirAppend);
                     PatternField.saveHistory("myfiledialog.pattern.history"+PatternAppend);
                     FileField.remember(getFilePath());
                     FileField.saveHistory("myfiledialog.file.history"+FileAppend);
              }
              doclose();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Panel rene.dialogs.MyFileDialog.linePanel ( Component  x,
Component  y 
) [inline, package]

Definition at line 196 of file MyFileDialog.java.

       {      Panel p=new MyPanel();
              p.setLayout(new GridLayout(1,0));
              p.add(x); p.add(y);
              return p;
       }

Here is the caller graph for this function:

Definition at line 517 of file MyFileDialog.java.

       {      if (FD!=null) return;
              DirField.loadHistory("myfiledialog.dir.history"+DirAppend);
              DirHistory.update();
              if (recent) setDirectory(DirHistory.getRecent());
              if (updateDir()) updateFiles();           
              PatternField.loadHistory("myfiledialog.pattern.history"+PatternAppend);
              FileField.loadHistory("myfiledialog.file.history"+FileAppend);
              FileHistory.update();
       }

Here is the call graph for this function:

Definition at line 527 of file MyFileDialog.java.

       {      loadHistories(true);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.dialogs.MyFileDialog.loadHistories ( String  dir,
String  pattern,
String  file 
) [inline]

Loads the histories from the configuration file.

If you want a unique history for your instance, you need to give a string unique for your instance. There are three types of histories.

Parameters:
dir
pattern
file
See also:
loadHistories

Definition at line 540 of file MyFileDialog.java.

       {      setAppend(dir,pattern,file);
              loadHistories();
       }

Here is the call graph for this function:

static void rene.dialogs.MyFileDialog.main ( String  args[]) [inline, static]

Definition at line 491 of file MyFileDialog.java.

       {      Frame f=new CloseFrame()
              {      public void doclose ()
                     {      System.exit(0);
                     }
              };
              f.setSize(500,500);
              f.setLocation(400,400);
              f.setVisible(true);
              MyFileDialog d=new MyFileDialog(f,"Title","Save",false);
              d.center(f);
              d.update();
              d.setVisible(true);
       }

Here is the call graph for this function:

void rene.dialogs.MyFileDialog.mouseClicked ( MouseEvent  e) [inline]

Definition at line 223 of file MyFileDialog.java.

{}
void rene.dialogs.MyFileDialog.mouseEntered ( MouseEvent  e) [inline]

Definition at line 224 of file MyFileDialog.java.

{}
void rene.dialogs.MyFileDialog.mouseExited ( MouseEvent  e) [inline]

Definition at line 225 of file MyFileDialog.java.

{}
void rene.dialogs.MyFileDialog.mousePressed ( MouseEvent  e) [inline]

Definition at line 219 of file MyFileDialog.java.

       {      HomeShiftControl = e.isShiftDown() && e.isControlDown();
       }
void rene.dialogs.MyFileDialog.mouseReleased ( MouseEvent  e) [inline]

Definition at line 222 of file MyFileDialog.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.dialogs.MyFileDialog.setAppend ( String  dir,
String  pattern,
String  file 
) [inline]

Histories are used for the directories, the files and the patterns.

The dialog can use different histories for each instance of this class. If you want that, you need to determine the history for the instance with a string, unique for the instance. If a string is empty, "default" is used.

Parameters:
dir
pattern
file

Definition at line 555 of file MyFileDialog.java.

       {      if (FD!=null) return;
              if (!dir.equals("")) DirAppend="."+dir;
              else DirAppend=".default";
              if (!pattern.equals("")) PatternAppend="."+pattern;
              else PatternAppend=".default";
              if (!file.equals("")) FileAppend="."+file;
              else FileAppend=".default";
       }

Here is the caller graph for this function:

void rene.dialogs.MyFileDialog.setDirectory ( String  dir) [inline]

Definition at line 419 of file MyFileDialog.java.

       {      if (FD!=null) FD.setDirectory(dir);
              else DirField.setText(dir);
       }

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;
       }
void rene.dialogs.MyFileDialog.setFile ( String  s) [inline]

Definition at line 306 of file MyFileDialog.java.

       {      DirField.setText(FileName.path(s));
              FileField.setText(FileName.filename(s));
              // System.out.println(s);
              update(false);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.dialogs.MyFileDialog.setFilePath ( String  file) [inline]

Definition at line 433 of file MyFileDialog.java.

       {      if (FD!=null)
              {      FD.setFile(file);
                     return;
              }
              String dir=FileName.path(file);
              if (!dir.equals(""))
              {      DirField.setText(dir);
                     FileField.setText(FileName.filename(file));
              }
              else FileField.setText(file);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.dialogs.MyFileDialog.setPattern ( String  pattern) [inline]

Definition at line 424 of file MyFileDialog.java.

       {      if (FD!=null)
              {      FD.setFilenameFilter(this); // does not work
                     String s=pattern.replace(' ',';');
                     FD.setFile(s);
              }
              else PatternField.setText(pattern);
       }

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:

Definition at line 481 of file MyFileDialog.java.

       {      if (FD!=null) FD.setVisible(flag);
              else super.setVisible(flag);
       }

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:

void rene.dialogs.MyFileDialog.update ( boolean  recent) [inline]

This should be called at the start.

Definition at line 470 of file MyFileDialog.java.

       {      if (FD!=null) return;
              loadHistories(recent);
              setFilePath(FileField.getText());
              if (updateDir()) updateFiles();
              Aborted=true;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 477 of file MyFileDialog.java.

       {      update(true); 
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Update the directory list.

Returns:
if the current content of DirField is indeed a directory.

Definition at line 346 of file MyFileDialog.java.

       {      if (FD!=null) return true;
              File dir=new File(DirField.getText()+File.separatorChar);
              if (!dir.isDirectory()) return false;
              try
              {      String s=FileName.canonical(dir.getCanonicalPath());
                     addUndo(s);
                     DirField.setText(s);
                     Chosen.setText(
                            FileName.chop(16,
                            DirField.getText()+File.separatorChar+
                                   PatternField.getText(),48));
              }
              catch (Exception e) { return false; }
              return true;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Update the file list.

Definition at line 387 of file MyFileDialog.java.

       {      if (FD!=null) return;
              File dir=new File(DirField.getText());
              if (!dir.isDirectory()) return;
              CurrentDir=DirField.getText();
              if (PatternField.getText().equals("")) PatternField.setText("*");
              try
              {      Files.clear();
                     Dirs.clear();
                     FileList l=new FileList(DirField.getText(),
                            PatternField.getText(),false);
                     l.setCase(Global.getParameter("filedialog.usecaps",false));
                     l.search();
                     l.sort();
                     Enumeration e=l.files();
                     while (e.hasMoreElements())
                     {      File f=(File)e.nextElement();
                            Files.addElement(FileName.filename(f.getCanonicalPath()));
                     }
                     Dirs.addElement("..");
                     e=l.dirs();
                     while (e.hasMoreElements())
                     {      File f=(File)e.nextElement();
                            Dirs.addElement(FileName.filename(f.getCanonicalPath()));
                     }
              }
              catch (Exception e) {}
              Dirs.updateDisplay();
              Files.updateDisplay();
              Files.requestFocus();
       }

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

Reimplemented from rene.gui.CloseDialog.

Definition at line 76 of file MyFileDialog.java.

TextField rene.dialogs.MyFileDialog.Chosen [package]

Definition at line 74 of file MyFileDialog.java.

String rene.dialogs.MyFileDialog.CurrentDir = "." [package]

Definition at line 75 of file MyFileDialog.java.

String rene.dialogs.MyFileDialog.DirAppend = "" [package]

Definition at line 77 of file MyFileDialog.java.

Definition at line 72 of file MyFileDialog.java.

Definition at line 73 of file MyFileDialog.java.

Definition at line 71 of file MyFileDialog.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.dialogs.MyFileDialog.F [package]

Reimplemented from rene.gui.CloseDialog.

Definition at line 79 of file MyFileDialog.java.

FileDialog rene.dialogs.MyFileDialog.FD [package]

Definition at line 208 of file MyFileDialog.java.

String rene.dialogs.MyFileDialog.FileAppend = "" [package]

Definition at line 77 of file MyFileDialog.java.

Definition at line 72 of file MyFileDialog.java.

Definition at line 73 of file MyFileDialog.java.

Definition at line 71 of file MyFileDialog.java.

Definition at line 78 of file MyFileDialog.java.

Definition at line 217 of file MyFileDialog.java.

Definition at line 77 of file MyFileDialog.java.

Definition at line 72 of file MyFileDialog.java.

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

Reimplemented in rene.dialogs.InfoDialog.

Definition at line 22 of file CloseDialog.java.

Definition at line 363 of file MyFileDialog.java.


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