当前位置: 首页>>代码示例>>Java>>正文


Java JFileChooser.addPropertyChangeListener方法代码示例

本文整理汇总了Java中javax.swing.JFileChooser.addPropertyChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java JFileChooser.addPropertyChangeListener方法的具体用法?Java JFileChooser.addPropertyChangeListener怎么用?Java JFileChooser.addPropertyChangeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JFileChooser的用法示例。


在下文中一共展示了JFileChooser.addPropertyChangeListener方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ProjectChooserAccessory

import javax.swing.JFileChooser; //导入方法依赖的package包/类
/** Creates new form ProjectChooserAccessory */
public ProjectChooserAccessory(JFileChooser chooser, boolean isOpenSubprojects) {
    initComponents();

    modelUpdater = new ModelUpdater();
    //#98080
    RP = new RequestProcessor(ModelUpdater.class.getName(), 1);
    RP2 = new RequestProcessor(ModelUpdater.class.getName(), 1);
    updateSubprojectsTask = RP.create(modelUpdater);
    updateSubprojectsTask.setPriority( Thread.MIN_PRIORITY );

    // Listen on the subproject checkbox to change the option accordingly
    jCheckBoxSubprojects.setSelected( isOpenSubprojects );
    jCheckBoxSubprojects.addActionListener( this );

    // Listen on the chooser to update the Accessory
    chooser.addPropertyChangeListener( this );

    // Set default list model for the subprojects list
    jListSubprojects.setModel( new DefaultListModel() );

    // Disable the Accessory. JFileChooser does not select a file
    // by default
    setAccessoryEnablement( false, 0 );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:ProjectChooserAccessory.java

示例2: doLoadCalibration

import javax.swing.JFileChooser; //导入方法依赖的package包/类
synchronized public void doLoadCalibration() {
    final JFileChooser j = new JFileChooser();
    j.setCurrentDirectory(new File(dirPath));
    j.setApproveButtonText("Select folder");
    j.setDialogTitle("Select a folder that has XML files storing calibration");
    j.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // let user specify a base filename
    j.setApproveButtonText("Select folder");
    j.setApproveButtonToolTipText("Only enabled for a folder that has cameraMatrix.xml and distortionCoefs.xml");
    setButtonState(j, j.getApproveButtonText(), calibrationExists(j.getCurrentDirectory().getPath()));
    j.addPropertyChangeListener(JFileChooser.DIRECTORY_CHANGED_PROPERTY, new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent pce) {
            setButtonState(j, j.getApproveButtonText(), calibrationExists(j.getCurrentDirectory().getPath()));
        }
    });
    int ret = j.showOpenDialog(null);
    if (ret != JFileChooser.APPROVE_OPTION) {
        return;
    }
    dirPath = j.getSelectedFile().getPath();
    putString("dirPath", dirPath);

    loadCalibration();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:25,代码来源:SingleCameraCalibration.java

示例3: doLoadCalibration

import javax.swing.JFileChooser; //导入方法依赖的package包/类
synchronized public void doLoadCalibration() {
	final JFileChooser j = new JFileChooser();
	j.setCurrentDirectory(new File(dirPath));
	j.setApproveButtonText("Select folder");
	j.setDialogTitle("Select a folder that has XML files storing calibration");
	j.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); // let user specify a base filename
	j.setApproveButtonText("Select folder");
	j.setApproveButtonToolTipText("Only enabled for a folder that has cameraMatrix.xml and distortionCoefs.xml");
	setButtonState(j, j.getApproveButtonText(), calibrationExists(j.getCurrentDirectory().getPath()));
	j.addPropertyChangeListener(JFileChooser.DIRECTORY_CHANGED_PROPERTY, new PropertyChangeListener() {
		@Override
		public void propertyChange(PropertyChangeEvent pce) {
			setButtonState(j, j.getApproveButtonText(), calibrationExists(j.getCurrentDirectory().getPath()));
		}
	});
	int ret = j.showOpenDialog(null);
	if (ret != JFileChooser.APPROVE_OPTION) {
		return;
	}
	dirPath = j.getSelectedFile().getPath();
	putString("dirPath", dirPath);

	loadCalibration();
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:25,代码来源:SingleOrStereoCameraCalibration.java

示例4: AntArtifactChooser

import javax.swing.JFileChooser; //导入方法依赖的package包/类
/** Creates new form JarArtifactChooser */
public AntArtifactChooser( String[] artifactTypes, JFileChooser chooser ) {
    this.artifactTypes = artifactTypes;
    
    initComponents();
    jListArtifacts.setModel( new DefaultListModel() );
    chooser.addPropertyChangeListener( this );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:AntArtifactChooser.java

示例5: FileDeleter

import javax.swing.JFileChooser; //导入方法依赖的package包/类
/** adds a keyreleased listener on the JFileChooser FilePane inner classes so that user can use Delete key to delete the file
 * that is presently being shown in the preview window
 * @param chooser the chooser
 * @param preview the data file preview
 */
public FileDeleter(JFileChooser chooser, ChipDataFilePreview preview) {
    this.chooser = chooser;
    this.preview = preview;
    chooser.addPropertyChangeListener(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY, this);
    Component comp = addDeleteListener(chooser);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:12,代码来源:MotionViewer.java

示例6: ImagePreview

import javax.swing.JFileChooser; //导入方法依赖的package包/类
public ImagePreview(JFileChooser fc) {
    setPreferredSize(new Dimension(100, 50));
    setBorder(new TitledBorder(BorderFactory.createEtchedBorder(), 
    Local.getString("Preview"), TitledBorder.CENTER, TitledBorder.ABOVE_TOP));
    fc.addPropertyChangeListener(this);
}
 
开发者ID:ser316asu,项目名称:Neukoelln_SER316,代码行数:7,代码来源:ImagePreview.java

示例7: FilePreview

import javax.swing.JFileChooser; //导入方法依赖的package包/类
/**
 * Constructor.
 */
public FilePreview(JFileChooser fc) {
    setPreferredSize(new Dimension(160, 160));
    fc.addPropertyChangeListener(this);
}
 
开发者ID:takun2s,项目名称:smile_1.5.0_java7,代码行数:8,代码来源:FileChooser.java

示例8: sequenceMenuItemActionPerformed

import javax.swing.JFileChooser; //导入方法依赖的package包/类
private void sequenceMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sequenceMenuItemActionPerformed

            if (evt.getActionCommand().equals("start")) {
                float oldScale = chipCanvas.getScale();
                AESequencerInterface aemonseq = (AESequencerInterface) chip.getHardwareInterface();
                try {
                    if ((aemonseq != null) && (aemonseq instanceof AEMonitorSequencerInterface)) {
                        ((AEMonitorSequencerInterface) aemonseq).stopMonitoringSequencing();
                    }
                } catch (HardwareInterfaceException e) {
                    e.printStackTrace();
                }

                JFileChooser fileChooser = new JFileChooser();
                ChipDataFilePreview preview = new ChipDataFilePreview(fileChooser, chip); // from book swing hacks
                fileChooser.addPropertyChangeListener(preview);
                fileChooser.setAccessory(preview);

                String lastFilePath = prefs.get("AEViewer.lastFile", ""); // getString the last folder

                lastFile = new File(lastFilePath);

                DATFileFilter datFileFilter = new DATFileFilter();
                fileChooser.addChoosableFileFilter(datFileFilter);
                fileChooser.setCurrentDirectory(lastFile); // sets the working directory of the chooser
                //            boolean wasPaused=isPaused();
                //        setPaused(true);
                int retValue = fileChooser.showOpenDialog(this);
                if (retValue == JFileChooser.APPROVE_OPTION) {
                    lastFile = fileChooser.getSelectedFile();
                    if (lastFile != null) {
                        recentFiles.addFile(lastFile);
                    }
                    SwingUtilities.invokeLater(new Runnable() {

                        @Override
                        public void run() {
                            sequenceFile(lastFile);
                        }
                    });
                }
                fileChooser = null;
                //     setPaused(false);
                //            chipCanvas.setScale(oldScale);
            } else if (evt.getActionCommand().equals("stop")) {
                setPlayMode(PlayMode.LIVE);
                stopSequencing();
            }
	}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:50,代码来源:AEViewer.java

示例9: openAEInputFileDialog

import javax.swing.JFileChooser; //导入方法依赖的package包/类
/**
     * Called when user asks to open data file file dialog.
     */
    @Override
    public void openAEInputFileDialog() {
//        try{Thread.currentThread().sleep(200);}catch(InterruptedException e){}
        float oldScale = viewer.chipCanvas.getScale();
        fileChooser = new JFileChooser();
//            new TypeAheadSelector(fileChooser);
        //com.sun.java.plaf.windows.WindowsFileChooserUI;
//            fileChooser.addKeyListener(new KeyAdapter() {
//                public void keyTyped(KeyEvent e){
//                    System.out.println("keycode="+e.getKeyCode());
//                }
//            });
//            System.out.println("fileChooser.getUIClassID()="+fileChooser.getUIClassID());
//            KeyListener[] keyListeners=fileChooser.getKeyListeners();
        ChipDataFilePreview preview = new ChipDataFilePreview(fileChooser, viewer.getChip());
        // from book swing hacks
        new FileDeleter(fileChooser, preview);
        fileChooser.addPropertyChangeListener(preview);
        fileChooser.setAccessory(preview);
        String lastFilePath = AEViewer.prefs.get("AEViewer.lastFile", "");
        // get the last folder
        viewer.lastFile = new File(lastFilePath);
//            fileChooser.setFileFilter(datFileFilter);
        IndexFileFilter indexFileFilter = new IndexFileFilter();
        fileChooser.addChoosableFileFilter(indexFileFilter);
        DATFileFilter datFileFilter = new DATFileFilter();
        fileChooser.addChoosableFileFilter(datFileFilter);
        if (lastFilter == null) {
            fileChooser.setFileFilter(datFileFilter);
        } else {
            fileChooser.setFileFilter(lastFilter);
        }
        fileChooser.setCurrentDirectory(viewer.lastFile);
        // sets the working directory of the chooser
//            boolean wasPaused=isPaused();
        setPaused(true);
        try {
            int retValue = fileChooser.showOpenDialog(viewer);
            if (retValue == JFileChooser.APPROVE_OPTION) {
                lastFilter = fileChooser.getFileFilter();
                try {
                    viewer.lastFile = fileChooser.getSelectedFile();
                    if (viewer.lastFile != null) {
                        viewer.recentFiles.addFile(viewer.lastFile);
                    }
                    startPlayback(viewer.lastFile);
                } catch (IOException fnf) {
                    log.warning(fnf.toString());
                }
            } else {
                preview.showFile(null);
            }
        } catch (GLException e) {
            log.warning(e.toString());
            preview.showFile(null);
        }
        fileChooser = null;
//        viewer.chipCanvas.setScale(oldScale);
        // restore persistent scale so that we don't get tiny size on next startup
        setPaused(false);
    }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:65,代码来源:AEPlayer.java

示例10: FilePreviewer

import javax.swing.JFileChooser; //导入方法依赖的package包/类
@SuppressWarnings("LeakingThisInConstructor")
public FilePreviewer(JFileChooser fc) {
    setPreferredSize(new Dimension(100, 50));
    fc.addPropertyChangeListener(this);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:FileChooserDemo.java

示例11: FileDeleter

import javax.swing.JFileChooser; //导入方法依赖的package包/类
/**
 * adds a key-released listener on the JFileChooser FilePane inner
 * classes so that user can use Delete key to delete the file that is
 * presently being shown in the preview window
 *
 * @param chooser the chooser
 * @param preview the data file preview
 */
public FileDeleter(JFileChooser chooser, ChipDataFilePreview preview) {
    super();
    this.chooser = chooser;
    this.preview = preview;
    chooser.addPropertyChangeListener(JFileChooser.SELECTED_FILE_CHANGED_PROPERTY, this);
    Component comp = addDeleteListener(chooser);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:16,代码来源:AEPlayer.java


注:本文中的javax.swing.JFileChooser.addPropertyChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。