yaoyu 3 år sedan
förälder
incheckning
72b7381722
23 ändrade filer med 8248 tillägg och 1 borttagningar
  1. 9 0
      pu/META-INF/thopenapi.upm
  2. 1 0
      pu/pu/.gitignore
  3. 199 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThFileBrowseCreatePane.java
  4. 844 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThFileBrowseGPYPotoDialog.java
  5. 2231 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThFileContentPanel.java
  6. 242 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThFileMoveDialog.java
  7. 607 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThFilePatchAttrDialog.java
  8. 125 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThGaopaiyiAction.java
  9. 295 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThPPTBrosePanel.java
  10. 111 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThPasteAttachAction.java
  11. 38 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThScanAttachAction.java
  12. 267 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThSingleImageBrowsePanel.java
  13. 239 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThSmallImageBrowsePanel.java
  14. 926 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThTakePotoPanel.java
  15. 94 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThUploadAction.java
  16. 74 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThUploadRefAction.java
  17. 213 0
      pu/pu/src/client/nc/pub/filesystem/newui/ThUploadURLAction.java
  18. 1234 0
      pu/pu/src/client/nc/ui/pub/filesystem/ThFileManageUI.java
  19. 140 0
      pu/pu/src/client/nc/ui/pubapp/uif2app/actions/InvoiceUploadAction.java
  20. 1 1
      pu/pu/src/client/nc/ui/pubapp/uif2app/actions/ViewAtacmtsAction.java
  21. 12 0
      pu/pu/src/public/nc/itf/pu/service/IInvoiceOCRMaintain.java
  22. 81 0
      pu/pu/src/public/nc/log/NcLog.java
  23. 265 0
      pu/pu/src/public/nc/vo/pub/filesystem/NCFileVO.java

+ 9 - 0
pu/META-INF/thopenapi.upm

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding='gb2312'?>
+<module name="tbb">
+    <public>
+ 	    <component remote="true" singleton="true" tx="NONE">
+            <interface>nc.itf.pu.service.IInvoiceOCRMaintain</interface>
+            <implementation>nc.impl.pu.service.InvoiceOCRMaintainImpl</implementation>
+        </component>
+    </public>	
+</module>

+ 1 - 0
pu/pu/.gitignore

@@ -0,0 +1 @@
+/classes/

+ 199 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThFileBrowseCreatePane.java

@@ -0,0 +1,199 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.util.ArrayList;
+import java.util.Collection;
+
+import nc.ui.pub.beans.ScaleSlider;
+import nc.vo.pub.filesystem.FileTypeConst;
+import nc.vo.pub.filesystem.NCFileNode;
+import nc.vo.pub.filesystem.NCFileVO;
+/**
+ * 创建各种浏览方式的 panel 及显示数据
+ * @author zhoujja
+ *
+ */
+public class ThFileBrowseCreatePane {
+	/**
+	 * 缩略图显示
+	 * @param parentpanel
+	 */
+	protected static void  createSmallImagePane(ThFileContentPanel parentpanel) {
+		NCFileNode selnode =  parentpanel.selfoldernode;
+		Collection<NCFileVO> ncfilevos  =null ;
+		if(selnode==null||selnode.getFullPath().equalsIgnoreCase(parentpanel.rootDirStr)){
+			ncfilevos = parentpanel.getTreenodefilecacheMap().get("root");
+		}else{
+			ncfilevos = parentpanel.getTreenodefilecacheMap().get(selnode.getFullPath());
+		}
+		ArrayList<NCFileVO> listimagefilevo = new ArrayList<NCFileVO>();
+		//列出图片类型
+		if(ncfilevos!=null)
+		for(NCFileVO fvo:ncfilevos){
+			if(fvo.getFiletype()!=null &&fvo.getFiletype().equals(FileTypeConst.IMAGE)){
+				listimagefilevo.add(fvo);
+			}
+		}
+		parentpanel.refreshStatuBar();
+//		
+		if(listimagefilevo==null||listimagefilevo.size()==0){
+			if(parentpanel.PAGE_STATE==parentpanel.BROWSESMALLICON_STATE){
+				parentpanel.getTablepanel().removeAll();
+				parentpanel.getTablepanel().updateUI();
+			}
+//			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseCreatePane-0000")/*未发现没有图片类型附件!*/);
+			
+			return ;
+		}
+		//新上传的附件,在树的节点中没存主键,从数据库获取主主键,按主键下载到本地
+		FileBroseConst.setFileVOPK(listimagefilevo);
+		
+		parentpanel.getTablepanel().removeAll();
+		parentpanel.getTablepanel().add(new ThSmallImageBrowsePanel(listimagefilevo,parentpanel),BorderLayout.CENTER);
+		
+		parentpanel.getTablepanel().updateUI();
+		parentpanel.getScaleSliderPane().removeAll();
+		parentpanel.getScaleSliderPane().updateUI();
+	}
+	/**
+	 * 列表显示
+	 * @param parentpanel
+	 */
+	protected static void  createListBrowsePane(ThFileContentPanel parentpanel){
+		parentpanel.getTablepanel().removeAll();
+//		
+		NCFileVO[] arr_treevos;
+		if(parentpanel.getPatchInfoTable().getCellEditor()!=null){
+			parentpanel.getPatchInfoTable().getCellEditor().stopCellEditing();
+		}
+		if (parentpanel.selfoldernode==null||parentpanel.selfoldernode.getFullPath().equalsIgnoreCase(parentpanel.rootDirStr)) {
+			if (parentpanel.getTreenodefilecacheMap().get("root") != null) {
+				// 更新表
+				arr_treevos = parentpanel.getTreenodefilecacheMap().get("root").toArray(
+						new NCFileVO[0]);
+				parentpanel.getfiletablemodel().clearTable();
+				parentpanel.getfiletablemodel().addVO(arr_treevos);
+				parentpanel.getfiletablemodel().refreshTable();
+				parentpanel.getPatchInfoTable().repaint();
+				if (parentpanel.getPatchInfoTable().getRowCount() > 0) {
+					parentpanel.getPatchInfoTable().setRowSelectionInterval(0, 0);
+				}
+				
+				// 更新状态栏(几个附件,大小)
+				//refresh statusbar 
+				parentpanel.refreshStatuBar();
+				
+			}else{
+				
+			}
+		}
+		else if (parentpanel.selfoldernode!=null&&parentpanel.getTreenodefilecacheMap().get(parentpanel.selfoldernode.getFullPath()) != null) {
+			arr_treevos = parentpanel.getTreenodefilecacheMap().get(
+					parentpanel.selfoldernode.getFullPath()).toArray(new NCFileVO[0]);
+			parentpanel.getfiletablemodel().clearTable();
+			parentpanel.getfiletablemodel().addVO(arr_treevos);
+			parentpanel.getfiletablemodel().refreshTable();
+			parentpanel.getPatchInfoTable().repaint();
+			if (parentpanel.getPatchInfoTable().getRowCount() > 0) {
+				parentpanel.getPatchInfoTable().setRowSelectionInterval(0, 0);
+			}
+			//refresh statusbar 
+			// 更新状态栏(几个附件,大小)
+			parentpanel.refreshStatuBar();
+			
+		}else{
+			parentpanel.getfiletablemodel().clearTable();
+			// 更新状态栏(几个附件,大小)
+			//refresh statusbar 
+			parentpanel.refreshStatuBar();
+		}
+		
+		parentpanel.getTablepanel().add(parentpanel.getJstablepanel(),BorderLayout.CENTER);
+		parentpanel.getTablepanel().updateUI();
+		
+		parentpanel.getScaleSliderPane().removeAll();
+		parentpanel.getScaleSliderPane().updateUI();
+	}
+	/**
+	 * 单张显示
+	 * @param parentpanel
+	 * @param scaleSlider
+	 */
+	protected static void  createSingleBrosePane(ThFileContentPanel parentpanel,ScaleSlider scaleSlider ){
+		NCFileNode selnode =  parentpanel.selfoldernode;
+		Collection<NCFileVO> ncfilevos  =null ;
+		if(selnode==null||selnode.getFullPath().equalsIgnoreCase(parentpanel.rootDirStr)){
+			ncfilevos = parentpanel.getTreenodefilecacheMap().get("root");
+		}else{
+			ncfilevos = parentpanel.getTreenodefilecacheMap().get(selnode.getFullPath());
+		}
+		ArrayList<NCFileVO> listimagefilevo = new ArrayList<NCFileVO>();
+		//列出图片类型
+		if(ncfilevos!=null)
+		for(NCFileVO fvo:ncfilevos){
+			if(fvo.getFiletype()!=null &&fvo.getFiletype().equals(FileTypeConst.IMAGE)){
+				listimagefilevo.add(fvo);
+			}
+		}
+//		
+		parentpanel.refreshStatuBar();
+		if(listimagefilevo==null||listimagefilevo.size()==0){
+			if(parentpanel.PAGE_STATE==parentpanel.BROWSESINGLEICON_STATE){
+				parentpanel.getTablepanel().removeAll();
+				parentpanel.getTablepanel().updateUI();
+			}
+//			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseCreatePane-0000")/*未发现没有图片类型附件!*/);			
+			return ;
+		}
+		//新上传的附件,在树的节点中没存主键,从数据库获取主主键,按主键下载到本地
+		FileBroseConst.setFileVOPK(listimagefilevo);
+		parentpanel.getScaleSliderPane().removeAll();
+		parentpanel.getScaleSliderPane().add(scaleSlider);
+		parentpanel.getScaleSliderPane().updateUI();
+		parentpanel.getTablepanel().removeAll();
+		parentpanel.getTablepanel().add(new ThSingleImageBrowsePanel(listimagefilevo,parentpanel,scaleSlider));
+		parentpanel.getTablepanel().repaint();
+		parentpanel.getTablepanel().updateUI();
+	}
+	protected static void  createPPTBrowsePane(ThFileContentPanel parentpanel,ScaleSlider scaleSlider ){
+		NCFileNode selnode =  parentpanel.selfoldernode;
+		Collection<NCFileVO> ncfilevos  =null ;
+		if(selnode==null||selnode.getFullPath().equalsIgnoreCase(parentpanel.rootDirStr)){
+			ncfilevos = parentpanel.getTreenodefilecacheMap().get("root");
+		}else{
+			ncfilevos = parentpanel.getTreenodefilecacheMap().get(selnode.getFullPath());
+		}
+		ArrayList<NCFileVO> listimagefilevo = new ArrayList<NCFileVO>();
+		//列出图片类型
+		if(ncfilevos!=null)
+		for(NCFileVO fvo:ncfilevos){
+			if(fvo.getFiletype()!=null &&fvo.getFiletype().equals(FileTypeConst.IMAGE)){
+				listimagefilevo.add(fvo);
+			}
+		}
+//		
+		parentpanel.refreshStatuBar();
+		if(listimagefilevo==null||listimagefilevo.size()==0){
+			if(parentpanel.PAGE_STATE==parentpanel.BROWSEPPTICON_STATE){
+				parentpanel.getTablepanel().removeAll();
+				parentpanel.getTablepanel().updateUI();
+			}
+//			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseCreatePane-0000")/*未发现没有图片类型附件!*/);			
+			return ;
+		}
+		
+		//新上传的附件,在树的节点中没存主键,从数据库获取主主键,按主键下载到本地
+		FileBroseConst.setFileVOPK(listimagefilevo);
+		
+		//动态生成主界面
+		parentpanel.getScaleSliderPane().removeAll();
+		parentpanel.getScaleSliderPane().add(scaleSlider);		
+		parentpanel.getScaleSliderPane().updateUI();
+		parentpanel.getTablepanel().removeAll();
+		parentpanel.getTablepanel().add(new ThPPTBrosePanel(listimagefilevo,parentpanel,scaleSlider));
+		
+		parentpanel.getTablepanel().repaint();
+		parentpanel.getTablepanel().updateUI();		
+
+	}
+}

+ 844 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThFileBrowseGPYPotoDialog.java

@@ -0,0 +1,844 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Enumeration;
+
+import javax.imageio.ImageIO;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.SpringLayout;
+import javax.swing.border.EmptyBorder;
+
+import nc.bs.logging.Logger;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.funcnode.ui.ActionButton;
+import nc.funcnode.ui.FuncletMenuBar;
+import nc.funcnode.ui.action.AbstractNCAction;
+import nc.funcnode.ui.action.INCAction;
+import nc.pub.billcode.ui.ButtonPanel;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.IImageFetch;
+import nc.ui.pub.beans.ImageBrowser;
+import nc.ui.pub.beans.ImageObject;
+import nc.ui.pub.beans.ImagePreviewPanel;
+import nc.ui.pub.beans.ImageSelectionEvent;
+import nc.ui.pub.beans.ImageSelectionListener;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.ScaleSlider;
+import nc.ui.pub.beans.UIButton;
+import nc.ui.pub.beans.UIDialog;
+import nc.ui.pub.beans.UIPanel;
+import nc.ui.pub.filesystem.FileManageServletClient;
+import nc.uitheme.ui.ThemeResourceCenter;
+import nc.vo.pub.filesystem.FileImageProcess;
+import nc.vo.pub.filesystem.NCFileNode;
+
+public class ThFileBrowseGPYPotoDialog extends UIDialog{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private ImageObject   currimageobj =null ;
+	private ThFileContentPanel parentpanel ;
+	ThTakePotoPanel takepotopane ;
+	
+	public ThFileBrowseGPYPotoDialog(ThTakePotoPanel panel,String ptempfolder,ThFileContentPanel ppane,ImageObject imageobject ) {
+		super(panel, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0000")/*浏览*/);
+		takepotopane =panel;
+		tempfolder =ptempfolder;
+		parentpanel =ppane; 
+//		this.imagebrower = browser;
+		this.addWindowListener(new WindowAdapter(){
+			@Override
+			public void windowClosing(WindowEvent e) {
+				File file = new File(tempfolder);
+				File [] arrfile =file.listFiles(new FileFilter() {					
+					@Override
+					public boolean accept(File pathname) {
+						if(pathname.getName().endsWith(".jpg")){
+						return true;
+						}else{
+							return false;
+						}
+					}
+				});
+//				takepotopane.imagebrower.reset(arrfile.length);
+//				takepotopane.imagebrower.refresh();
+//				takepotopane.imagebrower.revalidate();
+				takepotopane.setHasopen(false);
+			}
+		});
+		initUI();
+		
+//		getpreviewPnl().setImage(image);
+		getImagebrower().setSelectionByIcon(imageobject.getIcon());
+	}
+	
+//	private FileContentPanel parentpanel = null;
+	private JDialog pdialog = null;
+	String tempfolder = "";
+	int n = 1;
+	private static ImageIcon menuBarBGIcon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/menu/menu_bg.png");
+	private static ImageIcon menuBarBGFrameIcon = ThemeResourceCenter
+			.getInstance().getImage("themeres/control/menu/menu_bg_frame.png");
+
+	private static ImageIcon leftrotateicon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/rotate_left_normal.png");
+	private static ImageIcon leftrotateovericon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/rotate_left_highligh.png");
+
+	private static ImageIcon rightrotateicon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/rotate_right_normal.png");
+	private static ImageIcon rightrotateovericon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/rotate_right_highligh.png");
+
+	private static ImageIcon takepotoicon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/photos_noamal.png");
+	private static ImageIcon takepotoovericon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/photos_highlight.png");
+
+	private static ImageIcon uploadicon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/upload_noamal.png");
+	private static ImageIcon uploadovericon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/upload_highlight.png");
+	private int leftrotatecount = 0;
+	private int rightrotatecount = 4;
+	private int[] anglearr = { 0, 90, 270, 180 };
+
+	// menubar菜单栏 外层
+	private JPanel menuBarContainer;
+
+	private JPanel bottombtnpanel;
+
+	public JPanel getBottombtnpanel() {
+		if (bottombtnpanel == null) {
+			bottombtnpanel = new JPanel();
+			bottombtnpanel.setBorder(new MyBorder(0, 0, 0, 0));
+			FlowLayout layout = new FlowLayout();
+			layout.setAlignment(FlowLayout.RIGHT);
+			bottombtnpanel.setLayout(layout);
+			bottombtnpanel.add(getbtnexit());
+		}
+		return bottombtnpanel;
+	}
+
+	private UIButton btnexit;
+
+	public UIButton getbtnexit() {
+		if (btnexit == null) {
+			btnexit = new UIButton(NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0001")/*退出*/);
+			btnexit.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					ThFileBrowseGPYPotoDialog.this.closeOK();
+
+				}
+			});
+		}
+		return btnexit;
+	}
+
+	public UIPanel potobtnpanel;
+
+	public UIPanel getPotobtnpanel() {
+		if (potobtnpanel == null) {
+			potobtnpanel = new UIPanel();
+			potobtnpanel.add(getBtnleftturn());
+			potobtnpanel.add(getBtnuploadpoto());
+//			potobtnpanel.add(getBtntakepoto());
+			potobtnpanel.add(getBtnrightturn());
+			
+		}
+		return potobtnpanel;
+	}
+
+	// menubar
+	private FuncletMenuBar bar;
+	// 设置按钮
+//	private ActionButton btnsetting;
+	// 继续拍照按钮
+	private ActionButton btngobackpoto;
+	// 左转90
+	private UIButton btnleftturn;
+	// 右转90
+	private UIButton btnrightturn;
+	// 拍照
+//	private UIButton btntakepoto;
+	// 什么批量上传button??
+	private UIButton btnuploadpoto;
+
+	// 缩率图
+	private ImageBrowser imagebrower;
+	// 牌照区域
+//	private GaoPaiYiPanel gpypanel;
+	// 高拍仪的尺寸属性
+//	private int gpysize;
+	// 分辨率(高拍仪厂商支持的不好)
+//	private int resolution;
+//	private String namerule;
+
+//	private Action settingaction;
+
+//	private class SettingAction extends AbstractNCAction {
+//		public SettingAction() {
+//			putValue(AbstractAction.NAME, "设置");
+//			this.putValue(INCAction.CODE, "setting");
+//			this.putValue(Action.SHORT_DESCRIPTION, "设置");
+//		}
+//		@Override
+//		public void actionPerformed(ActionEvent e) {
+//			GPYSettingDialog dlg = new GPYSettingDialog();
+//			dlg.showModal();
+//
+//		}
+//
+//	}
+
+	public UIButton getBtnuploadpoto() {
+		if (btnuploadpoto == null) {
+			btnuploadpoto = new UIButton();
+			btnuploadpoto.setPreferredSize(new Dimension(25, 25));
+			btnuploadpoto.setIcon(uploadicon);
+			btnuploadpoto.setRolloverIcon(uploadovericon);
+			btnuploadpoto.addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					
+					UploadPotoDialog dlg = new UploadPotoDialog();
+					dlg.showModal();
+					// 
+//					File file = new File(tempfolder);
+//					if(file.exists()){
+//						for(File subfile :file.listFiles()){
+//							if(FileTypeConst.getFileTypeByFileName(subfile.getName()).equalsIgnoreCase(FileTypeConst.IMAGE)){								
+//
+//								String fileName = subfile.getName();
+//								//校验是否同名
+//								if(parentpanel.CheckTheSameFileName((NCFileNode)node, fileName)){
+//									continue ;
+//								}
+//								//检查 附件大小 ,文件超过  参数设置的大小不能上传
+//								if(FileBroseConst.getfilelimit()*1024*1024<subfile.length()){
+//									MessageDialog.showErrorDlg(parentpanel, "文件超过限制", fileName+"大小超过限制不能上传!");
+//									continue ;
+//								}
+//								input = new FileInputStream(subfile);
+//								NCFileNode newNode = FileManageServletClient.uploadFile(dsName, pPath, fileName, input, creator, subfile.length());
+//								if (newNode != null) {
+//									NCFileVO  newfilevo = new NCFileVO();
+////									
+//									parentpanel.nodeToFileVO((NCFileNode)node, newNode);
+//								}
+//							
+//							}
+//						}
+//					}
+				}
+			});
+		}
+		return btnuploadpoto;
+	}
+
+	private class returnAction extends AbstractNCAction {
+		public returnAction() {
+			putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0000")/*返回拍照*/);
+			this.putValue(INCAction.CODE, "returnpoto");
+			this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0000")/*返回拍照*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			//
+			ThFileBrowseGPYPotoDialog.this.close();
+		}
+
+	}
+	private ActionButton btndeletepoto ;
+	private ActionButton getBtndeletepoto() {
+		if (btndeletepoto == null) {
+			btndeletepoto = new ActionButton(new deletePotoAction());
+		}
+		return btndeletepoto;
+	}
+	private class deletePotoAction extends AbstractNCAction {
+		public deletePotoAction() {
+			putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0001")/*删除图片*/);
+			this.putValue(INCAction.CODE, "deletepoto");
+			this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0001")/*删除图片*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			if(currimageobj!=null){
+				try{
+					getImagebrower().deleteImage(currimageobj);
+					takepotopane.getImagebrower().deleteImage(currimageobj);
+					takepotopane.getImageObjectlist().remove(currimageobj);
+					getImagebrower().refresh();
+					String filepath =currimageobj.getImageID();
+					File file = new File(filepath);
+					if(file.exists()){
+						file.delete();
+					}
+					getpreviewPnl().setImage(null);
+					currimageobj=null ;
+				}catch (Exception e1) {
+					Logger.error(e1);
+				}
+			}
+		}
+
+	}
+	private ActionButton getBtngobackpoto() {
+		if (btngobackpoto == null) {
+			btngobackpoto = new ActionButton(new returnAction());
+		}
+		return btngobackpoto;
+	}
+
+	// 旋转
+	public UIButton getBtnleftturn() {
+		if (btnleftturn == null) {
+			btnleftturn = new UIButton();
+			btnleftturn.setPreferredSize(new Dimension(25, 25));
+			btnleftturn.setIcon(leftrotateicon);
+			btnleftturn.setRolloverIcon(leftrotateovericon);
+			btnleftturn.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+//					leftrotatecount = leftrotatecount + 1;
+//					int index = leftrotatecount % 4;
+//					int angle = index * 90;
+//					if(MYUISTATE==TakePotoState){
+//						
+//						int state = 0;
+//						for (int i = 0; i < anglearr.length; i++) {
+//							if (angle == anglearr[i]) {
+//								state = i;
+//							}
+//						}
+//						getGpypanel().SetVideoRotate(state);
+//					}else{
+						BufferedImage image =(BufferedImage) getpreviewPnl().getImage();
+						if(image!=null){
+							try {
+								BufferedImage  bimage =FileImageProcess.rotateImg(image, 270, null);
+								getpreviewPnl().setImage(bimage);
+							} catch (IOException e1) {
+								
+							}
+						}
+//					}
+				}
+			});
+		}
+		return btnleftturn;
+	}
+
+	// 旋转
+	public UIButton getBtnrightturn() {
+		if (btnrightturn == null) {
+			btnrightturn = new UIButton();
+			btnrightturn.setPreferredSize(new Dimension(25, 25));
+			btnrightturn.setIcon(rightrotateicon);
+			btnrightturn.setRolloverIcon(rightrotateovericon);
+			btnrightturn.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+//					rightrotatecount = rightrotatecount - 1;
+//					int index = rightrotatecount % 4;
+//					if(index<0){
+//						index = 4+index ;
+//					}
+//					int angle = index * 90;
+					BufferedImage image =(BufferedImage) getpreviewPnl().getImage();
+					if(image!=null){
+						try {
+							BufferedImage  bimage =FileImageProcess.rotateImg(image, 90, null);
+							getpreviewPnl().setImage(bimage);
+						} catch (IOException e1) {
+							
+						}
+					}
+				}
+			});
+		}
+		return btnrightturn;
+	}
+
+//	public UIButton getBtntakepoto() {
+//		if (btntakepoto == null) {
+//			btntakepoto = new UIButton();
+//			btntakepoto.setPreferredSize(new Dimension(25, 25));
+//			btntakepoto.setIcon(takepotoicon);
+//			btntakepoto.setRolloverIcon(takepotoovericon);
+//			btntakepoto.addActionListener(new ActionListener() {
+//				@Override
+//				public void actionPerformed(ActionEvent e) {
+//					String path;
+//					if (namerule == null || namerule.isEmpty()) {
+//						path = tempfolder + File.separatorChar + (n++) + ".jpg";
+//					} else {
+//						path = tempfolder + File.separatorChar + namerule
+//								+ (n++) + ".jpg";
+//					}
+//
+//					File file = new File(path);
+//
+//					if (file.exists()) {
+//						file.delete();
+//					}
+//					// else{
+//					// file.mkdirs();
+//					// }
+//					
+//					
+//					getGpypanel().QuickScan(path);
+//					// 刷新 imagebrowser
+//					BufferedImage image=null;
+//					BufferedImage samallimage=null;
+//					try {
+//						image = ImageIO.read(file);
+//						samallimage =FileCompression.doCompressImage(image, 96.0, 96.0);
+//					} catch (IOException e1) {
+//						Logger.error(e1);
+//					}
+//					
+//					ImageObject imageobj = new ImageObject(path, new ImageIcon(samallimage));
+//					getImagebrower().addNewImage(imageobj);
+////					
+//
+//				}
+//			});
+//		}
+//		return btntakepoto;
+//	}
+
+//	private List<File> listfile = new ArrayList<File>();
+//
+//	public List<File> getfilelist() {
+//		listfile.clear();
+//		File file = new File(tempfolder);
+//		if (file.exists()) {
+//			File[] arrfiles = file.listFiles();
+//			// 情况1:没文件,返回空
+//			if (arrfiles == null) {
+//				return null;
+//			}
+//			for (File f : arrfiles) {
+//				if (f.isFile()
+//						&& FileTypeConst.getFileTypeByFileName(f.getName())
+//								.equals(FileTypeConst.IMAGE)) {
+//					listfile.add(f);
+//				}
+//			}
+//			Collections.sort(listfile ,new FileComparator());
+//		}
+//		return listfile;
+//	}
+//	private class  FileComparator implements Comparator{
+//
+//		@Override
+//		public int compare(Object o1, Object o2) {
+//			File f1 =(File)o1;
+//			File f2 =(File)o2;
+//			return Long.valueOf(f2.lastModified()).compareTo(Long.valueOf(f1.lastModified()));
+//			
+//		}
+//		
+//	}
+	public ImageBrowser getImagebrower() {
+		if (imagebrower == null) {
+			imagebrower = new ImageBrowser(ImageBrowser.VERTICAL, takepotopane.getImageObjectlist()
+					.size(), new PotoImageFetch());
+			imagebrower.addChangeListener(new ImageSelectionListener(){
+				@Override
+				public void valueChanged(ImageSelectionEvent e) {	
+					if(e.getImageObject()!=null){
+						currimageobj = e.getImageObject();
+						String filepath =e.getImageObject().getImageID();
+						File file = new File(filepath);
+						try {
+							BufferedImage image = ImageIO.read(file);
+							getpreviewPnl().setImage(image);
+							getpreviewPnl().updateUI();
+						} catch (IOException e1) {
+							Logger.error(e1);
+						}
+						
+					}
+				}
+			});
+		}
+		return imagebrower;
+	}
+	private ImagePreviewPanel previewPnl;
+
+	private ImagePreviewPanel getpreviewPnl() {
+		if (previewPnl == null) {
+			previewPnl = new ImagePreviewPanel(new ScaleSlider());
+		}
+		return previewPnl;
+	}
+	private class PotoImageFetch implements IImageFetch {
+		int pagenum = 5;
+
+		@Override
+		public ImageObject[] getImage(int page) {
+
+			// 情况2: 没有图片类型文件 返回空
+			if (takepotopane.getImageObjectlist().size() == 0) {
+				return null;
+			}
+			int startindext = (page - 1) * pagenum;
+			int end = page * pagenum - 1;
+
+			if (end > (takepotopane.getImageObjectlist().size() - 1)) {
+				end = takepotopane.getImageObjectlist().size() - 1;
+			}
+			ImageObject[] rtnimgObj = new ImageObject[end - startindext + 1];
+		
+			// 
+			for (int i = startindext; i <= end; i++) {
+
+				rtnimgObj[i-startindext] = takepotopane.getImageObjectlist().get(takepotopane.getImageObjectlist().size()-1-i);
+			}
+			return rtnimgObj;
+		}
+	}
+
+	// 中间的图和右边条pane
+	private UIPanel centerpanel;
+
+	public UIPanel getCenterpanel() {
+		if (centerpanel == null) {
+			centerpanel = new UIPanel();
+			centerpanel.setLayout(new BorderLayout());
+			centerpanel.add(getGpyandimagepanel(), BorderLayout.CENTER);
+			centerpanel.add(getImagebrower(), BorderLayout.EAST);
+		}
+		return centerpanel;
+	}
+
+	// 包装高拍仪或者imagepreview的pane
+	private JPanel gpyandimagepanel;
+
+	// 高拍仪或者图片浏览,外套的panel
+	public JPanel getGpyandimagepanel() {
+		if (gpyandimagepanel == null) {
+			gpyandimagepanel = new JPanel();
+			gpyandimagepanel.setLayout(new BorderLayout());
+			gpyandimagepanel.add(getGpyborderpanel(), BorderLayout.CENTER);
+			gpyandimagepanel.add(getPotobtnpanel(), BorderLayout.SOUTH);
+		}
+		return gpyandimagepanel;
+	}
+
+	private JPanel gpyborderpanel;
+
+	public JPanel getGpyborderpanel() {
+		if (gpyborderpanel == null) {
+			gpyborderpanel = new UIPanel();
+			gpyborderpanel.setBorder(new EmptyBorder(20, 20, 20, 20));
+			gpyborderpanel.setLayout(new BorderLayout());
+			gpyborderpanel.add(getpreviewPnl());
+		}
+		return gpyborderpanel;
+	}
+
+//	public GaoPaiYiPanel getGpypanel() {
+//		if (gpypanel == null) {
+//			gpypanel = new GaoPaiYiPanel();
+//
+//		}
+//		return gpypanel;
+//	}
+
+	JPanel getMenuBarContainer() {
+		if (menuBarContainer == null) {
+			menuBarContainer = new JPanel() {
+
+				private static final long serialVersionUID = 7130908951757832647L;
+
+				@Override
+				protected void paintComponent(Graphics g) {
+					super.paintComponent(g);
+					Dimension size = getSize();
+					if (menuBarBGIcon != null && menuBarBGFrameIcon != null) {
+						int frameW = menuBarBGFrameIcon.getIconWidth();
+						g.drawImage(menuBarBGIcon.getImage(), frameW, 0,
+								size.width - 2 * frameW, size.height, this);
+						menuBarBGFrameIcon.paintIcon(this, g, 0, 0);
+						menuBarBGFrameIcon.paintIcon(this, g, size.width
+								- frameW, 0);
+					}
+				}
+
+			};
+			menuBarContainer.setOpaque(false);
+			menuBarContainer.setBorder(BorderFactory.createEmptyBorder(6, 6, 6,
+					6));
+			menuBarContainer.setLayout(new BorderLayout());
+			menuBarContainer.add(getBar(), BorderLayout.CENTER);
+
+			getBar().setOpaque(false);
+		}
+		return menuBarContainer;
+	}
+
+	public FuncletMenuBar getBar() {
+		if (bar == null) {
+			bar = new FuncletMenuBar();
+			bar.setPreferredSize(new Dimension(0, 30));
+			bar.addMenuComp(getBtngobackpoto());
+			bar.addMenuComp(getBtndeletepoto());
+
+			bar.setOpaque(false);
+
+		}
+		return bar;
+	}
+
+	
+
+	private void initUI() {
+		setLayout(new BorderLayout());
+		// add(comp,BorderLayout.CENTER);
+		add(getMenuBarContainer(), BorderLayout.NORTH);
+		add(getCenterpanel(), BorderLayout.CENTER);
+		add(getBottombtnpanel(), BorderLayout.SOUTH);
+
+	}
+
+	/**
+	 * 高拍仪设置 dlg
+	 * 
+	 * @author zhoujja
+	 * 
+	 */
+	
+
+	
+	private class UploadPotoDialog extends UIDialog{
+		public UploadPotoDialog(){
+			initUI ();
+		}
+		private void initUI(){
+			setSize(450, 200);
+			setLayout(new BorderLayout());
+			this.add(getMainpanel());
+			
+		}
+		 private JPanel mainpanel;
+			public JPanel getMainpanel(){
+				if(mainpanel== null){
+					mainpanel = new JPanel();
+					SpringLayout layout = new SpringLayout();
+					mainpanel.add(getLbluploadfolder());
+					mainpanel.add(getComboxfolder());
+					mainpanel.add(getlblFilename());
+					mainpanel.add(getTxtfilename());
+					mainpanel.add(getBottombtnPane());
+					mainpanel.setLayout(layout);
+					
+					layout.putConstraint(SpringLayout.NORTH, getLbluploadfolder(), 35,SpringLayout.NORTH , mainpanel);
+					layout.putConstraint(SpringLayout.EAST, getLbluploadfolder(), -10,SpringLayout.WEST , getComboxfolder());
+//					
+					
+					layout.putConstraint(SpringLayout.WEST, getComboxfolder(), 100,SpringLayout.WEST , mainpanel);
+					layout.putConstraint(SpringLayout.EAST, getComboxfolder(), -35,SpringLayout.EAST , mainpanel);
+					layout.putConstraint(SpringLayout.NORTH, getComboxfolder(), 35,SpringLayout.NORTH , mainpanel);			
+					
+					layout.putConstraint(SpringLayout.NORTH, getlblFilename(), 10,SpringLayout.SOUTH , getLbluploadfolder());
+					layout.putConstraint(SpringLayout.EAST, getlblFilename(), -10,SpringLayout.WEST , getTxtfilename());
+					
+					layout.putConstraint(SpringLayout.WEST, getTxtfilename(), 100,SpringLayout.WEST , mainpanel);
+					layout.putConstraint(SpringLayout.EAST, getTxtfilename(), -35,SpringLayout.EAST , mainpanel);
+					layout.putConstraint(SpringLayout.NORTH, getTxtfilename(), 10,SpringLayout.SOUTH , getLbluploadfolder());		
+					
+					layout.putConstraint(SpringLayout.WEST ,getBottombtnPane(), 0,SpringLayout.WEST , mainpanel);
+					layout.putConstraint(SpringLayout.EAST ,getBottombtnPane(), 0,SpringLayout.EAST , mainpanel);
+//					
+					layout.putConstraint(SpringLayout.SOUTH, getBottombtnPane(), -0,SpringLayout.SOUTH , mainpanel);
+					
+				}
+				return mainpanel ;
+			}
+			private JPanel bottombtnPane;
+			public JPanel getBottombtnPane(){
+				if(bottombtnPane==null){
+					bottombtnPane = new JPanel();
+//					bottombtnPane.setPreferredSize(new Dimension(290,40));
+					FlowLayout  fl = new FlowLayout();
+					fl.setAlignment(FlowLayout.RIGHT);
+					bottombtnPane.setLayout(fl);
+					bottombtnPane.add(getBtnpanel());
+					
+					bottombtnPane.setBackground(FileColorConst.BOTTOMCOLOR);
+//					bottombtnPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+					bottombtnPane.setBorder(new MyBorder(0,0,0,0));
+				}
+				
+				return bottombtnPane;
+			}
+
+			private ButtonPanel btnpanel ;
+			public ButtonPanel getBtnpanel(){
+				if(btnpanel == null){
+					btnpanel = new ButtonPanel();
+					btnpanel.setOpaque(false);
+					btnpanel.getBtnOK().addActionListener(new ActionListener(){
+						public void actionPerformed(ActionEvent e) {
+							int i=1 ;
+							for(ImageObject iobj :takepotopane.getImageObjectlist()){
+								File subfile = new File(iobj.getImageID());
+								try{
+									String rulename =getTxtfilename().getText();
+									rulename = rulename+(i++);
+									int index = subfile.getName().lastIndexOf(".");//
+									// 找出扩展名如 ".jpg"
+									String filetype = subfile.getName().substring(index);
+									String newfilename =rulename+filetype;
+									
+									//检查 附件大小 ,文件超过  参数设置的大小不能上传
+									if(FileBroseConst.getfilelimit()*1024*1024<subfile.length()){
+										MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "UploadAction-0001")/*文件超过限制*/, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0002")/*大小超过限制不能上传!*/);
+										continue ;
+									}
+									String dsName = WorkbenchEnvironment.getInstance().getDSName();
+									String pPath = ((MoveFolder)(getComboxfolder().getSelectedItem())).value;
+									NCFileNode node =parentpanel.findNode(parentpanel.rootNode, pPath);
+									////校验是否同名
+									if(parentpanel.CheckTheSameFileName((NCFileNode)node, newfilename)){
+										//TODO 记录重名的文件
+										continue ;
+									}
+									FileInputStream input = new FileInputStream(subfile);
+									String creator = WorkbenchEnvironment.getInstance().getLoginUser().getCuserid();
+									NCFileNode newNode = FileManageServletClient.uploadFile(dsName, pPath, newfilename, input, creator, subfile.length());
+									if (newNode != null) {										
+										parentpanel.nodeToFileVO((NCFileNode)node, newNode);
+									}
+								}catch (Exception ex) {
+									Logger.error(ex);
+									Logger.error(NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0003", null, new String[]{subfile.getName()})/*{0}上传失败,详细原因请检查日志!*/);
+									MessageDialog.showHintDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0004")/*上传失败*/, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0005", null, new String[]{subfile.getName()})/*{0}上传失败!*/);
+								}
+								}
+							MessageDialog.showHintDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0006")/*操作完成*/, NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0007")/*操作完成!*/);
+							UploadPotoDialog.this.closeOK();
+							}
+						
+					});
+					btnpanel.getBtnCancel().addActionListener(new ActionListener(){
+						@Override
+						public void actionPerformed(ActionEvent e) {
+							UploadPotoDialog.this.closeCancel();
+							
+						}
+					});
+				}
+				return btnpanel ;
+			}
+			private JLabel lblfilename ;
+			private JTextField txtfilename ;
+			private JLabel getlblFilename(){
+				if(lblfilename ==null){
+					lblfilename = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0008")/*文件名规则*/);
+				}
+				return lblfilename;
+			}
+			private JTextField getTxtfilename(){
+				if(txtfilename == null){
+					txtfilename = new JTextField();
+				}
+				return txtfilename ;				
+			}
+		private JLabel lbluploadfolder ;
+		private JLabel getLbluploadfolder(){
+			if(lbluploadfolder == null){
+				lbluploadfolder = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0009")/*上传到*/);
+			}
+			return lbluploadfolder;
+		}
+		private JComboBox Comboxfile;
+		private JComboBox getComboxfolder(){
+			if(Comboxfile == null){
+				Comboxfile = new JComboBox();
+				
+				NCFileNode node =(NCFileNode)parentpanel.getTreemodel().getRoot();
+				String rootpath = node.getFullPath();
+				//隐藏根目录前字符串
+//				String unvisstr = "";
+//				if(rootpath.contains("/")){
+//					unvisstr=rootpath.substring(0,rootpath.lastIndexOf("/")+1);
+//				}
+				
+				Enumeration<NCFileNode>  e =node.breadthFirstEnumeration();
+				while(e.hasMoreElements()){
+					NCFileNode enode =(NCFileNode)e.nextElement();
+					if(!enode.isRoot()){
+						MoveFolder mf = new MoveFolder();
+						if(rootpath!=""){
+							mf.dispname=NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0010", null, new String[]{enode.getFullPath().substring(rootpath.length())})/*全部{0}*/;							
+						}else{
+							mf.dispname=enode.getFullPath();	
+						}
+						mf.value=enode.getFullPath();
+						Comboxfile.addItem( mf);					
+					}
+				}
+				
+			}
+			return Comboxfile;
+		}
+	}
+	
+	private class MoveFolder{
+		public String getValue() {
+			return value;
+		}
+		public void setValue(String value) {
+			this.value = value;
+		}
+		public String getDispname() {
+			return dispname;
+		}
+		public void setDispname(String dispname) {
+			this.dispname = dispname;
+		}
+		private String value ;
+		private String dispname ;
+		@Override
+		public String toString() {
+			
+			return this.dispname;
+		}
+	}
+	
+}

+ 2231 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThFileContentPanel.java

@@ -0,0 +1,2231 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionAdapter;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileOutputStream;
+import java.net.InetAddress;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.EventObject;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.BorderFactory;
+import javax.swing.DefaultCellEditor;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.JTree;
+import javax.swing.KeyStroke;
+import javax.swing.SpringLayout;
+import javax.swing.SwingConstants;
+import javax.swing.border.AbstractBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.LineBorder;
+import javax.swing.event.CellEditorListener;
+import javax.swing.event.MouseInputAdapter;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellEditor;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+
+import nc.bs.framework.common.NCLocator;
+import nc.bs.logging.Logger;
+import nc.bs.pub.filesystem.IFileSystemActionConst;
+import nc.bs.pub.filesystem.IFileSystemService;
+import nc.bs.pub.filesystem.IQueryFolderTreeNodeService;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.funcnode.ui.ActionButton;
+import nc.funcnode.ui.FuncletMenuBar;
+import nc.funcnode.ui.action.AbstractNCAction;
+import nc.funcnode.ui.action.SeparatorAction;
+import nc.pub.filesystem.newui.control.ActionDelegate;
+import nc.pub.filesystem.newui.control.MenuAction;
+import nc.pub.filesystem.newui.control.MenuButton;
+import nc.pub.filesystem.newui.control.SeparatorButton;
+import nc.sfbase.client.ClientToolKit;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.ActionsBar;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.ScaleSlider;
+import nc.ui.pub.beans.UIComboBox;
+import nc.ui.pub.beans.UIDialog;
+import nc.ui.pub.beans.UIPanel;
+import nc.ui.pub.beans.UISplitPane;
+import nc.ui.pub.beans.UITable;
+import nc.ui.pub.beans.UITree;
+import nc.ui.pub.beans.table.VOTableModel;
+import nc.ui.pub.filesystem.FileManageServletClient;
+import nc.ui.uif2.editor.BillForm;
+import nc.uitheme.ui.ThemeResourceCenter;
+import nc.vo.pub.BusinessException;
+import nc.vo.pub.ValueObject;
+import nc.vo.pub.filesystem.FileTypeConst;
+import nc.vo.pub.filesystem.ItemObj;
+import nc.vo.pub.filesystem.NCFileNode;
+import nc.vo.pub.filesystem.NCFileVO;
+import nc.vo.uap.rbac.FuncSubInfo;
+
+public class ThFileContentPanel extends JPanel {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5442105336247254657L;
+	//当前页面的状态
+	public int PAGE_STATE=BROWSELISTTABLE_STATE;
+	//列表浏览
+	public static final int BROWSELISTTABLE_STATE =0;
+	//ppt浏览
+	public static final int BROWSEPPTICON_STATE =1;
+	//单张浏览
+	public static final int BROWSESINGLEICON_STATE =2;
+	//缩略图浏览
+	public static final int BROWSESMALLICON_STATE =3; 
+	private int colnumbtnpane =5 ;
+	private int colnumbtnbrow =1;
+	protected String rootDirStr = "dir1/dir2/ewei";
+	protected BillForm editor_;
+	private String funcode ;
+	public String getFuncode(){
+		return funcode;
+	}
+	private FuncSubInfo funcsubinfo ;
+	
+//	IFuncRegisterQueryService.queryFunctionByCode
+	public String getRootDirStr() {
+		return rootDirStr;
+	}
+
+	protected NCFileNode rootNode;
+	protected NCFileNode selfoldernode;
+	/** 节点上的文件缓存 */
+	private HashMap<String, Collection<NCFileVO>> treenodefilecacheMap = new HashMap<String, Collection<NCFileVO>>();
+
+	private class SmallImageFileFilter implements  FileFilter{
+		@Override
+		public boolean accept(File pathname) {					
+			int  index  =pathname.getName().lastIndexOf(".");
+			if(pathname.isFile()
+					&&index!=-1
+					&&pathname.getName().substring(index+1).equalsIgnoreCase("jpg")
+					){
+				return true;			
+			}else{
+				return false ;
+			}
+		}
+	}
+	/** 节点上的文件缓存 */
+	protected HashMap<String, Collection<NCFileVO>> getTreenodefilecacheMap() {
+		return treenodefilecacheMap;
+	}
+	private List<ItemObj> itemlist ;
+	public  List<ItemObj> getItemlist(){
+		if(itemlist==null){
+			itemlist = new ArrayList<ItemObj>();
+		}
+		return itemlist;
+	}
+	public void showcombox(ArrayList<ItemObj>list){
+		setItemlist(list);
+		getComboxbilltype().addItems(list.toArray(new ItemObj[0]));
+		getComboxbilltype().setVisible(true);
+		getComboxbilltype().validate();
+	}
+	public void setItemlist( List<ItemObj> list){
+		getItemlist().clear();
+		getItemlist().addAll(list);
+	}
+	/** 节点大小缓存 */
+	private HashMap<String, Long> treefileszieMap = new HashMap<String, Long>();
+
+//	/** 构造器 */
+//	public FileContentPanel(String fcode,String root) {		
+//		super();
+//		funcode =fcode ;
+//		rootDirStr = root ;
+//		initUI();
+//	}
+	/** 构造器 */
+	public ThFileContentPanel(FuncSubInfo pfuncsubinfo,String root) {		
+		super();
+		
+		this.funcsubinfo=pfuncsubinfo ;
+		funcode =pfuncsubinfo.getFuncode() ;
+		rootDirStr = root ;
+		//设置权限
+		setUIEnable();
+		initUI();
+	}
+	public ThFileContentPanel(String root,BillForm editor) {		
+		super();
+		rootDirStr = root ;
+		editor_ = editor;
+		//设置权限		
+		initUI();
+	}
+
+	/**
+	 * 
+	 */
+	private void setUIEnable() {
+		if(funcsubinfo!=null){
+			uploadenable =funcsubinfo.isValidButton(IFileSystemActionConst.UPLOAD);
+			downloadenable =funcsubinfo.isValidButton(IFileSystemActionConst.DOWNLOAD);
+			browseenable =funcsubinfo.isValidButton(IFileSystemActionConst.BROWSE);
+			deleteenable =funcsubinfo.isValidButton(IFileSystemActionConst.DELETE);
+			renameenable = funcsubinfo.isValidButton(IFileSystemActionConst.RENAME);
+		}
+	}
+
+
+	private void initUI() {
+		this.setLayout(new BorderLayout());
+//		add(getToolbar(), BorderLayout.NORTH);
+		add(getMenuBarContainer(), BorderLayout.NORTH);
+		add(getSplitpanel(), BorderLayout.CENTER);
+		add(getStatusbar(), BorderLayout.SOUTH);
+		
+		IQueryFolderTreeNodeService service = NCLocator
+				.getInstance().lookup(
+						IQueryFolderTreeNodeService.class);
+		
+		//add by ZTH 赋值rootNode
+		try {
+			NCFileNode	node = service.getNCFileNodeTreeAndCreateAsNeed(
+					rootDirStr, WorkbenchEnvironment.getInstance()
+							.getLoginUser().getCuserid());
+			rootNode = findNode(node, rootDirStr);
+		} catch (BusinessException e) {
+			// TODO 自动生成的 catch 块
+			e.printStackTrace();
+		}
+		
+		// rootnode 放入缓存
+		toCache(rootNode);
+		//设置默认选中根节点
+		TreePath path = new TreePath(rootNode);
+		getPatchTree().setSelectionPath(path);
+
+
+		
+	}
+
+	/** 新建文件夹 action */
+	private NewFolderAction newfolderaction;
+
+	public NewFolderAction getNewfolderaction() {
+		if (newfolderaction == null) {
+			newfolderaction = new NewFolderAction();
+			
+		}
+		return newfolderaction;
+	}
+
+	/** 重命名 action */
+	private RenameFolderAction renamefolderaction;
+
+	public RenameFolderAction getRenamefolderaction() {
+		if (renamefolderaction == null) {
+			renamefolderaction = new RenameFolderAction();
+		}
+		return renamefolderaction;
+	}
+
+	/** 删除文件夹(文件) action */
+	private DelFolderAction delfolderaction;
+
+	public DelFolderAction getDelfolderaction() {
+		if (delfolderaction == null) {
+			delfolderaction = new DelFolderAction();
+		}
+		return delfolderaction;
+	}
+
+	private JPanel statusbar;
+	private UIPanel scaleSliderPane =null;
+	UIPanel getScaleSliderPane(){
+		if(scaleSliderPane == null){
+			scaleSliderPane=new UIPanel();
+//			scaleSlider.setPreferredSize(new Dimension(220,30));
+//			scaleSlider.setBorder(new LineBorder(Color.RED));
+			scaleSliderPane.setOpaque(false);
+		}
+		return scaleSliderPane ;
+	}
+	public JPanel getStatusbar() {
+		if (statusbar == null) {
+			statusbar = new JPanel();
+			statusbar.setPreferredSize(new Dimension(0, 35));
+			statusbar.setBorder(new LineBorder(Color.gray));
+			statusbar.setBackground(FileColorConst.BOTTOMCOLOR);
+//			FlowLayout mgr = new FlowLayout();
+//			mgr.setAlignment(FlowLayout.LEFT);
+			BorderLayout mgr = new BorderLayout();
+			statusbar.setLayout(mgr);
+			statusbar.add(getLblstatubar(),BorderLayout.WEST);
+			statusbar.add(getScaleSliderPane(),BorderLayout.EAST);
+		}
+		return statusbar;
+	}
+
+	private JLabel lblstatubar;
+
+	public JLabel getLblstatubar() {
+		if (lblstatubar == null) {
+			lblstatubar = new JLabel("");
+
+		}
+		return lblstatubar;
+
+	}
+
+	private class CMouseHandler extends MouseInputAdapter {
+	
+
+		@Override
+		public void mouseReleased(MouseEvent e) {
+			if (e.isPopupTrigger()) {
+				showPopupMenu(e);
+			}
+		}
+	}
+
+	public void showPopupMenu(MouseEvent e) {
+		//根节点不弹出
+
+		ArrayList<TreePath> list = new ArrayList<TreePath>();
+		TreePath tp = getPatchTree().getPathForLocation(e.getX(), e.getY());
+		
+		
+		if (tp != null) {			
+			list.add(tp);
+		}
+		if (e.isControlDown()) {
+			TreePath[] tps = getPatchTree().getSelectionPaths();
+			if (tps != null && tps.length > 0) {
+				list.addAll(Arrays.asList(tps));
+			}
+		}
+		getPatchTree().setSelectionPaths(list.toArray(new TreePath[0]));
+		if(tp!=null&&tp.getLastPathComponent().equals(rootNode)){
+			return;
+		}
+		getTreepopMenu().show(getPatchTree(), e.getX(), e.getY());
+
+	}
+
+	/** 树的右键菜单 */
+	private JPopupMenu treepopMenu;
+	
+	/** 树右键菜单 删除action*/
+	private DelFolderPopupAction delfolderPopAction;
+	/** 树右键菜单 删除action */
+	public DelFolderPopupAction getDelfolderPopAction(){
+		if(delfolderPopAction == null){
+			delfolderPopAction = new DelFolderPopupAction();
+		}
+		return delfolderPopAction ;
+	}
+	/** 树右键菜单重命名action*/
+	private  RenameFolderPopupAction renamefolderPopAction ;
+	/** 树右键菜单重命名action*/
+	public RenameFolderPopupAction  getRenamefolderPopAction(){
+		if(renamefolderPopAction == null ){
+			renamefolderPopAction =new RenameFolderPopupAction() ;
+			
+		}
+		return renamefolderPopAction ;
+	}
+	/** 树右键菜单新建action*/
+	private NewFolderPopupAction newfolderPopAction;
+	/** 树右键菜单新建action*/
+	public NewFolderPopupAction  getNewfolderPopAction(){
+		if(newfolderPopAction == null){
+			newfolderPopAction = new NewFolderPopupAction();
+		}
+		return newfolderPopAction ;
+	}
+	/** 获取树右键菜单*/
+	private JPopupMenu getTreepopMenu() {
+		if (treepopMenu == null) {
+			treepopMenu = new JPopupMenu();
+			treepopMenu.add(getNewfolderPopAction());
+			treepopMenu.addSeparator();
+			treepopMenu.add(getDelfolderPopAction());
+			treepopMenu.add(getRenamefolderPopAction());
+			
+			
+//			treepopMenu.add(new NewFolderPopupAction());
+//			treepopMenu.addSeparator();
+			// popMenu.add(getUploadFileAction());
+			// popMenu.add(getUpscan());
+			// popMenu.add(getDownLoadFileAction());
+			// popMenu.addSeparator();
+			// popMenu.add(getRefreshAction());
+			// popMenu.add(getShowFileInWebAction());
+
+		}
+		return treepopMenu;
+	}
+
+	/** 上传action */
+	private ThUploadAction uploadAction = new ThUploadAction(ThFileContentPanel.this);
+	/** 引用文档ation */
+	private ThUploadRefAction uprefaction = new ThUploadRefAction(ThFileContentPanel.this);
+	private ThUploadURLAction uploadurlaction = new ThUploadURLAction(ThFileContentPanel.this);
+	private ActionButton btnupdateURL;
+	/** 引用文档 --废弃了*/
+	private JButton btnuploadrefcenter;
+	public ActionButton getBtnupdateURL(){
+		if(btnupdateURL==null){
+			btnupdateURL = new ActionButton(uploadurlaction);
+		}
+		return btnupdateURL;
+	}
+	
+	private JButton btnupload;
+	/* 2010-10-24    以下按照uif2 画button 工具栏***/
+	ActionButton getupmenu(){
+		if(btnupload==null){
+			btnupload =new ActionButton(uploadAction);
+		}
+		return (ActionButton)btnupload;
+	}
+	
+	ActionButton getuprefmenu(){
+		if(btnuploadrefcenter==null){
+			btnuploadrefcenter =new ActionButton(uprefaction);
+		}
+		return (ActionButton)btnuploadrefcenter;
+	}
+	ActionButton getGpyimenu(){
+		if(btngpy==null){
+			btngpy =new ActionButton(gpyaction);
+		}
+		return (ActionButton)btngpy;
+	}
+	ActionButton getPastemenu(){
+		if(btnpaste==null){
+			btnpaste =new ActionButton(pasteaction);
+			//快捷键测试
+			btnpaste.registerKeyboardAction(pasteaction, KeyStroke.getKeyStroke(KeyEvent.VK_V,KeyEvent.CTRL_DOWN_MASK ), JComponent.WHEN_IN_FOCUSED_WINDOW);
+			//快捷键测试
+			btnpaste.setMnemonic(KeyEvent.VK_V);
+		}
+		return (ActionButton)btnpaste;
+	}
+	ThScanAttachAction scanattachaction ;
+	public ThScanAttachAction getScanattachaction(){
+		if(scanattachaction == null){
+			scanattachaction =(new ThScanAttachAction(ThFileContentPanel.this));
+		}
+		return scanattachaction;
+	}
+	private ThScanAttachAction scanpptaction;
+	public  ThScanAttachAction getScanpptaction(){
+		if(scanpptaction == null){
+			scanpptaction = new ThScanAttachAction(ThFileContentPanel.this);
+		}
+		return scanpptaction;
+	}
+	private ThScanAttachAction scansingleaction;
+	public  ThScanAttachAction getScansingleaction(){
+		if(scansingleaction == null){
+			scansingleaction = new ThScanAttachAction(ThFileContentPanel.this);
+		}
+		return scansingleaction;
+	}
+	private ThScanAttachAction scansmallaction;
+	public  ThScanAttachAction getScansmallaction(){
+		if(scansmallaction == null){
+			scansmallaction = new ThScanAttachAction(ThFileContentPanel.this);
+		}
+		return scansmallaction;
+	}
+	
+	MenuButton btnscanimage ;
+	MenuButton getScangrpmenu(){
+		if(btnscanimage==null){
+			ActionDelegate pde = new ActionDelegate();
+			pde.setAction(getBtnscanimage());
+			
+			ActionDelegate cde1 = new ActionDelegate();			
+			ActionDelegate cde2 = new ActionDelegate();
+			ActionDelegate cde3 = new ActionDelegate();
+			ActionDelegate cde4 = new ActionDelegate();
+			cde1.setAction(getScanattachaction());
+			cde2.setAction(getScanpptaction());
+			cde3.setAction(getScansingleaction());
+			cde4.setAction(getScansmallaction());
+			pde.addChild(cde1);
+			pde.addChild(cde2);
+			pde.addChild(cde3);
+			pde.addChild(cde4);
+			btnscanimage =new MenuButton(pde);
+		}
+		return btnscanimage;
+	}
+	private static ImageIcon menuBarBGIcon = ThemeResourceCenter.getInstance().getImage("themeres/control/menu/menu_bg.png");
+	private static ImageIcon menuBarBGFrameIcon = ThemeResourceCenter.getInstance().getImage("themeres/control/menu/menu_bg_frame.png");
+	private JPanel menuBarContainer ;
+	JPanel getMenuBarContainer() {
+		if(menuBarContainer == null){
+			menuBarContainer = new JPanel(){
+				
+				private static final long serialVersionUID = 7130908951757832647L;
+				@Override
+				protected void paintComponent(Graphics g) {
+					super.paintComponent(g);
+					Dimension size = getSize();
+					if(menuBarBGIcon != null && menuBarBGFrameIcon != null){
+						int frameW = menuBarBGFrameIcon.getIconWidth();
+						g.drawImage(menuBarBGIcon.getImage(), frameW, 0, size.width-2*frameW, size.height, this);
+						menuBarBGFrameIcon.paintIcon(this, g, 0, 0);
+						menuBarBGFrameIcon.paintIcon(this, g, size.width - frameW, 0);
+					}
+				}
+				
+			};
+			menuBarContainer.setOpaque(false);
+			menuBarContainer.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6));
+			menuBarContainer.setLayout(new BorderLayout());
+			menuBarContainer.add(getBar(), BorderLayout.CENTER);
+			menuBarContainer.add(getComboxbilltype(),BorderLayout.EAST);
+			getBar().setOpaque(false);
+		}
+		return menuBarContainer;
+	}
+	private UIComboBox comboxbilltype;
+	public UIComboBox getComboxbilltype(){
+		if(comboxbilltype == null){
+			comboxbilltype = new UIComboBox();
+			comboxbilltype.setPreferredSize(new Dimension(140,18));
+			comboxbilltype.setVisible(false);
+			
+//			comboxbilltype.addItem("某单据类型1");
+//			comboxbilltype.addItem("某单据类型2222");
+			comboxbilltype.setSize(140,18);
+			comboxbilltype.addItemListener(new ItemListener(){
+				@Override
+				public void itemStateChanged(ItemEvent e) {
+					if (e.getStateChange() != ItemEvent.SELECTED){
+						return ;
+					}else{
+						//浏览状态
+						PAGE_STATE=BROWSELISTTABLE_STATE;
+						
+						treenodefilecacheMap.clear();
+						treefileszieMap.clear();
+
+						
+						treemodel=null;
+						ItemObj item =(ItemObj) getComboxbilltype().getSelectedItem();
+						rootDirStr =item.getRootname();
+						treemodel=getTreemodel();
+						getPatchTree().setModel(treemodel);
+						
+						getPatchTree().updateUI();
+						getfiletablemodel().clearTable();
+						// rootnode 放入缓存
+						toCache(rootNode);
+					}
+					
+				}
+			});
+		}
+		return comboxbilltype;
+	}
+	FuncletMenuBar bar ;
+	public FuncletMenuBar getBar(){
+		if(bar==null){
+			bar =new FuncletMenuBar();
+			bar.setPreferredSize(new Dimension(0,30));
+			bar.addMenuComp(getupmenu());//上传按钮添加  zth
+//			bar.addMenuComp(getPastemenu());
+//			bar.addMenuComp(getuprefmenu());
+//			bar.addMenuComp(getGpyimenu());			
+//			bar.addMenuComp(getBtnupdateURL());
+//			ActionDelegate de =new ActionDelegate();
+//			de.setAction(new SeparatorAction());
+//			bar.addMenuComp(new SeparatorButton(de));
+//			bar.setOpaque(false);
+//			bar.addMenuComp(getScangrpmenu());//浏览
+		}
+		return bar;
+	}
+	/*2010-10-24    end 以下按照uif2 画button 工具栏***/
+//	public JButton getBtnupload() {
+//		if (btnupload == null) {
+//			btnupload = new JButton("上传附件");
+//			btnupload.addActionListener(uploadAction);
+//		}
+//		return btnupload;
+//	}
+
+	
+//
+//	public JButton getBtnuploadrefcenter() {
+//		if (btnuploadrefcenter == null) {
+//			btnuploadrefcenter = new JButton("引用文档");
+//			btnuploadrefcenter.addActionListener(uprefaction);
+//		}
+//		return btnuploadrefcenter;
+//	}
+
+	private ThGaopaiyiAction gpyaction = new ThGaopaiyiAction(ThFileContentPanel.this);
+	private JButton btngpy;
+
+//	public JButton getBtngpy() {
+//		if (btngpy == null) {
+//			btngpy = new JButton("高拍仪");
+//			btngpy.addActionListener(gpyaction);
+//		}
+//		return btngpy;
+//	}
+
+	private ThPasteAttachAction pasteaction = new ThPasteAttachAction(
+			ThFileContentPanel.this);
+	private JButton btnpaste;
+
+//	public JButton getBtnpaste() {
+//		if (btnpaste == null) {
+//			btnpaste = new JButton("粘贴附件");
+//			btnpaste.addActionListener(pasteaction);
+//			//快捷键测试
+//			btnpaste.registerKeyboardAction(pasteaction, KeyStroke.getKeyStroke(KeyEvent.VK_V,KeyEvent.CTRL_DOWN_MASK ), JComponent.WHEN_IN_FOCUSED_WINDOW);
+//			//快捷键测试
+//			btnpaste.setMnemonic(KeyEvent.VK_V);
+//			
+//		}
+//		return btnpaste;
+//	}
+//	private MenuAction browseaction ;
+//	public MenuAction getBrowseaction(){
+//		return browseaction;
+//	}
+	private MenuAction btnscanimageaction;
+
+	public MenuAction getBtnscanimage() {
+		if (btnscanimageaction == null) {
+			btnscanimageaction = new MenuAction("brow",NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0000")/*浏览*/);
+			btnscanimageaction.addChildAction(getScanattachaction());
+			btnscanimageaction.addChildAction(getScanpptaction());
+			btnscanimageaction.addChildAction(getScansingleaction());
+			btnscanimageaction.addChildAction(getScansmallaction());
+
+		}
+		return btnscanimageaction;
+	}
+
+
+
+//	private JToolBar toolbar = null;
+//
+//	public JToolBar getToolbar() {
+//		if (toolbar == null) {
+//			toolbar = new UIToolBar();
+//			toolbar.setFloatable(false);
+//			toolbar.add(getupmenu());
+//			toolbar.add(getBtnuploadrefcenter());
+//			toolbar.add(getBtngpy());
+//			toolbar.add(getBtnpaste());
+//			toolbar.add(getBtnscanimage());
+//
+//		}
+//		return toolbar;
+//	}
+
+	/**
+	 * 左树,右表分割
+	 */
+
+	private UISplitPane splitpanel = null;
+	private JPanel lefttreepanel;
+
+	public JPanel getLefttreepanel() {
+		if (lefttreepanel == null) {
+			lefttreepanel = new JPanel();
+			lefttreepanel.setBorder(new LineBorder(Color.gray));
+			lefttreepanel.setLayout(new BorderLayout());
+			
+			lefttreepanel.setPreferredSize(new Dimension(235, 0));
+			lefttreepanel.setMinimumSize(new Dimension(235,0));
+			lefttreepanel.add(getTreetoolpanel(), BorderLayout.NORTH); //新增文件夹按钮  重命名  删除按钮
+			lefttreepanel.add(getTreepane(), BorderLayout.CENTER);
+			//			
+		}
+		return lefttreepanel;
+	}
+	
+	private JScrollPane treepane ;
+	public JScrollPane getTreepane(){
+		if(treepane == null ){
+			treepane = new JScrollPane();
+			treepane.setBorder(null);
+			treepane.setName("treescrollpane");
+			treepane.setViewportView(getPatchTree());
+		}
+		return treepane ;
+	}
+//	private JPanel treepanel ;	
+//	public JPanel getTreepanel(){
+//		if(treepanel==null){
+//			treepanel = new JPanel();
+//			treepanel.setBorder(new LineBorder(Color.red));
+//			treepanel.setPreferredSize(new Dimension(235, 0));
+//			SpringLayout springlayout = new SpringLayout();
+//			treepanel.setLayout(springlayout);
+//			treepanel.add(getPatchTree());
+//			springlayout.putConstraint(SpringLayout.WEST, getPatchTree(), 10, SpringLayout.WEST, treepanel);
+//			springlayout.putConstraint(SpringLayout.NORTH, getPatchTree(), 5, SpringLayout.NORTH, treepanel);
+//			springlayout.putConstraint(SpringLayout.EAST, getPatchTree(), 10, SpringLayout.EAST, treepanel);
+//		}
+//			
+//		return treepanel ;
+//	}
+	 
+	private JPanel treetoolpanel;
+
+	public JPanel getTreetoolpanel() {
+		if (treetoolpanel == null) {
+			treetoolpanel = new JPanel();
+			treetoolpanel.setBorder(new BottomBorder(0,0,0,0));
+			FlowLayout m = new FlowLayout();
+			m.setAlignment(FlowLayout.RIGHT);
+			treetoolpanel.setLayout(m);
+
+			treetoolpanel.add(getTreetoolbar());
+		}
+		return treetoolpanel;
+	}
+
+	private ActionsBar treetoolbar;
+
+	public ActionsBar getTreetoolbar() {
+		if (treetoolbar == null) {
+			treetoolbar = new ActionsBar();
+			// treetoolbar.setBorder(new LineBorder(Color.gray));
+			//	
+			treetoolbar.setMinimumSize(new Dimension(100,22));
+			treetoolbar.addAction(getNewfolderaction());
+			treetoolbar.addAction(getRenamefolderaction());
+			treetoolbar.addAction(getDelfolderaction());
+			// treetoolbar.add(new HyperButton("test1","test1"));
+		}
+		return treetoolbar;
+	}
+
+	private class NewFolderAction extends AbstractNCAction {
+
+		private static final long serialVersionUID = -4636774835978670803L;
+
+		public NewFolderAction() {
+			this.putValue(AbstractNCAction.SMALL_ICON, ClientToolKit
+					.loadImageIcon("themeroot/blue/themeres/ui/toolbaricons/add-child.png"));
+			this.setTooltip(NCLangRes.getInstance().getStrByID("sftemp", "FileInputNameDialog-0000")/*新建文件夹*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			createfolder();
+		}
+
+		
+	}
+
+	private class NewFolderPopupAction extends AbstractNCAction {
+
+		private static final long serialVersionUID = -4636774835978670803L;
+
+		public NewFolderPopupAction() {
+			this.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0001")/*新建*/);
+			this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0001")/*新建*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			createfolder();
+		}
+	}
+
+	private class DelFolderPopupAction extends AbstractNCAction {
+
+		private static final long serialVersionUID = -1L;
+
+		public DelFolderPopupAction() {
+			this.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0002")/*删除*/);
+			this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0002")/*删除*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			delfolder();
+		}
+	}
+	private void createfolder() {
+
+		if (rootNode == null) {
+			return;
+		}
+//		//规定只能在根目录下  建文件夹
+//		TreePath path = getPatchTree().getSelectionPath();
+		//修改为只在根目录下
+		TreePath path =  new TreePath(rootNode.getPath()) ;
+
+		NCFileNode node = (NCFileNode)path.getLastPathComponent();
+		String str = null;
+		FileInputNameDialog dialog = new FileInputNameDialog();
+		if(dialog.showModal()==UIDialog.ID_OK){
+			str = dialog.getFilename();
+		}
+//		String str = (String) MessageDialog.showInputDlg(FileContentPanel.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000005")/*新建文件夹*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000006")/*请输入文件夹名称*/, "newfolder");
+		if (str != null && str.trim().length() > 0) {
+			try {
+				if(CheckTheSameFolderName(node,str))
+				{	
+					return;
+				}
+				IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+				NCFileNode newNode = service.createNewFileNode(node.getFullPath(), str, WorkbenchEnvironment.getInstance().getLoginUser().getCuserid());
+				DefaultTreeModel model = getTreemodel();
+				model.insertNodeInto(newNode, node, node.getChildCount());
+				model.nodeStructureChanged(node);
+				TreePath newPath = new TreePath(getTreePath(newNode));
+				getPatchTree().setSelectionPath(newPath);
+				getPatchTree().expandPath(newPath);
+				
+				getTreenodefilecacheMap().put(newNode.getFullPath(), new ArrayList<NCFileVO>());
+			} catch (Exception ex) {
+				Logger.error(ex.getMessage(), ex);
+				MessageDialog.showErrorDlg(ThFileContentPanel.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, ex.getMessage());
+			}
+		}
+	}
+	private class RenameFolderPopupAction extends AbstractNCAction {
+
+		private static final long serialVersionUID = -1L;
+
+		public RenameFolderPopupAction() {
+			this.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0003")/*重命名*/);
+			this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0003")/*重命名*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			renamefoder();
+		}
+	}
+
+	private class DelFolderAction extends AbstractNCAction {
+		private static final long serialVersionUID = 3273091047549713804L;
+
+		public DelFolderAction() {
+			this.putValue(AbstractNCAction.SMALL_ICON, ClientToolKit
+					.loadImageIcon("themeroot/blue/themeres/ui/toolbaricons/delete.png"));
+			this.setTooltip(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0002")/*删除*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			delfolder();
+		}
+	}
+
+	private class RenameFolderAction extends AbstractNCAction {
+		private static final long serialVersionUID = -132307984647892932L;
+
+		public RenameFolderAction() {
+			this.putValue(AbstractNCAction.SMALL_ICON, ClientToolKit
+					.loadImageIcon("themeroot/blue/themeres/ui/toolbaricons/edit.png"));
+			this.setTooltip(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0003")/*重命名*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			renamefoder();
+		}
+	}
+
+	private void renamefoder() {
+		TreePath treePath = getPatchTree().getSelectionPath();
+		if (treePath == null) {
+			return;
+		}
+		Object obj = treePath.getLastPathComponent();
+		if (obj.equals(rootNode)) {
+			MessageDialog.showErrorDlg(ThFileContentPanel.this,
+					NCLangRes.getInstance().getStrByID("pc",
+							"FileManageUI-000000")/* 错误 */, NCLangRes
+							.getInstance().getStrByID("pc",
+									"FileManageUI-000011")/* 不能对根节点重命名 */);
+			return;
+		}
+
+		getPatchTree().getUI().startEditingAtPath(getPatchTree(), treePath);
+	}
+
+	public void delfolder() {
+
+		if (rootNode == null) {
+			return;
+		}
+		
+		TreePath[] paths = getPatchTree().getSelectionPaths();
+		if (paths == null || paths.length == 0)
+			return;
+		
+		List<String> nodePathsList = new ArrayList<String>();
+		List<DefaultMutableTreeNode> nodeList = new ArrayList<DefaultMutableTreeNode>();
+		for (int i = 0; i < paths.length; i++) {
+			NCFileNode node = (NCFileNode) paths[i].getLastPathComponent();
+			//根节点 不能删除 ,删除就会出错
+			if (node.equals(rootNode)) {
+				MessageDialog.showOkCancelDlg(ThFileContentPanel.this, NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0012")/*错误*/,NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0016")/*根节点不能删除!*/);
+				continue;
+			}
+			String nodePath = ((NCFileNode) node).getFullPath();
+			nodePathsList.add(nodePath);
+			nodeList.add(node);
+		}
+		if (nodePathsList.size() > 0) {
+			try {
+				IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+				StringBuilder sb = new StringBuilder(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000019")+"\r\n");
+				for (int i = 0; i < nodeList.size(); i++) {
+					TreeNode[] nodes = getTreePath(nodeList.get(i));
+					sb.append(convertTreePathToString(nodes)).append("\r\n");
+				}
+				if (MessageDialog.showOkCancelDlg(ThFileContentPanel.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000007")/*删除确认框*/, sb.toString()) == MessageDialog.ID_OK) {
+					
+					DefaultTreeModel model = getTreemodel();
+					for (int i = 0; i < nodeList.size(); i++) {
+						DefaultMutableTreeNode tempNode = nodeList.get(i);
+						TreeNode parent = tempNode.getParent();
+						
+						NCFileNode fn =(NCFileNode)tempNode;
+						HashMap<String, NCFileVO> mapfilevo = fn.getFilemap();
+						String path = fn.getFullPath();
+						
+						//清理客户端,"全部"下的删除文件
+						for(NCFileVO fvo :mapfilevo.values()){
+							getTreenodefilecacheMap().get("root").remove(fvo);
+						}
+						//清理客户端,本页的缓存map
+						if(getTreenodefilecacheMap().containsKey(path)){
+							getTreenodefilecacheMap().remove(path);
+						}
+						
+						//改变树结构
+						model.removeNodeFromParent(tempNode);
+						if (parent != null) {
+							model.nodeStructureChanged(parent);
+						}
+					}
+					//清理缓存 
+					getfiletablemodel().clearTable();
+//					for(String path :nodePathsList){
+//					
+//					}
+					if(PAGE_STATE!=BROWSELISTTABLE_STATE){
+						getTablepanel().removeAll();
+						getTablepanel().updateUI();
+					}
+					service.deleteNCFileNodes(nodePathsList.toArray(new String[0]));
+				}
+			} catch (BusinessException ex) {
+				Logger.error(ex.getMessage(), ex);
+			}
+		}
+
+	
+		
+	}
+
+	private class CTreeCellEditor extends DefaultTreeCellEditor {
+		private NCFileNode node = null;
+
+		public CTreeCellEditor(JTree tree) {
+			super(tree, getFiletreerender());
+		}
+
+		@Override
+		public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
+			Component c = super.getTreeCellEditorComponent(tree, value, isSelected, expanded, leaf, row);
+			if (value instanceof NCFileNode) {
+				node = (NCFileNode) value;				
+			}
+			
+			return c ;
+		}
+		@Override
+		public Object getCellEditorValue() {
+			
+			Object o = super.getCellEditorValue();
+			if (o instanceof String && node != null) {
+				String newValue = ((String) o).trim();
+				String oldValue = node.getName();
+				String oldPath = node.getFullPath();
+				
+				TreePath treePath = getPatchTree().getSelectionPath();
+				if (treePath == null) {
+					return oldValue;
+				}
+				Object obj = treePath.getLastPathComponent();
+				if (obj.equals(rootNode)) {
+					MessageDialog.showErrorDlg(ThFileContentPanel.this,
+							NCLangRes.getInstance().getStrByID("pc",
+									"FileManageUI-000000")/* 错误 */, NCLangRes
+									.getInstance().getStrByID("pc",
+											"FileManageUI-000011")/* 不能对根节点重命名 */);
+					return oldValue;
+				}
+				
+				node.setUserObject(newValue);
+				String newPath = node.getFullPath();
+				
+				
+				
+				boolean b = false;
+				try {
+					if (newValue.indexOf("/") != -1 || newValue.indexOf("\\") != -1) {
+						MessageDialog.showErrorDlg(ThFileContentPanel.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000001")/*文件名中不能包含\\或/符号*/);
+						return oldValue;
+					}
+					//如果去掉前后空格长度为0,返回原来值,提示文件名不能空
+					if(newValue.trim().length()==0)
+					{
+						//MessageDialog.showErrorDlg(FileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, "文件名不能为空");
+						return oldValue;
+					}
+					if (!oldPath.equals(newPath)) {
+						IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+						b = service.rename(oldPath, newPath);
+						if (!b) {
+							MessageDialog.showHintDlg(ThFileContentPanel.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000002")/*提示*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000003")/*文件名重复*/);
+							return oldValue;
+						}else{
+							//保存成功更新树缓存
+							Collection<NCFileVO> c =getTreenodefilecacheMap().get(oldPath);
+							getTreenodefilecacheMap().remove(oldPath);
+							getTreenodefilecacheMap().put(newPath, c);
+						}
+					}
+				} catch (BusinessException e) {
+					Logger.error(e);
+				}
+				if (b) {
+					return newValue;
+				} else {
+					return oldValue;
+				}
+			}
+			return o;
+		}
+
+		@Override
+		protected void determineOffset(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
+			super.determineOffset(tree, value, isSelected, expanded, leaf, row);
+			if (renderer != null) {
+				editingIcon = ((JLabel) renderer.getTreeCellRendererComponent(tree, value, isSelected, expanded, leaf, row, false)).getIcon();
+			}
+		}
+
+
+	}
+
+	/**
+	 * 左边附件树
+	 */
+	private UITree patchtree = null;
+	/**
+	 * 右边的附件详细信息
+	 */
+	private UITable patchinfotable = null;
+
+	/**
+	 * 左边树的model
+	 */
+	private DefaultTreeModel treemodel = null;
+	/**
+	 * 右边附件列表的model
+	 */
+	private FileVOTableModel tablemodel = null;
+
+	public UISplitPane getSplitpanel() {
+		if (splitpanel == null) {
+			splitpanel = new UISplitPane(UISplitPane.HORIZONTAL_SPLIT);
+//			splitpanel.add(getLefttreepanel(), UISplitPane.LEFT);
+			
+			splitpanel.add(getTablepanel(), UISplitPane.RIGHT);//右边框
+			splitpanel.setDividerSize(3);
+		}
+		return splitpanel;
+	}
+	protected JPanel tablepanel;
+	public JPanel getTablepanel(){
+		if(tablepanel== null){
+			
+			tablepanel = new JPanel();
+			tablepanel.setLayout(new BorderLayout());
+			tablepanel.setPreferredSize(new Dimension(500, 400));
+//			CardLayout cardlayout = new CardLayout();
+//			tablepanel.setLayout(cardlayout);
+			
+			tablepanel.add(getJstablepanel(),BorderLayout.CENTER);
+//			tablepanel.add(getJstablepanel(),"card2");
+		}
+		return tablepanel;
+	}
+	
+	private JScrollPane jstablepanel;
+
+	public JScrollPane getJstablepanel() {
+		if (jstablepanel == null) {
+			jstablepanel = new JScrollPane(getPatchInfoTable());
+		}
+		return jstablepanel;
+	}
+
+	@SuppressWarnings("unchecked")
+	protected class FileVOTableModel extends VOTableModel {
+
+		/**
+		 * 
+		 */
+		private static final long serialVersionUID = -6001046311222516903L;
+		String[] columnnames = { "", NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0004")/*附件名*/, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0004")/*大小*/, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0005")/*描述*/, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0006")/*上传时间*/, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0007")/*操作*/ };
+
+		public FileVOTableModel(ValueObject[] vos) {
+			super(vos);
+		}
+
+		@Override
+		public String getColumnName(int col) {
+			// 
+			return columnnames[col];
+		}
+
+		@Override
+		public int getColumnCount() {
+			return columnnames.length;
+		}
+
+		@Override
+		public Object getValueAt(int rowIndex, int columnIndex) {
+			Object o = this.getVO(rowIndex);
+			if (o instanceof NCFileVO) {
+				NCFileVO file = (NCFileVO) o;
+
+				if (columnIndex == 0) {
+					return rowIndex + 1;
+				} else if (columnIndex == 1) {
+					return file.getName();
+				} else if (columnIndex == 2) {
+					return FileManageStringFormat.formatFileSize(file
+							.getFileLen());
+				} else if (columnIndex == 3) {
+					return file.getFiledesc();
+				} else if (columnIndex == 4) {
+					return FileManageStringFormat.formatDateToString(file
+							.getTime());
+				} else if (columnIndex == 5) {
+					return "";
+				} else {
+					return "";
+				}
+			}
+			return "test";
+		}
+
+		@Override
+		public boolean isCellEditable(int row, int column) {
+			if (isColumnEditable(column)) {
+				return true;
+			} else {
+				return false;
+			}
+		}
+
+		@Override
+		public boolean isColumnEditable(int col) {
+			if (col == 1 || col == 5) {
+				return true;
+			}
+			return false;
+		}
+
+		public boolean isRowEditable(int row) {
+
+			return true;
+		}
+
+		@Override
+		public boolean isAndEditable() {
+			// 
+			return true;
+		}
+
+	}
+
+	private FileManageTreeRenderer filetreerender;
+
+	public FileManageTreeRenderer getFiletreerender() {
+		if (filetreerender == null) {
+			filetreerender = new FileManageTreeRenderer();
+		}
+		return filetreerender;
+	}
+
+
+	
+	private class MyFileTree extends UITree{
+		/**
+		 * 
+		 */
+		private static final long serialVersionUID = -3022453623914006697L;
+
+		@Override
+		public boolean isPathEditable(TreePath path) {
+			if(path.getLastPathComponent().equals(rootNode)){
+				return false ;
+			}
+			return super.isPathEditable(path);
+		}
+	}
+
+	public UITree getPatchTree() {
+		if (patchtree == null) {
+			patchtree = new MyFileTree();
+			patchtree.setUI(new FileManageTreeUI());
+			
+			patchtree.setRowHeight(28);
+			patchtree.setBorder(new EmptyBorder(5,10,0,10));
+			// patchtree.setBackground(FileManageUIConst.MCBOXTREEBG);
+			patchtree.setCellRenderer(getFiletreerender());
+			CTreeCellEditor ceditor = new CTreeCellEditor(patchtree);
+			patchtree.setCellEditor(ceditor);
+			patchtree.setModel(getTreemodel());
+			patchtree.setEditable(true);
+			
+			patchtree.addMouseListener(new CMouseHandler());
+			patchtree.setRootVisible(true);
+			patchtree.setBounds(10,5,patchtree.getWidth()-20,patchtree.getHeight()-10);
+			patchtree.addTreeSelectionListener(new TreeSelectionListener() {
+				@Override
+				public void valueChanged(TreeSelectionEvent e) {
+					actionTree(e);
+				}
+			});
+			
+		}
+		return patchtree;
+	}
+
+	private void actionTree(TreeSelectionEvent e) {
+		refreshUIbyClickTree();
+
+	}
+	
+	private void refreshUIbyClickTree() {
+		if (getPatchTree().getSelectionPath() == null)
+			return;
+		
+		selfoldernode = (NCFileNode) getPatchTree()
+				.getSelectionPath().getLastPathComponent();
+		if(selfoldernode.equals(rootNode)){
+			getDelfolderaction().setEnabled(false);
+			getRenamefolderaction().setEnabled(false);
+		}else{
+			getDelfolderaction().setEnabled(true);
+			getRenamefolderaction().setEnabled(true);
+		}
+		if(PAGE_STATE==BROWSELISTTABLE_STATE){
+			ThFileBrowseCreatePane.createListBrowsePane(ThFileContentPanel.this);
+
+		}else if(PAGE_STATE==BROWSEPPTICON_STATE){
+			ThFileBrowseCreatePane.createPPTBrowsePane(ThFileContentPanel.this, new ScaleSlider());
+		}else if(PAGE_STATE==BROWSESINGLEICON_STATE){
+			ThFileBrowseCreatePane.createSingleBrosePane(ThFileContentPanel.this, new ScaleSlider());
+		}else if(PAGE_STATE==BROWSESMALLICON_STATE){
+			ThFileBrowseCreatePane.createSmallImagePane(ThFileContentPanel.this);
+		}
+		
+	}
+	/**
+	 * 更新状态栏 
+	 */
+	protected void refreshStatuBar(){
+		//TODO (方法if else要重构)
+		if(selfoldernode== null ||selfoldernode.getFullPath().equals(rootDirStr)){
+			// 更新状态栏(几个附件,大小)
+			int filecount = getTreenodefilecacheMap().get("root").size();
+			Long filesize = 0l;
+			for (NCFileVO fvo : getTreenodefilecacheMap().get("root")) {
+				filesize += fvo.getFileLen();
+			}
+	
+			if (filecount > 0 && filesize > 0) {
+				StringBuffer sb = new StringBuffer();
+				sb.append(filecount).append(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0008")/*个附件 :*/).append("   ");
+				sb.append(FileManageStringFormat.formatFileSize(filesize));
+				getLblstatubar().setText(sb.toString());
+			} else {
+				getLblstatubar().setText(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0009")/*附件信息*/);
+			}
+		}else{
+			// 更新状态栏
+			int filecount =0;
+			Long filesize = 0l;
+			if(getTreenodefilecacheMap().get(selfoldernode.getFullPath())!=null){
+					filecount = getTreenodefilecacheMap().get(selfoldernode.getFullPath()).size();
+					for (NCFileVO fvo : getTreenodefilecacheMap().get(selfoldernode.getFullPath())) {
+						filesize += fvo.getFileLen();
+					}
+			}
+			
+			
+			if (filecount > 0 && filesize > 0) {
+				StringBuffer sb = new StringBuffer();
+				sb.append(filecount).append(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0008")/*个附件 :*/).append("   ");
+				sb.append(FileManageStringFormat.formatFileSize(filesize));
+				getLblstatubar().setText(sb.toString());
+			} else {
+				getLblstatubar().setText(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0009")/*附件信息*/);
+			}
+		}
+	}
+	
+	/**
+	 * 树的model
+	 * 
+	 * @return
+	 */
+	protected DefaultTreeModel getTreemodel() {
+		if (treemodel == null) {
+			treemodel = new DefaultTreeModel(null);
+			treemodel.setAsksAllowsChildren(true);
+			
+			try {
+				if (rootDirStr != null) {
+					IQueryFolderTreeNodeService service = NCLocator
+							.getInstance().lookup(
+									IQueryFolderTreeNodeService.class);
+					NCFileNode node = service.getNCFileNodeTreeAndCreateAsNeed(
+							rootDirStr, WorkbenchEnvironment.getInstance()
+									.getLoginUser().getCuserid());
+					rootNode = findNode(node, rootDirStr);
+				} else {
+					rootNode = null;
+				}
+
+				
+
+				treemodel.setRoot(rootNode);
+				treemodel.nodeStructureChanged(rootNode);
+
+			} catch (BusinessException e) {
+				Logger.error(e);
+			}
+		}
+		return treemodel;
+	}
+
+	private void toCache(NCFileNode rootNode) {
+		if(rootNode==null){
+			return ;
+		}
+		Enumeration<NCFileNode> enumer = rootNode.breadthFirstEnumeration();
+//		NCFileNode retrNode = null;
+		while (enumer.hasMoreElements()) {
+			NCFileNode tempNode = (NCFileNode) enumer.nextElement();
+			getTreenodefilecacheMap().put(tempNode.getFullPath(),
+					tempNode.getFilemap().values());
+		}
+		// root 包含所有的文件
+		if (getTreenodefilecacheMap().get("root") == null) {
+			ArrayList<NCFileVO> arr = new ArrayList<NCFileVO>();
+			for (Collection<NCFileVO> cvo : getTreenodefilecacheMap().values()) {
+				arr.addAll(cvo);
+			}
+			getTreenodefilecacheMap().put("root", arr);
+		}
+
+	}
+
+	@SuppressWarnings("unchecked")
+	 NCFileNode findNode(NCFileNode node, String path) {
+		Enumeration<NCFileNode> enumer = node.breadthFirstEnumeration();
+		NCFileNode retrNode = null;
+		while (enumer.hasMoreElements()) {
+			NCFileNode tempNode = (NCFileNode) enumer.nextElement();
+			if (tempNode.getFullPath().equals(path)) {
+				retrNode = tempNode;
+				// retrNode.setParent(null);
+				break;
+			}
+		}
+		return retrNode;
+	}
+
+	public UITable getPatchInfoTable() {
+		if (patchinfotable == null) {
+			patchinfotable = new UITable();
+			patchinfotable.setModel(getfiletablemodel());
+			patchinfotable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
+			TableColumnModel colmodel = patchinfotable.getColumnModel();
+			TableColumn col0_rownum = colmodel.getColumn(0);
+			col0_rownum.setPreferredWidth(30);
+			col0_rownum.setCellRenderer(new RownumTableCellRender());
+			TableColumn col1_filename = colmodel.getColumn(1);
+			col1_filename.setCellRenderer(new BtnTableCellRender());
+			col1_filename
+					.setCellEditor(new BtnTableCellEditor(new JCheckBox()));
+			col1_filename.setPreferredWidth(93);
+			TableColumn col2 = colmodel.getColumn(2);
+			col2.setPreferredWidth(66);
+			TableColumn col4 = colmodel.getColumn(4);
+			col4.setPreferredWidth(120);
+
+			TableColumn btncol = colmodel.getColumn(5);
+			btncol.setCellRenderer(new BtnTableCellRender());
+			btncol.setCellEditor(new BtnTableCellEditor(new JCheckBox()));
+			btncol.setPreferredWidth(190);
+			patchinfotable.addMouseMotionListener( new FileMouseListener());
+		}
+		return patchinfotable;
+	}
+	
+	private class FileMouseListener extends MouseMotionAdapter{
+		@Override
+		public void mouseMoved(MouseEvent e) {
+			int col =patchinfotable.columnAtPoint(e.getPoint());
+			if(col!=-1&&(col == colnumbtnpane ||col == colnumbtnbrow) ){
+				patchinfotable.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+				
+			}else{
+				patchinfotable.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+			}
+		}
+		
+	}
+
+	private class RownumTableCellRender implements TableCellRenderer {
+
+		@Override
+		public Component getTableCellRendererComponent(JTable table,
+				Object value, boolean isSelected, boolean hasFocus, int row,
+				int column) {
+			JLabel label = new JLabel();
+			label.setText(String.valueOf(value));
+			label.setOpaque(true);
+			
+			
+			if(isSelected){
+				label.setBackground(table.getSelectionBackground());
+			}else{
+				label.setBackground(table.getTableHeader().getBackground());
+			}
+			label.setHorizontalAlignment(SwingConstants.CENTER);
+			return label;
+		}
+
+	}
+
+	
+	public FileVOTableModel getfiletablemodel() {
+
+		if (tablemodel == null) {
+			tablemodel = new FileVOTableModel(null);
+		}
+		return tablemodel;
+	}
+	
+	
+	/**
+	 * @param name
+	 * @return 返回文件后缀名,包含"."
+	 */
+	private String getFileType(String name) {
+		String type = null;
+		if (name != null && name.contains(".")) {
+			type = name.substring(name.lastIndexOf("."), name.length());
+		}
+		return type;
+	}
+
+	private class BtnPanel extends JPanel {
+		
+		private static final long serialVersionUID = 5460160935253553438L;
+		HyperButton btndownload = new HyperButton(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0010")/*下载*/, "dowm");
+		HyperButton btnupfpload = new HyperButton(NCLangRes.getInstance().getStrByID("sftemp", "传发票"), "upfp");
+		HyperButton btnmove = new HyperButton(NCLangRes.getInstance().getStrByID("sftemp", "FileMoveDialog-0000")/*移动*/, "move");
+		HyperButton btneidt = new HyperButton(NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0010")/*编辑属性*/, "edit");
+		HyperButton btndelete = new HyperButton(NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0002")/*删除*/, "delete");
+		int rowindex;
+
+		// JButton test= new JButton("test");
+
+		public BtnPanel(int row) {
+			super();
+			rowindex = row;
+			
+			SpringLayout layout = new SpringLayout();
+			this.setLayout(layout);
+			NCFileVO filevo = (NCFileVO) getfiletablemodel().getVO(row);
+			
+//			btnbdownload.setOpaque(true);
+//			btnbdownload.setBackground(Color.red);
+			BtnPanel.this.setOpaque(true);
+//			BtnPanel.this.setBackground(Color.red);
+			BtnPanel.this.add(btndownload);
+			BtnPanel.this.add(btnupfpload);
+//			BtnPanel.this.add(btnmove);
+			BtnPanel.this.add(btneidt);
+			BtnPanel.this.add(btndelete);
+			
+			if(filevo!=null&&filevo.getFiletype()!=null&&filevo.getFiletype().equalsIgnoreCase(FileTypeConst.URL)){
+//				btndownload.setEnabled(false);
+				btndownload.setVisible(false);
+			}else{
+//				btndownload.setEnabled(true);
+				btndownload.setVisible(true);
+			}
+			
+
+			// springlayout 控制按钮间距离 15
+			layout.putConstraint(SpringLayout.WEST, btndownload, 12,
+					SpringLayout.WEST, BtnPanel.this);
+			
+			layout.putConstraint(SpringLayout.WEST, btnupfpload, 12,
+					SpringLayout.EAST, btndownload);
+			
+			layout.putConstraint(SpringLayout.WEST, btneidt, 12,
+					SpringLayout.EAST, btnupfpload);
+			layout.putConstraint(SpringLayout.WEST, btndelete, 12,
+					SpringLayout.EAST, btneidt);
+			
+			
+/*			layout.putConstraint(SpringLayout.WEST, btndownload, 15,
+			SpringLayout.WEST, BtnPanel.this);
+			
+			layout.putConstraint(SpringLayout.WEST, btnmove, 15,
+					SpringLayout.EAST, btndownload);
+			layout.putConstraint(SpringLayout.WEST, btneidt, 15,
+					SpringLayout.EAST, btnmove);
+			layout.putConstraint(SpringLayout.WEST, btndelete, 15,
+					SpringLayout.EAST, btneidt);*/
+			// layout.putConstraint(SpringLayout.WEST,test,15,SpringLayout.EAST,btndelete);
+
+			//处理权限
+			
+				btndownload.setEnabled(downloadenable);
+				btndelete.setEnabled(deleteenable);
+			
+			
+			//注册事件
+			btndownload.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					downloadFile();
+
+				}
+
+				private void downloadFile() {
+					getPatchInfoTable().setRowSelectionInterval(rowindex,
+							rowindex);
+					int row = BtnPanel.this.rowindex;
+					if (row == -1) {
+						return;
+					}
+					NCFileVO filevo = (NCFileVO) getfiletablemodel().getVO(row);
+					String filepath = filevo.getFullPath();
+
+					if (filepath != null) {
+						String path = filevo.getFullPath();
+						String name = filevo.getName();
+						String defaultType = getFileType(name);
+						NCFileChooser chooser = new NCFileChooser();
+						// 设置默认选中文件
+						chooser.setSelectedFile(new File(name));
+
+						if (chooser.showSaveDialog(ThFileContentPanel.this) == JFileChooser.APPROVE_OPTION) {
+							File file = chooser.getSelectedFile();
+							
+							// 如果选中文件无后缀名,添加默认后缀名
+							if (!file.getName().contains(".")
+									&& defaultType != null) {
+								file = new File(file.getParent(), file
+										.getName()
+										+ defaultType);
+							}
+							String dsName = WorkbenchEnvironment.getInstance()
+									.getLoginBusiCenter().getDataSourceName();
+							FileOutputStream fos = null;
+							try {
+								fos = new FileOutputStream(file);
+								FileManageServletClient.downloadFile(dsName,
+										path, fos);
+							} catch (Exception ex) {
+								Logger.error(ex.getMessage(), ex);
+								MessageDialog
+										.showErrorDlg(
+												ThFileContentPanel.this,
+												NCLangRes
+														.getInstance()
+														.getStrByID("pc",
+																"FileManageUI-000000")/* 错误 */,
+												ex.getMessage());
+							} finally {
+								try {
+									if (fos != null) {
+										fos.close();
+									}
+								} catch (Exception e2) {
+								}
+							}
+						}
+
+					}
+				}
+
+			});
+			
+			
+			btnupfpload.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					downloadFile();
+
+				}
+
+				private void downloadFile() {
+					getPatchInfoTable().setRowSelectionInterval(rowindex,
+							rowindex);
+					int row = BtnPanel.this.rowindex;
+					if (row == -1) {
+						return;
+					}
+					NCFileVO filevo = (NCFileVO) getfiletablemodel().getVO(row);
+					String filepath = filevo.getFullPath();
+
+					if (filepath != null) {
+						String path = filevo.getFullPath();
+						String name = filevo.getName();
+						String defaultType = getFileType(name);
+	
+						File file = new File("C:\\Users\\Administrator\\Desktop\\附件迁移rrr.txt");
+						
+						String dsName = WorkbenchEnvironment.getInstance()
+								.getLoginBusiCenter().getDataSourceName();
+						FileOutputStream fos = null;
+						try {
+							fos = new FileOutputStream(file);
+							FileManageServletClient.downloadFile(dsName,
+									path, fos);
+							MessageDialog.showHintDlg(ThFileContentPanel.this, "提示", "传发票系统成功!");
+						} catch (Exception ex) {
+							Logger.error(ex.getMessage(), ex);
+							MessageDialog
+									.showErrorDlg(
+											ThFileContentPanel.this,
+											NCLangRes
+													.getInstance()
+													.getStrByID("pc",
+															"FileManageUI-000000")/* 错误 */,
+											ex.getMessage());
+							} finally {
+								try {
+									if (fos != null) {
+										fos.close();
+									}
+								} catch (Exception e2) {
+								}
+							}
+
+					}
+				}
+
+			});
+			
+			
+			btneidt.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					getPatchInfoTable().setRowSelectionInterval(rowindex,
+							rowindex);
+					ThFilePatchAttrDialog dialog = new ThFilePatchAttrDialog(
+							ThFileContentPanel.this);
+//					dialog.setSize(525, 350);
+					dialog.showModal();
+				}
+
+			});
+			btndelete.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					getPatchInfoTable().setRowSelectionInterval(rowindex,
+							rowindex);
+					if (MessageDialog.showOkCancelDlg(ThFileContentPanel.this,
+							NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0011")/*确认删除*/, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0012")/*确定要删除文件?*/) == MessageDialog.ID_OK) {
+						int row = getPatchInfoTable().getSelectedRow();
+						NCFileVO filevo = (NCFileVO) getfiletablemodel().getVO(
+								row);
+						String filepath = filevo.getFullPath();
+						try {
+							// 删除文件
+							IFileSystemService service = NCLocator
+									.getInstance().lookup(
+											IFileSystemService.class);
+
+							service
+									.deleteNCFileNodes(new String[] { filepath });
+
+							// 刷新table
+							getfiletablemodel().removeVO(row);
+							getfiletablemodel().refreshTable();
+							// 树上的缓存清理
+							getTreenodefilecacheMap().get("root")
+									.remove(filevo);
+							getTreenodefilecacheMap().get(
+									filevo.getParentpath()).remove(filevo);
+							
+
+							//// 更新状态栏(几个附件,大小)
+							refreshStatuBar();
+						} catch (BusinessException ex) {
+							Logger.error(ex.getMessage(), ex);
+						}
+					}
+				}
+			});
+			btnmove.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					getPatchInfoTable().setRowSelectionInterval(rowindex,
+							rowindex);
+					ThFileMoveDialog fdlg = new ThFileMoveDialog(
+							ThFileContentPanel.this);
+					fdlg.showModal();
+				}
+
+			});
+		}
+
+	}
+
+	private class BtnTableCellRender implements TableCellRenderer {
+		public BtnTableCellRender() {
+			// FileManageMainUI.this.btnpanel.setOpaque(true);
+			// FileManageMainUI.this.btnpanel.btndelete.setOpaque(true);
+			// FileManageMainUI.this.btnpanel.btneidt.setOpaque(true);
+
+		}
+
+		@Override
+		public Component getTableCellRendererComponent(JTable table,
+				Object value, boolean isSelected, boolean hasFocus, int row,
+				int column) {
+			// table.setRowSelectionInterval(row, row);
+			if (column == 5) {
+				BtnPanel bp =new BtnPanel(row);
+				bp.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+
+				bp.setOpaque(true);
+				if(isSelected){
+					bp.setBackground(table.getSelectionBackground());
+				}
+				
+				return bp;
+			} else if (column == 1) {
+				String strbtn = (value == null) ? "" : value.toString();
+				HyperButton btn1 = new HyperButton(strbtn, strbtn);
+				if(isSelected){
+					btn1.setOpaque(true);
+					btn1.setBackground(table.getSelectionBackground());
+				}
+				btn1.addActionListener(new ActionListener() {
+
+					@Override
+					public void actionPerformed(ActionEvent e) {
+						JOptionPane.showMessageDialog(null, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0013")/*预览*/);
+
+					}
+
+				});
+				return btn1;
+			}
+			return null;
+		}
+
+	}
+
+	private class BtnTableCellEditor extends DefaultCellEditor {
+		private static final long serialVersionUID = 103249569489177021L;
+
+		public BtnTableCellEditor(JCheckBox checkBox) {
+			super(checkBox);
+
+		}
+
+		JLabel label = new JLabel();
+
+		@Override
+		public Component getTableCellEditorComponent(JTable table,
+				Object value, boolean isSelected, int row, int column) {
+			table.setRowSelectionInterval(row, row);
+			if (column == 5) {
+				return new BtnPanel(row);
+			} else if (column == 1) {
+				String strbtn = (value == null) ? "" : value.toString();
+				
+//				NCFileVO file = (NCFileVO) getfiletablemodel().getVO(
+//						row);
+//				file.getTime()
+				HyperButton btn1 = new HyperButton(strbtn, strbtn);
+			
+				btn1.addActionListener(new ActionListener() {
+
+					@Override
+					public void actionPerformed(ActionEvent e) {
+						// JOptionPane.showMessageDialog(null, "预览");
+						int row = getPatchInfoTable().getSelectedRow();
+						NCFileVO file = (NCFileVO) getfiletablemodel().getVO(
+								row);
+
+						String dsName = WorkbenchEnvironment.getInstance()
+								.getLoginBusiCenter().getDataSourceName();
+						try {
+							//更新浏览次数(前台调用,是否该下载后台?)
+							IFileSystemService ser= NCLocator.getInstance().lookup(IFileSystemService.class);
+							ser.updateBrowseTimes(file.getFullPath());
+							//前台浏览次数+1
+							int size=0;
+							if(file.getScantimes()==Integer.MAX_VALUE){
+								size=file.getScantimes();
+							}else{
+								size=file.getScantimes()+1;
+							}
+							file.setScantimes(size);
+							//下载文件()
+							//如果URL直接打开
+							if(file.getFiletype()!=null&&file.getFiletype().equalsIgnoreCase(FileTypeConst.URL)){
+								//没必要在自己系统里判断自己附件安全,让加上就加上//TODO 捎个URL的DNS解析IP判断,不写了真没必要检查
+								URL url = new URL(file.getPk_doc());
+								List<String> list =null;
+								list = getHostNameIP();
+								//判断URL IP或者hostname,是否在本地IP list,或者 name list 中,
+								//不在本地提示再打开
+								if(!IsStrInListIgnoreCase( url.getHost(),list)){								
+									if(MessageDialog.showOkCancelDlg(ThFileContentPanel.this,NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0018")/*警告*/,NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0017")/**/)== MessageDialog.ID_OK){
+										ClientToolKit.showDocument(new URL(file.getPk_doc()), "_blank");
+									}
+								}else{//本地直接打开
+									ClientToolKit.showDocument(new URL(file.getPk_doc()), "_blank");
+								}
+							}else{//如果文件下载打开
+								FileManageServletClient.showFileInWeb(dsName, file
+									.getFullPath(), file.getTime());
+							}
+						} catch (Exception e1) {
+							MessageDialog.showErrorDlg(ThFileContentPanel.this, NCLangRes.getInstance().getStrByID("sftemp", "PasteAttachAction-0001")/*错误*/, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0014")/*浏览错误请查看日志!*/);
+							Logger.error(e1);
+						}
+
+					}
+
+				});
+				return btn1;
+			} else {
+				label.setText((value == null) ? "" : value.toString());
+				return label;
+			}
+		}
+
+		@Override
+		public void addCellEditorListener(CellEditorListener l) {
+
+//			System.out.println("addCellEditorListener");
+			super.addCellEditorListener(l);
+		}
+
+		@Override
+		public void cancelCellEditing() {
+//			System.out.println("cancelCellEditing");
+			super.cancelCellEditing();
+		}
+
+		@Override
+		public Object getCellEditorValue() {
+			return "";
+		}
+
+		@Override
+		public boolean isCellEditable(EventObject anEvent) {
+			// 
+			return super.isCellEditable(anEvent);
+		}
+
+		@Override
+		public void removeCellEditorListener(CellEditorListener l) {
+			// 
+			super.removeCellEditorListener(l);
+		}
+
+		@Override
+		public boolean shouldSelectCell(EventObject anEvent) {
+//			System.out.println("cancelCellEditing");
+			return super.shouldSelectCell(anEvent);
+		}
+
+		@Override
+		public boolean stopCellEditing() {
+			// 
+			return super.stopCellEditing();
+		}
+		
+	}
+	public boolean CheckTheSameFileName(NCFileNode node ,String filename)
+	{
+		//加入 前台校验 ,判断是否存在同名 文件,同名不允许添加
+		String nodepath = node.getFullPath();
+		String combinepath =nodepath;
+		if(!nodepath.endsWith("/")){
+			combinepath=combinepath+"/";
+		}
+		Collection<NCFileVO> cltvo = getTreenodefilecacheMap().get(nodepath);
+		if(cltvo!=null){
+			for(NCFileVO filevo :cltvo){
+				if(filevo.getFullPath().equalsIgnoreCase(combinepath+filename)){
+					MessageDialog.showErrorDlg(this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("sftemp", "FileContentPanel-0015", null, new String[]{filename})/*文件名{0}重复,不能该文件上传!*/);
+					return  true;
+				}
+			}
+		}
+		return false;
+		
+	}
+	/**
+	 * 新建文件夹,文件夹改名时,检查重复
+	 * @param node
+	 * @param foldername
+	 * @return
+	 */
+	public boolean CheckTheSameFolderName(TreeNode node ,String foldername)
+	{
+		//加入 前台校验 ,判断是否存在同名 文件,同名不允许添加
+		for(int noden=0; noden<node.getChildCount();noden++)
+		{
+			TreeNode subnode =node.getChildAt(noden);
+			//如果选择node下有同名的node
+			if(foldername.trim().equalsIgnoreCase(subnode.toString().trim()))
+			{
+				MessageDialog.showErrorDlg(ThFileContentPanel.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("sfbase", "FileManageUI-000000", null, new String[]{foldername})/*文件存在:{0}*/);
+				return  true;
+			}
+		}
+		return false;
+		
+	}
+	protected TreeNode[] getTreePath(TreeNode node) {
+		List<TreeNode> list = new ArrayList<TreeNode>();
+		TreeNode temp = node;
+		while (temp != null && !temp.equals(rootNode)) {
+			list.add(0, temp);
+			temp = temp.getParent();
+		}
+		list.add(0, rootNode);
+		return list.toArray(new TreeNode[0]);
+	}
+	private String convertTreePathToString(TreeNode[] nodes) {
+		StringBuilder sb = new StringBuilder();
+		int count = nodes == null ? 0 : nodes.length;
+		int index = 0;
+//		if (!getPatchTree().isRootVisible())
+			index = 1;
+		for (int i = index; i < count; i++) {
+			if (sb.length() > 0)
+				sb.append("/");
+			sb.append(nodes[i]);
+		}
+		return sb.toString();
+	}
+	
+	/**
+	 * 不管用何种方式上传后,刷新树和表
+	 * @param parentfoldernode
+	 * @param newaddfilevo
+	 */
+	protected void nodeToFileVO(NCFileNode parentfoldernode, NCFileNode newaddfilevo) {
+		NCFileVO newfilevo = new NCFileVO();
+		String newpath = "";
+		if(parentfoldernode.getFullPath().endsWith("/")){
+			newpath=parentfoldernode.getFullPath();
+		}else{
+			newpath=parentfoldernode.getFullPath()+"/";
+		}
+		
+		newfilevo.setPath(newpath+newaddfilevo.getFullPath());
+		newfilevo.setCreator(newaddfilevo.getCreator());
+		newfilevo.setTime(newaddfilevo.getTime());
+		newfilevo.setFileLen(newaddfilevo.getFileLen());
+		newfilevo.setFiletype(FileTypeConst.getFileTypeByFileName(newaddfilevo.getFullPath()));
+		//刷新界面
+		refreshUI(parentfoldernode, newfilevo);
+	}
+
+	protected void refreshUI(NCFileNode parentfoldernode, NCFileVO newfilevo) {
+		//加入树缓存 
+		ArrayList<NCFileVO> arr = new ArrayList<NCFileVO>();
+		
+		if(getTreenodefilecacheMap().get(parentfoldernode.getFullPath())!=null){
+			arr.addAll(getTreenodefilecacheMap().get(parentfoldernode.getFullPath()));
+		}
+		arr.add(newfilevo);
+		parentfoldernode.getFilemap().put(newfilevo.getFullPath(),newfilevo);
+		getTreenodefilecacheMap().put(parentfoldernode.getFullPath(),arr);
+		//如果不是根的话,选根时也能查看到,加入跟缓存	
+		ArrayList<NCFileVO> arrroot = new ArrayList<NCFileVO>();
+		if(getTreenodefilecacheMap().get("root")!=null){
+		arrroot.addAll(getTreenodefilecacheMap().get("root"));
+		}
+		arrroot.add(newfilevo);
+		getTreenodefilecacheMap().put("root",arrroot);
+		if(!parentfoldernode.getFullPath().equalsIgnoreCase(rootDirStr)){
+			// ... 不是根的操作???
+			
+		}else{			
+			arr =(ArrayList<NCFileVO>) getTreenodefilecacheMap().get("root");
+		}
+		//刷新table
+		if(PAGE_STATE==BROWSELISTTABLE_STATE){
+			getfiletablemodel().clearTable();
+			getfiletablemodel().addVO(arr.toArray(new NCFileVO[0]));
+		}else{
+			refreshUIbyClickTree();
+		}
+		//状态栏
+		refreshStatuBar();
+	}
+	private class BottomBorder extends AbstractBorder{
+		private static final long serialVersionUID = 1L;
+		protected int left, right, top, bottom;
+		public BottomBorder(int top, int left, int bottom, int right)   {
+	        this.top = top; 
+	        this.right = right;
+	        this.bottom = bottom;
+	        this.left = left;
+	    
+		}
+		@Override
+		public void paintBorder(Component c, Graphics g, int x, int y,int width, int height) {
+		
+			Color oldColor = g.getColor();
+			g.setColor(Color.gray);
+			g.drawLine(x, y+height-1, x+width, y+height-1);	
+			g.setColor(oldColor);
+//			g.drawLine(0, height, width, height);
+			
+		}
+		 public Insets getBorderInsets(Component c)       {
+		        return getBorderInsets();
+		    }
+
+		  
+		    public Insets getBorderInsets(Component c, Insets insets) {
+		        insets.left = left;
+		        insets.top = top;
+		        insets.right = right;
+		        insets.bottom = bottom;
+		        return insets;
+		    }
+
+		   
+		    public Insets getBorderInsets() {
+		        return new Insets(top, left, bottom, right);
+		    }
+
+		 
+		    public boolean isBorderOpaque() { return true; }
+		
+	}
+	
+	
+	/* begin 权限处理*/
+	
+	private boolean uploadenable= true;
+		
+	private boolean downloadenable = true;
+		
+	private boolean  deleteenable = true;
+		
+	private boolean  browseenable = true;
+		
+	private boolean  renameenable = true;
+	private boolean  showenable = true;
+	
+	
+	/**
+	 * 
+	 * @param validButton
+	 */	
+	public void setUploadFileEnable(boolean validButton) {
+		uploadenable=validButton ;
+		this.uploadAction.setEnabled(validButton);
+		this.uprefaction.setEnabled(validButton);
+		this.gpyaction.setEnabled(validButton);
+		this.pasteaction.setEnabled(validButton);
+		this.uploadurlaction.setEnabled(validButton);
+		
+	}
+
+	public void setCreateNewFolderEnable(boolean validButton) {
+		this.getNewfolderaction().setEnabled(validButton);
+		this.getNewfolderPopAction().setEnabled(validButton);
+	}
+
+	public void setDeleteNodeEnable(boolean validButton) {
+		
+		//对于文件夹操作
+		this.getDelfolderaction().setEnabled(validButton);
+		getDelfolderPopAction().setEnabled(validButton);
+		// 对于文件 删除怎么办
+		//1(对于文件)设置全局标志 表示 是否可删除??
+		//2(对于文件) 刷新table??
+		this.deleteenable = validButton ;
+	}
+
+	public void setDownloadFileEnable(boolean validButton) {
+		//1设置全局标志 表示 是否可删除??
+		//2 刷新table?? 
+		this.downloadenable = validButton;
+		
+		
+	}
+
+	public void setShowFileEnable(boolean validButton) {
+		//1设置全局标志 表示 是否可删除??
+		//2 刷新table??
+		showenable = validButton;
+		
+	}
+
+	public void setRenameNodeEnable(boolean validButton) {
+		//
+		this.renameenable = validButton ;
+		this.getRenamefolderaction().setEnabled(validButton);
+		this.getRenamefolderPopAction().setEnabled(validButton);
+		this.getPatchTree().setEditable(validButton);
+		//1设置全局标志 表示 是否可删除?? 删除时判断提示
+		//2 刷新table??
+		
+	}
+	/* end 权限处理*/
+	
+	public void setBilltypeComBoxEnable(boolean validButton){
+		this.getComboxbilltype().setVisible(validButton);
+	}
+	/**
+	 * 
+	 * @param map 显示名,根路径值
+	 */
+	public void setBilltypeComBoxData(Map<String,String> map){
+		this.getComboxbilltype().removeAllItems();
+		for(String disname :map.keySet()){
+			ItemObj item = new ItemObj(disname,map.get(disname));
+			this.getComboxbilltype().addItem(item);
+		}
+		
+	}
+	public List<String> getHostNameIP(){
+		List<String>  list = new ArrayList<String>();
+		InetAddress addr;
+		String hostname =null  ;
+		try {
+			addr = InetAddress.getLocalHost();
+			hostname= addr.getHostName();
+		} catch (UnknownHostException e) {
+			Logger.error(e);
+		}		
+		
+		list.add("127.0.0.1");
+		list.add("localhost");
+		if(hostname!=null){
+			
+			list.add(hostname);
+			String [] arrip = getAllLocalHostIP(hostname);
+			if(arrip!=null){
+				list.addAll(Arrays.asList(arrip));
+			}
+		}
+		return list ;
+	}
+	public String[] getAllLocalHostIP(String hostName) {
+	    String[] ret = null;
+	    try {
+	        
+	        if (hostName.length() > 0) {
+	            InetAddress[] addrs = InetAddress.getAllByName(hostName);
+	            if (addrs.length > 0) {
+	                ret = new String[addrs.length];
+	                for (int i = 0; i < addrs.length; i++) {
+	                    ret[i] = addrs[i].getHostAddress();
+	                }
+	            }
+	        }	 
+        } catch (Exception ex) {
+            ret = null;
+        }
+        return ret;
+	}
+	
+	public boolean IsStrInListIgnoreCase(String str,List<String> list){
+		boolean flag = false ;
+		if(str==null||list==null){
+			return flag ;
+		}
+		for(String s :list){
+			if(s.equalsIgnoreCase(str)){
+				flag = true ;
+				break ;
+			}
+		}
+		return flag ;
+	}
+}

+ 242 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThFileMoveDialog.java

@@ -0,0 +1,242 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Enumeration;
+
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SpringLayout;
+
+import nc.bs.framework.common.NCLocator;
+import nc.bs.logging.Logger;
+import nc.bs.pub.filesystem.IFileSystemService;
+import nc.pub.billcode.ui.ButtonPanel;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.UIDialog;
+import nc.vo.pub.BusinessException;
+import nc.vo.pub.filesystem.NCFileNode;
+import nc.vo.pub.filesystem.NCFileVO;
+
+public class ThFileMoveDialog extends UIDialog{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 3151163400123581252L;
+	ThFileContentPanel fielcontentpanel ;
+	public ThFileMoveDialog(ThFileContentPanel para){	
+		fielcontentpanel = para ;
+		int row = ThFileMoveDialog.this.fielcontentpanel.getPatchInfoTable().getSelectedRow();
+		if(row==-1){
+			return ;
+		}
+		initUI();		
+		this.setTitle(NCLangRes.getInstance().getStrByID("sftemp", "FileMoveDialog-0000")/*移动*/);
+	}
+	
+	 private JPanel mainpanel;
+	public JPanel getMainpanel(){
+		if(mainpanel== null){
+			mainpanel = new JPanel();
+			SpringLayout layout = new SpringLayout();
+			mainpanel.add(getLblmovefile());
+			mainpanel.add(getComboxfolder());
+//			mainpanel.add(getLinepanel());
+			mainpanel.add(getBottombtnPane());
+			mainpanel.setLayout(layout);
+			
+			layout.putConstraint(SpringLayout.NORTH, getLblmovefile(), 35,SpringLayout.NORTH , mainpanel);
+			layout.putConstraint(SpringLayout.WEST, getLblmovefile(), 35,SpringLayout.WEST , mainpanel);
+//			layout.putConstraint(SpringLayout.EAST, getLblmovefile(), 0,SpringLayout.EAST , mainpanel);
+			
+			layout.putConstraint(SpringLayout.WEST, getComboxfolder(), 10,SpringLayout.EAST , getLblmovefile());
+			layout.putConstraint(SpringLayout.EAST, getComboxfolder(), -35,SpringLayout.EAST , mainpanel);
+			layout.putConstraint(SpringLayout.NORTH, getComboxfolder(), 35,SpringLayout.NORTH , mainpanel);			
+			
+//			layout.putConstraint(SpringLayout.SOUTH, getLinepanel(), -75,SpringLayout.SOUTH , mainpanel);
+//			layout.putConstraint(SpringLayout.WEST, getLinepanel(), 0,SpringLayout.WEST , mainpanel);
+//			layout.putConstraint(SpringLayout.EAST, getLinepanel(), 0,SpringLayout.EAST , mainpanel);
+			
+			layout.putConstraint(SpringLayout.WEST ,getBottombtnPane(), 0,SpringLayout.WEST , mainpanel);
+			layout.putConstraint(SpringLayout.EAST ,getBottombtnPane(), 0,SpringLayout.EAST , mainpanel);
+//			layout.putConstraint(SpringLayout.SOUTH, getBottombtnPane(), 0,SpringLayout.SOUTH , mainpanel);
+			layout.putConstraint(SpringLayout.SOUTH, getBottombtnPane(), -0,SpringLayout.SOUTH , mainpanel);
+			
+		}
+		return mainpanel ;
+	}
+	private JPanel bottombtnPane;
+	public JPanel getBottombtnPane(){
+		if(bottombtnPane==null){
+			bottombtnPane = new JPanel();
+//			bottombtnPane.setPreferredSize(new Dimension(290,40));
+			FlowLayout  fl = new FlowLayout();
+			fl.setAlignment(FlowLayout.RIGHT);
+			bottombtnPane.setLayout(fl);
+			bottombtnPane.add(getBtnpanel());
+			
+			bottombtnPane.setBackground(FileColorConst.BOTTOMCOLOR);
+//			bottombtnPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
+			bottombtnPane.setBorder(new MyBorder(0,0,0,0));
+		}
+		
+		return bottombtnPane;
+	}
+	
+//	private JPanel dialogContenPane;
+//	public JPanel getDialogpane(){
+//		if(dialogContenPane == null){
+//			dialogContenPane = new JPanel();
+//			dialogContenPane.add(getMainpanel());
+//		}
+//		return dialogContenPane;
+//	}
+	private void initUI(){
+		setSize(290, 145);
+		this.getContentPane().add(getMainpanel());
+	}
+	private JLabel lblmovefile;
+	public JLabel getLblmovefile(){
+		if(lblmovefile == null){
+			lblmovefile = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "FileMoveDialog-0001")/*移动到*/);
+		}
+		return lblmovefile ;
+	}
+	private JComboBox Comboxfile;
+	public JComboBox getComboxfolder(){
+		if(Comboxfile == null){
+			Comboxfile = new JComboBox();
+			
+			NCFileNode node =(NCFileNode)fielcontentpanel.getTreemodel().getRoot();
+			String rootpath = node.getFullPath();
+			//隐藏根目录前字符串
+//			String unvisstr = "";
+//			if(rootpath.contains("/")){
+//				unvisstr=rootpath.substring(0,rootpath.lastIndexOf("/")+1);
+//			}
+			
+			Enumeration<NCFileNode>  e =node.breadthFirstEnumeration();
+			while(e.hasMoreElements()){
+				NCFileNode enode =(NCFileNode)e.nextElement();
+				if(!enode.isRoot()){
+					MoveFolder mf = new MoveFolder();
+					if(rootpath!=""){
+						mf.dispname=NCLangRes.getInstance().getStrByID("sftemp", "FileBrowseGPYPotoDialog-0010", null, new String[]{enode.getFullPath().substring(rootpath.length())})/*全部{0}*/;							
+					}else{
+						mf.dispname=enode.getFullPath();	
+					}
+					mf.value=enode.getFullPath();
+					Comboxfile.addItem( mf);					
+				}
+			}
+			
+		}
+		return Comboxfile;
+	}
+	private ButtonPanel btnpanel ;
+	public ButtonPanel getBtnpanel(){
+		if(btnpanel == null){
+			btnpanel = new ButtonPanel();
+			btnpanel.setOpaque(false);
+			btnpanel.getBtnOK().addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					int row = ThFileMoveDialog.this.fielcontentpanel.getPatchInfoTable().getSelectedRow();
+					if(row==-1){
+						return ;
+					}
+					NCFileVO filevo = (NCFileVO)ThFileMoveDialog.this.fielcontentpanel.getfiletablemodel().getVO(row);
+					String oldpath = filevo.getFullPath();
+					String filenodepath =filevo.getParentpath();
+					String oldtreepath = "";
+						
+					if(filevo.getParentpath().equalsIgnoreCase(ThFileMoveDialog.this.fielcontentpanel.getRootDirStr())){
+						oldtreepath="root";
+					}else{
+						oldtreepath=filevo.getParentpath();
+					}
+					
+					String newfullpath ="";
+					String filenewpath = ((MoveFolder)getComboxfolder().getSelectedItem()).getValue();
+					if(filenewpath.endsWith("/")){
+						newfullpath=filenewpath+filevo.getName();
+					}else{
+						newfullpath=filenewpath+"/"+filevo.getName();
+					}
+					//假如根本没有移动
+					if(oldpath.equalsIgnoreCase(newfullpath)){
+						MessageDialog.showErrorDlg(ThFileMoveDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "FileMoveDialog-0002")/*文件在本文件夹下,不用移动!*/);
+						return;
+					}
+					filevo.setPath(newfullpath);
+					
+					NCFileNode node = (NCFileNode)fielcontentpanel.getPatchTree().getSelectionPath().getLastPathComponent();
+					IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);					
+					try {
+						//更新树
+						boolean b =service.updateFileAttribute(filevo, oldpath);
+						if(b){
+							//更新界面
+							//树上的缓存
+							ThFileMoveDialog.this.fielcontentpanel.getTreenodefilecacheMap().get(filenodepath).remove(filevo);
+							ArrayList<NCFileVO> arr = new ArrayList<NCFileVO>();
+							arr.addAll(ThFileMoveDialog.this.fielcontentpanel.getTreenodefilecacheMap().get(filevo.getParentpath()));
+							arr.add(filevo);
+							//更新table
+							ThFileMoveDialog.this.fielcontentpanel.getTreenodefilecacheMap().put(filevo.getParentpath(), arr);
+							NCFileVO [] arrtablevo =ThFileMoveDialog.this.fielcontentpanel.getTreenodefilecacheMap().get(oldtreepath).toArray(new NCFileVO[0]);
+							ThFileMoveDialog.this.fielcontentpanel.getfiletablemodel().clearTable();
+							if(node.getFullPath().equals(fielcontentpanel.rootDirStr)){
+								ThFileMoveDialog.this.fielcontentpanel.getfiletablemodel().addVO(fielcontentpanel.getTreenodefilecacheMap().get("root").toArray(new NCFileVO[0]));
+							}else{
+								ThFileMoveDialog.this.fielcontentpanel.getfiletablemodel().addVO(fielcontentpanel.getTreenodefilecacheMap().get(node.getFullPath()).toArray(new NCFileVO[0]));
+							}
+							//状态栏
+							ThFileMoveDialog.this.fielcontentpanel.refreshStatuBar();
+						}else{
+							//有同名 
+							MessageDialog.showErrorDlg(ThFileMoveDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "FileMoveDialog-0003")/*不能移动,该文件下有同名文件!*/);
+						}
+						ThFileMoveDialog.this.closeOK();
+					} catch (BusinessException e1) {
+						Logger.error(e1);
+					}
+				}	
+			});
+			btnpanel.getBtnCancel().addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					ThFileMoveDialog.this.closeCancel();
+					
+				}
+			});
+		}
+		return btnpanel ;
+	}
+	private class MoveFolder{
+		public String getValue() {
+			return value;
+		}
+		public void setValue(String value) {
+			this.value = value;
+		}
+		public String getDispname() {
+			return dispname;
+		}
+		public void setDispname(String dispname) {
+			this.dispname = dispname;
+		}
+		private String value ;
+		private String dispname ;
+		@Override
+		public String toString() {
+			
+			return this.dispname;
+		}
+	}
+	
+}

+ 607 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThFilePatchAttrDialog.java

@@ -0,0 +1,607 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Date;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
+
+import nc.bs.framework.common.InvocationInfoProxy;
+import nc.bs.framework.common.NCLocator;
+import nc.bs.logging.Logger;
+import nc.bs.pub.filesystem.IFileSystemService;
+import nc.pubitf.rbac.IUserPubService;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.UIButton;
+import nc.ui.pub.beans.UIDialog;
+import nc.ui.pub.beans.UIPanel;
+import nc.vo.ml.MultiLangUtil;
+import nc.vo.pub.BusinessException;
+import nc.vo.pub.filesystem.FileTypeConst;
+import nc.vo.pub.filesystem.NCFileNode;
+import nc.vo.pub.filesystem.NCFileVO;
+import nc.vo.sm.UserVO;
+import net.miginfocom.swing.MigLayout;
+
+public class ThFilePatchAttrDialog extends UIDialog {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 7993565512938510101L;
+	private ThFileContentPanel parentpane;
+	private JLabel lblfilename;
+	private JTextField txtfilename;
+	private JLabel lblfilesize;
+	private JTextField txtfilesize;
+	private JLabel lblfiletype;
+	private JTextField txtfiletype;
+	private JLabel lblfilescantimes;
+	private JTextField txtfilescantimes;
+	private JLabel lblfilecreator;
+	private JTextField textfilecreator;
+	private JLabel lblcreatetime;
+	private JTextField txtcreatetime;
+	private JLabel lblfilemodifier;
+	private JTextField txtfilemodifier;
+	private JLabel lblfilemodifytime;
+	private JTextField txtfilemodifytime;
+	private JLabel lblfiledesc;
+	private JTextArea txtareafiledesc;
+	private JLabel lblinfo;
+
+	public JLabel getLblinfo() {
+		if (lblinfo == null) {
+			lblinfo = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0011")/*附件说明不超过200字*/);
+			lblinfo.setHorizontalAlignment(SwingConstants.RIGHT);
+		}
+		return lblinfo;
+	}
+
+	private JPanel btnpanel;
+
+	public JPanel getBtnpanel() {
+		if (btnpanel == null) {
+			btnpanel = new JPanel();
+			btnpanel.setOpaque(false);
+			UIButton btnsave = new UIButton(NCLangRes.getInstance().getStrByID(
+					"sftemp", "UploadURLAction-0003")/* 确定 */);
+			UIButton btncancel = new UIButton(NCLangRes.getInstance().getStrByID(
+					"sftemp", "UploadURLAction-0004")/* 取消 */);
+			btnsave.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+				
+					//检查输入合法性
+					if(!checkValidate()){
+						return;
+					}
+					
+					NCFileNode selectednode = (NCFileNode) parentpane
+							.getPatchTree().getSelectionPath()
+							.getLastPathComponent();
+					String selectedtreepath = selectednode.getFullPath();
+					String sepath = "";
+
+					int row = parentpane.getPatchInfoTable().getSelectedRow();
+					NCFileVO oldvo = (NCFileVO) parentpane.getfiletablemodel()
+							.getVO(row);
+					NCFileVO newvo = oldvo.clone();
+					newvo.setFiledesc(ThFilePatchAttrDialog.this
+							.getTxtareafiledesc().getText());
+
+					if (selectedtreepath.equals(parentpane.getRootDirStr())) {
+						sepath = "root";
+					} else {
+						sepath = oldvo.getParentpath();
+					}
+
+					String path = "";
+					int point = getTxtfilename().getText().lastIndexOf(".");
+					// 如果没有输入扩展名,加上扩展名,输入了取值即可
+					if ((point == -1 || !getTxtfiletype().getText()
+							.equalsIgnoreCase(
+									getFileType(getTxtfilename().getText())))
+							&& !getTxtfiletype().getText().equals(
+									FileTypeConst.URL)) {
+						path = oldvo.getParentpath() + "/"
+								+ getTxtfilename().getText() + "."
+								+ getTxtfiletype().getText();
+					} else {
+						path = oldvo.getParentpath() + "/"
+								+ getTxtfilename().getText();
+					}
+
+					newvo.setPath(path);
+					// 修改人
+					newvo.setModifier(InvocationInfoProxy.getInstance()
+							.getUserId());
+					// 修改的时间
+					Date date = new Date();
+					newvo.setModifytime(date.getTime());
+					// 保存
+					IFileSystemService service = NCLocator.getInstance()
+							.lookup(IFileSystemService.class);
+					try {
+						boolean b = service.updateFileAttribute(newvo, oldvo
+								.getFullPath());
+						if (b) {
+							// 更新table
+							oldvo.setFiledesc(ThFilePatchAttrDialog.this
+									.getTxtareafiledesc().getText());
+							oldvo.setPath(path);
+							oldvo.setModifier(newvo.getModifier());
+							oldvo.setModifytime(newvo.getModifytime());
+							parentpane.getfiletablemodel().clearTable();
+							parentpane.getfiletablemodel().addVO(
+									parentpane.getTreenodefilecacheMap().get(
+											sepath).toArray(new NCFileVO[0]));
+							parentpane.getfiletablemodel().refreshTable();
+						} else {
+							MessageDialog.showErrorDlg(parentpane, NCLangRes
+									.getInstance().getStrByID("sftemp",
+											"PasteAttachAction-0001")/* 错误 */,
+									NCLangRes.getInstance().getStrByID(
+											"sftemp",
+											"FilePatchAttrDialog-0000")/*
+																		 * 文件名重复!
+																		 */);
+						}
+
+					} catch (BusinessException e1) {
+						Logger.error(e1);
+					}
+					ThFilePatchAttrDialog.this.closeOK();
+				}
+
+				private boolean checkValidate() {
+					if (getTxtfilename().getText() == null
+							|| getTxtfilename().getText().isEmpty()) {
+						MessageDialog.showErrorDlg(ThFilePatchAttrDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0012")/*错误*/, NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0013")/*附件名不能为空!*/);
+						return false;
+					}
+					if(getTxtfilename().getText().length()>30){
+						MessageDialog.showErrorDlg(ThFilePatchAttrDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0012")/*错误*/, NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0014")/*附件名不能超过30字!*/);
+						return false;
+					}
+					if(getTxtareafiledesc().getText()!=null&&getTxtareafiledesc().getText().length()>200){
+						MessageDialog.showErrorDlg(ThFilePatchAttrDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0012")/*错误*/, NCLangRes.getInstance().getStrByID("sftemp", "FilePatchAttrDialog-0015")/*附件描述长度不能超过200字!*/);
+						return false;
+					}
+					return true;
+				}
+			});
+			btncancel.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					// 
+					ThFilePatchAttrDialog.this.closeCancel();
+
+				}
+			});
+			btnpanel.add(btnsave);
+			btnpanel.add(btncancel);
+		}
+		return btnpanel;
+	}
+
+	public JLabel getLblfiledesc() {
+		if (lblfiledesc == null) {
+			
+			lblfiledesc = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0001")/* 附件说明 */);
+		}
+		return lblfiledesc;
+	}
+private JScrollPane jscpanedesc;
+private JScrollPane getJscpanedesc(){
+	if(jscpanedesc==null){
+		jscpanedesc = new JScrollPane(getTxtareafiledesc());
+		
+	}
+	return jscpanedesc ;
+}
+	public JTextArea getTxtareafiledesc() {
+		if (txtareafiledesc == null) {
+			txtareafiledesc = new JTextArea();
+			txtareafiledesc.setAutoscrolls(true);
+			txtareafiledesc.setLineWrap(true);
+			txtareafiledesc.setBorder(null);
+		}
+		return txtareafiledesc;
+	}
+
+	public JTextField getTextfilecreator() {
+		if (textfilecreator == null) {
+			textfilecreator = new JTextField();
+		}
+		return textfilecreator;
+	}
+
+	public JLabel getLblcreatetime() {
+		if (lblcreatetime == null) {
+			lblcreatetime = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0002")/* 创建时间 */);
+		}
+		return lblcreatetime;
+	}
+
+	public JTextField getTxtcreatetime() {
+		if (txtcreatetime == null) {
+			txtcreatetime = new JTextField();
+			txtcreatetime.setEditable(false);
+			txtcreatetime.setEnabled(false);
+		}
+		return txtcreatetime;
+	}
+
+	public JLabel getLblfilemodifytime() {
+		if (lblfilemodifytime == null) {
+			lblfilemodifytime = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0003")/* 修改时间 */);
+		}
+		return lblfilemodifytime;
+	}
+
+	public JTextField getTxtfilemodifytime() {
+		if (txtfilemodifytime == null) {
+			txtfilemodifytime = new JTextField();
+			txtfilemodifytime.setEditable(false);
+			txtfilemodifytime.setEnabled(false);
+		}
+		return txtfilemodifytime;
+	}
+
+	public JLabel getLblfilename() {
+		if (lblfilename == null) {
+			lblfilename = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0004")/* 附件名 */);
+		}
+		return lblfilename;
+	}
+
+	public JTextField getTxtfilename() {
+		if (txtfilename == null) {
+			txtfilename = new JTextField();
+		}
+		return txtfilename;
+	}
+
+	public JLabel getLblfilesize() {
+		if (lblfilesize == null) {
+			lblfilesize = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0005")/* 附件大小 */);
+		}
+		return lblfilesize;
+	}
+
+	public JTextField getTxtfilesize() {
+		if (txtfilesize == null) {
+			txtfilesize = new JTextField();
+			// txtfilesize.setEditable(false);
+			txtfilesize.setEnabled(false);
+
+		}
+		return txtfilesize;
+	}
+
+	public JLabel getLblfiletype() {
+		if (lblfiletype == null) {
+			lblfiletype = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0006")/* 附件类型 */);
+		}
+		return lblfiletype;
+	}
+
+	public JTextField getTxtfiletype() {
+		if (txtfiletype == null) {
+			txtfiletype = new JTextField();
+			txtfiletype.setEditable(false);
+			txtfiletype.setEnabled(false);
+		}
+		return txtfiletype;
+	}
+
+	public JLabel getLblfilescantimes() {
+		if (lblfilescantimes == null) {
+			lblfilescantimes = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0007")/* 浏览次数 */);
+		}
+		return lblfilescantimes;
+	}
+
+	public JTextField getTxtfilescantimes() {
+		if (txtfilescantimes == null) {
+			txtfilescantimes = new JTextField();
+			// txtfilescantimes.setEditable(false);
+			txtfilescantimes.setEnabled(false);
+		}
+		return txtfilescantimes;
+	}
+
+	public JLabel getLblfilecreator() {
+		if (lblfilecreator == null) {
+			lblfilecreator = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0008")/* 创建人 */);
+		}
+		return lblfilecreator;
+	}
+
+	public JTextField getTxtfilecreator() {
+		if (textfilecreator == null) {
+			textfilecreator = new JTextField();
+			// textfilecreator.setEditable(false);
+			textfilecreator.setEnabled(false);
+		}
+		return textfilecreator;
+	}
+
+	public JLabel getLblfilemodifier() {
+		if (lblfilemodifier == null) {
+			lblfilemodifier = new JLabel(NCLangRes.getInstance().getStrByID(
+					"sftemp", "FilePatchAttrDialog-0009")/* 修改人 */);
+		}
+		return lblfilemodifier;
+	}
+
+	public JTextField getTxtfilemodifier() {
+		if (txtfilemodifier == null) {
+			txtfilemodifier = new JTextField();
+			// txtfilemodifier.setEditable(false);
+			txtfilemodifier.setEnabled(false);
+		}
+		return txtfilemodifier;
+	}
+
+	public ThFilePatchAttrDialog(ThFileContentPanel ppane) {
+		this.parentpane = ppane;
+		initUI();
+		initData();
+	}
+
+	public ThFilePatchAttrDialog() {
+
+		initUI();
+		initData();
+	}
+//	private JScrollPane jscpane ;
+//	private JScrollPane getJscpane(){
+//		if(jscpane ==null){
+//			jscpane = new JScrollPane();
+//			jscpane.setViewportView(getMainPane1());
+//		}
+//		return jscpane;
+//	}
+	private JPanel mainpane;
+
+	public JPanel getMainPane1() {
+		if (mainpane == null) {
+			mainpane = new UIPanel();
+			mainpane.setOpaque(true);
+
+			// SpringLayout springlayout = new SpringLayout();
+			// mainpane.setLayout(springlayout);
+			// mainpane.add(getLblfilename());
+			// mainpane.add(getTxtfilename());
+			// mainpane.add(getLblfiletype());
+			// mainpane.add(getTxtfiletype());
+			// mainpane.add(getLblfilesize());
+			// mainpane.add(getTxtfilesize());
+			// mainpane.add(getLblfilescantimes());
+			// mainpane.add(getTxtfilescantimes());
+			// mainpane.add(getLblfilecreator());
+			// mainpane.add(getTxtfilecreator());
+			// mainpane.add(getLblcreatetime());
+			// mainpane.add(getTxtcreatetime());
+			// mainpane.add(getLblfilemodifier());
+			// mainpane.add(getTxtfilemodifier());
+			// mainpane.add(getLblfilemodifytime());
+			// mainpane.add(getTxtfilemodifytime());
+			// mainpane.add(getLblfiledesc());
+			// mainpane.add(getTxtareafiledesc());
+			// mainpane.add(getBtnpanel());
+			//			
+			// springlayout.putConstraint(SpringLayout.WEST, getLblfilename(),
+			// 35, SpringLayout.WEST, mainpane);
+
+			MigLayout miglayout = new MigLayout("insets 25 35 25 35",
+					"[fill]rel[fill]30[fill]rel[fill]",
+					"[]10[]10[]10[]10[]10[]");
+
+			mainpane.setLayout(miglayout);
+			mainpane.add(getLblfilename(), "");
+			mainpane.add(getTxtfilename(), "w 150:150:150");
+			mainpane.add(getLblfiletype(), "");
+			mainpane.add(getTxtfiletype(), "w 150:150:150, wrap ");
+			mainpane.add(getLblfilesize(), "");
+			mainpane.add(getTxtfilesize(), "w 150:150:150");
+			mainpane.add(getLblfilescantimes(), "");
+			mainpane.add(getTxtfilescantimes(), "w 150:150:150 ,wrap");
+			mainpane.add(getLblfilecreator(), "");
+			mainpane.add(getTxtfilecreator(), "w 150:150:150");
+			mainpane.add(getLblcreatetime(), "");
+			mainpane.add(getTxtcreatetime(), "w 150:150:150 ,wrap");
+			mainpane.add(getLblfilemodifier(), "");
+			mainpane.add(getTxtfilemodifier(), "w 150:150:150");
+			mainpane.add(getLblfilemodifytime(), "");
+			mainpane.add(getTxtfilemodifytime(), "w 150:150:150,wrap");
+			mainpane.add(getLblfiledesc(), "");
+			mainpane.add(getJscpanedesc(),
+					"span 3,wrap,w 380:380:, h 120:120:120, growy");
+			mainpane.add(getLblinfo(), "span 4");
+			// mainpane.add(getTxtareafiledesc(),"span 3,wrap,,w 380:380:380, h 120:120:120");
+			// mainpane.add(getBottombtnPane(),"span 4,align right,wrap");
+		}
+		return mainpane;
+	}
+
+	private JPanel bottombtnPane;
+
+	public JPanel getBottombtnPane() {
+		if (bottombtnPane == null) {
+			bottombtnPane = new JPanel();
+			FlowLayout fl = new FlowLayout();
+			fl.setAlignment(FlowLayout.RIGHT);
+			bottombtnPane.setLayout(fl);
+			bottombtnPane.setBackground(FileColorConst.BOTTOMCOLOR);
+
+			bottombtnPane.add(getBtnpanel());
+			bottombtnPane.setBorder(new MyBorder(0, 0, 0, 0));
+		}
+
+		return bottombtnPane;
+	}
+
+	private JPanel borderpanel;
+
+	public JPanel getBorderpanel() {
+		if (borderpanel == null) {
+			borderpanel = new JPanel();
+			BorderLayout fl = new BorderLayout();
+
+			borderpanel.setLayout(fl);
+			borderpanel.add(BorderLayout.CENTER, getMainPane1());
+			borderpanel.add(BorderLayout.SOUTH, getBottombtnPane());
+			borderpanel.setBorder(new MyBorder(0, 0, 0, 0));
+		}
+
+		return borderpanel;
+	}
+
+	private void initUI() {
+			
+		
+		this.setResizable(true);
+		this.add(getBorderpanel());
+		this.setTitle(NCLangRes.getInstance().getStrByID("sftemp",
+				"FilePatchAttrDialog-0010")/* 编辑属性 */);
+		this.setSize((int)getMainPane1().getPreferredSize().getWidth()+40, 350);
+		
+	}
+
+	private void initData() {
+		if (this.parentpane == null)
+			return;
+		int row = this.parentpane.getPatchInfoTable().getSelectedRow();
+		NCFileVO filevo = (NCFileVO) this.parentpane.getfiletablemodel().getVO(
+				row);
+		getTxtfilename().setText(getFileName(filevo.getName()));
+		getTxtfiletype().setText(getFileType(filevo));
+		getTxtfilesize().setText(
+				FileManageStringFormat.formatFileSize(filevo.getFileLen()));
+		getTxtfilescantimes().setText(filevo.getScantimes() + "");
+		UserVO creator = null;
+		UserVO modifier = null;
+		String[] arruserpk = { filevo.getCreator(), filevo.getModifier() };
+		IUserPubService ser = NCLocator.getInstance().lookup(
+				IUserPubService.class);
+		UserVO[] arruservo = null;
+		try {
+			arruservo = ser.getUsersByPKs(arruserpk);
+		} catch (BusinessException e) {
+			Logger.error(e);
+		}
+		if (arruservo != null) {
+			for (UserVO uvo : arruservo) {
+				if (uvo.getCuserid().equals(filevo.getCreator())) {
+					creator = uvo;
+				}
+				if (uvo.getCuserid().equals(filevo.getModifier())) {
+					modifier = uvo;
+				}
+			}
+		}
+//		if (creator == null || creator.equals("")) {
+//			creator = filevo.getCreator();
+//		}
+//		if (modifier == null || modifier.equals("")) {
+//			modifier = filevo.getModifier();
+//		}
+		getTxtfilecreator().setText(getUserVOName(creator));
+		getTxtcreatetime().setText(
+				FileManageStringFormat.formatDateToString(filevo.getTime()));
+		getTxtfilemodifier().setText(getUserVOName(modifier));
+		getTxtfilemodifytime().setText(
+				FileManageStringFormat.formatDateToString(filevo
+						.getModifytime()));
+		getTxtareafiledesc().setText(filevo.getFiledesc());
+	}
+	private String getUserVOName(UserVO uvo){
+		if(uvo==null){
+			return "" ;			
+		}
+		String s = null;
+		try{
+			switch (MultiLangUtil.getCurrentLangSeq()) {
+				case 1:
+					s = uvo.getUser_name();
+					break;
+				case 2:
+					s = uvo.getUser_name2();
+					break;
+				case 3:
+					s = uvo.getUser_name3();
+					break;
+				case 4:
+					s = uvo.getUser_name4();
+					break;
+				case 5:
+					s = uvo.getUser_name5();
+					break;
+				case 6:
+					s = uvo.getUser_name6();
+					break;
+				default:
+					s = uvo.getUser_name();
+					break;
+			}
+		}catch (Exception e) {
+			Logger.error(e);
+		}
+		return s ;
+	}
+	/**
+	 * @param name
+	 * @return 返回文件后缀名,包含"."
+	 */
+	private String getFileType(NCFileVO filevo) {
+		String type = null;
+		if (filevo.getFiletype() != null
+				&& filevo.getFiletype().equalsIgnoreCase(FileTypeConst.URL)) {
+			return FileTypeConst.URL;
+		}
+		if (filevo != null && filevo.getName() != null
+				&& filevo.getName().contains(".")) {
+			type = filevo.getName().substring(
+					filevo.getName().lastIndexOf(".") + 1,
+					filevo.getName().length());
+		}
+		return type;
+	}
+
+	private String getFileType(String name) {
+		String type = null;
+		if (name != null && name.contains(".")) {
+			type = name.substring(name.lastIndexOf(".") + 1, name.length());
+		}
+		return type;
+	}
+
+	private String getFileName(String name) {
+		String filename = null;
+		if (name != null && name.contains(".")) {
+			filename = name.substring(0, name.lastIndexOf("."));
+		} else {
+			filename = name;
+		}
+		return filename;
+	}
+
+}

+ 125 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThGaopaiyiAction.java

@@ -0,0 +1,125 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.Dimension;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.util.Date;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JDialog;
+
+import nc.bs.logging.Logger;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.sfbase.client.ClientToolKit;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.MessageDialog;
+ 
+public class ThGaopaiyiAction extends AbstractAction{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 4811264645182420117L;
+	private ThFileContentPanel parentpanel ;
+	public ThGaopaiyiAction(ThFileContentPanel para) {
+		parentpanel=para;
+		this.putValue(AbstractAction.NAME,NCLangRes.getInstance().getStrByID("sftemp", "GaopaiyiAction-0000")/*高拍仪*/);
+		this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "GaopaiyiAction-0000")/*高拍仪*/);
+	}
+
+	@Override
+	public void actionPerformed(ActionEvent e) {
+		GaopaiyiDialog dlg =  new GaopaiyiDialog();
+		dlg.setSize(new Dimension(850,670));
+		Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
+//		Insets insets =Toolkit.getDefaultToolkit().getScreenInsets(window.getGraphicsConfiguration());
+		dlg.setLocation(new Point(((int)(dim.width-850)/2),(int)(dim.height-670)/2));
+		
+		dlg.setResizable(true);
+		
+		dlg.setModal(true);
+		dlg.setVisible(true);
+		
+	}
+	
+	protected class GaopaiyiDialog extends JDialog{
+		public String tempfile ="";
+		boolean firstloadflag = true ;
+		ThTakePotoPanel panel =null ;
+		public GaopaiyiDialog() {
+			//用户ID+时间time值 作为临时文件夹名
+			tempfile = WorkbenchEnvironment.getInstance().getLoginUser().getCuserid()+new Date().getTime();
+			String catchpath =ClientToolKit.getNCCodeBase();
+			//临时文件夹绝对位置
+			tempfile=catchpath+File.separatorChar+"attach"+File.separatorChar+tempfile;
+			File file = new File(tempfile);
+			if(!file.exists()){
+				file.mkdirs();				
+			}
+			panel= new ThTakePotoPanel(parentpanel,tempfile,GaopaiyiDialog.this);
+			this.add(panel);
+			//
+			
+			
+			//窗口事件
+			this.addWindowListener(new WindowAdapter(){
+				//高拍仪。。只能在 加载界面时做初始化,所以在加载完dialog后 延时1s开始操作
+				@Override
+				public void windowActivated(WindowEvent e) {
+					try{
+						if(firstloadflag){
+							firstloadflag = false;
+							try {
+								Thread.sleep(1000);
+							} catch (InterruptedException e1) {
+								// 
+								Logger.error(e1);
+							}
+	//						panel.getGpypanel().OpenScanner();
+							if(!panel.getGpypanel().IsConnect()){
+								MessageDialog.showErrorDlg(GaopaiyiDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "GaopaiyiAction-0003")/*未连接高拍仪!*/, NCLangRes.getInstance().getStrByID("sftemp", "GaopaiyiAction-0003")/*未连接高拍仪!*/);
+							}
+							panel.getGpypanel().StartPreview();
+							panel.getGpypanel().SetScanSize(0);
+							panel.getGpypanel().SetVideoRotate(0);
+						}
+					}catch (Exception e1) {
+						// 
+						MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "GaopaiyiAction-0001")/*高拍仪错误*/, NCLangRes.getInstance().getStrByID("sftemp", "GaopaiyiAction-0002")/*高拍仪初始化失败,请检查设备重新打开本窗口!*/);
+					}
+				}
+				@Override
+				public void windowClosing(WindowEvent e) {
+					try{
+						
+						panel.getGpypanel().StopPreview();
+						if(panel.getGpypanel().IsConnect()){		
+							panel.getGpypanel().CloseScanner();
+						}
+						panel.getGpypanel().dispose();
+						GaopaiyiDialog.this.removeAll();
+						
+						//删除临时文件,
+						try {
+							FileBroseConst.deleteFile(tempfile);
+						} catch (Exception e1) {
+//							MessageDialog.showErrorDlg(parentpanel, "错误", "删除临时文件出错");
+							Logger.error(e1);
+						}
+
+					}catch (Exception e1) {
+						//
+						Logger.error(e1);
+					}
+					
+				}
+			});
+		}
+		
+		
+	}
+}

+ 295 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThPPTBrosePanel.java

@@ -0,0 +1,295 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import nc.bs.logging.Logger;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.IImageFetch;
+import nc.ui.pub.beans.ImageBrowser;
+import nc.ui.pub.beans.ImageObject;
+import nc.ui.pub.beans.ImagePreviewPanel;
+import nc.ui.pub.beans.ImageSelectionEvent;
+import nc.ui.pub.beans.ImageSelectionListener;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.ScaleSlider;
+import nc.ui.pub.beans.UIPanel;
+import nc.ui.pub.filesystem.FileManageServletClient;
+import nc.vo.pub.filesystem.NCFileVO;
+import nc.vo.pub.lang.UFDouble;
+
+public class ThPPTBrosePanel extends UIPanel {
+	//需要传过来scaleSlider;
+	private ScaleSlider scaleSlider;
+	private ArrayList<NCFileVO> listfilevo;
+	private ThFileContentPanel parentpanel = null;
+
+	public ThPPTBrosePanel(ArrayList<NCFileVO> listvo, ThFileContentPanel pane,
+			ScaleSlider parascaleSlider) {
+		scaleSlider = parascaleSlider;
+		listfilevo = listvo;
+		parentpanel = pane;
+		initUI();
+		initListener();
+		FileImageObject imageobj = (FileImageObject)getImagebrowser().getFirstIamgeObject();
+		if(imageobj!=null){			
+			fillImageToPrePane(imageobj);
+		}
+	}
+
+	private void fillImageToPrePane(FileImageObject imageobj) {
+		BufferedImage image = null;
+		String fullpath = imageobj.getFullpath();
+		String pk = imageobj.getImageID();
+		File bigimgcache = new File(FileBroseConst
+				.getBigImageCacheFileFullpath(pk, fullpath));
+		String dsName = WorkbenchEnvironment.getInstance()
+				.getLoginBusiCenter().getDataSourceName();
+		FileOutputStream out = null;
+		try {
+			if (bigimgcache.exists()) {
+				image = ImageIO.read(bigimgcache);
+			} else {
+				out = new FileOutputStream(bigimgcache);
+				FileManageServletClient.downloadFile(dsName,
+						fullpath, out);
+				image = ImageIO.read(bigimgcache);
+			}
+		} catch (Exception ex) {
+			Logger.error(ex);
+		} finally {
+			try {
+				if (out != null) {
+					out.close();
+				}
+			} catch (Exception innerex) {
+				Logger.error(innerex);
+			}
+		}
+		// Image image=
+		// Toolkit.getDefaultToolkit().getImage(e.getImageObject().getImageID());
+		if (image == null) {
+			if(bigimgcache.exists()){
+				bigimgcache.delete();
+			}
+			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "PPTBrosePanel-0000")/*下载图片出错*/,
+					NCLangRes.getInstance().getStrByID("sftemp", "PPTBrosePanel-0001")/*下载图片出错,无法浏览!*/);
+		} else {
+			getpreviewPnl().setImage(image);
+			double  scale =getpreviewPnl().getScale();
+			int ivalue = (int)(scale*100);
+			scaleSlider.setValue(ivalue);
+			String filename = fullpath.substring( fullpath.lastIndexOf("/")+1);
+			getLblfilename().setText(filename);
+			String text ="" +(imageobj.getIndex()+1)+"/" + listfilevo.size() + "";
+			getLblimageinfo().setText(text);
+		}
+	}
+
+	private void initListener() {
+		scaleSlider.addChangeListener(new ChangeListener() {
+
+			@Override
+			public void stateChanged(ChangeEvent e) {
+				// 
+				UFDouble d = new UFDouble(scaleSlider.getValue());
+				UFDouble scale = d.div(100);
+				getpreviewPnl().setImageScale(scale.doubleValue());
+			}
+
+		});
+		
+	}
+
+	private void initUI() {
+		this.setLayout(new BorderLayout());
+		this.add(getImagepane(), BorderLayout.CENTER);
+		this.add(getBroserpane(), BorderLayout.EAST);
+	}
+
+	private PatchFileImageFetch filefech;
+
+	public PatchFileImageFetch getFilefech() {
+		if (filefech == null) {
+			filefech = new PatchFileImageFetch(listfilevo
+					.toArray(new NCFileVO[0]));
+		}
+		return filefech;
+	}
+
+	private UIPanel broserpane;
+	// 大图panel+lblpanel
+	private UIPanel imagepane;
+	private JLabel lblimageinfo;
+	// 第几张 共 几张
+	private UIPanel infopane;
+	// 大图控件 panel
+	private UIPanel imgpreviewpane;
+
+	UIPanel getinfopane() {
+		if (infopane == null) {
+			infopane = new UIPanel();
+			infopane.add(getLblfilename());
+			infopane.add(getLblimageinfo());
+		}
+		return infopane;
+	}
+
+	/** 大图 的 panel,里边一个 大图浏览控件 */
+	UIPanel getImgpreviewpane() {
+		if (imgpreviewpane == null) {
+			imgpreviewpane = new UIPanel();
+			imgpreviewpane.setBorder(new EmptyBorder(20, 10, 5, 10));
+			imgpreviewpane.setLayout(new BorderLayout());
+			imgpreviewpane.add(getpreviewPnl(), BorderLayout.CENTER);
+		}
+		return imgpreviewpane;
+	}
+
+	// 控件1 浏览控件
+	private ImageBrowser imagebrowser;
+	// 控件2 滑动 条
+	// final ScaleSlider scaleSlider = new ScaleSlider();
+	// //控件3 图片
+	private ImagePreviewPanel previewPnl;
+
+	private ImagePreviewPanel getpreviewPnl() {
+		if (previewPnl == null) {
+			previewPnl = new ImagePreviewPanel(scaleSlider);
+		}
+		return previewPnl;
+	}
+
+	public ImageBrowser getImagebrowser() {
+		if (imagebrowser == null) {
+			imagebrowser = new ImageBrowser(ImageBrowser.VERTICAL, listfilevo
+					.size(), getFilefech());
+			imagebrowser.addChangeListener(new ImageSelectionListener() {
+				@Override
+				public void valueChanged(ImageSelectionEvent e) {
+
+					// //TODO 返回图片
+					FileImageObject fimgobj = (FileImageObject) e
+							.getImageObject();
+					fillImageToPrePane(fimgobj);
+				}
+			});
+		}
+		return imagebrowser;
+	}
+
+	public UIPanel getBroserpane() {
+		if (broserpane == null) {
+			broserpane = new UIPanel();
+			broserpane.add(getImagebrowser());
+
+		}
+		return broserpane;
+	}
+
+	public UIPanel getImagepane() {
+		if (imagepane == null) {
+			imagepane = new UIPanel();
+			imagepane.setLayout(new BorderLayout());
+			imagepane.add(getImgpreviewpane(), BorderLayout.CENTER);
+			imagepane.add(getinfopane(), BorderLayout.SOUTH);
+		}
+		return imagepane;
+	}
+	private JLabel lblfilename = null ;
+	private JLabel getLblfilename(){
+		if(lblfilename== null ){
+			lblfilename = new JLabel();
+			
+		}
+		return lblfilename ;
+	}
+	public JLabel getLblimageinfo() {
+		if (lblimageinfo == null) {
+			lblimageinfo = new JLabel();
+			lblimageinfo.setText("" + listfilevo.size() + "");
+		}
+		return lblimageinfo;
+	}
+
+}
+
+// 取图片的类
+class PatchFileImageFetch implements IImageFetch {
+	private int pagenum = 5;
+	NCFileVO[] arrimagefilevo = null;
+
+	public PatchFileImageFetch(NCFileVO[] pimagefilevo) {
+		arrimagefilevo = pimagefilevo;
+	}
+
+	@Override
+	public ImageObject[] getImage(int page) {
+
+		int startindext = (page - 1) * pagenum;
+		int end = page * pagenum - 1;
+
+		if (end > (arrimagefilevo.length - 1)) {
+			end = arrimagefilevo.length - 1;
+		}
+		ImageObject[] rtnimgObj = new FileImageObject[end - startindext + 1];
+
+		ArrayList<String> pklist = new ArrayList<String>();
+		String dsName = WorkbenchEnvironment.getInstance().getLoginBusiCenter()
+				.getDataSourceName();
+
+		String strpkcom = "";
+		// 如果文件不存在,得到要下载的pk
+		for (int i = startindext; i <= end; i++) {
+			String pk = arrimagefilevo[i].getPk();
+			String filename = FileBroseConst.getSmallImageCacheFileFullpath(pk);
+			File imagefile = new File(filename);
+			if (!imagefile.exists()) {
+				if (strpkcom.isEmpty()) {
+					strpkcom = pk;
+				} else {
+					strpkcom = strpkcom + "," + pk;
+				}
+
+			}
+		}
+		//			
+		if (!strpkcom.isEmpty()) {
+			try {
+				FileManageServletClient
+						.downloadSmallImagebypk(dsName, strpkcom);
+			} catch (Exception e) {
+				Logger.error(e);
+			} finally {
+
+			}
+		}
+		for (int i = startindext; i <= end; i++) {
+			String pk = arrimagefilevo[i].getPk();
+			String filename = FileBroseConst.getSmallImageCacheFileFullpath(pk);
+			File imagefile = new File(filename);
+			BufferedImage image = null;
+			try {
+				image = ImageIO.read(imagefile);
+			} catch (IOException e) {
+				Logger.error(e);
+			}
+			rtnimgObj[i-startindext] = new FileImageObject(arrimagefilevo[i]
+					.getFullPath(), pk, new ImageIcon(image), i);
+		}
+		return rtnimgObj;
+	}
+
+}

+ 111 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThPasteAttachAction.java

@@ -0,0 +1,111 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.KeyStroke;
+
+import nc.bs.logging.Logger;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.funcnode.ui.action.AbstractNCAction;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.filesystem.FileManageServletClient;
+import nc.vo.pub.filesystem.NCFileNode;
+
+public class ThPasteAttachAction extends AbstractNCAction{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 6069958008297322824L;
+	private ThFileContentPanel parentpanel; 
+	public ThPasteAttachAction(ThFileContentPanel para){
+		parentpanel = para;
+		this.putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E,KeyEvent.CTRL_DOWN_MASK ));
+		this.putValue(AbstractAction.NAME,NCLangRes.getInstance().getStrByID("sftemp", "PasteAttachAction-0000")/*粘贴附件*/);
+		this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "PasteAttachAction-0000")/*粘贴附件*/);
+	}
+	@Override
+	public void actionPerformed(ActionEvent e) {
+		//上传位置,树节点
+		NCFileNode filenode =null ;
+		if(parentpanel.getPatchTree().getSelectionPath()==null){
+//			MessageDialog.showErrorDlg(parentpanel, "错误", "未选择要上传的节点!");
+//			return;
+			filenode =(NCFileNode)parentpanel.rootNode;
+		}else{
+			filenode =(NCFileNode)parentpanel.getPatchTree().getSelectionPath().getLastPathComponent();
+		}
+		//内存
+		Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
+		Transferable  tb =clip.getContents(null);
+		boolean isfailed=false ;
+		FileInputStream finstream=null;
+		try {
+			
+			String dsName = WorkbenchEnvironment.getInstance().getLoginBusiCenter().getDataSourceName();
+			String creator = WorkbenchEnvironment.getInstance().getLoginUser().getCuserid();
+			//剪切板中的 文件获取到list
+			List<File>list  =(List<File>)tb.getTransferData(DataFlavor.javaFileListFlavor);
+			if(list!=null){
+				for(File file :list){
+					//类型判断文件夹不上传
+					if(file.isDirectory()){
+//						//MessageDialog.showErrorDlg(parentpanel, "错误", "\""+file.getAbsolutePath()+"\"是文件夹不能上传!");						
+						continue;
+					}
+					finstream = new FileInputStream(file);					
+					//校验是否同名
+					if(parentpanel.CheckTheSameFileName(filenode, file.getName())){
+						continue ;
+					}
+					//保留使用ncv61 以前的上传方法
+					NCFileNode  node =FileManageServletClient.uploadFile(dsName, filenode.getFullPath(), file.getName(), finstream, creator, file.length());
+					
+					//上传成功的话,node不等于null
+					if(node!=null){
+						//刷新界面
+						parentpanel.nodeToFileVO(filenode, node);
+					}
+				}
+			}else{
+				isfailed=true;
+			}
+		} catch (UnsupportedFlavorException e1) {
+			isfailed=true;
+			Logger.error(e1);
+		} catch (IOException e1) {
+			isfailed=true;
+			Logger.error(e1);
+		} catch (Exception e1) {
+			isfailed=true;
+			Logger.error(e1);;
+		}finally{
+			try {
+				if(finstream!=null){
+					finstream.close();
+				}
+			} catch (IOException e1) {
+				Logger.error(e1);
+			}
+		}
+		//粘贴错误提示
+		if(isfailed){
+			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "PasteAttachAction-0001")/*错误*/, NCLangRes.getInstance().getStrByID("sftemp", "PasteAttachAction-0002")/*复制文件上传遇到错误!*/);
+		}
+	}
+	
+	
+}

+ 38 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThScanAttachAction.java

@@ -0,0 +1,38 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+
+import nc.funcnode.ui.action.AbstractNCAction;
+import nc.funcnode.ui.action.INCAction;
+import nc.ui.ml.NCLangRes;
+
+public class ThScanAttachAction extends AbstractNCAction {
+
+	
+	private ThFileContentPanel parentpanel ;
+	public  ThScanAttachAction(ThFileContentPanel para){
+		parentpanel=para;
+		this.putValue(AbstractAction.NAME,NCLangRes.getInstance().getStrByID("sftemp", "ScanAttachAction-0000")/*Áбí²é¿´*/);
+		this.putValue(INCAction.CODE,"scan1");
+		this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "ScanAttachAction-0000")/*Áбí²é¿´*/);
+	}
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7240717373795888241L;
+
+	@Override
+	public void actionPerformed(ActionEvent e) {
+//		MessageDialog.showErrorDlg(null, "t", "tÆÕͨ");
+		ThFileBrowseCreatePane.createListBrowsePane(parentpanel);
+		parentpanel.PAGE_STATE = parentpanel.BROWSELISTTABLE_STATE;
+	}
+
+	
+
+
+
+}

+ 267 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThSingleImageBrowsePanel.java

@@ -0,0 +1,267 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.LayoutManager;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import nc.bs.logging.Logger;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.ui.pub.beans.ImagePreviewPanel;
+import nc.ui.pub.beans.ScaleSlider;
+import nc.ui.pub.beans.UIButton;
+import nc.ui.pub.beans.UILabel;
+import nc.ui.pub.beans.UIPanel;
+import nc.ui.pub.filesystem.FileManageServletClient;
+import nc.uitheme.ui.ThemeResourceCenter;
+import nc.vo.pub.filesystem.NCFileVO;
+import nc.vo.pub.lang.UFDouble;
+
+import com.borland.jbcl.layout.VerticalFlowLayout;
+
+public class ThSingleImageBrowsePanel extends UIPanel {
+	ScaleSlider scaleSlider =null;
+	private ArrayList<NCFileVO> listfilevo ;
+	private String prefIconPath = "themeres/control/accessory/arrow_left_normal.png";
+	private String nextfIconPath = "themeres/control/accessory/arrow_right_normal.png";
+	
+	private String prefIconPath_rollOver = "themeres/control/accessory/arrow_left_mouseover.png";
+	private String nextfIconPath_rollOver = "themeres/control/accessory/arrow_right_mouseover.png";
+	
+	private ThFileContentPanel parentpanel = null;
+	private int currentimageindex =0;
+	public ThSingleImageBrowsePanel(ArrayList<NCFileVO> listvo,ThFileContentPanel pane,ScaleSlider pscaleSlider){
+		scaleSlider =pscaleSlider;
+		listfilevo = listvo ;
+		parentpanel =pane ;
+		initUI();
+		initData();
+		setBtnandLblstate();
+		scaleSlider.addChangeListener(new ChangeListener() {
+
+			@Override
+			public void stateChanged(ChangeEvent e) {
+				// 
+				UFDouble d = new UFDouble(scaleSlider.getValue());
+				UFDouble scale = d.div(100);
+				getImagepane().setImageScale(scale.doubleValue());
+			}
+
+		});
+	}
+	
+	private void setBtnandLblstate() {
+		if(currentimageindex==0){
+			getBtnleft().setEnabled(false);
+			getBtnright().setEnabled(true);
+		}else if(currentimageindex==listfilevo.size()-1){
+			getBtnleft().setEnabled(true);
+			getBtnright().setEnabled(false);
+		}else if(currentimageindex==0&&currentimageindex==listfilevo.size()-1){
+			getBtnleft().setEnabled(false);
+			getBtnright().setEnabled(false);
+		}
+		else{
+			getBtnleft().setEnabled(true);
+			getBtnright().setEnabled(true);
+		}
+		//lbl
+		String text =(currentimageindex+1)+"/"+listfilevo.size();		
+		getLblinfo().setText(text);
+		
+	}
+
+	private void initData() {
+		//图片
+		String pk =listfilevo.get(currentimageindex).getPk();
+		String fullpath = listfilevo.get(currentimageindex).getFullPath();
+		String filename = FileBroseConst.getBigImageCacheFileFullpath(pk, fullpath);
+		String dsName = WorkbenchEnvironment.getInstance().getDSName();
+		File file = new File(filename);
+		FileOutputStream fileout = null ;
+		try{
+		if(!file.exists()){
+			fileout = new FileOutputStream(file);
+			FileManageServletClient.downloadFile(dsName, fullpath, fileout);
+		}
+		}catch (Exception e) {
+			Logger.error(e);
+		}finally{
+			try {
+				if(fileout!=null){
+					fileout.close();
+				}
+			} catch (Exception e2) {
+				Logger.error(e2);
+			}
+		}
+		
+		BufferedImage image=null;
+		try {
+			image = ImageIO.read(file);
+		} catch (IOException e) {
+			Logger.error(e);
+		}finally{
+			
+		}
+		getImagepane().setImage(image);
+		double  scale =getImagepane().getScale();
+		int ivalue = (int)(scale*100);
+		scaleSlider.setValue(ivalue);
+		
+//		//信息
+//		String text =(currentimageindex+1)+"/"+listfilevo.size();		
+//		getLblinfo().setText(text);
+		
+	}
+
+	public UIPanel getLeftbtnpane() {
+		if(leftbtnpane== null){
+			leftbtnpane = new UIPanel();
+			VerticalFlowLayout  layout = new VerticalFlowLayout(VerticalFlowLayout.CENTER);
+//			layout.setAlignment(VerticalFlowLayout.MIDDLE);
+			leftbtnpane.setLayout(layout);
+			leftbtnpane.add(getBtnleft());
+		}
+		return leftbtnpane;
+	}
+
+	public UIPanel getRigthbtnpane() {
+		if(rigthbtnpane == null){
+			rigthbtnpane = new UIPanel();
+			VerticalFlowLayout  layout = new VerticalFlowLayout(VerticalFlowLayout.CENTER);
+			rigthbtnpane.setLayout(layout);
+			rigthbtnpane.add(getBtnright());
+		}
+		return rigthbtnpane;
+	}
+
+	public UIPanel getBottomlblpane() {
+		if(bottomlblpane==null){
+			bottomlblpane = new UIPanel();
+			bottomlblpane.add(getLblinfo());
+		}
+		return bottomlblpane;
+	}
+
+	public UIPanel getCenterimagepane() {
+		if(centerimagepane==null){
+			centerimagepane = new UIPanel();
+			centerimagepane.setLayout(new BorderLayout());
+//			centerimagepane.add(new JLabel("testimage"));
+			centerimagepane.add(getImagepane(),BorderLayout.CENTER);
+		}
+		return centerimagepane;
+	}
+
+	public UIButton getBtnleft() {
+		if(btnleft==null){
+			btnleft= new UIButton();
+			ImageIcon icon = ThemeResourceCenter.getInstance().getImage(
+					prefIconPath);
+			ImageIcon icon_rollover = ThemeResourceCenter.getInstance().getImage(
+					prefIconPath_rollOver);
+			btnleft.setPreferredSize(new Dimension(30,30));
+
+			btnleft.setOpaque(true);
+			btnleft.setContentAreaFilled(false);
+			btnleft.setBorder(null);
+			btnleft.setFocusPainted(false);
+			
+			btnleft.addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					//向前翻页
+					if(currentimageindex==0){
+						return ;
+					}
+					currentimageindex-=1;
+					initData();
+					setBtnandLblstate();
+					
+				}
+			});
+			
+			btnleft.setIcon(icon);
+			btnleft.setRolloverIcon(icon_rollover);
+		}
+		return btnleft;
+	}
+
+	public UIButton getBtnright() {
+		if(btnright == null){
+			btnright = new UIButton();
+			ImageIcon icon = ThemeResourceCenter.getInstance().getImage(
+					nextfIconPath);
+			ImageIcon icon_rollover = ThemeResourceCenter.getInstance().getImage(
+					nextfIconPath_rollOver);
+			btnleft.setPreferredSize(new Dimension(30,30));
+
+			btnright.setOpaque(false);
+			btnright.setContentAreaFilled(false);
+			btnright.setBorder(null);
+			btnright.setFocusPainted(false);
+			btnright.setIcon(icon);
+			btnright.addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					//向后翻页
+					if(currentimageindex==listfilevo.size()-1){
+						return ;
+					}
+					currentimageindex+=1;
+					initData();
+					setBtnandLblstate();
+					
+				}
+			});
+			
+			btnright.setRolloverIcon(icon_rollover);
+		}
+		return btnright;
+	}
+
+	public UILabel getLblinfo() {
+		if(lblinfo ==null){
+			lblinfo = new UILabel();
+		}
+		return lblinfo;
+	}
+
+	public ImagePreviewPanel getImagepane() {
+		if(imagepane ==null){
+			imagepane = new ImagePreviewPanel(scaleSlider);
+		}
+		return imagepane;
+	}
+
+	private UIPanel leftbtnpane ;
+	private UIPanel rigthbtnpane ;
+	private UIPanel bottomlblpane ;
+	private UIPanel centerimagepane ;
+	
+	private UIButton btnleft ;
+	private UIButton btnright ;
+	private UILabel lblinfo;
+	private ImagePreviewPanel imagepane ;
+	
+	private void initUI() {
+		LayoutManager layout = new BorderLayout();
+		this.setLayout(layout);
+		add(getLeftbtnpane(),BorderLayout.WEST);
+		add(getRigthbtnpane(),BorderLayout.EAST);
+		add(getCenterimagepane(),BorderLayout.CENTER);
+		add(getBottomlblpane(),BorderLayout.SOUTH);
+	}
+}

+ 239 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThSmallImageBrowsePanel.java

@@ -0,0 +1,239 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.SwingConstants;
+import javax.swing.SwingWorker;
+import javax.swing.border.LineBorder;
+
+import nc.bs.logging.Logger;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.ui.pub.beans.UIPanel;
+import nc.ui.pub.beans.UIScrollPane;
+import nc.ui.pub.filesystem.FileManageServletClient;
+import nc.vo.pub.filesystem.NCFileVO;
+
+public class ThSmallImageBrowsePanel extends UIPanel {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	private ArrayList<NCFileVO> listfilevo;
+	private ThFileContentPanel parentpanel = null;
+	private HashMap<String, String> pkandnameMap = new HashMap<String, String>();
+	public ThSmallImageBrowsePanel(ArrayList<NCFileVO> listvo,
+			ThFileContentPanel pane) {
+		listfilevo = listvo;
+		if(listfilevo!=null){
+			for(NCFileVO filevo :listfilevo){
+				if(!pkandnameMap.containsKey(filevo.getPk())){
+					pkandnameMap.put(filevo.getPk(), filevo.getName());				
+				}
+			}
+		}
+		parentpanel = pane;
+		initUI();
+		SmallImageSwingWorker work = new SmallImageSwingWorker(getImagespane());
+		work.execute();
+		this.updateUI();
+	}
+
+	private UIScrollPane imagescorpane = null;
+
+	public UIScrollPane getImagescorpane() {
+		if (imagescorpane == null) {
+			imagescorpane = new UIScrollPane(){
+				@Override
+				public void setBounds(int x, int y, int width, int height) {
+					// TODO Auto-generated method stub
+					super.setBounds(x, y, width, height);
+				}
+			};
+			imagescorpane.setViewportView(getImagespane());
+				imagescorpane.setPreferredSize(new Dimension(200,200));
+			imagescorpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
+//					imagescorpane.setViewportView(getImagespane());
+		}
+		return imagescorpane;
+
+	}
+
+	public UIPanel getImagespane() {
+		if (imagespane == null) {			
+			imagespane = new UIPanel()
+			{
+				@Override
+				public void setBounds(int x, int y, int width, int height) {
+					int rowheight = 96+10+20 ;
+					int colwidth =106 ;
+					int colnum = (width)/colwidth;
+					int rownum = 0;
+					if(listfilevo.size()%colnum ==0){
+						rownum =listfilevo.size()/colnum ;
+					}else{
+						rownum =(listfilevo.size()/colnum+1);
+					}
+					int newheight =rownum *rowheight+10;
+					super.setBounds(x, y, width, newheight);
+				}
+			};
+			
+			imagespane.setPreferredSize(new Dimension(240,100));
+			
+			FlowLayout f =new FlowLayout();
+			
+			f.setVgap(10);
+			f.setHgap(10);
+			f.setAlignment(FlowLayout.LEFT);
+			imagespane.setLayout(f);
+		}
+		return imagespane;
+	}
+
+	private UIPanel imagespane = null;
+
+	private void initUI() {
+		this.setLayout(new BorderLayout());
+		this.add(getImagescorpane(),BorderLayout.CENTER);
+
+	}
+	
+//	class SmallImageLabel extends JLabel{
+//		String imagepath = "";
+//		public SmallImageLabel(String path){
+//			imagepath =path ;
+//		}
+//		public void paint(Graphics g) {
+//			ImageIcon ico =new ImageIcon(imagepath);
+//			
+//			Image image = ico.getImage();
+//			g.drawImage(image, (96-ico.getIconWidth())/2,(96-ico.getIconHeight())/2 ,SmallImageLabel.this);
+//			image.flush();
+//		}
+//	}
+	class SmallImageSwingWorker extends SwingWorker<Object, ArrayList<File>> {
+		private final UIPanel imagepane;
+
+		public SmallImageSwingWorker(UIPanel myimagepane) {
+			imagepane = myimagepane;
+		}
+
+		@Override
+		protected Object doInBackground() throws Exception {			
+			if(listfilevo==null) return null ;
+//			Thread.sleep(1000);
+			for (int i = 0; i < listfilevo.size(); i++) {				
+				if ((i + 1) % 5 == 0 || (i + 1) == listfilevo.size()) {
+					int startindext = 0;
+					if((i + 1) % 5 == 0 ){
+						startindext= i-4;// (i+1)-5;
+						ArrayList<File> listfile = loadData(startindext, i);
+						publish(listfile );
+					}else{
+						startindext= (i + 1)-((i + 1) % 5);// (i+1)-5;
+						ArrayList<File> listfile = loadData(startindext, i);						
+						publish(listfile );
+					}
+				}
+//				Thread.sleep(1000);
+			}
+			//				
+
+			return null;
+		}
+
+		private ArrayList<File> loadData(int startindext, int end) {
+			String dsname = WorkbenchEnvironment.getInstance()
+					.getLoginBusiCenter().getDataSourceName();
+			String strpkcom = "";
+			ArrayList<File>  listfile = new ArrayList<File>();
+
+			for (int i = startindext; i <= end; i++) {
+				String pk = listfilevo.get(i).getPk();
+				String filename = FileBroseConst
+						.getSmallImageCacheFileFullpath(pk);
+				File imagefile = new File(filename);
+				if (!imagefile.exists()) {
+					if (strpkcom.isEmpty()) {
+						strpkcom = pk;
+					} else {
+						strpkcom = strpkcom + "," + pk;
+					}
+
+				}
+			}
+			//
+			if (!strpkcom.isEmpty()) {
+				try {
+					FileManageServletClient.downloadSmallImagebypk(dsname,
+							strpkcom);
+				} catch (Exception e) {
+					Logger.error(e);
+				} finally {
+
+				}
+			}
+			for (int i = startindext; i <= end; i++) {
+				String pk = listfilevo.get(i).getPk();
+				String filename = FileBroseConst
+						.getSmallImageCacheFileFullpath(pk);
+				File imagefile = new File(filename);
+				listfile.add(imagefile);
+			}
+			return listfile;
+		}
+
+		@Override
+		protected void process(List<ArrayList<File>> chunks) {
+			for (ArrayList<File> list : chunks) {
+				for(File file :list){
+//					SmallImageLabel label = new SmallImageLabel(file.getAbsolutePath());
+					//缩率图panel,上图 下名
+					JPanel pan = new JPanel();
+//					pan.setPreferredSize(new Dimension(96,116));
+//					pan.setSize(new Dimension(96,0));
+					pan.setLayout(new BorderLayout());
+					//缩略图					
+					JLabel label = new JLabel();
+					label.setPreferredSize(new Dimension(96,96));
+					label.setBorder(new LineBorder(Color.gray));
+					ImageIcon icon = new ImageIcon(file.getAbsolutePath());
+					label.setIcon(icon);
+					label.updateUI();
+					//文件名
+					JLabel lblfilename = new JLabel();
+					
+					lblfilename.setHorizontalAlignment(SwingConstants.CENTER);
+					String filename = file.getName();
+					String pk = filename.substring(0,filename.lastIndexOf("."));
+					String turename = pkandnameMap.get(pk);
+					lblfilename.setText(turename);
+					lblfilename.setPreferredSize(new Dimension(96,20));
+//					lblfilename.setSize(new Dimension(96,20));
+//					lblfilename.setMaximumSize(new Dimension(96,20));
+					//
+					pan.add(label,BorderLayout.CENTER);
+					pan.add(lblfilename,BorderLayout.SOUTH);
+					pan.updateUI();
+					imagepane.add(pan);					
+				}
+			
+				imagepane.revalidate();
+				
+//				getImagescorpane().revalidate();
+			}
+		
+		}
+	}
+}

+ 926 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThTakePotoPanel.java

@@ -0,0 +1,926 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.imageio.ImageIO;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
+import javax.swing.border.EmptyBorder;
+
+import nc.bs.logging.Logger;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.funcnode.ui.ActionButton;
+import nc.funcnode.ui.FuncletMenuBar;
+import nc.funcnode.ui.action.AbstractNCAction;
+import nc.funcnode.ui.action.INCAction;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.IImageFetch;
+import nc.ui.pub.beans.ImageBrowser;
+import nc.ui.pub.beans.ImageObject;
+import nc.ui.pub.beans.ImagePreviewPanel;
+import nc.ui.pub.beans.ImageSelectionEvent;
+import nc.ui.pub.beans.ImageSelectionListener;
+import nc.ui.pub.beans.ScaleSlider;
+import nc.ui.pub.beans.UIButton;
+import nc.ui.pub.beans.UIDialog;
+import nc.ui.pub.beans.UIPanel;
+import nc.ui.pub.filesystem.GaoPaiYiPanel;
+import nc.uitheme.ui.ThemeResourceCenter;
+import nc.vo.pub.filesystem.FileCompression;
+import nc.vo.pub.filesystem.FileTypeConst;
+import net.miginfocom.swing.MigLayout;
+
+public class ThTakePotoPanel extends JPanel {
+	//现在的状态
+	private  int MYUISTATE =0 ;
+	/**拍摄状态*/
+	private static final int TakePotoState=0 ;	
+	/**点击照片浏览状态*/
+	private static final int BrowseState=1 ;
+	/**异常状态*/
+	private static final int EXCEPTIONState=-1 ;	
+	private ThFileContentPanel parentpanel = null;
+	private JDialog pdialog = null;
+	String tempfolder = "";
+	int n = 1;
+	private static ImageIcon menuBarBGIcon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/menu/menu_bg.png");
+	private static ImageIcon menuBarBGFrameIcon = ThemeResourceCenter
+			.getInstance().getImage("themeres/control/menu/menu_bg_frame.png");
+
+	private static ImageIcon leftrotateicon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/rotate_left_normal.png");
+	private static ImageIcon leftrotateovericon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/rotate_left_highligh.png");
+
+	private static ImageIcon rightrotateicon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/rotate_right_normal.png");
+	private static ImageIcon rightrotateovericon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/rotate_right_highligh.png");
+
+	private static ImageIcon takepotoicon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/photos_noamal.png");
+	private static ImageIcon takepotoovericon = ThemeResourceCenter
+			.getInstance().getImage(
+					"themeres/control/accessory/photos_highlight.png");
+
+	private static ImageIcon uploadicon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/upload_noamal.png");
+	private static ImageIcon uploadovericon = ThemeResourceCenter.getInstance()
+			.getImage("themeres/control/accessory/upload_highlight.png");
+	private int leftrotatecount = 0;
+	private int rightrotatecount = 4;
+	private int[] anglearr = { 0, 90, 270, 180 };
+	private List<ImageObject> imageObjectlist= new ArrayList<ImageObject>() ;
+	public List<ImageObject>  getImageObjectlist(){
+		if(imageObjectlist==null){
+			imageObjectlist = new ArrayList<ImageObject>();			
+		}
+		return imageObjectlist ;
+	}
+	// menubar菜单栏 外层
+	private JPanel menuBarContainer;
+	private boolean hasopen =false;
+	public boolean GetHasopen(){
+		return hasopen;
+	}
+	public void setHasopen(boolean phasopen){
+		hasopen=phasopen;
+	}
+	private JPanel bottombtnpanel;
+
+	public JPanel getBottombtnpanel() {
+		if (bottombtnpanel == null) {
+			bottombtnpanel = new JPanel();
+			bottombtnpanel.setBorder(new MyBorder(0, 0, 0, 0));
+			FlowLayout layout = new FlowLayout();
+			layout.setAlignment(FlowLayout.RIGHT);
+			bottombtnpanel.setLayout(layout);
+			bottombtnpanel.add(getbtnexit());
+		}
+		return bottombtnpanel;
+	}
+
+	public ActionButton getBtngobackpoto() {
+		if (btngobackpoto == null) {
+			btngobackpoto = new ActionButton(new returnAction());
+		}
+		return btngobackpoto;
+	}
+	private class returnAction extends AbstractNCAction {
+		public returnAction() {
+			putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0000")/*返回拍照*/);
+			this.putValue(INCAction.CODE, "returnpoto");
+			this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0000")/*返回拍照*/);
+		}
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			//在一个界面不行
+			if(MYUISTATE==1){
+				MYUISTATE =0;
+				getGpyborderpanel().removeAll();
+				getGpyborderpanel().add(getGpypanel());
+				try {
+					Thread.sleep(2000);
+				} catch (InterruptedException e1) {
+					
+				}
+				getGpypanel().OpenScanner();
+				getGpypanel().StartPreview();
+			}
+		}
+
+	}
+	private UIButton btnexit;
+
+	public UIButton getbtnexit() {
+		if (btnexit == null) {
+			btnexit = new UIButton(NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0001")/*退出*/);
+			btnexit.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					try{
+						getGpypanel().StopPreview();
+						if(getGpypanel().IsConnect()){						
+							getGpypanel().CloseScanner();
+						}
+						// 删除临时文件,
+						try {
+							FileBroseConst.deleteFile(tempfolder);
+						} catch (Exception e1) {
+							// MessageDialog.showErrorDlg(parentpanel, "错误",
+							// "删除临时文件出错");
+						}
+					}catch (Exception e2) {
+						// MessageDialog.showErrorDlg(parentpanel, "错误",
+						// "删除临时文件出错");
+					}
+					finally{
+						pdialog.dispose();
+					}
+
+					
+
+				}
+			});
+		}
+		return btnexit;
+	}
+
+	public UIPanel potobtnpanel;
+
+	public UIPanel getPotobtnpanel() {
+		if (potobtnpanel == null) {
+			potobtnpanel = new UIPanel();
+			potobtnpanel.add(getBtnleftturn());
+			potobtnpanel.add(getBtntakepoto());
+			potobtnpanel.add(getBtnrightturn());
+//			potobtnpanel.add(getBtnuploadpoto());
+		}
+		return potobtnpanel;
+	}
+
+	// menubar
+	private FuncletMenuBar bar;
+	// 设置按钮
+	private ActionButton btnsetting;
+	// 继续拍照按钮
+	private ActionButton btngobackpoto;
+	// 左转90
+	private UIButton btnleftturn;
+	// 右转90
+	private UIButton btnrightturn;
+	// 拍照
+	private UIButton btntakepoto;
+	// 什么批量上传button??
+	private UIButton btnuploadpoto;
+
+	// 缩率图
+	ImageBrowser imagebrower;
+	// 牌照区域
+	private GaoPaiYiPanel gpypanel;
+	// 高拍仪的尺寸属性
+	private int gpysize;
+	// 分辨率(高拍仪厂商支持的不好)
+	private int resolution;
+	private String namerule;
+
+	private Action settingaction;
+
+	private class SettingAction extends AbstractNCAction {
+		public SettingAction() {
+			putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0002")/*设置*/);
+			this.putValue(INCAction.CODE, "setting");
+			this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0002")/*设置*/);
+		}
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			GPYSettingDialog dlg = new GPYSettingDialog();
+			dlg.showModal();
+
+		}
+
+	}
+
+	public UIButton getBtnuploadpoto() {
+		if (btnuploadpoto == null) {
+			btnuploadpoto = new UIButton();
+			btnuploadpoto.setPreferredSize(new Dimension(25, 25));
+			btnuploadpoto.setIcon(uploadicon);
+			btnuploadpoto.setRolloverIcon(uploadovericon);
+			btnuploadpoto.addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					// 
+					
+				}
+			});
+		}
+		return btnuploadpoto;
+	}
+
+//	private class returnAction extends AbstractNCAction {
+//		public returnAction() {
+//			putValue(AbstractAction.NAME, "返回拍照");
+//			this.putValue(INCAction.CODE, "returnpoto");
+//			this.putValue(Action.SHORT_DESCRIPTION, "返回拍照");
+//		}
+//
+//		@Override
+//		public void actionPerformed(ActionEvent e) {
+//			//
+//			if(MYUISTATE==BrowseState){
+//				MYUISTATE =TakePotoState;
+//				getGpyborderpanel().removeAll();
+//				getGpyborderpanel().add(getGpypanel());
+//				getGpypanel().OpenScanner();
+//				getGpypanel().StartPreview();
+//				
+//				
+//				
+//			}
+//		}
+//
+//	}
+
+	public Action getSettingaction() {
+		if (settingaction == null) {
+			settingaction = new SettingAction();
+		}
+		return settingaction;
+	}
+
+	public ActionButton getBtnsetting() {
+		if (btnsetting == null) {
+			btnsetting = new ActionButton(getSettingaction());
+			
+		}
+		return btnsetting;
+	}
+
+
+	// 旋转
+	public UIButton getBtnleftturn() {
+		if (btnleftturn == null) {
+			btnleftturn = new UIButton();
+			btnleftturn.setPreferredSize(new Dimension(25, 25));
+			btnleftturn.setIcon(leftrotateicon);
+			btnleftturn.setRolloverIcon(leftrotateovericon);
+			btnleftturn.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					leftrotatecount = leftrotatecount + 1;
+					int index = leftrotatecount % 4;
+					int angle = index * 90;
+//					if(MYUISTATE==TakePotoState){
+						
+						int state = 0;
+						for (int i = 0; i < anglearr.length; i++) {
+							if (angle == anglearr[i]) {
+								state = i;
+								break;
+							}
+						}
+						getGpypanel().SetVideoRotate(state);
+//					}else{
+//						BufferedImage image =(BufferedImage) getpreviewPnl().getImage();
+//						if(image!=null){
+//							try {
+//								BufferedImage  bimage =FileImageProcess.rotateImg(image, angle, null);
+//								getpreviewPnl().setImage(bimage);
+//							} catch (IOException e1) {
+//								
+//							}
+//						}
+//					}
+				}
+			});
+		}
+		return btnleftturn;
+	}
+
+	// 旋转
+	public UIButton getBtnrightturn() {
+		if (btnrightturn == null) {
+			btnrightturn = new UIButton();
+			btnrightturn.setPreferredSize(new Dimension(25, 25));
+			btnrightturn.setIcon(rightrotateicon);
+			btnrightturn.setRolloverIcon(rightrotateovericon);
+			btnrightturn.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					rightrotatecount = rightrotatecount - 1;
+					int mod =rightrotatecount % 4;
+					if(mod<0){
+						rightrotatecount =4+mod;
+					}
+					
+					
+					int index =rightrotatecount;
+					int angle = index * 90;
+					int state = 0;
+					for (int i = 0; i < anglearr.length; i++) {
+						if (angle == anglearr[i]) {
+							state = i;
+							break;
+						}
+					}
+					getGpypanel().SetVideoRotate(state);
+				}
+			});
+		}
+		return btnrightturn;
+	}
+
+	public UIButton getBtntakepoto() {
+		if (btntakepoto == null) {
+			btntakepoto = new UIButton();
+			btntakepoto.setPreferredSize(new Dimension(25, 25));
+			btntakepoto.setIcon(takepotoicon);
+			btntakepoto.setRolloverIcon(takepotoovericon);
+			btntakepoto.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent e) {
+					String path;
+					if (namerule == null || namerule.isEmpty()) {
+						path = tempfolder + File.separatorChar + (n++) + ".jpg";
+					} else {
+						path = tempfolder + File.separatorChar + namerule
+								+ (n++) + ".jpg";
+					}
+
+					File file = new File(path);
+
+					if (file.exists()) {
+						file.delete();
+					}
+					// else{
+					// file.mkdirs();
+					// }
+					
+					
+					if(getGpypanel().IsConnect()&&getGpypanel().Scan(path)){
+						// 刷新 imagebrowser
+						BufferedImage image=null;
+						BufferedImage samallimage=null;
+						try {
+							try {
+								//高拍仪在使用文件
+		 						Thread.sleep(500);
+								image = ImageIO.read(file);
+								if(image==null){							
+									Thread.sleep(1000);							
+									image = ImageIO.read(file);
+								}
+								} catch (InterruptedException e1) {
+									
+								}
+							samallimage =FileCompression.doCompressImage(image, 96.0, 96.0);
+						} catch (IOException e1) {
+							Logger.error(e1);
+						}
+						
+						ImageObject imageobj = new ImageObject(path, new ImageIcon(samallimage));
+						getImageObjectlist().add(imageobj);
+						getImagebrower().addNewImage(imageobj);
+						getImagebrower().refresh();
+					}else{
+						JOptionPane.showMessageDialog(null,NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0007")/*扫描失败*/);
+					}
+
+				}
+			});
+		}
+		return btntakepoto;
+	}
+
+	private List<File> listfile = new ArrayList<File>();
+
+	public List<File> getfilelist() {
+		listfile.clear();
+		File file = new File(tempfolder);
+		if (file.exists()) {
+			File[] arrfiles = file.listFiles();
+			// 情况1:没文件,返回空
+			if (arrfiles == null) {
+				return null;
+			}
+			for (File f : arrfiles) {
+				if (f.isFile()
+						&& FileTypeConst.getFileTypeByFileName(f.getName())
+								.equals(FileTypeConst.IMAGE)) {
+					listfile.add(f);
+				}
+			}
+		}
+		return listfile;
+	}
+
+	public ImageBrowser getImagebrower() {
+		if (imagebrower == null) {
+			imagebrower = new ImageBrowser(ImageBrowser.VERTICAL, getfilelist()
+					.size(), new PotoImageFetch());
+			imagebrower.addChangeListener(new ImageSelectionListener(){
+				@Override
+				public void valueChanged(ImageSelectionEvent e) {
+					if(e.getImageObject()!=null){
+//					//方案1 :浏览图片在一个界面里,界面好理解,代码复杂
+					//按照方案1 高拍仪bug 无解 ,虽然设置 状态,但是调用CloseScanner 时会JVM异常 
+//					if(MYUISTATE==TakePotoState){
+//						MYUISTATE=BrowseState;
+//						getGpypanel().StopPreview();
+//						getGpypanel().CloseScanner();
+//						getGpyborderpanel().removeAll();
+//						getGpyborderpanel().add(getpreviewPnl());
+//					}
+//					try{
+//						BufferedImage image = ImageIO.read(new File(e.getImageObject().getImageID()));
+//						getpreviewPnl().setImage(image);
+//						
+//					}catch (Exception e1) {
+//						// 
+//					}
+
+//						//方案2  浏览图片在两个界面
+						if(!hasopen){
+							
+							try {
+//								BufferedImage image = ImageIO.read(new File(e.getImageObject().getImageID()));
+								ThFileBrowseGPYPotoDialog dlg = new ThFileBrowseGPYPotoDialog(ThTakePotoPanel.this,tempfolder,parentpanel, e.getImageObject());
+								dlg.setSize(new Dimension(850,670));
+								hasopen=true;
+								dlg.showModal();							
+							} catch (Exception e1) {
+								Logger.error(e);
+							}
+							
+						}
+					}
+				}
+			});
+		}
+		return imagebrower;
+	}
+	private ImagePreviewPanel previewPnl;
+
+	private ImagePreviewPanel getpreviewPnl() {
+		if (previewPnl == null) {
+			previewPnl = new ImagePreviewPanel(new ScaleSlider());
+		}
+		return previewPnl;
+	}
+	private class PotoImageFetch implements IImageFetch {
+		int pagenum = 5;
+
+		@Override
+		public ImageObject[] getImage(int page) {
+
+			// 情况2: 没有图片类型文件 返回空
+			if (listfile.size() == 0) {
+				return null;
+			}
+			int startindext = (page - 1) * pagenum;
+			int end = page * pagenum - 1;
+
+			if (end > (listfile.size() - 1)) {
+				end = listfile.size() - 1;
+			}
+			ImageObject[] rtnimgObj = new ImageObject[end - startindext + 1];
+
+			ArrayList<String> pklist = new ArrayList<String>();
+			String dsName = WorkbenchEnvironment.getInstance()
+					.getLoginBusiCenter().getDataSourceName();
+
+			String strpkcom = "";
+			// 
+			for (int i = startindext; i <= end; i++) {
+				String filename = listfile.get(i).getAbsolutePath();
+
+				File imagefile = new File(filename);
+				BufferedImage image = null;
+				BufferedImage smallimage = null ;
+				try {
+					image = ImageIO.read(imagefile);
+					smallimage = FileCompression.doCompressImage(image, 96.0, 96.0);
+				} catch (IOException e) {
+					Logger.error(e);
+				}
+				rtnimgObj[end - i] = new ImageObject(filename, new ImageIcon(
+						smallimage));
+			}
+			return rtnimgObj;
+		}
+	}
+
+	// 中间的图和右边条pane
+	private UIPanel centerpanel;
+
+	public UIPanel getCenterpanel() {
+		if (centerpanel == null) {
+			centerpanel = new UIPanel();
+			centerpanel.setLayout(new BorderLayout());
+			centerpanel.add(getGpyandimagepanel(), BorderLayout.CENTER);
+			centerpanel.add(getImagebrower(), BorderLayout.EAST);
+		}
+		return centerpanel;
+	}
+
+	// 包装高拍仪或者imagepreview的pane
+	private JPanel gpyandimagepanel;
+
+	// 高拍仪或者图片浏览,外套的panel
+	public JPanel getGpyandimagepanel() {
+		if (gpyandimagepanel == null) {
+			gpyandimagepanel = new JPanel();
+			gpyandimagepanel.setLayout(new BorderLayout());
+			gpyandimagepanel.add(getGpyborderpanel(), BorderLayout.CENTER);
+			gpyandimagepanel.add(getPotobtnpanel(), BorderLayout.SOUTH);
+		}
+		return gpyandimagepanel;
+	}
+
+	private JPanel gpyborderpanel;
+
+	public JPanel getGpyborderpanel() {
+		if (gpyborderpanel == null) {
+			gpyborderpanel = new UIPanel();
+			gpyborderpanel.setBorder(new EmptyBorder(20, 20, 20, 20));
+			gpyborderpanel.setLayout(new BorderLayout());
+			gpyborderpanel.add(getGpypanel());
+		}
+		return gpyborderpanel;
+	}
+
+	public GaoPaiYiPanel getGpypanel() {
+		if (gpypanel == null) {
+			gpypanel = new GaoPaiYiPanel();
+
+		}
+		return gpypanel;
+	}
+
+	JPanel getMenuBarContainer() {
+		if (menuBarContainer == null) {
+			menuBarContainer = new JPanel() {
+
+				private static final long serialVersionUID = 7130908951757832647L;
+
+				@Override
+				protected void paintComponent(Graphics g) {
+					super.paintComponent(g);
+					Dimension size = getSize();
+					if (menuBarBGIcon != null && menuBarBGFrameIcon != null) {
+						int frameW = menuBarBGFrameIcon.getIconWidth();
+						g.drawImage(menuBarBGIcon.getImage(), frameW, 0,
+								size.width - 2 * frameW, size.height, this);
+						menuBarBGFrameIcon.paintIcon(this, g, 0, 0);
+						menuBarBGFrameIcon.paintIcon(this, g, size.width
+								- frameW, 0);
+					}
+				}
+
+			};
+			menuBarContainer.setOpaque(false);
+			menuBarContainer.setBorder(BorderFactory.createEmptyBorder(6, 6, 6,
+					6));
+			menuBarContainer.setLayout(new BorderLayout());
+			menuBarContainer.add(getBar(), BorderLayout.CENTER);
+
+			getBar().setOpaque(false);
+		}
+		return menuBarContainer;
+	}
+
+	public FuncletMenuBar getBar() {
+		if (bar == null) {
+			bar = new FuncletMenuBar();
+			bar.setPreferredSize(new Dimension(0, 30));
+
+			bar.addMenuComp(getBtnsetting());
+//			if(MYUISTATE==TakePotoState){
+//				bar.addMenuComp(getBtngobackpoto());
+//			}
+			
+			bar.setOpaque(false);
+
+		}
+		return bar;
+	}
+
+	ThTakePotoPanel(ThFileContentPanel para, String path, JDialog parentdialog) {
+		tempfolder = path;
+		pdialog = parentdialog;
+		parentpanel = para;
+		initUI();
+		
+	}
+
+	private void initUI() {
+		setLayout(new BorderLayout());
+		// add(comp,BorderLayout.CENTER);
+		add(getMenuBarContainer(), BorderLayout.NORTH);
+		add(getCenterpanel(), BorderLayout.CENTER);
+		add(getBottombtnpanel(), BorderLayout.SOUTH);
+
+	}
+
+	/**
+	 * 高拍仪设置 dlg
+	 * 
+	 * @author zhoujja
+	 * 
+	 */
+	private class GPYSettingDialog extends UIDialog {
+		public GPYSettingDialog() {
+			super(ThTakePotoPanel.this, NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0002")/*设置*/);
+			initUI();
+			initData();
+			
+		}
+		private void initData(){
+			getChangescansize().removeAllItems(); 
+			int num = getGpypanel().GetScanSizeCount();
+			if(num==8)
+			{
+				getChangescansize().addItem("All");
+				getChangescansize().addItem("A3");
+				getChangescansize().addItem("A4");
+				getChangescansize().addItem("A5");
+				getChangescansize().addItem("A6");
+				getChangescansize().addItem("A7");
+				getChangescansize().addItem(NCLangRes.getInstance().getStrByID("sfbase", "ScanUIDialog-000002")/*名片*/);
+				getChangescansize().addItem(NCLangRes.getInstance().getStrByID("sfbase", "ScanUIDialog-000003")/*身份证*/);
+				getChangescansize().addItem(NCLangRes.getInstance().getStrByID("sfbase", "ScanUIDialog-000004")/*自定义*/);
+				getChangescansize().setSelectedIndex(0);
+			}
+			else
+			{
+				
+				getChangescansize().addItem("All");
+				getChangescansize().addItem("A4");
+				getChangescansize().addItem("A5");
+				getChangescansize().addItem("A6");
+				getChangescansize().addItem("A7");
+				getChangescansize().addItem(NCLangRes.getInstance().getStrByID("sfbase", "ScanUIDialog-000002")/*名片*/);
+				getChangescansize().addItem(NCLangRes.getInstance().getStrByID("sfbase", "ScanUIDialog-000003")/*身份证*/);
+				getChangescansize().addItem(NCLangRes.getInstance().getStrByID("sfbase", "ScanUIDialog-000004")/*自定义*/);	
+				getChangescansize().setSelectedIndex(0);
+				
+			}
+			
+			 int i=0;
+			 int num1= getGpypanel().GetResolutionCount();
+			 int selindex=0;
+			 int width = getGpypanel().GetResolutionWidth(0);
+			 int height= getGpypanel().GetResolutionHeight(0); 
+
+			 getcomboxresolution().removeAllItems(); 
+			 for(i=0;i<num1;i++)
+			 {
+				int w=getGpypanel().GetResolutionWidth(i);
+				int h=getGpypanel().GetResolutionHeight(i);
+				Integer w1=w;
+				Integer h1=h;
+				String str=w1.toString()+"x"+h1.toString();
+				getcomboxresolution().addItem(str);
+				if(w==width)selindex=i;
+			 }    
+			 getcomboxresolution().setSelectedIndex(selindex);		
+		
+			 getcomboxresolution().addItemListener(new ItemListener(){
+			@Override
+			public void itemStateChanged(ItemEvent e) {
+				// 
+				if(e.getStateChange() == ItemEvent.SELECTED){
+					int num=	getcomboxresolution().getItemCount();
+					int index=	getcomboxresolution().getSelectedIndex();
+					if(index<num)
+					{
+						getGpypanel().SetResolution(index);
+					}  
+				}
+			}
+		});
+		}
+
+		private JPanel mainpane;
+		private JPanel toppane;
+		private JPanel btnpaPanel;
+		
+		private JLabel lblsize; 
+//		private JTextField txtsize;
+		private JLabel lblresolution ;
+//		private JTextField txtresolution ;
+		private JComboBox comboxresolution ;
+		private JLabel lblnamerule;
+		private JTextField txtnamerule;
+		private JButton btnsave;
+		private JButton btncancel;
+		private JComboBox changescansize ;
+		public JComboBox getChangescansize(){
+			if(changescansize==null){
+				changescansize =new JComboBox();
+//				changescansize.addItemListener(new ItemListener(){
+//					@Override
+//					public void itemStateChanged(ItemEvent e) {
+//						// 
+//						if (e.getStateChange() != ItemEvent.SELECTED)
+//							return;
+//						//
+//						
+//					}
+//				});
+			}
+			return changescansize;
+		}
+		public JLabel getLblresolution(){
+			if(lblresolution == null){
+				lblresolution = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0003")/*分辨率*/);
+				lblresolution.setHorizontalAlignment(SwingConstants.RIGHT);   
+			}
+			return lblresolution;
+		}
+//		public JTextField getTxtresolution(){
+//			if(txtresolution == null){
+//				txtresolution = new JTextField();
+//				txtresolution.setEnabled(false);
+//				txtresolution.setText("1600*1200");
+//			}
+//			return txtresolution;
+//		}
+		public JComboBox getcomboxresolution(){
+			if(comboxresolution == null){
+				comboxresolution = new JComboBox();
+			}
+			return comboxresolution ;
+		}
+		public JPanel getMainpane() {
+			if (mainpane == null) {
+				mainpane = new JPanel();
+				mainpane.setLayout(new BorderLayout());
+				mainpane.add(getToppane(), BorderLayout.CENTER);
+				mainpane.add(getBtnpaPanel(), BorderLayout.SOUTH);
+			}
+			return mainpane;
+		}
+
+		public JPanel getToppane() {
+			if (toppane == null) {
+				toppane = new JPanel();
+				MigLayout miglayout = new MigLayout("insets 30 20 20 30",
+						"[]10[]10[]", "[]20[]");
+				toppane.setLayout(miglayout);
+				toppane.add(getLblsize(), "w 100:100:100,left");
+				toppane.add(getChangescansize(), "w 200:200:200,wrap");
+				toppane.add(getLblresolution(), "w 100:100:100,left");
+				toppane.add(getcomboxresolution(), "w 200:200:200,wrap");
+				getcomboxresolution().setEnabled(false);
+				
+//				toppane.add(getLblnamerule(), "w 100:100:100,left");
+//				toppane.add(getTxtnamerule(), "w 200:200:200,wrap");
+			}
+			return toppane;
+		}
+
+		public JPanel getBtnpaPanel() {
+			if (btnpaPanel == null) {
+				btnpaPanel = new JPanel();
+				btnpaPanel.setBorder(new MyBorder(0,0,0,0));
+				FlowLayout mgr = new FlowLayout();
+				mgr.setAlignment(FlowLayout.RIGHT);
+				btnpaPanel.setLayout(mgr);
+				btnpaPanel.add(getBtnsave());
+				btnpaPanel.add(getBtncancel());
+			}
+			return btnpaPanel;
+		}
+
+		public JLabel getLblsize() {
+			if (lblsize == null) {
+				lblsize = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0004")/*尺寸*/);
+				lblsize.setHorizontalAlignment(SwingConstants.RIGHT);
+			}
+			return lblsize;
+		}
+
+//		public JTextField getTxtsize() {
+//			if (txtsize == null) {
+//				txtsize = new JTextField();
+//			}
+//			return txtsize;
+//		}
+
+//		public JLabel getLblnamerule() {
+//			if (lblnamerule == null) {
+//				lblnamerule = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0005")/*命名规则*/);
+//				lblnamerule.setHorizontalAlignment(SwingConstants.RIGHT);
+//			}
+//			return lblnamerule;
+//		}
+//
+//		public JTextField getTxtnamerule() {
+//			if (txtnamerule == null) {
+//				txtnamerule = new JTextField();
+//			}
+//			return txtnamerule;
+//		}
+
+		public JButton getBtnsave() {
+			if (btnsave == null) {
+				btnsave = new JButton(NCLangRes.getInstance().getStrByID("sftemp", "TakePotoPanel-0006")/*保存*/);
+				btnsave.addActionListener(new ActionListener() {
+					@Override
+					public void actionPerformed(ActionEvent e) {
+						int selindex = getChangescansize().getSelectedIndex();
+						if(selindex==-1){
+							selindex = 0 ;
+						}
+						//暂时保存到
+						System.setProperty(FileBroseConst.GPYSIZE, selindex+"");
+						//高拍仪设置
+						getGpypanel().SetScanSize(selindex);
+						GPYSettingDialog.this.close();
+
+					}
+				});
+			}
+			return btnsave;
+		}
+
+		public JButton getBtncancel() {
+			if (btncancel == null) {
+				btncancel = new JButton(NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0004")/*取消*/);
+				btncancel.addActionListener(new ActionListener() {
+					@Override
+					public void actionPerformed(ActionEvent e) {
+						GPYSettingDialog.this.close();
+					}
+				});
+			}
+			return btncancel;
+		}
+
+		void initUI() {
+			this.getContentPane().add(getMainpane());
+
+		}
+
+	}
+
+//	@Override
+//	public void repaint() {
+//		// 
+//		if(imagebrower!=null){
+//			imagebrower=null;
+//			getImagebrower();
+//		}
+//		super.repaint();
+//	}
+	
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 94 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThUploadAction.java


+ 74 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThUploadRefAction.java

@@ -0,0 +1,74 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+
+import nc.bs.framework.common.NCLocator;
+import nc.bs.logging.Logger;
+import nc.bs.pub.filesystem.IFileSystemService;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.funcnode.ui.action.AbstractNCAction;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.UIRefPane;
+import nc.vo.pub.filesystem.NCFileNode;
+
+public class ThUploadRefAction extends AbstractNCAction {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -1827737299310863063L;
+	private ThFileContentPanel parentpanel ;
+	public ThUploadRefAction(ThFileContentPanel para) {
+		parentpanel = para ;
+		this.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("sftemp", "UploadRefAction-0000")/*引用文档*/);
+		this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "UploadRefAction-0000")/*引用文档*/);
+	}
+
+	@Override
+	public void actionPerformed(ActionEvent e) {
+
+		if (parentpanel.rootNode == null) {
+			return;
+		}
+		TreePath path = parentpanel.getPatchTree().getSelectionPath();
+		if (path == null) {
+			path = new TreePath(parentpanel.rootNode.getPath());
+		}
+		DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
+//		if (!node.getAllowsChildren()) {
+//			MessageDialog.showErrorDlg(FileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000008")/*不能在文件下面新建文件*/);
+//			return;
+//		}
+//		node = getClosedValidateNode(node);
+		UIRefPane fileref = new UIRefPane(NCLangRes.getInstance().getStrByID("sftemp", "UploadRefAction-0001")/*文档*/);
+		fileref.setMultiSelectedEnabled(false);
+		fileref.getRefModel().setUseDataPower(false);
+		
+		fileref.showModel();
+		String pk_doc = fileref.getRefPK();
+		if(pk_doc==null)
+			return;
+		String pPath = "";
+		if (node instanceof NCFileNode) {
+			pPath = ((NCFileNode) node).getFullPath();
+		}
+		String creator = WorkbenchEnvironment.getInstance().getLoginUser().getCuserid();
+		try{
+			IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+			//文档中心上传
+			NCFileNode newNode = service.createRefFileNode(pPath, creator, pk_doc);
+			if (newNode != null) {
+				parentpanel.nodeToFileVO((NCFileNode)node, newNode);
+			}
+		} catch (Exception ex) {
+			Logger.error(ex.getMessage(), ex);
+			MessageDialog.showErrorDlg(parentpanel, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, ex.getMessage());
+		}
+	}
+}

+ 213 - 0
pu/pu/src/client/nc/pub/filesystem/newui/ThUploadURLAction.java

@@ -0,0 +1,213 @@
+package nc.pub.filesystem.newui;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.URL;
+import java.util.Date;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.SwingConstants;
+import javax.swing.border.EmptyBorder;
+import javax.swing.tree.TreePath;
+
+import nc.bs.framework.common.NCLocator;
+import nc.bs.logging.Logger;
+import nc.bs.pub.filesystem.IFileSystemService;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.funcnode.ui.action.AbstractNCAction;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.UIButton;
+import nc.ui.pub.beans.UIDialog;
+import nc.ui.pub.beans.UITextField;
+import nc.vo.pub.BusinessException;
+import nc.vo.pub.filesystem.FileTypeConst;
+import nc.vo.pub.filesystem.NCFileNode;
+import nc.vo.pub.filesystem.NCFileVO;
+import net.miginfocom.swing.MigLayout;
+
+public class ThUploadURLAction   extends AbstractNCAction{
+	private static final long serialVersionUID = 1L;
+	private ThFileContentPanel parentpanel ;
+	public ThUploadURLAction(ThFileContentPanel para){
+		parentpanel = para;
+		this.putValue(AbstractAction.NAME,NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0000")/*上传 URL*/);
+		this.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0000")/*上传 URL*/);
+//		this.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/newfolder.png"));
+	}
+	@Override
+	public void actionPerformed(ActionEvent e) {
+		//TODO 弹出上传附件对话框,url,别名
+		UploadURLDialog dlg = new UploadURLDialog();
+		dlg.showModal();
+		
+	}
+	private class UploadURLDialog extends UIDialog {
+		public UploadURLDialog(){
+			super(parentpanel, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0001")/*上传URL*/);
+			
+			
+			this.setResizable(true);
+			initUI();
+			this.setSize((int)getMainPane().getPreferredSize().getWidth()+20, 180);
+		}
+		
+		private void initUI(){
+			UploadURLDialog.this.getContentPane().setLayout(new BorderLayout());
+			UploadURLDialog.this.getContentPane().add(BorderLayout.CENTER,getMainPane());
+			UploadURLDialog.this.getContentPane().add(BorderLayout.SOUTH,getBottombtnPane());
+
+		}
+//		private JScrollPane jscpane ;
+//		private JScrollPane getJscpane(){
+//			if(jscpane ==null){
+//				jscpane = new JScrollPane();
+//				jscpane.setViewportView(getMainPane());
+//			}
+//			return jscpane;
+//		}
+		private JPanel manPane ;
+		public JPanel getMainPane(){
+			if(manPane == null){
+				manPane = new JPanel();
+//				manPane.set
+				manPane.setBorder(new EmptyBorder(20,20,20,20));
+				manPane.setLayout(new MigLayout("","[]rel[]unrel[]rel[]","[]20[]"));
+				manPane.add(getLblalias(),"");
+				manPane.add(getTxtalias(),"w 300:300:300,wrap");
+				manPane.add(getLblURL(),"");
+				manPane.add(getTxtURL(),"w 300:300:300,wrap");
+			}
+			return manPane;
+		}
+		private JLabel lblalias;
+		public JLabel getLblalias(){
+			if(lblalias == null){
+				lblalias = new JLabel(NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0002")/*附件名*/);
+				lblalias.setHorizontalAlignment(SwingConstants.RIGHT);
+			}
+			return lblalias ;
+		}
+		private UITextField txtalias;
+		public UITextField getTxtalias(){
+			if(txtalias == null){
+				txtalias = new UITextField();
+				txtalias.setShowMustInputHint(true);
+			}
+			return txtalias ;
+		}
+		
+		private JLabel lblURL;
+		public JLabel getLblURL(){
+			if(lblURL == null){
+				lblURL = new JLabel("URL");
+				lblURL.setHorizontalAlignment(SwingConstants.RIGHT);
+			}
+			return lblURL ;
+		}
+		private UITextField txtURL;
+		public UITextField getTxtURL(){
+			if(txtURL == null){
+				txtURL = new UITextField();
+				txtURL.setShowMustInputHint(true);
+				//默认显示http://
+				txtURL.setText("http://");
+			}
+			return txtURL ;
+		}
+		
+		private JPanel bottombtnPane;
+		public JPanel getBottombtnPane(){
+			if(bottombtnPane==null){
+				bottombtnPane = new JPanel();
+				FlowLayout  fl = new FlowLayout();
+				fl.setAlignment(FlowLayout.RIGHT);
+				bottombtnPane.setLayout(fl);
+				bottombtnPane.setBackground(FileColorConst.BOTTOMCOLOR);
+				
+				bottombtnPane.add(getBtnpanel());
+				bottombtnPane.setBorder(new MyBorder(0,0,0,0));
+			}
+			
+			return bottombtnPane;
+		}
+		
+		private JPanel btnpanel ;
+		public JPanel getBtnpanel (){
+			if(btnpanel == null){
+				btnpanel = new JPanel();
+				btnpanel.setOpaque(false);
+				UIButton btnsave = new UIButton(NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0003")/*确定*/);
+				UIButton btncancel = new UIButton(NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0004")/*取消*/);
+				btnsave.addActionListener(new ActionListener(){
+					@Override
+					public void actionPerformed(ActionEvent e) {
+						//
+						if(txtalias.getText()==null ||txtalias.getText().trim().isEmpty()){
+							MessageDialog.showErrorDlg(UploadURLDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0006")/*附件名不能为空!*/);
+							return ;
+						}
+						if(txtURL.getText()==null ||txtURL.getText().trim().isEmpty()){
+							MessageDialog.showErrorDlg(UploadURLDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0007")/*URL不能为空!*/);
+							return ;
+						}
+
+						try{
+							//URL是否正确
+							URL url = new URL(txtURL.getText());
+						}catch (Exception e1) 
+						{
+							MessageDialog.showErrorDlg(UploadURLDialog.this, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0005")/*提示*/, NCLangRes.getInstance().getStrByID("sftemp", "UploadURLAction-0008")/*URL不合法!*/);
+							return ;
+						}
+						TreePath path = parentpanel.getPatchTree().getSelectionPath();
+						if (path == null) {
+							path = new TreePath(parentpanel.rootNode.getPath());
+						}
+						NCFileNode node = (NCFileNode) path.getLastPathComponent();
+						String filepath =node.getFullPath();
+						filepath =filepath+"/"+txtalias.getText() ;
+						//(creator,isfolder,filepath, lasttime, filetype,pk_doc)";
+						NCFileVO newfilevo = new NCFileVO();  
+						String creator =WorkbenchEnvironment.getInstance().getLoginUser().getCuserid();
+						newfilevo.setCreator(creator);
+						newfilevo.setPath(filepath);
+						newfilevo.setFolder(false);
+						newfilevo.setFiletype(FileTypeConst.URL);
+						newfilevo.setTime(new Date().getTime());
+						newfilevo.setPk_doc(txtURL.getText());
+						IFileSystemService fileservice = NCLocator.getInstance().lookup(IFileSystemService.class);
+						boolean flag = false ;
+						try {
+							flag =fileservice.insertURLFileVO(newfilevo);
+						} catch (BusinessException e1) {
+							Logger.error(e1);
+						}
+						if(flag ){
+							//刷新界面 
+							parentpanel.refreshUI(node, newfilevo);
+						}
+						UploadURLDialog.this.closeOK();
+					}
+				});
+				btncancel.addActionListener(new ActionListener(){
+					@Override
+					public void actionPerformed(ActionEvent e) {
+						// 
+						UploadURLDialog.this.closeCancel();
+						
+					}
+				});
+				btnpanel.add(btnsave);
+				btnpanel.add(btncancel);
+			}
+			return btnpanel ;
+		}
+	}
+}

+ 1234 - 0
pu/pu/src/client/nc/ui/pub/filesystem/ThFileManageUI.java

@@ -0,0 +1,1234 @@
+package nc.ui.pub.filesystem;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.JToolBar;
+import javax.swing.JTree;
+import javax.swing.event.MouseInputAdapter;
+import javax.swing.plaf.basic.BasicTreeUI;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellEditor;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+
+import nc.bs.framework.common.NCLocator;
+import nc.bs.logging.Logger;
+import nc.bs.pub.filesystem.FileSystemUtil;
+import nc.bs.pub.filesystem.IFileSystemService;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.funcnode.ui.action.SeparatorAction;
+import nc.pub.filesystem.newui.FileContentPanel;
+import nc.pub.filesystem.newui.ThFileContentPanel;
+import nc.sfbase.client.ClientToolKit;
+import nc.ui.ml.NCLangRes;
+import nc.ui.pub.beans.MessageDialog;
+import nc.ui.pub.beans.UIButton;
+import nc.ui.pub.beans.UIDialog;
+import nc.ui.pub.beans.UIRefPane;
+import nc.ui.pub.beans.UITree;
+import nc.ui.uif2.editor.BillForm;
+import nc.vo.pub.BusinessException;
+import nc.vo.pub.filesystem.ItemObj;
+import nc.vo.pub.filesystem.NCFileNode;
+
+import com.sun.java.swing.plaf.windows.WindowsToolBarSeparatorUI;
+
+
+
+public class ThFileManageUI extends JPanel {
+	private String rootDirStr = null;	
+	public ThFileManageUI() {
+		super();
+		setLayout(new BorderLayout());
+		filepanel = new ThFileContentPanel(rootDirStr,null);
+		add(filepanel, BorderLayout.CENTER);
+	}
+	private ThFileContentPanel filepanel ;
+	public ThFileManageUI(String rootDirStr,BillForm editor) {
+		super();
+		setLayout(new BorderLayout());
+		filepanel = new ThFileContentPanel(rootDirStr,editor);	
+		setPreferredSize(new Dimension(800,700));
+//		add(filepanel);
+		add(filepanel,BorderLayout.CENTER);
+
+	}
+	
+	/*
+	 * 
+	 *TODO 下边的方法除了设置按钮的方法基本都废弃,
+	 *考虑到方法很多是公开的,
+	 *TODO 可能会有调用,不敢删除
+	 */
+	
+	
+	/**
+	 * 
+	 */
+	private class  DefaultFileNameRender implements IRootNodeNameRender{
+
+		public String getDisplayName(String name) {
+			return name;
+		}
+		
+	}
+	private static final long serialVersionUID = -2269771697062506234L;
+	
+	private class CTreeUI extends BasicTreeUI {
+		public CTreeUI() {
+			super();
+		}
+
+		@Override
+		protected void completeEditing(boolean messageStop, boolean messageCancel, boolean messageTree) {
+			super.completeEditing(messageStop, messageCancel, true);
+		}
+
+		@Override
+		protected boolean startEditing(TreePath path, MouseEvent event) {
+			if (path != null) {
+			Object obj = path.getLastPathComponent();
+			if (obj.equals(rootNode)) {
+				// MessageDialog.showErrorDlg(tree, "错误", "不能对根节点重命名");
+				return false;
+			}
+		}
+			return super.startEditing(path, event);
+		}
+
+//		@Override
+//		public void startEditingAtPath(JTree tree, TreePath path) {
+//			if (path != null) {
+//				Object obj = path.getLastPathComponent();
+//				if (obj.equals(rootNode)) {
+//					// MessageDialog.showErrorDlg(tree, "错误", "不能对根节点重命名");
+//					return;
+//				}
+//			}
+//			super.startEditingAtPath(tree, path);
+//		}
+
+	}
+
+	private class CTreeCellRender extends DefaultTreeCellRenderer {
+		private static final long serialVersionUID = -8004831268687492791L;
+
+		@Override
+		public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) {
+			Component comp = super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
+			if (value instanceof NCFileNode) {
+				NCFileNode node = (NCFileNode) value;
+				JLabel lbl = (JLabel) comp;
+				Icon icon = null;
+				if (!node.getAllowsChildren()) {
+					String name = node.getName();
+					int index = name.lastIndexOf(".");
+					if (index != -1) {
+						String ext = name.substring(index + 1).toLowerCase();
+						icon = ClientToolKit.loadImageIcon("images/filesystem/" + ext + ".png");
+					} else {
+						icon = ClientToolKit.loadImageIcon("images/filesystem/default.png");
+					}
+				} else if (node.equals(rootNode)) {
+					icon = ClientToolKit.loadImageIcon("images/filesystem/root.png");
+				}
+				if (icon != null) {
+					lbl.setIcon(icon);
+				}
+				if(node.equals(rootNode)){
+					String displayName = getRootNodeNameRender().getDisplayName(node.getName());
+					lbl.setText(displayName);
+				}
+				
+			}
+			return comp;
+		}
+
+	}
+
+	private class CTreeCellEditor extends DefaultTreeCellEditor {
+		private NCFileNode node = null;
+
+		public CTreeCellEditor(JTree tree) {
+			super(tree, treeCellRender);
+		}
+
+		@Override
+		public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
+			if (value instanceof NCFileNode) {
+				node = (NCFileNode) value;
+			}
+			return super.getTreeCellEditorComponent(tree, value, isSelected, expanded, leaf, row);
+		}
+		@Override
+		public Object getCellEditorValue() {
+			Object o = super.getCellEditorValue();
+			if (o instanceof String && node != null) {
+				String newValue = ((String) o).trim();
+				String oldValue = node.getName();
+				String oldPath = node.getFullPath();
+				node.setUserObject(newValue);
+				String newPath = node.getFullPath();
+				boolean b = false;
+				try {
+					if (newValue.indexOf("/") != -1 || newValue.indexOf("\\") != -1) {
+						MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000001")/*文件名中不能包含\\或/符号*/);
+						return oldValue;
+					}
+					//如果去掉前后空格长度为0,返回原来值,提示文件名不能空
+					if(newValue.trim().length()==0)
+					{
+						//MessageDialog.showErrorDlg(FileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, "文件名不能为空");
+						return oldValue;
+					}
+					if (!oldPath.equals(newPath)) {
+						IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+						b = service.rename(oldPath, newPath);
+						if (!b) {
+							MessageDialog.showHintDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000002")/*提示*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000003")/*文件名重复*/);
+						}
+					}
+				} catch (BusinessException e) {
+					Logger.error(e);
+				}
+				if (b) {
+					return newValue;
+				} else {
+					return oldValue;
+				}
+			}
+			return o;
+		}
+
+		@Override
+		protected void determineOffset(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
+			super.determineOffset(tree, value, isSelected, expanded, leaf, row);
+			if (renderer != null) {
+				editingIcon = ((JLabel) renderer.getTreeCellRendererComponent(tree, value, isSelected, expanded, leaf, row, false)).getIcon();
+			}
+		}
+
+	}
+
+	private class CreateFolderAction extends AbstractAction {
+		private static final long serialVersionUID = 8586968483409225741L;
+
+		public void actionPerformed(ActionEvent e) {
+			if (rootNode == null) {
+				return;
+			}
+			TreePath path = getFileManageTree().getSelectionPath();
+			if (path == null) {
+				path = new TreePath(rootNode.getPath());
+			}
+			DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
+			String pPath = "";
+			if (node instanceof NCFileNode) {
+				pPath = ((NCFileNode) node).getFullPath();
+			}
+			if (!node.getAllowsChildren()) {
+				MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000004")/*不能在文件下面新建文件夹*/);
+				return;
+			}
+			String str = (String) MessageDialog.showInputDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000005")/*新建文件夹*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000006")/*请输入文件夹名称*/, "newfolder");
+			if (str != null && str.trim().length() > 0) {
+				try {
+					if(CheckTheSameFileName(node,str))
+					{
+						return;
+					}
+					IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+					NCFileNode newNode = service.createNewFileNode(pPath, str, WorkbenchEnvironment.getInstance().getLoginUser().getCuserid());
+					DefaultTreeModel model = getFileManageTreeModel();
+					model.insertNodeInto(newNode, node, node.getChildCount());
+					model.nodeStructureChanged(node);
+					TreePath newPath = new TreePath(getTreePath(newNode));
+					getFileManageTree().setSelectionPath(newPath);
+					getFileManageTree().expandPath(newPath);
+				} catch (Exception ex) {
+					Logger.error(ex.getMessage(), ex);
+					MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, ex.getMessage());
+				}
+			}
+		}
+	}
+
+	private class DeleteNCFileNodeAction extends AbstractAction {
+		private static final long serialVersionUID = 480062171698567464L;
+
+		public void actionPerformed(ActionEvent e) {
+			if (rootNode == null) {
+				return;
+			}
+			TreePath[] paths = getFileManageTree().getSelectionPaths();
+			if (paths == null || paths.length == 0)
+				return;
+			List<String> nodePathsList = new ArrayList<String>();
+			List<DefaultMutableTreeNode> nodeList = new ArrayList<DefaultMutableTreeNode>();
+			for (int i = 0; i < paths.length; i++) {
+				DefaultMutableTreeNode node = (DefaultMutableTreeNode) paths[i].getLastPathComponent();
+				if (node.equals(rootNode)) {
+					continue;
+				}
+				if (node instanceof NCFileNode) {
+					String nodePath = ((NCFileNode) node).getFullPath();
+					nodePathsList.add(nodePath);
+					nodeList.add(node);
+				}
+
+			}
+			if (nodePathsList.size() > 0) {
+				try {
+					IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+					StringBuilder sb = new StringBuilder(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000019")+"\r\n");
+					for (int i = 0; i < nodeList.size(); i++) {
+						TreeNode[] nodes = getTreePath(nodeList.get(i));
+						sb.append(convertTreePathToString(nodes)).append("\r\n");
+					}
+					if (MessageDialog.showOkCancelDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000007")/*删除确认框*/, sb.toString()) == MessageDialog.ID_OK) {
+						service.deleteNCFileNodes(nodePathsList.toArray(new String[0]));
+						DefaultTreeModel model = getFileManageTreeModel();
+						for (int i = 0; i < nodeList.size(); i++) {
+							DefaultMutableTreeNode tempNode = nodeList.get(i);
+							TreeNode parent = tempNode.getParent();
+							model.removeNodeFromParent(tempNode);
+							if (parent != null) {
+								model.nodeStructureChanged(parent);
+							}
+						}
+						// model.removeNodeFromParent(node);
+						// model.nodeStructureChanged(parent);
+					}
+				} catch (BusinessException ex) {
+					Logger.error(ex.getMessage(), ex);
+				}
+			}
+
+		}
+
+	}
+	private static Window getTopWindow(Container parentContainer) {
+		Container parent = parentContainer;
+		while (parent != null && !(parent instanceof Dialog || parent instanceof Frame)) {
+			parent = parent.getParent();
+		}
+		if(parent == null){
+			parent = JOptionPane.getFrameForComponent(parentContainer);
+		}
+		return (Window)parent;
+	}
+	private class UploadFormSCanerAction extends AbstractAction{
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			try{
+
+				ScanUIDialog f = new ScanUIDialog(getTopWindow(ThFileManageUI.this.getTopLevelAncestor()) , getFileManageTree(),rootNode);
+				Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
+//				Insets insets =Toolkit.getDefaultToolkit().getScreenInsets(window.getGraphicsConfiguration());
+				f.setLocation(new Point(((int)(dim.width-700)/2),(int)(dim.height-600)/2));
+				f.setModal(true);
+				f.show(true);
+//				Display display = Display.getDefault();
+//
+//				TestOcx thisClass = new TestOcx(getFileManageTree(),rootNode);
+//
+//				thisClass.createSShell();
+//				thisClass.createActivex();
+//				thisClass.createControl();
+//				thisClass.sShell.open();
+//
+//				while (!thisClass.sShell.isDisposed())
+//				{
+//				   if (!display.readAndDispatch())
+//				     display.sleep();
+//				}
+			}catch(Exception ex){
+				MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("sfbase", "FileManageUI-000001")/*连接失败*/, NCLangRes.getInstance().getStrByID("sfbase", "FileManageUI-000002")/*连接高拍仪失败!*/);
+			}
+		}
+	}
+	
+	private class UploadFileAction extends AbstractAction {
+		private static final long serialVersionUID = 2336027794934776723L;
+
+		public void actionPerformed(ActionEvent e) {
+			if (rootNode == null) {
+				return;
+			}
+			TreePath path = getFileManageTree().getSelectionPath();
+			if (path == null) {
+				path = new TreePath(rootNode.getPath());
+			}
+			DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
+//			if (!node.getAllowsChildren()) {
+//				MessageDialog.showErrorDlg(FileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000008")/*不能在文件下面新建文件*/);
+//				return;
+//			}
+			//树的点击点  取所在文件夹(如果点击的是文件,则取上一层)
+			node = getClosedValidateNode(node);
+			
+			JFileChooser chooser = new JFileChooser();
+			if (chooser.showOpenDialog(ThFileManageUI.this) == JFileChooser.APPROVE_OPTION) {
+				String pPath = "";
+				if (node instanceof NCFileNode) {
+					pPath = ((NCFileNode) node).getFullPath();
+				}
+				File file = chooser.getSelectedFile();
+				String dsName = WorkbenchEnvironment.getInstance().getLoginBusiCenter().getDataSourceName();
+				String fileName = file.getName();
+				String creator = WorkbenchEnvironment.getInstance().getLoginUser().getCuserid();
+				FileInputStream input = null;
+				
+				//校验是否同名
+				if(CheckTheSameFileName(node, fileName)){
+					return ;
+				}
+					
+					
+				try {
+					input = new FileInputStream(file);
+					NCFileNode newNode = FileManageServletClient.uploadFile(dsName, pPath, fileName, input, creator, file.length());
+					if (newNode != null) {
+						DefaultTreeModel model = getFileManageTreeModel();
+						model.insertNodeInto(newNode, node, node.getChildCount());
+						model.nodeStructureChanged(node);
+						// getFileManageTree().expandPath(path);
+						TreePath newPath = new TreePath(getTreePath(newNode));
+						getFileManageTree().setSelectionPath(newPath);
+						getFileManageTree().expandPath(newPath);
+					}
+				} catch (Exception ex) {
+					Logger.error(ex.getMessage(), ex);
+					MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, ex.getMessage());
+				} finally {
+					try {
+						if (input != null) {
+							input.close();
+						}
+					} catch (Exception e2) {
+					}
+				}
+			}
+		}
+	}
+	
+	private DefaultMutableTreeNode getClosedValidateNode(DefaultMutableTreeNode node){
+		if(node.getAllowsChildren())
+			return node;
+		DefaultMutableTreeNode parentnode =(DefaultMutableTreeNode) node.getParent();
+		return getClosedValidateNode(parentnode);
+	}
+	
+	private class RefrenceFileAction extends AbstractAction {
+
+		private static final long serialVersionUID = 3497920350046729694L;
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			if (rootNode == null) {
+				return;
+			}
+			TreePath path = getFileManageTree().getSelectionPath();
+			if (path == null) {
+				path = new TreePath(rootNode.getPath());
+			}
+			DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
+//			if (!node.getAllowsChildren()) {
+//				MessageDialog.showErrorDlg(FileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000008")/*不能在文件下面新建文件*/);
+//				return;
+//			}
+			node = getClosedValidateNode(node);
+			UIRefPane fileref = new UIRefPane("文档");/*-=notranslate=-*/  
+			fileref.setMultiSelectedEnabled(false);
+			fileref.getRefModel().setUseDataPower(false);
+			
+			fileref.showModel();
+			String pk_doc = fileref.getRefPK();
+			if(pk_doc==null)
+				return;
+			String pPath = "";
+			if (node instanceof NCFileNode) {
+				pPath = ((NCFileNode) node).getFullPath();
+			}
+			String creator = WorkbenchEnvironment.getInstance().getLoginUser().getCuserid();
+			try{
+				IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+				NCFileNode newNode = service.createRefFileNode(pPath, creator, pk_doc);
+				if (newNode != null) {
+					DefaultTreeModel model = getFileManageTreeModel();
+					model.insertNodeInto(newNode, node, node.getChildCount());
+					model.nodeStructureChanged(node);
+					// getFileManageTree().expandPath(path);
+					TreePath newPath = new TreePath(getTreePath(newNode));
+					getFileManageTree().setSelectionPath(newPath);
+					getFileManageTree().expandPath(newPath);
+				}
+			} catch (Exception ex) {
+				Logger.error(ex.getMessage(), ex);
+				MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, ex.getMessage());
+			}
+			
+		}
+		
+	}
+
+	private class DownLoadFileAction extends AbstractAction {
+		private static final long serialVersionUID = -2148614538083746599L;
+
+		public void actionPerformed(ActionEvent e) {
+			if (rootNode == null) {
+				return;
+			}
+			TreePath treePath = getFileManageTree().getSelectionPath();
+			if (treePath == null) {
+				return;
+			}
+			DefaultMutableTreeNode node = (DefaultMutableTreeNode) treePath.getLastPathComponent();
+			if (node.getAllowsChildren()) {
+				MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000009")/*只能下载文件*/);
+				return;
+			}
+			if (node instanceof NCFileNode) {
+				String path = ((NCFileNode) node).getFullPath();
+				String name=((NCFileNode) node).getName();
+				String defaultType= getFileType(name);
+				JFileChooser chooser = new JFileChooser();
+				// 设置默认选中文件
+				chooser.setSelectedFile(new File(name));
+				
+				if (chooser.showSaveDialog(ThFileManageUI.this) == JFileChooser.APPROVE_OPTION) {				
+					File file = chooser.getSelectedFile();					
+					// 如果选中文件无后缀名,添加默认后缀名
+					if (!file.getName().contains(".") && defaultType != null) {
+						file = new File(file.getParent(), file.getName()
+								+ defaultType);
+					}
+					String dsName = WorkbenchEnvironment.getInstance().getLoginBusiCenter().getDataSourceName();
+					FileOutputStream fos = null;
+					try {
+						fos = new FileOutputStream(file);
+						FileManageServletClient.downloadFile(dsName, path, fos);
+					} catch (Exception ex) {
+						Logger.error(ex.getMessage(), ex);
+						MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, ex.getMessage());
+					} finally {
+						try {
+							if (fos != null) {
+								fos.close();
+							}
+						} catch (Exception e2) {
+						}
+					}
+				}
+				
+			}
+			
+
+		}
+		/**
+		 * @param name
+		 * @return 返回文件后缀名,包含"."
+		 */
+		private String getFileType(String name) {
+			String type=null;
+			if(name!=null&&name.contains(".")){
+				type=name.substring(name.lastIndexOf("."), name.length());
+			}
+			return type;
+		}
+
+
+	}
+
+	private class RefreshAction extends AbstractAction {
+		private static final long serialVersionUID = -7401161189389362236L;
+
+		public void actionPerformed(ActionEvent e) {
+			constructTree();
+		}
+
+	}
+
+	private class ShowFileInWebAction extends AbstractAction {
+		private static final long serialVersionUID = -5973794844705935313L;
+
+		public void actionPerformed(ActionEvent e) {
+			//测试进入action次数
+			Logger.error("--------------------------zhoujjtestinmethod测试进入action次数---------------------------------------");
+			
+			if (rootNode == null) {
+				return;
+			}
+			TreePath treePath = getFileManageTree().getSelectionPath();
+			if (treePath == null) {
+				return;
+			}
+			DefaultMutableTreeNode node = (DefaultMutableTreeNode) treePath.getLastPathComponent();
+			if (node.getAllowsChildren()) {
+				MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000010")/*请选择一个文件*/);
+				return;
+			}
+			String path = "";
+			if (node instanceof NCFileNode) {
+				path = ((NCFileNode) node).getFullPath();
+			}
+			String dsName = WorkbenchEnvironment.getInstance().getLoginBusiCenter().getDataSourceName();
+			try {
+				FileManageServletClient.showFileInWeb(dsName, path,((NCFileNode)node).getTime());
+			} catch (Exception e1) {
+				Logger.error(e1);
+			}
+
+		}
+	}
+
+	private class RenameTreeNodeAction extends AbstractAction {
+		private static final long serialVersionUID = -5973794844705935313L;
+
+		public void actionPerformed(ActionEvent e) {
+			if (rootNode == null) {
+				return;
+			}
+			TreePath treePath = getFileManageTree().getSelectionPath();
+			if (treePath == null) {
+				return;
+			}
+			Object obj = treePath.getLastPathComponent();
+			if (obj.equals(rootNode)) {
+				MessageDialog.showErrorDlg(getFileManageTree(), NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000011")/*不能对根节点重命名*/);
+				return;
+			}
+
+			getFileManageTree().getUI().startEditingAtPath(getFileManageTree(), treePath);
+
+		}
+	}
+
+	private class CMouseHandler extends MouseInputAdapter {
+		public void mouseClicked(MouseEvent e) {
+			if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) {
+				doDoubleClicked(e);
+			}
+		}
+
+		@Override
+		public void mouseReleased(MouseEvent e) {
+			if (e.isPopupTrigger()) {
+				showPopupMenu(e);
+			}
+		}
+
+	}
+
+	
+
+	private NCFileNode rootNode = null;
+
+	private UITree fileManageTree = null;
+
+	private JToolBar toolBar = null;
+
+	private JPopupMenu popMenu = null;
+
+	private JScrollPane scrollPane = null;
+
+	private DefaultTreeModel fileManageTreeModel = null;
+
+	private CMouseHandler mouseHandler = new CMouseHandler();
+
+	private CreateFolderAction createFolderAction = null;
+	private UIButton btncreateFolder = null;
+	public UIButton getBtncreateFolder(){
+		if(btncreateFolder == null){
+			btncreateFolder = new UIButton(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000005")/*新建文件夹*/);
+			btncreateFolder.addActionListener(new CreateFolderAction());
+		}
+		return btncreateFolder;
+	}
+	
+	private DeleteNCFileNodeAction deleteNCFileNodeAction = null;
+	private UIButton btndeleteNCFileNode = null;
+	public UIButton getBtnDeleteNCFileNode(){
+		if(btndeleteNCFileNode == null){
+			btndeleteNCFileNode = new UIButton( NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000012")/*删除*/);
+			btndeleteNCFileNode.addActionListener(new DeleteNCFileNodeAction());
+		}
+		return btndeleteNCFileNode;
+	}
+	//上传文件的popup
+	private JPopupMenu uploadPopAction;
+	public JPopupMenu getUploadPopAction(){
+		if(uploadPopAction==null){
+			uploadPopAction = new JPopupMenu();
+			uploadPopAction.add(getUploadFileAction());
+			uploadPopAction.add(getUpscan());
+//			uploadPopAction.add(getRefrenceFileAction());			
+			
+		}
+		return uploadPopAction;
+	}
+	//本地文件上传 action
+	private UploadFileAction uploadFileAction = null;
+	public final UploadFileAction getUploadFileAction() {
+		if (uploadFileAction == null) {
+			uploadFileAction = new UploadFileAction();
+			uploadFileAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000013")/*上传文件*/);
+			uploadFileAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000013")/*上传文件*/);
+			uploadFileAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/upload.png"));
+		}
+		return uploadFileAction;
+	}
+
+	
+	//高拍仪上传action
+	private UploadFormSCanerAction upscan;
+	public final UploadFormSCanerAction getUpscan(){
+		if(upscan==null){
+			upscan= new UploadFormSCanerAction();
+			upscan.putValue(AbstractAction.NAME,NCLangRes.getInstance().getStrByID("sfbase", "FileManageUI-000003")/*抓拍上传*/);
+			upscan.putValue(Action.SHORT_DESCRIPTION,NCLangRes.getInstance().getStrByID("sfbase", "FileManageUI-000003")/*抓拍上传*/);
+			upscan.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/upload.png"));
+		}
+		return upscan;
+	}
+
+	//弹出三个上传popup的action
+	private   UploadPopAction upAction ;
+	private class UploadPopAction extends AbstractAction{
+		@Override
+		public void actionPerformed(ActionEvent e) {			
+			getUploadPopAction().show(getToolBar().getComponent(2), 0, getToolBar().getComponent(2).getHeight()+10);
+			
+		}
+	}
+	//弹出上传pop的 按钮 toolbar button
+	private UIButton btnup = null;
+	public UIButton getBtnupscan(){
+		if(btnup==null){
+			btnup = new UIButton(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000013")/*上传文件*/);
+			btnup.addActionListener(new UploadPopAction());
+			
+		}
+		return btnup;
+	}
+	public UploadPopAction getUpButton(){
+		if(upAction == null){
+			upAction = new UploadPopAction();			
+			upAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000013")/*上传文件*/);
+			upAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000013")/*上传文件*/);
+			upAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/upload.png"));
+		}
+			
+		return upAction;
+	}
+		
+	//引用文档 action
+	private RefrenceFileAction refrenceFileAction = null;
+	//
+	
+	//下载action
+	private DownLoadFileAction downLoadFileAction = null;
+	//下载button
+	private UIButton btndownLoadFile = null;
+	public UIButton getBtndownLoadFile(){
+		if(btndownLoadFile==null){
+			btndownLoadFile = new UIButton(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000014")/*下载文件*/);
+			btndownLoadFile.addActionListener(new DownLoadFileAction());
+			
+		}
+		return btndownLoadFile;
+	}
+	//刷新 action
+	private RefreshAction refreshAction = null;
+	//刷新button
+	private UIButton btnrefresh = null;
+	public UIButton getBtnrefresh(){
+		if(btnrefresh==null){
+			btnrefresh = new UIButton(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000015")/*刷新*/);
+			btnrefresh.addActionListener(new RefreshAction());
+			
+		}
+		return btnrefresh;
+	}
+	//预览 action
+	private ShowFileInWebAction showFileInWebAction = null;
+	//预览button
+	private UIButton btnshowFileInWeb = null;
+	public UIButton getBtnshowFileInWeb(){
+		if(btnshowFileInWeb==null){
+			btnshowFileInWeb = new UIButton(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000016")/*阅览*/);
+			btnshowFileInWeb.addActionListener(new ShowFileInWebAction());
+			
+		}
+		return btnshowFileInWeb;
+	}
+	//重命名 action
+	private RenameTreeNodeAction renameTreeNodeAction = null;
+	//重命名 button
+	private UIButton btnrenameTreeNode = null;
+	public UIButton getBtnrenameTreeNode(){
+		if(btnrenameTreeNode==null){
+			btnrenameTreeNode = new UIButton(NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000017")/*重命名*/);
+			btnrenameTreeNode.addActionListener(new RenameTreeNodeAction());
+			
+		}
+		return btnrenameTreeNode;
+	}
+	private CTreeCellRender treeCellRender = new CTreeCellRender();
+	private IRootNodeNameRender rootNodeNameRender = null;
+	
+
+	
+
+
+
+	public void setRootDirStr(String dirStr) {
+		if (dirStr != null) {
+			rootDirStr = FileSystemUtil.validatePathString(dirStr);
+			// rootDirStr = dirStr.replace('\\', '/');
+			// if(rootDirStr.endsWith("/")){
+			// rootDirStr = rootDirStr.substring(0, rootDirStr.length()-1);
+			// }
+		}
+		constructTree();
+	}
+
+	public void showPopupMenu(MouseEvent e) {
+		ArrayList<TreePath> list = new ArrayList<TreePath>();
+		TreePath tp = getFileManageTree().getPathForLocation(e.getX(), e.getY());
+		if (tp != null) {
+			list.add(tp);
+		}
+		if (e.isControlDown()) {
+			TreePath[] tps = getFileManageTree().getSelectionPaths();
+			if (tps != null && tps.length > 0) {
+				list.addAll(Arrays.asList(tps));
+			}
+		}
+		getFileManageTree().setSelectionPaths(list.toArray(new TreePath[0]));
+
+		getPopMenu().show(getFileManageTree(), e.getX(), e.getY());
+
+	}
+
+	private void doDoubleClicked(MouseEvent e) {
+		TreePath selPath = getFileManageTree().getPathForLocation(e.getX(), e.getY());// getSelectionPath();
+		if (selPath != null) {
+			Object obj = selPath.getLastPathComponent();
+			if (obj instanceof NCFileNode) {
+				NCFileNode node = (NCFileNode) obj;
+				if (!node.isFolder()) {
+					getShowFileInWebAction().actionPerformed(null);
+				}
+			}
+		}
+
+	}
+
+	private void initialize() {
+		setLayout(new BorderLayout());
+		this.scrollPane = new JScrollPane(getFileManageTree());
+		this.scrollPane.setColumnHeaderView(getToolBar());
+		add(this.scrollPane, BorderLayout.CENTER);
+		setTreeEditable(true);
+		constructTree();
+	}
+
+	private void constructTree() {
+		try {
+			if (rootDirStr != null) {
+				IFileSystemService service = NCLocator.getInstance().lookup(IFileSystemService.class);
+				NCFileNode node = service.getNCFileNodeTreeAndCreateAsNeed(rootDirStr, WorkbenchEnvironment.getInstance().getLoginUser().getCuserid());
+				rootNode = findNode(node, rootDirStr);
+			} else {
+				rootNode = null;
+			}
+			getFileManageTreeModel().setRoot(rootNode);
+			getFileManageTreeModel().nodeStructureChanged(rootNode);
+
+		} catch (BusinessException e) {
+			Logger.error(e);
+		}
+
+	}
+
+	@SuppressWarnings("unchecked")
+	static NCFileNode findNode(NCFileNode node, String path) {
+		Enumeration<NCFileNode> enumer = node.breadthFirstEnumeration();
+		NCFileNode retrNode = null;
+		while (enumer.hasMoreElements()) {
+			NCFileNode tempNode = (NCFileNode) enumer.nextElement();
+			if (tempNode.getFullPath().equals(path)) {
+				retrNode = tempNode;
+				break;
+			}
+		}
+		return retrNode;
+	}
+
+	private DefaultTreeModel getFileManageTreeModel() {
+		if (fileManageTreeModel == null) {
+			fileManageTreeModel = new DefaultTreeModel(null);
+			fileManageTreeModel.setAsksAllowsChildren(true);
+		}
+		return fileManageTreeModel;
+	}
+
+	private UITree getFileManageTree() {
+		if (fileManageTree == null) {
+			fileManageTree = new UITree(getFileManageTreeModel());
+			fileManageTree.addMouseListener(mouseHandler);
+			fileManageTree.setCellRenderer(treeCellRender);
+			fileManageTree.setUI(new CTreeUI());
+			CTreeCellEditor treeCellEditor = new CTreeCellEditor(fileManageTree);
+			fileManageTree.setCellEditor(treeCellEditor);
+
+		}
+		return fileManageTree;
+	}
+
+	private TreeNode[] getTreePath(TreeNode node) {
+		List<TreeNode> list = new ArrayList<TreeNode>();
+		TreeNode temp = node;
+		while (temp != null && !temp.equals(rootNode)) {
+			list.add(0, temp);
+			temp = temp.getParent();
+		}
+		list.add(0, rootNode);
+		return list.toArray(new TreeNode[0]);
+	}
+
+	private String convertTreePathToString(TreeNode[] nodes) {
+		StringBuilder sb = new StringBuilder();
+		int count = nodes == null ? 0 : nodes.length;
+		int index = 0;
+		if (!getFileManageTree().isRootVisible())
+			index = 1;
+		for (int i = index; i < count; i++) {
+			if (sb.length() > 0)
+				sb.append("/");
+			sb.append(nodes[i]);
+		}
+		return sb.toString();
+	}
+
+	private JToolBar getToolBar() {
+		if (toolBar == null) {
+			toolBar = new JToolBar() {
+				private static final long serialVersionUID = 3388557700603254117L;
+
+				@Override
+				protected JButton createActionComponent(Action a) {
+					JButton btn = new ToolBarButton(a);
+					return btn;
+				}
+
+				@Override
+				public void addSeparator(Dimension size) {
+					JToolBar.Separator s = new JToolBar.Separator(size);
+					s.setUI(new WindowsToolBarSeparatorUI());
+					add(s);
+				}
+
+			};
+			toolBar.add(getBtncreateFolder());
+			toolBar.add(getBtnDeleteNCFileNode());
+			toolBar.add(new SeparatorAction());
+
+			toolBar.add(getBtnupscan());
+			toolBar.add(getBtndownLoadFile());
+
+			toolBar.add(new SeparatorAction());
+			toolBar.add(getBtnrefresh());
+			toolBar.add(getBtnshowFileInWeb());
+			toolBar.add(getBtnrenameTreeNode());			
+		}
+		return toolBar;
+	}
+
+	public final CreateFolderAction getCreatFolderAction() {
+		if (createFolderAction == null) {
+			createFolderAction = new CreateFolderAction();
+			createFolderAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000005")/*新建文件夹*/);
+			createFolderAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000005")/*新建文件夹*/);
+			createFolderAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/newfolder.png"));
+
+		}
+		return createFolderAction;
+	}
+
+	public final DeleteNCFileNodeAction getDeleteNCFileNodeAction() {
+		if (deleteNCFileNodeAction == null) {
+			deleteNCFileNodeAction = new DeleteNCFileNodeAction();
+			deleteNCFileNodeAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000012")/*删除*/);
+			deleteNCFileNodeAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000012")/*删除*/);
+			deleteNCFileNodeAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/delete.png"));
+
+		}
+		return deleteNCFileNodeAction;
+	}
+
+	
+	
+	public final RefrenceFileAction getRefrenceFileAction() {
+		if (refrenceFileAction == null) {
+			refrenceFileAction = new RefrenceFileAction();
+			refrenceFileAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000018")/*"引用文档"*/);
+			refrenceFileAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000018")/*"引用文档"*/);
+			refrenceFileAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/iconlib/8-1.gif"));
+		}
+		return refrenceFileAction;
+	}
+
+	public final DownLoadFileAction getDownLoadFileAction() {
+		if (downLoadFileAction == null) {
+			downLoadFileAction = new DownLoadFileAction();
+			downLoadFileAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000014")/*下载文件*/);
+			downLoadFileAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000014")/*下载文件*/);
+			downLoadFileAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/download.png"));
+		}
+		return downLoadFileAction;
+	}
+	
+
+	public final RefreshAction getRefreshAction() {
+		if (refreshAction == null) {
+			refreshAction = new RefreshAction();
+			refreshAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000015")/*刷新*/);
+			refreshAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000015")/*刷新*/);
+			refreshAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/refresh.png"));
+
+		}
+		return refreshAction;
+	}
+
+	public final ShowFileInWebAction getShowFileInWebAction() {
+		if (showFileInWebAction == null) {
+			showFileInWebAction = new ShowFileInWebAction();
+			showFileInWebAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000016")/*阅览*/);
+			showFileInWebAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000016")/*阅览*/);
+			showFileInWebAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/view.png"));
+		}
+		return showFileInWebAction;
+	}
+
+	public final RenameTreeNodeAction getRenameTreeNodeAction() {
+		if (renameTreeNodeAction == null) {
+			renameTreeNodeAction = new RenameTreeNodeAction();
+			renameTreeNodeAction.putValue(AbstractAction.NAME, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000017")/*重命名*/);
+			renameTreeNodeAction.putValue(Action.SHORT_DESCRIPTION, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000017")/*重命名*/);
+			renameTreeNodeAction.putValue(AbstractAction.SMALL_ICON, ClientToolKit.loadImageIcon("images/filesystem/rename.png"));
+			renameTreeNodeAction.setEnabled(getFileManageTree().isEditable());
+		}
+		return renameTreeNodeAction;
+	}
+
+	private JPopupMenu getPopMenu() {
+		if (popMenu == null) {
+			popMenu = new JPopupMenu();
+			popMenu.add(getCreatFolderAction());
+			popMenu.add(getDeleteNCFileNodeAction());
+			popMenu.addSeparator();
+			popMenu.add(getUploadFileAction());
+			popMenu.add(getUpscan());
+			popMenu.add(getDownLoadFileAction());
+			popMenu.addSeparator();
+			popMenu.add(getRefreshAction());
+			popMenu.add(getShowFileInWebAction());
+			popMenu.add(getRenameTreeNodeAction());
+		}
+		return popMenu;
+	}
+	public void showcombox(ArrayList<ItemObj> list){
+		filepanel.showcombox(list);
+	}
+	public void setCreateNewFolderEnable(boolean enable) {
+//		getCreatFolderAction().setEnabled(enable);
+		filepanel.setCreateNewFolderEnable(enable);
+	}
+
+	public void setDeleteNodeEnable(boolean enable) {
+//		getDeleteNCFileNodeAction().setEnabled(enable);
+		filepanel.setDeleteNodeEnable(enable);
+	}
+
+	public void setUploadFileEnable(boolean enable) {
+//		getUploadFileAction().setEnabled(enable);
+		filepanel.setUploadFileEnable(enable);
+	}
+
+	public void setDownloadFileEnable(boolean enable) {
+//		getDownLoadFileAction().setEnabled(enable);
+		filepanel.setDownloadFileEnable(enable);
+	}
+	
+	public void setRefrenceFileEnable(boolean enable) {
+//		getRefrenceFileAction().setEnabled(enable);
+	}
+
+	public void setRefreshEnable(boolean enable) {
+//		getRefreshAction().setEnabled(enable);
+	}
+
+	public void setShowFileEnable(boolean enable) {
+//		getShowFileInWebAction().setEnabled(enable);
+		filepanel.setShowFileEnable(enable);
+	}
+	
+	public void setRenameNodeEnable(boolean enable) {
+//		getRenameTreeNodeAction().setEnabled(enable);
+		filepanel.setRenameNodeEnable(enable);
+	}
+
+	public void setTreeRootVisible(boolean visible) {
+//		getFileManageTree().setRootVisible(visible);
+	}
+
+	public void setToolBarVisible(boolean visible) {
+//		getToolBar().setVisible(visible);
+//		if (visible) {
+//			scrollPane.setColumnHeaderView(getToolBar());
+//		} else {
+//			scrollPane.setColumnHeaderView(null);
+//		}
+	}
+
+	public void setTreeEditable(boolean editable) {
+//		getFileManageTree().setEditable(editable);
+//		getRenameTreeNodeAction().setEnabled(editable);
+	}
+
+	/**
+	 * 
+	 * @param parent
+	 *            父窗口
+	 * @param title
+	 *            对话框标题
+	 * @param rootPath
+	 *            文件管理控件的根目录
+	 */
+	public static void showInDlg(Container parent, String title, String rootPath) {
+		UIDialog dlg = new UIDialog(parent, title);
+
+		dlg.getContentPane().setLayout(new BorderLayout());
+//		FileManageUI ui = new FileManageUI(rootPath);
+		FileContentPanel ui = new FileContentPanel(rootPath);
+		dlg.getContentPane().add(ui, BorderLayout.CENTER);
+//		ui.setTreeRootVisible(false);
+		dlg.setResizable(true);
+		dlg.setSize(600, 400);
+		dlg.showModal();
+
+	}
+
+	/**
+	 * 
+	 * @param parent
+	 *            父窗口
+	 * @param rootPath
+	 *            文件管理控件的根目录
+	 * @param subPath
+	 *            子目录
+	 * @param creator
+	 *            创建者
+	 */
+	public static void uploadFile(Container parent, String rootPath, String subPath, String creator) {
+		JFileChooser chooser = new JFileChooser();
+		if (chooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION) {
+			String pPath = rootPath.replace('\\', '/');
+			if (!pPath.endsWith("/"))
+				pPath += "/";
+			if (subPath != null) {
+				pPath += subPath.replace('\\', '/');
+			}
+			File file = chooser.getSelectedFile();
+			String dsName = WorkbenchEnvironment.getInstance().getLoginBusiCenter().getDataSourceName();
+			String fileName = file.getName();
+			FileInputStream input = null;
+			try {
+				input = new FileInputStream(file);
+				FileManageServletClient.uploadFile(dsName, pPath, fileName, input, creator, file.length());
+			} catch (Exception ex) {
+				Logger.error(ex.getMessage(), ex);
+				MessageDialog.showErrorDlg(parent, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, ex.getMessage());
+			} finally {
+				try {
+					if (input != null) {
+						input.close();
+					}
+				} catch (Exception e2) {
+				}
+			}
+		}
+
+	}
+
+	public IRootNodeNameRender getRootNodeNameRender() {
+		if(rootNodeNameRender == null){
+			rootNodeNameRender = new DefaultFileNameRender();
+		}
+		return rootNodeNameRender;
+	}
+
+	public void setRootNodeNameRender(IRootNodeNameRender rootNodeNameRender) {
+//		if(rootNodeNameRender == null){
+//			rootNodeNameRender = new DefaultFileNameRender();
+//		}
+//		IRootNodeNameRender old = this.rootNodeNameRender;
+//		this.rootNodeNameRender = rootNodeNameRender;
+//		if(!this.rootNodeNameRender.equals(old)){
+//			getFileManageTree().repaint();
+//		}
+	}
+	/**
+	 * 加入前台校验是否在同一节点下存在同名节点 ,有同名返回true
+	 * @author zhoujja
+	 * @param node 要判断的节点
+	 * @param filename 新建节点名字
+	 */
+	public boolean CheckTheSameFileName(TreeNode node ,String filename)
+	{
+		//加入 前台校验 ,判断是否存在同名 文件,同名不允许添加
+		for(int noden=0; noden<node.getChildCount();noden++)
+		{
+			TreeNode subnode =node.getChildAt(noden);
+			//如果选择node下有同名的node
+			if(filename.trim().equalsIgnoreCase(subnode.toString().trim()))
+			{
+				MessageDialog.showErrorDlg(ThFileManageUI.this, NCLangRes.getInstance().getStrByID("pc", "FileManageUI-000000")/*错误*/, NCLangRes.getInstance().getStrByID("sfbase", "FileManageUI-000000", null, new String[]{filename})/*文件存在:{0}*/);
+				return  true;
+			}
+		}
+		return false;
+		
+	}
+}

+ 140 - 0
pu/pu/src/client/nc/ui/pubapp/uif2app/actions/InvoiceUploadAction.java

@@ -0,0 +1,140 @@
+package nc.ui.pubapp.uif2app.actions;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.util.Map;
+import java.util.UUID;
+
+import nc.bs.framework.common.NCLocator;
+import nc.bs.pub.filesystem.IFileSystemActionConst;
+import nc.bs.uif2.BusinessExceptionAdapter;
+import nc.bs.uif2.IActionCode;
+import nc.desktop.ui.WorkbenchEnvironment;
+import nc.itf.uap.IUAPQueryBS;
+import nc.jdbc.framework.processor.ColumnProcessor;
+import nc.md.MDBaseQueryFacade;
+import nc.md.data.access.NCObject;
+import nc.md.model.IBean;
+import nc.md.model.IBusinessEntity;
+import nc.md.model.MetaDataException;
+import nc.ui.pub.beans.UIDialog;
+import nc.ui.pub.bill.BillCardPanel;
+import nc.ui.pub.bill.BillItem;
+import nc.ui.pub.filesystem.ThFileManageUI;
+import nc.ui.uif2.NCAction;
+import nc.ui.uif2.UIState;
+import nc.ui.uif2.actions.ActionInitializer;
+import nc.ui.uif2.editor.BillForm;
+import nc.ui.uif2.model.AbstractUIAppModel;
+import nc.vo.bd.meta.IBDObject;
+import nc.vo.bd.meta.NCObject2BDObjectAdapter;
+import nc.vo.ml.NCLangRes4VoTransl;
+import nc.vo.pu.m25.entity.InvoiceVO;
+import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
+import nc.vo.uap.rbac.FuncSubInfo;
+import nc.vo.uap.rbac.profile.FunctionPermProfileManager;
+
+public class InvoiceUploadAction extends NCAction implements IFileSystemActionConst{
+	private static final long serialVersionUID = 4674049033047277460L;
+	private AbstractUIAppModel model;
+	public BillForm editor;
+	
+	public BillForm getEditor() {
+		return editor;
+	}
+
+	public void setEditor(BillForm editor) {
+		this.editor = editor;
+	}
+
+	public InvoiceUploadAction() {
+		super();
+		ActionInitializer.initializeAction(this, IActionCode.FILE);
+		 this.setBtnName("Ìí¼Ó·¢Æ±");
+	        this.setCode("invoiceUploadAction");
+	}
+
+	public IBDObject createBDObject(Object obj) {
+		if (obj == null) {
+			return null;
+		} else if (obj instanceof String) {
+			return null;
+		} else {
+			try {
+				String className = null;
+				if (obj instanceof AbstractBill) {
+					className = ((AbstractBill) obj).getParentVO().getClass().getName();
+				} else {
+					className = obj.getClass().getName();
+				}
+
+				IBean bean = MDBaseQueryFacade.getInstance().getBeanByFullClassName(className);
+				if (bean == null) {
+					return null;
+				} else {
+					Map<String, String> name_path_map = ((IBusinessEntity) bean)
+							.getBizInterfaceMapInfo(IBDObject.class.getName());
+					return new NCObject2BDObjectAdapter(NCObject.newInstance(obj), name_path_map);
+				}
+			} catch (MetaDataException var5) {
+				throw new BusinessExceptionAdapter(var5);
+			}
+		}
+	}
+
+	public void doAction(ActionEvent e) throws Exception {
+		Object selectedData = this.model.getSelectedData();
+		BillCardPanel cpanel=editor.getBillCardPanel();
+		String vdef17 = (String) cpanel.getHeadItem("vdef17").getValueObject();
+		String rootPath = null;
+		if(vdef17 != null){
+			rootPath = vdef17;
+		}else {
+			rootPath = UUID.randomUUID().toString();
+			cpanel.setHeadItem("vdef17", rootPath);
+		}
+		IBDObject target = this.createBDObject(selectedData);
+		//if (target != null) {
+			String userCode = WorkbenchEnvironment.getInstance().getLoginUser().getUser_code();
+			String funcode = this.model.getContext().getNodeCode();
+			String pk_group = this.model.getContext().getPk_group();
+			//FileManageUI ui = FileManageUIFactory.getFileManagePnl(rootPath, userCode, funcode, pk_group);
+			FuncSubInfo funcsubinfo = FunctionPermProfileManager.getInstance().getProfile(userCode).getFuncSubInfo(funcode);
+		    ThFileManageUI ui = new ThFileManageUI(rootPath,editor);
+			setActionPermission(ui,funcsubinfo);
+		      
+			ui.setTreeRootVisible(false);
+			UIDialog dlg = new UIDialog(this.model.getContext().getEntranceUI(),
+					NCLangRes4VoTransl.getNCLangRes().getStrByID("pubapp_0", "0pubapp-0129"));
+			dlg.getContentPane().setLayout(new BorderLayout());
+			dlg.getContentPane().add(ui, "Center");
+			dlg.setResizable(true);
+			dlg.setSize(600, 400);
+			dlg.showModal();
+		}
+	//}
+
+	public AbstractUIAppModel getModel() {
+		return this.model;
+	}
+
+	public void setModel(AbstractUIAppModel model) {
+		this.model = model;
+		this.model.addAppEventListener(this);
+	}
+
+	protected boolean isActionEnable() {
+		boolean ret = this.model.getSelectedData() != null && this.model.getUiState() != UIState.EDIT
+				&& this.model.getUiState() != UIState.ADD;
+		return true;
+	}
+	
+	private static void setActionPermission(ThFileManageUI fui,FuncSubInfo funcsubinfo){		
+	    fui.setUploadFileEnable(funcsubinfo.isValidButton(UPLOAD));
+		fui.setCreateNewFolderEnable(funcsubinfo.isValidButton(UPLOAD));
+		fui.setDownloadFileEnable(funcsubinfo.isValidButton(DOWNLOAD));
+		fui.setShowFileEnable(funcsubinfo.isValidButton(BROWSE));
+		fui.setDeleteNodeEnable(funcsubinfo.isValidButton(DELETE));
+		fui.setRenameNodeEnable(funcsubinfo.isValidButton(RENAME));
+	}
+}

+ 1 - 1
pu/pu/src/private/nc/ui/pubapp/uif2app/actions/ViewAtacmtsAction.java → pu/pu/src/client/nc/ui/pubapp/uif2app/actions/ViewAtacmtsAction.java

@@ -69,7 +69,7 @@ public class ViewAtacmtsAction extends FileDocManageAction implements IFileSyste
 	      String funcode = this.model.getContext().getNodeCode();
 	      String pk_group = this.model.getContext().getPk_group();
 	      FuncSubInfo funcsubinfo = FunctionPermProfileManager.getInstance().getProfile(userCode).getFuncSubInfo(funcode);
-	      TestFileManageUI ui = new TestFileManageUI(objrootPath.toString());
+	      TestFileManageUI ui = new TestFileManageUI(objrootPath.toString(),editor);
 		  setActionPermission(ui,funcsubinfo);
 		      ui.setTreeRootVisible(false);
 	      UIDialog dlg =

+ 12 - 0
pu/pu/src/public/nc/itf/pu/service/IInvoiceOCRMaintain.java

@@ -0,0 +1,12 @@
+package nc.itf.pu.service;
+
+import java.io.File;
+
+import com.alibaba.fastjson.JSONObject;
+
+
+public interface IInvoiceOCRMaintain {
+	
+	//¿ªÊ¼·¢Æ±ÔÆOCRʶ±ð
+	JSONObject startInvoiceOCR(File file);
+}

+ 81 - 0
pu/pu/src/public/nc/log/NcLog.java

@@ -0,0 +1,81 @@
+package nc.log;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import nc.bs.framework.common.RuntimeEnv;
+
+import org.apache.log4j.Logger;
+/**
+ * nclog
+ * @author YY
+ * @datetime 2021-9-29 
+ */
+public class NcLog
+{
+  private static final Logger logger = Logger.getLogger(NcLog.class);
+  private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+  private static SimpleDateFormat format$ = new SimpleDateFormat("yyyy-MM-dd");
+
+  public static void info(String str)
+  {
+    String logFilePath = getLogFile();
+    File file = new File(logFilePath);
+    BufferedWriter fos = null;
+    try
+    {
+      fos = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true)));
+      str = format.format(new Date()) + " " + str + "\r\n";
+      
+      fos.write(str + "\r\n");
+      fos.flush();
+    }
+    catch (Exception localException)
+    {
+      if (fos != null)
+        try
+        {
+          fos.close();
+        }
+        catch (IOException localIOException)
+        {
+        }
+    }
+    finally {
+      if (fos != null)
+        try
+        {
+          fos.close();
+        }
+        catch (IOException localIOException2)
+        {
+        }
+    }
+  }
+
+  private static String getLogFile() {
+    String destFileFolder = RuntimeEnv.getInstance().getNCHome() + File.separator + "mancLog" + File.separator + format$.format(new Date());
+    String destFilePath = destFileFolder + File.separator + "org.log";
+    File destFolder = new File(destFileFolder);
+    if (!destFolder.exists()) {
+      destFolder.mkdirs();
+    }
+    File destFile = new File(destFilePath);
+    if (!destFile.exists()) {
+      try
+      {
+        destFile.createNewFile();
+      }
+      catch (Exception e)
+      {
+        logger.info(e);
+      }
+    }
+    return destFilePath;
+  }
+}

+ 265 - 0
pu/pu/src/public/nc/vo/pub/filesystem/NCFileVO.java

@@ -0,0 +1,265 @@
+package nc.vo.pub.filesystem;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import nc.vo.ml.NCLangRes4VoTransl;
+import nc.vo.pub.ValidationException;
+import nc.vo.pub.ValueObject;
+
+
+/**
+ * 附件文件VO对象<br>
+ * (V63新加描述,浏览次数,修改者等信息,并将此VO从private移到public。)<br>
+ * @author modified by zhoujja 2012-10-17
+ *
+ */
+public class NCFileVO extends ValueObject implements Serializable {
+	private static final long serialVersionUID = -8538372121442731737L;
+	private String pk = null;
+	private List<String> segsList = new ArrayList<String>();
+	private long time = System.currentTimeMillis();
+	private long fileLen = 0;
+	private String creator = null;
+	private  boolean isFolder = false;
+	
+	/**是否引用文档*/
+	private boolean isdoc =false ;
+	/**引用文档的主键*/
+	private String pk_doc;
+	
+	/**
+	 * 附件描述 2012-9-30
+	 */
+	private String filedesc;
+	/**
+	 * 修改时间  2012-9-30
+	 */
+	private long modifytime ;
+	/**
+	 * 文件类型
+	 */
+	private String filetype ;
+	
+	public String getFiletype() {
+		return filetype;
+	}
+	public void setFiletype(String filetype) {
+		this.filetype = filetype;
+	}
+	public long getModifytime() {
+		return modifytime;
+	}
+	public void setModifytime(long modifytime) {
+		this.modifytime = modifytime;
+	}
+	public int getScantimes() {
+		return scantimes;
+	}
+	public void setScantimes(int scantimes) {
+		this.scantimes = scantimes;
+	}
+	public String getModifier() {
+		return modifier;
+	}
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+	/**
+	 * 浏览次数 2012-9-30 
+	 */
+	private int scantimes;
+	/**
+	 * 修改人 2012-9-30
+	 */
+	private String modifier;
+//	private String rootpath;
+//	public String getRootpath() {
+//		return rootpath;
+//	}
+//	public void setRootpath(String rootpath) {
+//		this.rootpath = rootpath;
+//	}
+	public String getPk_doc() {
+		return pk_doc;
+	}
+	public void setPk_doc(String pk_doc) {
+		this.pk_doc = pk_doc;
+	}
+	public boolean isDoc() {
+		return isdoc;
+	}
+	public void setIsdoc(boolean isdoc) {
+		this.isdoc = isdoc;
+	}
+	public String getCreator() {
+		return creator;
+	}
+	public void setCreator(String creator) {
+		this.creator = creator;
+	}
+	public long getTime() {
+		return time;
+	}
+	public void setTime(long time) {
+		this.time = time;
+	}
+	public long getFileLen() {
+		return fileLen;
+	}
+	public void setFileLen(long fileLen) {
+		this.fileLen = fileLen;
+	}
+	public String getName() {
+		if(segsList.size() > 0)
+			return segsList.get(segsList.size() - 1);
+		else
+			return null;
+	}
+	public void reName(String newName){
+		if(newName.replace('\\', '/').indexOf('/') != -1){
+			throw new RuntimeException(NCLangRes4VoTransl.getNCLangRes().getStrByID("sfbase", "NCFileVO-000000")/*文件名不能包含'\\'或者'/'*/);
+		}
+		if(segsList.size() > 0){
+			 segsList.set(segsList.size() - 1, newName);
+		}
+	}
+	public void setPath(String path) {
+//		this.path = path;
+		refreshSegsList(path);
+	}
+	private void refreshSegsList(String path){
+		segsList.clear();
+		if(path != null){
+			StringTokenizer st = new StringTokenizer(path,"/");
+			while (st.hasMoreTokens()) {
+				String str = st.nextToken().trim();
+				segsList.add(str);
+			}
+		}
+	}
+	public String getPk() {
+		return pk;
+	}
+	public void setPk(String pk) {
+		this.pk = pk;
+	}
+	public NCFileVO() {
+		super();
+	}
+	public NCFileVO( String path) {
+		super();
+		setPath(path);
+	}
+	public String getParentpath() {
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0; i < segsList.size()-1; i++) {
+			if(sb.length() > 0)
+				sb.append("/");
+			sb.append(segsList.get(i));
+		}
+		return sb.toString();
+	}
+//	public void setParentpath(String parentpath) {
+//		this.parentpath = parentpath;
+//	}
+	public String getFullPath(){
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0; i < segsList.size(); i++) {
+			if(sb.length() > 0)
+				sb.append("/");
+			sb.append(segsList.get(i));
+		}
+		return sb.toString();
+	}
+	public String getParentName(){
+		String pName = null;
+		int size = segsList.size();
+		if(size >= 2){
+			pName = segsList.get(size-2);
+		}
+		return pName;
+	}
+	public String getParentParentPath(){
+		String ppPath = null;
+		if(segsList.size() > 2){
+			StringBuilder sb = new StringBuilder();
+			for (int i = 0; i < segsList.size()-2; i++) {
+				if(sb.length() > 0)
+					sb.append("/");
+				sb.append(segsList.get(i));
+			}
+			ppPath = sb.toString();
+		}
+		return ppPath;
+	}
+//	public List<String> getPathSegments(){
+//		return segsList;
+////		List<String> list = new ArrayList<String>();
+////		if(getParentpath() != null && getParentpath().trim().length() > 0){
+////			StringTokenizer st = new StringTokenizer(getParentpath(),"/");
+////			while (st.hasMoreTokens()) {
+////				String str = st.nextToken();
+////				list.add(str);
+////			}
+////		}
+////		list.add(getName());
+////		return list;
+//	}
+	public boolean isFolder() {
+		return isFolder;
+	}
+	public void setFolder(boolean isFolder) {
+		this.isFolder = isFolder;
+	}
+	
+	@Override
+	public NCFileVO clone() {
+		NCFileVO theVO =new NCFileVO();//(NCFileVO)super.clone();
+		theVO.creator = this.creator;
+		theVO.isFolder = this.isFolder;
+		theVO.pk = this.pk;
+		theVO.time = this.time;
+		theVO.fileLen = this.fileLen;
+		theVO.segsList = new ArrayList<String>();
+		theVO.segsList.addAll(this.segsList);
+		theVO.isdoc = this.isdoc;
+		theVO.pk_doc=this.pk_doc;
+		
+		//新加字段
+		theVO.modifier = this.modifier;
+		theVO.filedesc = this.filedesc;
+		theVO.modifytime = this.modifytime;
+		theVO.scantimes=this.scantimes;		
+		theVO.filetype=this.filetype;
+		
+		return theVO;
+	}
+	public void changeParent(NCFileVO parentFile,NCFileVO newParentFile){
+		List<String> newList = new ArrayList<String>();
+		newList.addAll(newParentFile.segsList);
+		for (int i = parentFile.segsList.size(); i < segsList.size(); i++) {
+			newList.add(segsList.get(i));
+		}
+		segsList.clear();
+		segsList = newList;
+	}
+	public void setFiledesc(String filedesc) {
+		this.filedesc = filedesc;
+	}
+	public String getFiledesc() {
+		return filedesc;
+	}
+	@Override
+	public String getEntityName() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	@Override
+	public void validate() throws ValidationException {
+		// TODO Auto-generated method stub
+		
+	} 
+}

Vissa filer visades inte eftersom för många filer har ändrats