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

📄 packetdetailspanel.java

📁 The WLAN Traffic Visualizer is a platform independent Java program providing accurate measurement of
💻 JAVA
字号:
package view;

//Copyright (C) 2008 Harald Unander, Wang Wenjuan
//
//    This file is part of WlanTV.
//
//    WlanTV is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    WlanTV is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with WlanTV.  If not, see <http://www.gnu.org/licenses/>..

import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

import main.Main;
import model.Command;
import model.Packet;



@SuppressWarnings("serial")
public class PacketDetailsPanel extends JPanel {
	JTextArea ta;
	int no;
	String captureFile;

	public PacketDetailsPanel() {
		ta = new JTextArea();
		ta.setBorder(Main.emptyBdr4);
		setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
		add(new JScrollPane(ta));
	}

	public void update(Packet r, String captureFile) throws Exception {
		this.no = r.frameNumber;
		this.captureFile = captureFile;
		ta.setText("");
		Capture capture = new Capture();
		capture.run();
		ta.setCaretPosition(0);
	}

	private class Capture extends Command implements Runnable {
		@Override
		public void newLine(String line) throws InterruptedException {
			if (!line.startsWith("Data"))
				ta.append(line+"\n");
		}

		public void run() {
			String cmd = Main.tsharkExe+" -l -r "+captureFile+" -V "+"-R frame.number=="+no;
			try {
				execute(cmd);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}

⌨️ 快捷键说明

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