⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netreceiverframe.java

📁 用swt作的一个类似飞鸽一样的局域网通信工具
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
	}

	/**
	 * This method initializes composite1	
	 *
	 */
	private void createComposite1() {
		GridLayout gridLayout2 = new GridLayout();
		gridLayout2.horizontalSpacing = 0;
		gridLayout2.marginWidth = 0;
		gridLayout2.marginHeight = 0;
		gridLayout2.numColumns = 1;
		gridLayout2.verticalSpacing = 0;
		composite1 = new Composite(sashForm, SWT.NONE);
//		composite1.setBackground(SAPWindowFrame.BACKGROUNDCOLOR);
		createComposite2();
		composite1.setLayout(gridLayout2);
	}

	/**
	 * This method initializes composite2	
	 *
	 */
	private void createComposite2() {
		GridData gridData4 = new GridData();
		gridData4.grabExcessHorizontalSpace = true;
		gridData4.verticalAlignment = GridData.CENTER;
		gridData4.heightHint = -1;
		gridData4.horizontalAlignment = GridData.FILL;
		GridLayout gridLayout1 = new GridLayout();
		gridLayout1.numColumns = 1;
		gridLayout1.makeColumnsEqualWidth = false;
		gridLayout1.marginWidth = 0;
		gridLayout1.marginHeight = 0;
		gridLayout1.verticalSpacing = 0;
		gridLayout1.horizontalSpacing = 0;
		GridData gridData2 = new GridData();
		gridData2.grabExcessHorizontalSpace = false;
		gridData2.widthHint = -1;
		gridData2.horizontalAlignment = GridData.FILL;
		gridData2.verticalAlignment = GridData.FILL;
		gridData2.grabExcessVerticalSpace = true;
		gridData2.heightHint = -1;
		GridData gridData1 = new org.eclipse.swt.layout.GridData();
		gridData1.grabExcessVerticalSpace = true;
		gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
		gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
		gridData1.horizontalIndent = 0;
		gridData1.heightHint = -1;
		gridData1.widthHint = -1;
		gridData1.grabExcessHorizontalSpace = true;
		composite2 = new Composite(composite1, SWT.NONE);
		composite2.setLayoutData(gridData1);
		composite2.setLayout(gridLayout1);
		createCBanner();
		nftBackPanel = new NFR_BackPanel(composite2, SWT.NONE);
		nftBackPanel.setLayoutData(gridData2);
		cLabel1 = new CLabel(composite2, SWT.NONE);
		cLabel1.setText("NetReceiver Version:" + main.NetTransfer.version + " Create by:Tony D.W Xia  ");
		cLabel1.setBackground(SAPWindowFrame.BACKGROUNDCOLOR);
		cLabel1.setLayoutData(gridData4);
	}

	/**
	 * This method initializes cBanner	
	 *
	 */
	private void createCBanner() {
		GridData gridData3 = new GridData();
		gridData3.grabExcessHorizontalSpace = false;
		gridData3.verticalAlignment = GridData.CENTER;
		gridData3.grabExcessVerticalSpace = false;
		gridData3.horizontalAlignment = GridData.FILL;
		cBanner = new CBanner(composite2, SWT.NONE);
		cBanner.setSimple(false);
		cBanner.setBackground(SAPWindowFrame.BACKGROUNDCOLOR);
		createComposite3();
		cBanner.setLeft(composite3);
		createComposite5();
		cBanner.setLayoutData(gridData3);
		cBanner.setRight(composite5);
	}

	/**
	 * This method initializes composite3	
	 *
	 */
	private void createComposite3() {
		GridData gridData5 = new org.eclipse.swt.layout.GridData();
		gridData5.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
		gridData5.grabExcessHorizontalSpace = true;
		gridData5.grabExcessVerticalSpace = true;
		gridData5.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
		GridLayout gridLayout3 = new GridLayout();
		gridLayout3.numColumns = 1;
		gridLayout3.verticalSpacing = 0;
		gridLayout3.marginWidth = 0;
		gridLayout3.marginHeight = 0;
		gridLayout3.horizontalSpacing = 0;
		composite3 = new Composite(cBanner, SWT.NONE);
		composite3.setBackground(SAPWindowFrame.BACKGROUNDCOLOR);
		composite3.setLayout(gridLayout3);
		cLabel = new CLabel(composite3, SWT.NONE);
		cLabel.setBackground(SAPWindowFrame.BACKGROUNDCOLOR);
		cLabel.setText("From : ");
		cLabel.setLayoutData(gridData5);
	}
	

	/**
	 * This method initializes composite5	
	 *
	 */
	private void createComposite5() {
		GridData gridData7 = new GridData();
		gridData7.horizontalAlignment = GridData.CENTER;
		gridData7.heightHint = -1;
		gridData7.grabExcessVerticalSpace = true;
		gridData7.widthHint = -1;
		gridData7.verticalAlignment = GridData.FILL;
		GridData gridData6 = new GridData();
		gridData6.heightHint = -1;
		gridData6.verticalAlignment = GridData.FILL;
		gridData6.grabExcessVerticalSpace = true;
		gridData6.widthHint = -1;
		gridData6.grabExcessHorizontalSpace = false;
		gridData6.horizontalAlignment = GridData.CENTER;
		GridLayout gridLayout5 = new GridLayout();
		gridLayout5.horizontalSpacing = 0;
		gridLayout5.marginWidth = 0;
		gridLayout5.verticalSpacing = 0;
		gridLayout5.numColumns = 2;
		gridLayout5.makeColumnsEqualWidth = false;
		gridLayout5.marginHeight = 0;
		composite5 = new Composite(cBanner, SWT.NONE);
		composite5.setLayout(gridLayout5);
		composite5.setBackground(SAPWindowFrame.BACKGROUNDCOLOR);
		button1 = new Button(composite5, SWT.NONE);
		button1.setText("&Reply");
		button1.setLayoutData(gridData6);
		button1.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
			public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
				String hostAddr = socket.getInetAddress().getHostAddress();
				new NetSender(hostAddr,NetReceiverFrame.this.parent.getShell().getLocation().x,NetReceiverFrame.this.parent.getShell().getLocation().y,textArea.getText());
				try {
					if (rThread!=null){
						rThread.writeUTF("Disconnect");
						System.out.println("writeUTF(Disconnect)");
					}
					
				} catch (IOException e1) {
					e1.printStackTrace();
				}finally{
					NetReceiverFrame.this.parent.getShell().setVisible(false);
					NetReceiverFrame.this.parent.getShell().removeDisposeListener(disposeListenner);
//					NetReceiverFrame.this.parent.shell.close();
					thisDispose();
					System.gc();
				}
			}
		});
		button2 = new Button(composite5, SWT.NONE);
		button2.setText("&Close");
		button2.setLayoutData(gridData7);
		button2.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
			public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
				try {
					if (rThread!=null){
						rThread.writeUTF("Disconnect");
						System.out.println("writeUTF(Disconnect)");
					}
				} catch (IOException e1) {
					e1.printStackTrace();
				}finally{
					NetReceiverFrame.this.parent.getShell().setVisible(false);
					NetReceiverFrame.this.parent.getShell().removeDisposeListener(disposeListenner);
//					NetReceiverFrame.this.parent.shell.close();
					thisDispose();
					System.gc();
				}
			}
		});
	}
	
	public void thisDispose(){
		if ((nftBackPanel!=null)&&!nftBackPanel.isDisposed()) nftBackPanel.thisDispose();
		if ((sashForm!=null)&&!sashForm.isDisposed()) sashForm.dispose();
		if ((composite!=null)&&!composite.isDisposed()) composite.dispose();
		if ((composite1!=null)&&!composite1.isDisposed()) composite1.dispose();
		if ((textArea!=null)&&!textArea.isDisposed()) textArea.dispose();
		if ((composite2!=null)&&!composite2.isDisposed()) composite2.dispose();
		if ((cBanner!=null)&&!cBanner.isDisposed()) cBanner.dispose();
		if ((composite3!=null)&&!composite3.isDisposed()) composite3.dispose();
		if ((cLabel!=null)&&!cLabel.isDisposed()) cLabel.dispose();
		if ((cLabel1!=null)&&!cLabel1.isDisposed()) cLabel1.dispose();
		if ((composite5!=null)&&!composite5.isDisposed()) composite5.dispose();
		if ((button1!=null)&&!button1.isDisposed()) button1.dispose();
		if ((button2!=null)&&!button2.isDisposed()) button2.dispose();
		if ((ef!=null)&&!ef.isDisposed()) ef.dispose();
		this.dispose();
		if (parent!=null) this.parent.thisDispose();
		free();
	}
	
	protected void free(){
		this.button1 = null;
		this.button2 = null;
		this.cBanner = null;
		this.cLabel = null;
		this.cLabel1 = null;
		this.composite = null;
		this.composite1 = null;
		this.composite2 = null;
		this.composite3 = null;
		this.composite5 = null;
		this.nftBackPanel = null;
		this.packageList = null;
		this.parent = null;
		this.rThread = null;
		this.sashForm = null;
		this.socket = null;
		this.textArea = null;
		this.fillLayout = null;
	}
}  

class FNameAndSize {
	
	public String fileName;
	
	public long fileSize;
	
	public boolean isDirectory = false;
	
	public FNameAndSize(){
		super();
	}
	
	public FNameAndSize(String fileName, long fileSize){
		
		this.fileName = fileName;
		
		this.fileSize = fileSize;
		
		isDirectory = false;
	}
	
	public FNameAndSize(String fileName){
		
		this.fileName = fileName;
		
		isDirectory = true;
	}
	
}

⌨️ 快捷键说明

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