亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fileviewimpl.java

?? Java資源管理器
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
		 * 窗口布局,左邊是Tree右邊是Table
		 */
		JPanel southBtnPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
		southBtnPanel.setBorder(new TitledBorder(""));
		southBtnPanel.add(addFolderBtn);
		southBtnPanel.add(addFileBtn);
		southBtnPanel.add(deleteBtn);
		southBtnPanel.add(exitBtn);
		this.getContentPane().add(southBtnPanel,BorderLayout.SOUTH);
		
		JPanel leftPanel = new JPanel(new BorderLayout());
		leftPanel.setBorder(BorderFactory.createTitledBorder("Folder Tree"));
		JPanel rightPanel = new JPanel(new BorderLayout());
		rightPanel.setBorder(new TitledBorder("File Resorceses"));
		JPanel upBtnPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
		upBtnPanel.add(upBtn);
		upBtnPanel.add(addressLabel);
		JPanel rightTopTextFieldPanel = new JPanel(new BorderLayout());
		rightTopTextFieldPanel.setBorder(new TitledBorder(""));
		rightTopTextFieldPanel.add(upBtnPanel,BorderLayout.WEST);
		rightTopTextFieldPanel.add(addressTextField);
		leftPanel.add(new JScrollPane(tree));
		JScrollPane rightScrollPane = new JScrollPane(table);
		rightScrollPane.setBorder(new TitledBorder("File Detail"));
		
		rightPanel.add(rightTopTextFieldPanel,BorderLayout.NORTH);
		rightPanel.add(rightScrollPane);
		
        JSplitPane jsp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,leftPanel,rightPanel);
        jsp.setDividerSize(3);
        jsp.setDividerLocation(200);
        this.getContentPane().add(jsp);

        tree.addTreeSelectionListener(new TreeSelectionProcesser());
        tree.addTreeWillExpandListener(new TreeWillExpandProcessor());       
        table.addMouseListener(new mouseClickedProcessor()); 
        tree.addMouseListener(new MouseAdapter(){
            public void mouseClicked(MouseEvent e){
                if(e.getButton() == e.BUTTON3)
                    popMenu.show(tree,e.getX(),e.getY());
            }
        });
        addFolderBtn.addActionListener(this);
        addFolderMenu.addActionListener(this);
        addFileBtn.addActionListener(this);
        addFileMenu.addActionListener(this);
        deleteBtn.addActionListener(this);
        deleteMenu.addActionListener(this);
        exitBtn.addActionListener(this);
        upBtn.addActionListener(this);
        this.setSize(700,450);
        this.setLocationRelativeTo(this);
        this.setVisible(true);
    }
    
    /**
     * Append nodes to the tree 
     * @param node,parent node that will appended other nodes
     * @param vct,nodes file sets that you want to append
     */
    public void appendNodes(DefaultMutableTreeNode node,Collection vct){        
        Vector newVct = new Vector();
        if(vct != null){
            newVct = (Vector)vct;
            node.removeAllChildren();
        }
        else{
            node.removeAllChildren();
            return;
        }
        for(int i=0;i<vct.size();i++){
            File file = (File)newVct.get(i);
            TNode tnode = new TNode(file);
            tnode.add(new DefaultMutableTreeNode(""));
            node.add(tnode);
        }
    }
    
    /**
     * Rsize the table columnWidth
     */
    public void setColumnWidth(int pColumn, int pWidth){
        TableColumnModel colModel = table.getColumnModel();
        colModel.getColumn(pColumn).setPreferredWidth(pWidth);
    }
    
    public void actionPerformed(ActionEvent e){
        if(e.getSource() == upBtn){
            try{
                curPath = curPath.getParentPath();
                if(curPath != null){                    
	        		tree.setSelectionPath(curPath); 
                }
            }
            catch(Exception ee){
	            ee.printStackTrace();
            }
        }
        else if(e.getSource() == addFolderBtn || e.getSource() == addFolderMenu){
            try{
	            String buf = JOptionPane.showInputDialog(this,"Pls Input FileName: ","new Folder");
	            createFile("d",buf);
            }
            catch(Exception ee){
                ee.printStackTrace();
            }
        }
        else if(e.getSource() == addFileBtn || e.getSource() == addFileMenu){
            try{
	            String buf = JOptionPane.showInputDialog(this,"Pls Input FileName: ","new File");
	            createFile("f",buf);
            }
            catch(Exception ee){
                ee.printStackTrace();;
            }
        }
        else if(e.getSource() == deleteBtn || e.getSource() == deleteMenu){ 
                deleteFile();
        }
        else if(e.getSource() == exitBtn){
            System.exit(0);
        }
    }
    
    /**
     * Get all root nodes with the system root files
     */
    public Collection handleGetRootNodes() throws Exception{
        return model.handleGetRootNodes();
    }
    
    /**
     * Get all root files of system
     */
    public Collection handleGetRootFiles() throws Exception {
        // TODO Auto-generated method stub
        return model.handleGetRootFiles();
    }

    /**
     * This method invoke by controller,return a collection sets of the file with you supplied file
     * @param file,this is you supplied file that you want to get all files under it
     */
    public Collection handleGetAll(File file) throws Exception {
        // TODO Auto-generated method stub
        return model.handleGetAll(file);
    }

    /**
     * This method invoke by controller,return a collection sets of the directories with you supplied file
     * @param file,this is you supplied file that you want to get the directories under it
     */
    public Collection handleGetAllDirectories(File file) throws Exception {
        // TODO Auto-generated method stub
        return model.handleGetAllDirectories(file);
    }

    /**
     * This method invoke by model when file deleted
     * the end refresh the table and tree
     */
    public void fireDeleteFile() throws Exception {
        // TODO Auto-generated method stub
        try{
            if(isTable){
                refreshNode();
            }
            else{                    
                curPath = curPath.getParentPath();
                tree.setSelectionPath(curPath);
                refreshNode();
            }                 
        }
        catch(Exception ee){
            JOptionPane.showMessageDialog(this,"Delete failure,folder not empty or file protected!");
            ee.printStackTrace();
        }
    }  
    
    /**
     * This method invoke by model when a new file created,the "file" is the new file created,
     * the end refresh the table and tree 
     */
    public void fireCreateFile(File file) throws Exception {
        // TODO Auto-generated method stub
        refreshNode();
        if(!tree.isExpanded(curPath))
            tree.expandPath(curPath);
    }
    
    /* (non-Javadoc)
     * @see FileView#fireModifyFile(java.io.File)
     */
    public void fireModifyFileName(File file) throws Exception {
        // TODO Auto-generated method stub

    }    
    
    /**
     * Create a new file or folder
     * @param f this is the file type, "f" to create a file,"d" to create a folder
     * @param file
     */
    public void createFile(String f,String file){
        try{
	        if(file != null && f.equals("f")){
                file = file.trim();
                String newFile = "";
                if(currentFile.isDirectory())
                    newFile = currentFile.getAbsolutePath()+"\\"+file;
	            else
	                newFile = currentNode.getFile().getAbsolutePath()+"\\"+file;
                control.createFile("f",newFile);
	        }
	        else if(file != null && f.equals("d")){
	            file = file.trim();
                String newFile = "";
                if(currentFile.isDirectory())
                    newFile = currentFile.getAbsolutePath()+"\\"+file;
	            else
	                newFile = currentNode.getFile().getAbsolutePath()+"\\"+file;
                control.createFile("d",newFile);
	        }
        }
        catch(Exception e){
            e.printStackTrace();
        }
    }
    
    /**
     * Deleted the all files that you selected,but the file can not be deleted
     * that contain the another file under or sub-folder
     */
    public void deleteFile(){
        try{
            if(isTable){
                int[] indeics = table.getSelectedRows();
                if(indeics != null && indeics.length>0){
	                File[] buf = new File[indeics.length];
	                for(int i=0;i<indeics.length;i++){
	                    buf[i] = tableModel.getFile(indeics[i]);
	                }
	                control.deleteFile(buf); 
                }
            }
            else{
                File[] buf = {currentNode.getFile()};
                control.deleteFile(buf);
            }
        }
        catch(Exception ee){
            JOptionPane.showMessageDialog(this,"Delete failure,folder not empty or file protected!");
            ee.printStackTrace();
        }
    }
    
    /**
     * Refresh the Nodes and table when deleted or created a file 
     */
    public void refreshNode(){
        try{
	        Collection files = control.handleGetAll(currentNode.getFile());
	        tableModel.addAllFiles(files);
	        appendNodes(currentNode,control.handleGetAllDirectories(currentNode.getFile()));
	        treeModel.nodeStructureChanged(currentNode);
        }
        catch(Exception e){
            e.printStackTrace();
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲女性喷水在线观看一区| 国产午夜亚洲精品午夜鲁丝片| 久久美女艺术照精彩视频福利播放 | 蜜芽一区二区三区| www.成人在线| 一本色道亚洲精品aⅴ| 日韩女优毛片在线| 婷婷亚洲久悠悠色悠在线播放| 成人av在线网站| 国产欧美精品一区二区三区四区| 久久久蜜桃精品| 色综合久久久久综合| 亚洲国产精品一区二区尤物区| 欧美视频在线播放| 中文字幕巨乱亚洲| 麻豆中文一区二区| 3d成人动漫网站| 午夜久久久久久| 色综合久久精品| 亚洲精品中文在线影院| 91麻豆免费看| 亚洲一区二区精品3399| 91麻豆蜜桃一区二区三区| 国产精品久久久久久一区二区三区| 国产sm精品调教视频网站| 久久综合999| 国产精品一区二区在线观看不卡| 精品少妇一区二区三区在线播放| 老司机精品视频在线| 久久影院午夜论| 成人性色生活片| 亚洲一区二区在线免费观看视频| 日本精品一级二级| 国产精品久久毛片av大全日韩| 久久精品国产秦先生| av高清不卡在线| 国产欧美日韩亚州综合 | 日本一区二区三区在线不卡 | 日韩精品一区二区三区三区免费| 一级精品视频在线观看宜春院| 91在线播放网址| 日韩伦理电影网| 91丝袜美腿高跟国产极品老师| 国产精品拍天天在线| 国产成人精品aa毛片| 国产日韩欧美麻豆| 国产a久久麻豆| 国产精品成人一区二区艾草 | 国产精品久线观看视频| 大胆亚洲人体视频| 日韩国产在线观看| 亚洲精品免费在线| 亚洲成av人片一区二区| 欧美日韩国产区一| 蜜臀久久99精品久久久画质超高清 | 蜜臀久久99精品久久久久久9| 欧美一区二区美女| 国产在线精品不卡| 国产欧美日韩一区二区三区在线观看| 国产成人亚洲综合a∨猫咪| 国产精品视频yy9299一区| 99久久伊人久久99| 夜夜精品视频一区二区 | 白白色 亚洲乱淫| 亚洲图片激情小说| 欧美嫩在线观看| 美国欧美日韩国产在线播放| 久久久久久**毛片大全| aaa欧美日韩| 亚洲午夜精品一区二区三区他趣| 欧美日韩国产中文| 久久 天天综合| 国产人成一区二区三区影院| 99久久99久久精品国产片果冻| 亚洲已满18点击进入久久| 91麻豆精品国产自产在线| 国精产品一区一区三区mba视频| 中文子幕无线码一区tr| 欧美综合欧美视频| 蜜桃视频在线观看一区二区| 欧美激情中文不卡| 欧美日精品一区视频| 久久99在线观看| 日韩理论片一区二区| 欧美一区二视频| 成人免费av资源| 调教+趴+乳夹+国产+精品| 国产欧美一区二区三区沐欲| 欧美性受极品xxxx喷水| 黑人精品欧美一区二区蜜桃| 亚洲精品免费播放| 精品国产伦一区二区三区免费| 成人精品电影在线观看| 日韩福利电影在线| 国产精品成人免费在线| 69久久99精品久久久久婷婷 | 天堂一区二区在线| 亚洲国产精华液网站w| 欧美日韩国产bt| 成人午夜精品在线| 日韩影院免费视频| 亚洲久草在线视频| 26uuu欧美| 欧美日韩精品一区二区| 盗摄精品av一区二区三区| 日日嗨av一区二区三区四区| 成人精品亚洲人成在线| 免费一级欧美片在线观看| 亚洲欧美日本韩国| 国产午夜亚洲精品午夜鲁丝片| 欧美二区在线观看| 97久久精品人人做人人爽50路| 日本不卡一二三区黄网| 亚洲免费观看高清完整版在线观看| 2021国产精品久久精品 | 国产精品18久久久久| 天堂va蜜桃一区二区三区漫画版| 国产精品久久夜| 精品日韩在线观看| 欧美伦理影视网| 色欧美88888久久久久久影院| 极品少妇xxxx精品少妇偷拍| 视频一区视频二区中文| 亚洲人成影院在线观看| 国产精品午夜久久| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美日韩www| 欧美最猛性xxxxx直播| 99re热这里只有精品视频| 国产99一区视频免费| 国产最新精品免费| 麻豆久久一区二区| 日日摸夜夜添夜夜添精品视频| 亚洲精品老司机| 日韩理论片网站| 国产精品看片你懂得| 国产欧美久久久精品影院| 精品福利在线导航| 欧美成人女星排名| 欧美成人性战久久| 欧美成人精品福利| 欧美一区二区三区四区五区| 7777精品伊人久久久大香线蕉超级流畅| 欧美在线视频不卡| 欧美性色黄大片| 欧美视频第二页| 欧美日韩国产a| 欧美精品第一页| 欧美肥妇毛茸茸| 日韩一区二区三区在线观看| 日韩一区二区三区在线视频| 91精品婷婷国产综合久久 | 成人晚上爱看视频| 不卡的电影网站| 99国产精品国产精品毛片| 99久久精品久久久久久清纯| www.久久久久久久久| 不卡的电视剧免费网站有什么| jizzjizzjizz欧美| 91美女福利视频| 99国产欧美久久久精品| 91丨九色丨尤物| 色哟哟在线观看一区二区三区| 色综合久久久久综合体| 欧美做爰猛烈大尺度电影无法无天| 欧美在线免费观看视频| 欧美精品一级二级| 日韩午夜精品视频| 精品国一区二区三区| 久久久亚洲精华液精华液精华液 | 在线精品视频一区二区三四| 欧美在线一二三| 91精品欧美久久久久久动漫| 日韩精品综合一本久道在线视频| 精品少妇一区二区三区| 国产欧美精品一区二区色综合朱莉 | 波多野结衣在线一区| 91在线一区二区三区| 欧美视频一区二区在线观看| 91精品一区二区三区久久久久久| 精品国内片67194| 国产精品久久久久影院色老大| 玉米视频成人免费看| 视频在线观看一区| 国产一区视频在线看| eeuss鲁片一区二区三区 | 国产a级毛片一区| 在线观看视频91| 欧美一级黄色片| 国产亚洲一二三区| 一区二区三区丝袜| 九一久久久久久| 成人免费视频网站在线观看| 欧美亚洲日本国产| 欧美成人vr18sexvr| 国产精品国产三级国产aⅴ入口 | 久久婷婷成人综合色| 亚洲欧美综合网| 日韩不卡一二三区| 国产91高潮流白浆在线麻豆|