home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / JFileChooser.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  14.2 KB  |  736 lines

  1. package javax.swing;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Frame;
  7. import java.awt.event.ActionEvent;
  8. import java.awt.event.ActionListener;
  9. import java.io.File;
  10. import java.io.IOException;
  11. import java.io.ObjectOutputStream;
  12. import java.util.Vector;
  13. import javax.accessibility.Accessible;
  14. import javax.accessibility.AccessibleContext;
  15. import javax.swing.filechooser.FileFilter;
  16. import javax.swing.filechooser.FileSystemView;
  17. import javax.swing.filechooser.FileView;
  18. import javax.swing.plaf.FileChooserUI;
  19.  
  20. public class JFileChooser extends JComponent implements Accessible {
  21.    private static final String uiClassID = "FileChooserUI";
  22.    public static final int OPEN_DIALOG = 0;
  23.    public static final int SAVE_DIALOG = 1;
  24.    public static final int CUSTOM_DIALOG = 2;
  25.    public static final int CANCEL_OPTION = 1;
  26.    public static final int APPROVE_OPTION = 0;
  27.    public static final int ERROR_OPTION = -1;
  28.    public static final int FILES_ONLY = 0;
  29.    public static final int DIRECTORIES_ONLY = 1;
  30.    public static final int FILES_AND_DIRECTORIES = 2;
  31.    public static final String CANCEL_SELECTION = "CancelSelection";
  32.    public static final String APPROVE_SELECTION = "ApproveSelection";
  33.    public static final String APPROVE_BUTTON_TEXT_CHANGED_PROPERTY = "ApproveButtonTextChangedProperty";
  34.    public static final String APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY = "ApproveButtonToolTipTextChangedProperty";
  35.    public static final String APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY = "ApproveButtonMnemonicChangedProperty";
  36.    public static final String CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY = "ControlButtonsAreShownChangedProperty";
  37.    public static final String DIRECTORY_CHANGED_PROPERTY = "directoryChanged";
  38.    public static final String SELECTED_FILE_CHANGED_PROPERTY = "SelectedFileChangedProperty";
  39.    public static final String SELECTED_FILES_CHANGED_PROPERTY = "SelectedFilesChangedProperty";
  40.    public static final String MULTI_SELECTION_ENABLED_CHANGED_PROPERTY = "MultiSelectionEnabledChangedProperty";
  41.    public static final String FILE_SYSTEM_VIEW_CHANGED_PROPERTY = "FileSystemViewChanged";
  42.    public static final String FILE_VIEW_CHANGED_PROPERTY = "fileViewChanged";
  43.    public static final String FILE_HIDING_CHANGED_PROPERTY = "FileHidingChanged";
  44.    public static final String FILE_FILTER_CHANGED_PROPERTY = "fileFilterChanged";
  45.    public static final String FILE_SELECTION_MODE_CHANGED_PROPERTY = "fileSelectionChanged";
  46.    public static final String ACCESSORY_CHANGED_PROPERTY = "AccessoryChangedProperty";
  47.    public static final String ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY = "acceptAllFileFilterUsedChanged";
  48.    public static final String DIALOG_TITLE_CHANGED_PROPERTY = "DialogTitleChangedProperty";
  49.    public static final String DIALOG_TYPE_CHANGED_PROPERTY = "DialogTypeChangedProperty";
  50.    public static final String CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY = "ChoosableFileFilterChangedProperty";
  51.    private String dialogTitle;
  52.    private String approveButtonText;
  53.    private String approveButtonToolTipText;
  54.    private int approveButtonMnemonic;
  55.    private ActionListener actionListener;
  56.    private Vector filters;
  57.    private JDialog dialog;
  58.    private int dialogType;
  59.    private int returnValue;
  60.    private JComponent accessory;
  61.    private FileView fileView;
  62.    private FileView uiFileView;
  63.    private boolean controlsShown;
  64.    private boolean useFileHiding;
  65.    private int fileSelectionMode;
  66.    private boolean multiSelectionEnabled;
  67.    private boolean useAcceptAllFileFilter;
  68.    private FileFilter fileFilter;
  69.    private FileSystemView fileSystemView;
  70.    private File currentDirectory;
  71.    private File selectedFile;
  72.    private File[] selectedFiles;
  73.    protected AccessibleContext accessibleContext;
  74.    // $FF: synthetic field
  75.    static Class class$java$awt$Frame;
  76.    // $FF: synthetic field
  77.    static Class class$java$awt$event$ActionListener;
  78.  
  79.    public JFileChooser() {
  80.       this((File)null, (FileSystemView)null);
  81.    }
  82.  
  83.    public JFileChooser(String var1) {
  84.       this(var1, (FileSystemView)null);
  85.    }
  86.  
  87.    public JFileChooser(File var1) {
  88.       this(var1, (FileSystemView)null);
  89.    }
  90.  
  91.    public JFileChooser(FileSystemView var1) {
  92.       this((File)null, var1);
  93.    }
  94.  
  95.    public JFileChooser(File var1, FileSystemView var2) {
  96.       this.dialogTitle = null;
  97.       this.approveButtonText = null;
  98.       this.approveButtonToolTipText = null;
  99.       this.approveButtonMnemonic = 0;
  100.       this.actionListener = null;
  101.       this.filters = new Vector(5);
  102.       this.dialog = null;
  103.       this.dialogType = 0;
  104.       this.returnValue = -1;
  105.       this.accessory = null;
  106.       this.fileView = null;
  107.       this.uiFileView = null;
  108.       this.controlsShown = true;
  109.       this.useFileHiding = true;
  110.       this.fileSelectionMode = 0;
  111.       this.multiSelectionEnabled = false;
  112.       this.useAcceptAllFileFilter = true;
  113.       this.fileFilter = null;
  114.       this.fileSystemView = null;
  115.       this.currentDirectory = null;
  116.       this.selectedFile = null;
  117.       this.accessibleContext = null;
  118.       this.setup(var2);
  119.       this.setCurrentDirectory(var1);
  120.    }
  121.  
  122.    public JFileChooser(String var1, FileSystemView var2) {
  123.       this.dialogTitle = null;
  124.       this.approveButtonText = null;
  125.       this.approveButtonToolTipText = null;
  126.       this.approveButtonMnemonic = 0;
  127.       this.actionListener = null;
  128.       this.filters = new Vector(5);
  129.       this.dialog = null;
  130.       this.dialogType = 0;
  131.       this.returnValue = -1;
  132.       this.accessory = null;
  133.       this.fileView = null;
  134.       this.uiFileView = null;
  135.       this.controlsShown = true;
  136.       this.useFileHiding = true;
  137.       this.fileSelectionMode = 0;
  138.       this.multiSelectionEnabled = false;
  139.       this.useAcceptAllFileFilter = true;
  140.       this.fileFilter = null;
  141.       this.fileSystemView = null;
  142.       this.currentDirectory = null;
  143.       this.selectedFile = null;
  144.       this.accessibleContext = null;
  145.       this.setup(var2);
  146.       if (var1 == null) {
  147.          this.setCurrentDirectory((File)null);
  148.       } else {
  149.          this.setCurrentDirectory(this.fileSystemView.createFileObject(var1));
  150.       }
  151.  
  152.    }
  153.  
  154.    protected void setup(FileSystemView var1) {
  155.       if (var1 == null) {
  156.          var1 = FileSystemView.getFileSystemView();
  157.       }
  158.  
  159.       this.setFileSystemView(var1);
  160.       this.updateUI();
  161.       if (this.isAcceptAllFileFilterUsed()) {
  162.          this.setFileFilter(this.getAcceptAllFileFilter());
  163.       }
  164.  
  165.    }
  166.  
  167.    public File getSelectedFile() {
  168.       return this.selectedFile;
  169.    }
  170.  
  171.    public void setSelectedFile(File var1) {
  172.       File var2 = this.selectedFile;
  173.       this.selectedFile = var1;
  174.       if (this.selectedFile != null) {
  175.          String var3 = this.selectedFile.getParent();
  176.          if (var3 != null) {
  177.             File var4 = this.getFileSystemView().createFileObject(var3);
  178.             if (!var4.equals(this.getCurrentDirectory())) {
  179.                this.setCurrentDirectory(var4);
  180.             }
  181.          }
  182.  
  183.          this.ensureFileIsVisible(this.selectedFile);
  184.       }
  185.  
  186.       ((JComponent)this).firePropertyChange("SelectedFileChangedProperty", var2, this.selectedFile);
  187.    }
  188.  
  189.    public File[] getSelectedFiles() {
  190.       return this.selectedFiles == null ? new File[0] : (File[])this.selectedFiles.clone();
  191.    }
  192.  
  193.    public void setSelectedFiles(File[] var1) {
  194.       File[] var2 = this.selectedFiles;
  195.       this.selectedFiles = var1;
  196.       ((JComponent)this).firePropertyChange("SelectedFilesChangedProperty", var2, this.selectedFiles);
  197.    }
  198.  
  199.    public File getCurrentDirectory() {
  200.       return this.currentDirectory;
  201.    }
  202.  
  203.    public void setCurrentDirectory(File var1) {
  204.       File var2 = this.currentDirectory;
  205.       if (var1 == null) {
  206.          this.currentDirectory = this.getFileSystemView().getHomeDirectory();
  207.          ((JComponent)this).firePropertyChange("directoryChanged", var2, this.currentDirectory);
  208.       } else if (this.currentDirectory == null || !this.currentDirectory.equals(var1)) {
  209.          for(File var3 = null; !this.isTraversable(var1) && var3 != var1 && !this.getFileSystemView().isRoot(var1); var1 = this.getFileSystemView().getParentDirectory(var1)) {
  210.             var3 = var1;
  211.          }
  212.  
  213.          this.currentDirectory = var1;
  214.          ((JComponent)this).firePropertyChange("directoryChanged", var2, this.currentDirectory);
  215.       }
  216.    }
  217.  
  218.    public void changeToParentDirectory() {
  219.       File var1 = this.getCurrentDirectory();
  220.       this.setCurrentDirectory(this.getFileSystemView().getParentDirectory(var1));
  221.    }
  222.  
  223.    public void rescanCurrentDirectory() {
  224.       this.getUI().rescanCurrentDirectory(this);
  225.    }
  226.  
  227.    public void ensureFileIsVisible(File var1) {
  228.       this.getUI().ensureFileIsVisible(this, var1);
  229.    }
  230.  
  231.    public int showOpenDialog(Component var1) {
  232.       this.setDialogType(0);
  233.       return this.showDialog(var1, (String)null);
  234.    }
  235.  
  236.    public int showSaveDialog(Component var1) {
  237.       this.setDialogType(1);
  238.       return this.showDialog(var1, (String)null);
  239.    }
  240.  
  241.    public int showDialog(Component var1, String var2) {
  242.       if (var2 != null) {
  243.          this.setApproveButtonText(var2);
  244.          this.setDialogType(2);
  245.       }
  246.  
  247.       Frame var3 = var1 instanceof Frame ? (Frame)var1 : (Frame)SwingUtilities.getAncestorOfClass(class$java$awt$Frame == null ? (class$java$awt$Frame = class$("java.awt.Frame")) : class$java$awt$Frame, var1);
  248.       Object var4 = null;
  249.       String var6;
  250.       if (this.getDialogTitle() != null) {
  251.          var6 = this.dialogTitle;
  252.       } else {
  253.          var6 = this.getUI().getDialogTitle(this);
  254.       }
  255.  
  256.       this.dialog = new JDialog(var3, var6, true);
  257.       Container var5 = this.dialog.getContentPane();
  258.       var5.setLayout(new BorderLayout());
  259.       var5.add(this, "Center");
  260.       this.dialog.pack();
  261.       this.dialog.setLocationRelativeTo(var1);
  262.       this.rescanCurrentDirectory();
  263.       this.dialog.show();
  264.       return this.returnValue;
  265.    }
  266.  
  267.    public boolean getControlButtonsAreShown() {
  268.       return this.controlsShown;
  269.    }
  270.  
  271.    public void setControlButtonsAreShown(boolean var1) {
  272.       if (this.controlsShown != var1) {
  273.          boolean var2 = this.controlsShown;
  274.          this.controlsShown = var1;
  275.          ((JComponent)this).firePropertyChange("ControlButtonsAreShownChangedProperty", var2, this.controlsShown);
  276.       }
  277.    }
  278.  
  279.    public int getDialogType() {
  280.       return this.dialogType;
  281.    }
  282.  
  283.    public void setDialogType(int var1) {
  284.       if (this.dialogType != var1) {
  285.          if (var1 != 0 && var1 != 1 && var1 != 2) {
  286.             throw new IllegalArgumentException("Incorrect Dialog Type: " + var1);
  287.          } else {
  288.             int var2 = this.dialogType;
  289.             this.dialogType = var1;
  290.             if (var1 == 0 || var1 == 1) {
  291.                this.setApproveButtonText((String)null);
  292.             }
  293.  
  294.             ((JComponent)this).firePropertyChange("DialogTypeChangedProperty", var2, var1);
  295.          }
  296.       }
  297.    }
  298.  
  299.    public void setDialogTitle(String var1) {
  300.       String var2 = this.dialogTitle;
  301.       this.dialogTitle = var1;
  302.       if (this.dialog != null) {
  303.          this.dialog.setTitle(var1);
  304.       }
  305.  
  306.       ((JComponent)this).firePropertyChange("DialogTitleChangedProperty", var2, var1);
  307.    }
  308.  
  309.    public String getDialogTitle() {
  310.       return this.dialogTitle;
  311.    }
  312.  
  313.    public void setApproveButtonToolTipText(String var1) {
  314.       if (this.approveButtonToolTipText != var1) {
  315.          String var2 = this.approveButtonToolTipText;
  316.          this.approveButtonToolTipText = var1;
  317.          this.setDialogType(2);
  318.          ((JComponent)this).firePropertyChange("ApproveButtonToolTipTextChangedProperty", var2, this.approveButtonToolTipText);
  319.       }
  320.    }
  321.  
  322.    public String getApproveButtonToolTipText() {
  323.       return this.approveButtonToolTipText;
  324.    }
  325.  
  326.    public int getApproveButtonMnemonic() {
  327.       return this.approveButtonMnemonic;
  328.    }
  329.  
  330.    public void setApproveButtonMnemonic(int var1) {
  331.       if (this.approveButtonMnemonic != var1) {
  332.          int var2 = this.approveButtonMnemonic;
  333.          this.approveButtonMnemonic = var1;
  334.          ((JComponent)this).firePropertyChange("ApproveButtonMnemonicChangedProperty", var2, this.approveButtonMnemonic);
  335.       }
  336.    }
  337.  
  338.    public void setApproveButtonMnemonic(char var1) {
  339.       int var2 = var1;
  340.       if (var1 >= 'a' && var1 <= 'z') {
  341.          var2 = var1 - 32;
  342.       }
  343.  
  344.       this.setApproveButtonMnemonic(var2);
  345.    }
  346.  
  347.    public void setApproveButtonText(String var1) {
  348.       if (this.approveButtonText != var1) {
  349.          String var2 = this.approveButtonText;
  350.          this.approveButtonText = var1;
  351.          ((JComponent)this).firePropertyChange("ApproveButtonTextChangedProperty", var2, var1);
  352.       }
  353.    }
  354.  
  355.    public String getApproveButtonText() {
  356.       return this.approveButtonText;
  357.    }
  358.  
  359.    public FileFilter[] getChoosableFileFilters() {
  360.       FileFilter[] var1 = new FileFilter[this.filters.size()];
  361.       this.filters.copyInto(var1);
  362.       return var1;
  363.    }
  364.  
  365.    public void addChoosableFileFilter(FileFilter var1) {
  366.       if (var1 != null && !this.filters.contains(var1)) {
  367.          FileFilter[] var2 = this.getChoosableFileFilters();
  368.          this.filters.addElement(var1);
  369.          ((JComponent)this).firePropertyChange("ChoosableFileFilterChangedProperty", var2, this.getChoosableFileFilters());
  370.       }
  371.  
  372.       this.setFileFilter(var1);
  373.    }
  374.  
  375.    public boolean removeChoosableFileFilter(FileFilter var1) {
  376.       if (this.filters.contains(var1)) {
  377.          if (this.getFileFilter() == var1) {
  378.             this.setFileFilter((FileFilter)null);
  379.          }
  380.  
  381.          FileFilter[] var2 = this.getChoosableFileFilters();
  382.          this.filters.removeElement(var1);
  383.          ((JComponent)this).firePropertyChange("ChoosableFileFilterChangedProperty", var2, this.getChoosableFileFilters());
  384.          return true;
  385.       } else {
  386.          return false;
  387.       }
  388.    }
  389.  
  390.    public void resetChoosableFileFilters() {
  391.       FileFilter[] var1 = this.getChoosableFileFilters();
  392.       this.setFileFilter((FileFilter)null);
  393.       this.filters.removeAllElements();
  394.       if (this.isAcceptAllFileFilterUsed()) {
  395.          this.addChoosableFileFilter(this.getAcceptAllFileFilter());
  396.       }
  397.  
  398.       ((JComponent)this).firePropertyChange("ChoosableFileFilterChangedProperty", var1, this.getChoosableFileFilters());
  399.    }
  400.  
  401.    public FileFilter getAcceptAllFileFilter() {
  402.       FileFilter var1 = null;
  403.       if (this.getUI() != null) {
  404.          var1 = this.getUI().getAcceptAllFileFilter(this);
  405.       }
  406.  
  407.       return var1;
  408.    }
  409.  
  410.    public boolean isAcceptAllFileFilterUsed() {
  411.       return this.useAcceptAllFileFilter;
  412.    }
  413.  
  414.    public void setAcceptAllFileFilterUsed(boolean var1) {
  415.       boolean var2 = this.useAcceptAllFileFilter;
  416.       this.useAcceptAllFileFilter = var1;
  417.       if (!var1) {
  418.          this.removeChoosableFileFilter(this.getAcceptAllFileFilter());
  419.       } else {
  420.          this.removeChoosableFileFilter(this.getAcceptAllFileFilter());
  421.          this.addChoosableFileFilter(this.getAcceptAllFileFilter());
  422.       }
  423.  
  424.       ((JComponent)this).firePropertyChange("acceptAllFileFilterUsedChanged", var2, this.useAcceptAllFileFilter);
  425.    }
  426.  
  427.    public JComponent getAccessory() {
  428.       return this.accessory;
  429.    }
  430.  
  431.    public void setAccessory(JComponent var1) {
  432.       JComponent var2 = this.accessory;
  433.       this.accessory = var1;
  434.       ((JComponent)this).firePropertyChange("AccessoryChangedProperty", var2, this.accessory);
  435.    }
  436.  
  437.    public void setFileSelectionMode(int var1) {
  438.       if (this.fileSelectionMode != var1) {
  439.          if (var1 != 0 && var1 != 1 && var1 != 2) {
  440.             throw new IllegalArgumentException("Incorrect Mode for Dialog: " + var1);
  441.          } else {
  442.             int var2 = this.fileSelectionMode;
  443.             this.fileSelectionMode = var1;
  444.             ((JComponent)this).firePropertyChange("fileSelectionChanged", var2, this.fileSelectionMode);
  445.          }
  446.       }
  447.    }
  448.  
  449.    public int getFileSelectionMode() {
  450.       return this.fileSelectionMode;
  451.    }
  452.  
  453.    public boolean isFileSelectionEnabled() {
  454.       return this.fileSelectionMode == 0 || this.fileSelectionMode == 2;
  455.    }
  456.  
  457.    public boolean isDirectorySelectionEnabled() {
  458.       return this.fileSelectionMode == 1 || this.fileSelectionMode == 2;
  459.    }
  460.  
  461.    public void setMultiSelectionEnabled(boolean var1) {
  462.       if (this.multiSelectionEnabled != var1) {
  463.          boolean var2 = this.multiSelectionEnabled;
  464.          this.multiSelectionEnabled = var1;
  465.          ((JComponent)this).firePropertyChange("MultiSelectionEnabledChangedProperty", var2, this.multiSelectionEnabled);
  466.       }
  467.    }
  468.  
  469.    public boolean isMultiSelectionEnabled() {
  470.       return this.multiSelectionEnabled;
  471.    }
  472.  
  473.    public boolean isFileHidingEnabled() {
  474.       return this.useFileHiding;
  475.    }
  476.  
  477.    public void setFileHidingEnabled(boolean var1) {
  478.       boolean var2 = this.useFileHiding;
  479.       this.useFileHiding = var1;
  480.       ((JComponent)this).firePropertyChange("FileHidingChanged", var2, this.useFileHiding);
  481.    }
  482.  
  483.    public void setFileFilter(FileFilter var1) {
  484.       FileFilter var2 = this.fileFilter;
  485.       this.fileFilter = var1;
  486.       if (this.selectedFile != null && this.fileFilter != null && !var1.accept(this.selectedFile)) {
  487.          this.setSelectedFile((File)null);
  488.       }
  489.  
  490.       ((JComponent)this).firePropertyChange("fileFilterChanged", var2, this.fileFilter);
  491.    }
  492.  
  493.    public FileFilter getFileFilter() {
  494.       return this.fileFilter;
  495.    }
  496.  
  497.    public void setFileView(FileView var1) {
  498.       FileView var2 = this.fileView;
  499.       this.fileView = var1;
  500.       ((JComponent)this).firePropertyChange("fileViewChanged", var2, var1);
  501.    }
  502.  
  503.    public FileView getFileView() {
  504.       return this.fileView;
  505.    }
  506.  
  507.    public String getName(File var1) {
  508.       String var2 = null;
  509.       if (var1 != null) {
  510.          if (this.getFileView() != null) {
  511.             var2 = this.getFileView().getName(var1);
  512.          }
  513.  
  514.          if (var2 == null && this.uiFileView != null) {
  515.             var2 = this.uiFileView.getName(var1);
  516.          }
  517.       }
  518.  
  519.       return var2;
  520.    }
  521.  
  522.    public String getDescription(File var1) {
  523.       String var2 = null;
  524.       if (var1 != null) {
  525.          if (this.getFileView() != null) {
  526.             var2 = this.getFileView().getDescription(var1);
  527.          }
  528.  
  529.          if (var2 == null && this.uiFileView != null) {
  530.             var2 = this.uiFileView.getDescription(var1);
  531.          }
  532.       }
  533.  
  534.       return var2;
  535.    }
  536.  
  537.    public String getTypeDescription(File var1) {
  538.       String var2 = null;
  539.       if (var1 != null) {
  540.          if (this.getFileView() != null) {
  541.             var2 = this.getFileView().getTypeDescription(var1);
  542.          }
  543.  
  544.          if (var2 == null && this.uiFileView != null) {
  545.             var2 = this.uiFileView.getTypeDescription(var1);
  546.          }
  547.       }
  548.  
  549.       return var2;
  550.    }
  551.  
  552.    public Icon getIcon(File var1) {
  553.       Icon var2 = null;
  554.       if (var1 != null) {
  555.          if (this.getFileView() != null) {
  556.             var2 = this.getFileView().getIcon(var1);
  557.          }
  558.  
  559.          if (var2 == null && this.uiFileView != null) {
  560.             var2 = this.uiFileView.getIcon(var1);
  561.          }
  562.       }
  563.  
  564.       return var2;
  565.    }
  566.  
  567.    public boolean isTraversable(File var1) {
  568.       Boolean var2 = null;
  569.       if (var1 != null && this.getFileView() != null) {
  570.          var2 = this.getFileView().isTraversable(var1);
  571.       }
  572.  
  573.       if (var1 != null && var2 == null && this.uiFileView != null) {
  574.          var2 = this.uiFileView.isTraversable(var1);
  575.       }
  576.  
  577.       if (var2 == null && var1 != null) {
  578.          if (var1.isDirectory()) {
  579.             var2 = Boolean.TRUE;
  580.          } else {
  581.             var2 = Boolean.FALSE;
  582.          }
  583.       } else if (var2 == null) {
  584.          return false;
  585.       }
  586.  
  587.       return var2;
  588.    }
  589.  
  590.    public boolean accept(File var1) {
  591.       boolean var2 = true;
  592.       if (var1 != null && this.fileFilter != null) {
  593.          var2 = this.fileFilter.accept(var1);
  594.       }
  595.  
  596.       return var2;
  597.    }
  598.  
  599.    public void setFileSystemView(FileSystemView var1) {
  600.       FileSystemView var2 = this.fileSystemView;
  601.       this.fileSystemView = var1;
  602.       ((JComponent)this).firePropertyChange("FileSystemViewChanged", var2, this.fileSystemView);
  603.    }
  604.  
  605.    public FileSystemView getFileSystemView() {
  606.       return this.fileSystemView;
  607.    }
  608.  
  609.    public void approveSelection() {
  610.       this.returnValue = 0;
  611.       if (this.dialog != null) {
  612.          this.dialog.setVisible(false);
  613.       }
  614.  
  615.       this.fireActionPerformed("ApproveSelection");
  616.    }
  617.  
  618.    public void cancelSelection() {
  619.       this.returnValue = 1;
  620.       if (this.dialog != null) {
  621.          this.dialog.setVisible(false);
  622.       }
  623.  
  624.       this.fireActionPerformed("CancelSelection");
  625.    }
  626.  
  627.    public void addActionListener(ActionListener var1) {
  628.       super.listenerList.add(class$java$awt$event$ActionListener == null ? (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")) : class$java$awt$event$ActionListener, var1);
  629.    }
  630.  
  631.    public void removeActionListener(ActionListener var1) {
  632.       super.listenerList.remove(class$java$awt$event$ActionListener == null ? (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")) : class$java$awt$event$ActionListener, var1);
  633.    }
  634.  
  635.    protected void fireActionPerformed(String var1) {
  636.       Object[] var2 = super.listenerList.getListenerList();
  637.       ActionEvent var3 = null;
  638.  
  639.       for(int var4 = var2.length - 2; var4 >= 0; var4 -= 2) {
  640.          if (var2[var4] == (class$java$awt$event$ActionListener == null ? (class$java$awt$event$ActionListener = class$("java.awt.event.ActionListener")) : class$java$awt$event$ActionListener)) {
  641.             if (var3 == null) {
  642.                var3 = new ActionEvent(this, 1001, var1);
  643.             }
  644.  
  645.             ((ActionListener)var2[var4 + 1]).actionPerformed(var3);
  646.          }
  647.       }
  648.  
  649.    }
  650.  
  651.    public void updateUI() {
  652.       FileChooserUI var1 = (FileChooserUI)UIManager.getUI(this);
  653.       ((JComponent)this).setUI(var1);
  654.       this.uiFileView = this.getUI().getFileView(this);
  655.       if (this.isAcceptAllFileFilterUsed()) {
  656.          this.addChoosableFileFilter(this.getAcceptAllFileFilter());
  657.       }
  658.  
  659.    }
  660.  
  661.    public String getUIClassID() {
  662.       return "FileChooserUI";
  663.    }
  664.  
  665.    public FileChooserUI getUI() {
  666.       return (FileChooserUI)super.ui;
  667.    }
  668.  
  669.    private void writeObject(ObjectOutputStream var1) throws IOException {
  670.       var1.defaultWriteObject();
  671.       if (super.ui != null && this.getUIClassID().equals("FileChooserUI")) {
  672.          super.ui.installUI(this);
  673.       }
  674.  
  675.    }
  676.  
  677.    protected String paramString() {
  678.       String var1 = this.approveButtonText != null ? this.approveButtonText : "";
  679.       String var2 = this.dialogTitle != null ? this.dialogTitle : "";
  680.       String var3;
  681.       if (this.dialogType == 0) {
  682.          var3 = "OPEN_DIALOG";
  683.       } else if (this.dialogType == 1) {
  684.          var3 = "SAVE_DIALOG";
  685.       } else if (this.dialogType == 2) {
  686.          var3 = "CUSTOM_DIALOG";
  687.       } else {
  688.          var3 = "";
  689.       }
  690.  
  691.       String var4;
  692.       if (this.returnValue == 1) {
  693.          var4 = "CANCEL_OPTION";
  694.       } else if (this.returnValue == 0) {
  695.          var4 = "APPROVE_OPTION";
  696.       } else if (this.returnValue == -1) {
  697.          var4 = "ERROR_OPTION";
  698.       } else {
  699.          var4 = "";
  700.       }
  701.  
  702.       String var5 = this.useFileHiding ? "true" : "false";
  703.       String var6;
  704.       if (this.fileSelectionMode == 0) {
  705.          var6 = "FILES_ONLY";
  706.       } else if (this.fileSelectionMode == 1) {
  707.          var6 = "DIRECTORIES_ONLY";
  708.       } else if (this.fileSelectionMode == 2) {
  709.          var6 = "FILES_AND_DIRECTORIES";
  710.       } else {
  711.          var6 = "";
  712.       }
  713.  
  714.       String var7 = this.currentDirectory != null ? this.currentDirectory.toString() : "";
  715.       String var8 = this.selectedFile != null ? this.selectedFile.toString() : "";
  716.       return super.paramString() + ",approveButtonText=" + var1 + ",currentDirectory=" + var7 + ",dialogTitle=" + var2 + ",dialogType=" + var3 + ",fileSelectionMode=" + var6 + ",returnValue=" + var4 + ",selectedFile=" + var8 + ",useFileHiding=" + var5;
  717.    }
  718.  
  719.    public AccessibleContext getAccessibleContext() {
  720.       if (this.accessibleContext == null) {
  721.          this.accessibleContext = new AccessibleJFileChooser(this);
  722.       }
  723.  
  724.       return this.accessibleContext;
  725.    }
  726.  
  727.    // $FF: synthetic method
  728.    static Class class$(String var0) {
  729.       try {
  730.          return Class.forName(var0);
  731.       } catch (ClassNotFoundException var2) {
  732.          throw new NoClassDefFoundError(((Throwable)var2).getMessage());
  733.       }
  734.    }
  735. }
  736.