panelmanager.java

来自「JavaExplorer是一个独立于平台的浏览器」· Java 代码 · 共 207 行

JAVA
207
字号
/**  * File and FTP Explorer  * Copyright 2002  * BOESCH Vincent  *  * This program is free software; you can redistribute it and/or  * modify it under the terms of the GNU General Public License  * as published by the Free Software Foundation; either version 2  * of the License, or (at your option) any later version.  *  * This program is distributed in the hope that it will be useful,  * but WITHOUT ANY WARRANTY; without even the implied warranty of  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  * GNU General Public License for more details.  *  * You should have received a copy of the GNU General Public License  * along with this program; if not, write to the Free Software  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  */package javaexplorer.manager;import java.awt.*;import java.awt.event.*;import java.io.*;import javaexplorer.Launcher;import javaexplorer.gui.disk.*;import javaexplorer.gui.dnd.*;import javaexplorer.gui.internal.*;import javaexplorer.gui.menu.*;import javaexplorer.gui.renderer.XFileListCellRenderer;import javaexplorer.gui.viewer.*;import javaexplorer.model.*;import javaexplorer.ressource.*;import javaexplorer.util.*;import javaexplorer.util.laf.LookAndFeelChooser;import javax.swing.*;import javax.swing.border.*;import javax.swing.event.*;public class PanelManager extends JPanel implements MDIModel{    private int _compteur = 1;    private DefaultListModel _dlmCop = new DefaultListModel();    private DefaultListModel _dlmSel = new DefaultListModel();    private DNDPopup _dndp = null;    private ViewerPopup _imgp = null;    private XFilePopup _xfp = null;    private JDesktopPane _jdp = new JDesktopPane();    private CopyInfoFrame _copyManager = null;    private JInfoFrame _jifInfo = null;    private JInternalModelFrame _jifModel = null;    private JFtpPoolInfoFrame _jifFtpPoolInfo = null;    private ExplorerInternalFrameListener _eifListener = new ExplorerInternalFrameListener();    //Quelques constantes utiles...    //Barre de menu    //Statut    private JLabel _jlbStatusDir = new JLabel(TextRessource.MAINFRAME_GLOBAL_CURRENT_DIR +            " : ");    private XList _jlstCopy = new XList();    private XList _jlstSelection = new XList();    private JPanel _jpnStatus = new JPanel();    private JScrollPane _jspCopy = new JScrollPane();    private JScrollPane _jspSelection = new JScrollPane();    private Launcher _launcher = null;    private JPanel _mainPanel = new JPanel();    private boolean _maximizeByDefault = true;    private TitledBorder _tdbCopy;    private TitledBorder _tdbSelection;    private GridLayout gridLayout1 = new GridLayout();    private JSplitPane jSplitPane1 = new JSplitPane();    private JSplitPane jSplitPane2 = new JSplitPane();    /**     *  Class principale de l'application.     *  C'est la fen阾re MDI M鑢e     */    public PanelManager() {        super();    }    public CopyManager getCopyManager(){    	checkCopyManager();    	return _copyManager;    }        private void checkCopyManager(){    	if (_copyManager == null) {    		_copyManager = new CopyInfoFrame(_launcher);    		addFrame(_copyManager);    	}    	    }        public void showCopyInfo() {    	checkCopyManager();    	    	try {    		_copyManager.setIcon(false);    		_copyManager.setVisible(true);    		_copyManager.moveToFront();    	} catch (Exception e) {    		javaexplorer.util.Log.addError(e);    	}    }        /**     *  Adds a feature to the Frame attribute     *  of the PanelManager object     *     *@param  jif  The feature to be added     *      to the Frame attribute     */    public void addFrame(JInternalFrame jif) {        _jdp.add(jif);    }            /**     *  Affichage d'un message d'information     *     *@param  message  The feature to be added     *      to the Info attribute     */   public void addInfo(String message) {    	addMessage(message, JInfoFrame.INFO);    }   /**    *  Affichage d'un message d'information    *    *@param  message  The feature to be added    *      to the Info attribute    */  public void addDebug(String message) {   	addMessage(message, JInfoFrame.DEBUG);   }  /**   *  Affichage d'un message d'information   *   *@param  message  The feature to be added   *      to the Info attribute   */ public void addError(String message) {  	addMessage(message, JInfoFrame.ERROR);  	//Affichage syst閙atique lors d'une erreur    try {    	_jifInfo.setIcon(false);        _jifInfo.setVisible(true);        _jifInfo.moveToFront();    } catch (Exception e) {        javaexplorer.util.Log.addError(e);    }  	  }    /**     *  Affichage d'un message a un certzain niveau     *     *@param  message  The feature to be added     *      to the Info attribute     * @param level le niveau de trace voulu (INFO, DEBUG, ERROR)     */    private void addMessage(String message, int level) {        if (_jifInfo == null) {            _jifInfo = new JInfoFrame(false);            _jifInfo.setTitle(TextRessource.MAINFRAME_GLOBAL_INFO);            addFrame(_jifInfo);        }        try {            if (_jifInfo.needsToDisplay()) {                _jifInfo.setIcon(false);                _jifInfo.setVisible(true);                _jifInfo.moveToFront();            }        } catch (Exception e) {            javaexplorer.util.Log.addError(e);        }        // focusFrame( _jifInfo );        _jifInfo.addMessage(message, level);    }    /**     *  Changement du L&F pour l'application     *  (Menu Apparence)     *     *@param  look  Le look and feel voulu     */    public void changeLookAndFeel(String look) {        // If a valid look was specified        try {            if (look != null) {                // change the look and feel                UIManager.setLookAndFeel(look);            }            //Met 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?