Examples of CommonFileFilter


Examples of bnGUI.venn.gui.CommonFileFilter

     *
   */
    public static AllParameters loadOptions(Component parent)
    {
        JFileChooser dialog = new JFileChooser();
        CommonFileFilter filter;
       
        dialog.setAcceptAllFileFilterUsed(false);
       
        filter = new CommonFileFilter("VennMaster Options (.xml)");
        filter.addExtension("xml");
       
        dialog.addChoosableFileFilter(filter);
                       
        if( dialog.showOpenDialog(parent) != JFileChooser.APPROVE_OPTION )
        {
View Full Code Here

Examples of bnGUI.venn.gui.CommonFileFilter

        }
    }

    public static void saveOptions(Component parent, AllParameters params) {
        JFileChooser dialog = new JFileChooser();
        CommonFileFilter filter;
       
        dialog.setAcceptAllFileFilterUsed(false);
       
        filter = new CommonFileFilter("VennMaster Options (.xml)");
        filter.addExtension("xml");
       
        dialog.addChoosableFileFilter(filter);
                       
        if( dialog.showSaveDialog(parent) != JFileChooser.APPROVE_OPTION )
        {
View Full Code Here

Examples of bnGUI.venn.gui.CommonFileFilter

        */
   
    //System.out.println(geneFilter.getParameters());
   
    JFileChooser dialog = new JFileChooser();
    CommonFileFilter filter;

    String   groupFile = null,
        geneFile = null;

    if( lastWorkingPath != null )
    {
      dialog.setCurrentDirectory(new File(lastWorkingPath));
    }
   
    // LOAD CATEGORIES
    dialog.setAcceptAllFileFilterUsed(false);   
    filter = new CommonFileFilter("Summary Export File (.se,.txt)");
    filter.addExtension("se");
        filter.addExtension("txt");
    dialog.addChoosableFileFilter(filter);

    if( dialog.showOpenDialog(parentComponent) == JFileChooser.APPROVE_OPTION )
    {
      File file = dialog.getSelectedFile();
      lastWorkingPath = file.getAbsolutePath();
      if( file.exists() )
      {
        groupFile = file.getAbsolutePath();
      }
      else
      {
        JOptionPane.showMessageDialogparentComponent,
                        "File does not exist '"+ file.getName().toString() +"' ",
                        "Error",
                        JOptionPane.ERROR_MESSAGE);
        return false;       
      }
    }
    else
    {
      return false;
    }

    // LOAD GENE LIST
   
    dialog = new JFileChooser();
    dialog.setCurrentDirectory(new File(lastWorkingPath));
   
    filter = new CommonFileFilter("Gene Category Export (.gce,.txt)");
        filter.addExtension("gce");
    filter.addExtension("txt");
    dialog.setFileFilter(filter);
   
    if( dialog.showOpenDialog(parentComponent) == JFileChooser.APPROVE_OPTION )
    {
      File file = dialog.getSelectedFile();
View Full Code Here

Examples of bnGUI.venn.gui.CommonFileFilter

        */
       
        //System.out.println(geneFilter.getParameters());
       
        JFileChooser dialog = new JFileChooser();
        CommonFileFilter filter;

        String  geneFile  = null;
       
        if( lastWorkingPath != null )
        {
            dialog.setCurrentDirectory(new File(lastWorkingPath));
        }
       
        // LOAD CATEGORIES
        dialog.setAcceptAllFileFilterUsed(false);
       
        // LOAD GENE LIST      
        filter = new CommonFileFilter("High-Throughput GoMiner .gce file (.gce,.txt)");
        filter.addExtension("gce");
        filter.addExtension("txt");
        dialog.setFileFilter(filter);      
       
        if( dialog.showOpenDialog(parentComponent) == JFileChooser.APPROVE_OPTION )
        {
            File file = dialog.getSelectedFile();
View Full Code Here

Examples of bnGUI.venn.gui.CommonFileFilter

 

  private boolean actionFileOpenList_()
  {
    JFileChooser dialog = new JFileChooser();
    CommonFileFilter filter;
   
    dialog.setAcceptAllFileFilterUsed(false);   
    filter = new CommonFileFilter("LIST Listfile (.list,.lst,.txt)");
    filter.addExtension("list");
    filter.addExtension("lst");
        filter.addExtension("txt");
   
    dialog.addChoosableFileFilter(filter);

    if( lastWorkingPath != null )
    {
View Full Code Here

Examples of de.FeatureModellingTool.DictEditor.store.CommonFileFilter

        return dictInfoPane.getDictionaryFile();
    }

    protected void openTermiFile()
    {
        javax.swing.filechooser.FileFilter fileFilter = new CommonFileFilter("tdn", "Terminology Dictionary Files (*.tdn)");

        File selectedFile = null;


        if (fileChooser == null)
View Full Code Here

Examples of de.reuse.CommonFileFilter

            fileChooser.addChoosableFileFilter(moreFileFilter);
            fileChooser.setFileFilter(gifFileFilter);

            PropertyChangeListener fileFilterChangeListener = new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent e) {
                    CommonFileFilter ff = (CommonFileFilter) e.getNewValue();

                    if (!e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY))
                        return;

                    if (ff.getSuffix().equalsIgnoreCase("more")) {
                        fileChooser.cancelSelection();
                        Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
                        action.putValue(de.grapheditor.ConstantDefinition.IMAGE_TYPE, "more");
                        action.putValue(de.grapheditor.ConstantDefinition.UI_FRAME, uiFrame);
                        action.actionPerformed(null);
                        ((JFileChooser) e.getSource()).removePropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, this);
                    }
                }
            };

            fileChooser.addPropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, fileFilterChangeListener);

            for (; ;) {
                if (fileChooser.showDialog(uiFrame, null) == JFileChooser.APPROVE_OPTION) {
                    imageFile = fileChooser.getSelectedFile();
                    CommonFileFilter currentFilter = (CommonFileFilter) fileChooser.getFileFilter();

                    if (!currentFilter.getSuffix().equalsIgnoreCase(CommonFileFilter.getSuffix(imageFile))) {
                        String path = imageFile.getPath() + "." + currentFilter.getSuffix();
                        imageFile = new File(path);
                    }

                    if (imageFile.exists()) {
                        int result_tmp = JOptionPane.showConfirmDialog(uiFrame, "�ļ� " + imageFile.getPath() + " �Ѿ����ڣ��Ƿ񸲸Ǹ��ļ���", "ȷ�ϴ���", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);

                        if (result_tmp == JOptionPane.YES_OPTION) {
                            break;
                        } else {
                            continue;
                        }
                    }

                    break;
                } else {
                    break;
                }
            }

            fileChooser.removePropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, fileFilterChangeListener);

            CommonFileFilter selectedFilter = (CommonFileFilter) fileChooser.getFileFilter();

            fileChooser.removeChoosableFileFilter(moreFileFilter);
            fileChooser.removeChoosableFileFilter(svgFileFilter);
            fileChooser.removeChoosableFileFilter(gifFileFilter);

            for (int i = 0; i < oldFilter.length; i++) {
                fileChooser.addChoosableFileFilter(oldFilter[i]);
            }
            fileChooser.setSelectedFile(null);
            //end: get the image file's path from user

            //begin:
            if (imageFile == null)
                return;

            if (!imageFile.exists()) {
                try {
                    imageFile.createNewFile();
                } catch (IOException ioe) {
                    JOptionPane.showMessageDialog(uiFrame, "�������ļ�ʧ��,����洢�豸�Ƿ�������", "���洰��", JOptionPane.ERROR_MESSAGE);
                    return;
                }
            }
            //end:

            Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
            action.putValue(de.grapheditor.ConstantDefinition.FILE, imageFile);
            action.putValue(de.grapheditor.ConstantDefinition.IMAGE_TYPE, selectedFilter.getSuffix());
            action.putValue(de.grapheditor.ConstantDefinition.UI_FRAME, uiFrame);
            action.actionPerformed(null);
        }
View Full Code Here

Examples of de.reuse.CommonFileFilter

      fileChooser.addChoosableFileFilter(moreFileFilter);
      fileChooser.setFileFilter(gifFileFilter);

      PropertyChangeListener fileFilterChangeListener = new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent e) {
          CommonFileFilter ff = (CommonFileFilter) e.getNewValue();

          if (!e.getPropertyName().equals(
              JFileChooser.FILE_FILTER_CHANGED_PROPERTY))
            return;

          if (ff.getSuffix().equalsIgnoreCase("more")) {
            fileChooser.cancelSelection();
            Action action = (Action) graphicalEditorActionMap
                .getInterface("exportView");
            action
                .putValue(
                    de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.IMAGE_TYPE,
                    "more");
            action
                .putValue(
                    de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.UI_FRAME,
                    uiJPanel);
            action.actionPerformed(null);
            ((JFileChooser) e.getSource())
                .removePropertyChangeListener(
                    JFileChooser.FILE_FILTER_CHANGED_PROPERTY,
                    this);
          }
        }
      };

      fileChooser.addPropertyChangeListener(
          JFileChooser.FILE_FILTER_CHANGED_PROPERTY,
          fileFilterChangeListener);

      for (;;) {
        if (fileChooser.showDialog(uiJPanel, null) == JFileChooser.APPROVE_OPTION) {
          imageFile = fileChooser.getSelectedFile();
          CommonFileFilter currentFilter = (CommonFileFilter) fileChooser
              .getFileFilter();

          if (!currentFilter.getSuffix().equalsIgnoreCase(
              CommonFileFilter.getSuffix(imageFile))) {
            String path = imageFile.getPath() + "."
                + currentFilter.getSuffix();
            imageFile = new File(path);
          }

          if (imageFile.exists()) {
            int result_tmp = JOptionPane.showConfirmDialog(
                uiJPanel, "�ļ� " + imageFile.getPath()
                    + " �Ѿ����ڣ��Ƿ񸲸Ǹ��ļ���", "ȷ�ϴ���",
                JOptionPane.YES_NO_OPTION,
                JOptionPane.INFORMATION_MESSAGE);

            if (result_tmp == JOptionPane.YES_OPTION) {
              break;
            } else {
              continue;
            }
          }

          break;
        } else {
          break;
        }
      }

      fileChooser.removePropertyChangeListener(
          JFileChooser.FILE_FILTER_CHANGED_PROPERTY,
          fileFilterChangeListener);

      CommonFileFilter selectedFilter = (CommonFileFilter) fileChooser
          .getFileFilter();

      fileChooser.removeChoosableFileFilter(moreFileFilter);
      fileChooser.removeChoosableFileFilter(svgFileFilter);
      fileChooser.removeChoosableFileFilter(gifFileFilter);

      for (int i = 0; i < oldFilter.length; i++) {
        fileChooser.addChoosableFileFilter(oldFilter[i]);
      }
      fileChooser.setSelectedFile(null);
      // end: get the image file's path from user

      // begin:
      if (imageFile == null)
        return;

      if (!imageFile.exists()) {
        try {
          imageFile.createNewFile();
        } catch (IOException ioe) {
          JOptionPane.showMessageDialog(uiJPanel,
              "�������ļ�ʧ��,����洢�豸�Ƿ�������", "���洰��",
              JOptionPane.ERROR_MESSAGE);
          return;
        }
      }
      // end:

      Action action = (Action) graphicalEditorActionMap
          .getInterface("exportView");
      action
          .putValue(
              de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.FILE,
              imageFile);
      action
          .putValue(
              de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.IMAGE_TYPE,
              selectedFilter.getSuffix());
      action
          .putValue(
              de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.UI_FRAME,
              uiJPanel);
      action.actionPerformed(null);
View Full Code Here

Examples of de.reuse.CommonFileFilter

            fileChooser.addChoosableFileFilter(moreFileFilter);
            fileChooser.setFileFilter(gifFileFilter);

            PropertyChangeListener fileFilterChangeListener = new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent e) {
                    CommonFileFilter ff = (CommonFileFilter) e.getNewValue();

                    if (!e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY))
                        return;

                    if (ff.getSuffix().equalsIgnoreCase("more")) {
                        fileChooser.cancelSelection();
                        Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
                        action.putValue(de.grapheditor.ConstantDefinition.IMAGE_TYPE, "more");
                        action.putValue(de.grapheditor.ConstantDefinition.UI_FRAME, uiFrame);
                        action.actionPerformed(null);
                        ((JFileChooser) e.getSource()).removePropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, this);
                    }
                }
            };

            fileChooser.addPropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, fileFilterChangeListener);

            for (; ;) {
                if (fileChooser.showDialog(uiFrame, null) == JFileChooser.APPROVE_OPTION) {
                    imageFile = fileChooser.getSelectedFile();
                    CommonFileFilter currentFilter = (CommonFileFilter) fileChooser.getFileFilter();

                    if (!currentFilter.getSuffix().equalsIgnoreCase(CommonFileFilter.getSuffix(imageFile))) {
                        String path = imageFile.getPath() + "." + currentFilter.getSuffix();
                        imageFile = new File(path);
                    }

                    if (imageFile.exists()) {
                        int result_tmp = JOptionPane.showConfirmDialog(uiFrame, "�ļ� " + imageFile.getPath() + " �Ѿ����ڣ��Ƿ񸲸Ǹ��ļ���", "ȷ�ϴ���", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);

                        if (result_tmp == JOptionPane.YES_OPTION) {
                            break;
                        } else {
                            continue;
                        }
                    }

                    break;
                } else {
                    break;
                }
            }

            fileChooser.removePropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, fileFilterChangeListener);

            CommonFileFilter selectedFilter = (CommonFileFilter) fileChooser.getFileFilter();

            fileChooser.removeChoosableFileFilter(moreFileFilter);
            fileChooser.removeChoosableFileFilter(svgFileFilter);
            fileChooser.removeChoosableFileFilter(gifFileFilter);

            for (int i = 0; i < oldFilter.length; i++) {
                fileChooser.addChoosableFileFilter(oldFilter[i]);
            }
            fileChooser.setSelectedFile(null);
            //end: get the image file's path from user

            //begin:
            if (imageFile == null)
                return;

            if (!imageFile.exists()) {
                try {
                    imageFile.createNewFile();
                } catch (IOException ioe) {
                    JOptionPane.showMessageDialog(uiFrame, "�������ļ�ʧ��,����洢�豸�Ƿ�������", "���洰��", JOptionPane.ERROR_MESSAGE);
                    return;
                }
            }
            //end:

            Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
            action.putValue(de.grapheditor.ConstantDefinition.FILE, imageFile);
            action.putValue(de.grapheditor.ConstantDefinition.IMAGE_TYPE, selectedFilter.getSuffix());
            action.putValue(de.grapheditor.ConstantDefinition.UI_FRAME, uiFrame);
            action.actionPerformed(null);
        }
View Full Code Here

Examples of de.reuse.CommonFileFilter

            fileChooser.addChoosableFileFilter(moreFileFilter);
            fileChooser.setFileFilter(gifFileFilter);

            PropertyChangeListener fileFilterChangeListener = new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent e) {
                    CommonFileFilter ff = (CommonFileFilter) e.getNewValue();

                    if (!e.getPropertyName().equals(JFileChooser.FILE_FILTER_CHANGED_PROPERTY))
                        return;

                    if (ff.getSuffix().equalsIgnoreCase("more")) {
                        fileChooser.cancelSelection();
                        Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
                        action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.IMAGE_TYPE, "more");
                        action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.UI_FRAME, uiJPanel);
                        action.actionPerformed(null);
                        ((JFileChooser) e.getSource()).removePropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, this);
                    }
                }
            };

            fileChooser.addPropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, fileFilterChangeListener);

            for (; ;) {
                if (fileChooser.showDialog(uiJPanel, null) == JFileChooser.APPROVE_OPTION) {
                    imageFile = fileChooser.getSelectedFile();
                    CommonFileFilter currentFilter = (CommonFileFilter) fileChooser.getFileFilter();

                    if (!currentFilter.getSuffix().equalsIgnoreCase(CommonFileFilter.getSuffix(imageFile))) {
                        String path = imageFile.getPath() + "." + currentFilter.getSuffix();
                        imageFile = new File(path);
                    }

                    if (imageFile.exists()) {
                        int result_tmp = JOptionPane.showConfirmDialog(uiJPanel, "�ļ� " + imageFile.getPath() + " �Ѿ����ڣ��Ƿ񸲸Ǹ��ļ���", "ȷ�ϴ���", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);

                        if (result_tmp == JOptionPane.YES_OPTION) {
                            break;
                        } else {
                            continue;
                        }
                    }

                    break;
                } else {
                    break;
                }
            }

            fileChooser.removePropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, fileFilterChangeListener);

            CommonFileFilter selectedFilter = (CommonFileFilter) fileChooser.getFileFilter();

            fileChooser.removeChoosableFileFilter(moreFileFilter);
            fileChooser.removeChoosableFileFilter(svgFileFilter);
            fileChooser.removeChoosableFileFilter(gifFileFilter);

            for (int i = 0; i < oldFilter.length; i++) {
                fileChooser.addChoosableFileFilter(oldFilter[i]);
            }
            fileChooser.setSelectedFile(null);
            //end: get the image file's path from user

            //begin:
            if (imageFile == null)
                return;

            if (!imageFile.exists()) {
                try {
                    imageFile.createNewFile();
                } catch (IOException ioe) {
                    JOptionPane.showMessageDialog(uiJPanel, "�������ļ�ʧ��,����洢�豸�Ƿ�������", "���洰��", JOptionPane.ERROR_MESSAGE);
                    return;
                }
            }
            //end:

            Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
            action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.FILE, imageFile);
            action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.IMAGE_TYPE, selectedFilter.getSuffix());
            action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.UI_FRAME, uiJPanel);
            action.actionPerformed(null);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.