// Path: workspace/netvis/src/netvis/data/filters/FixedFilter.java
// public abstract class FixedFilter implements PacketFilter{
// 
// 	protected final JPanel panel;
// 	protected final JLabel filterText;
// 	protected final JButton closeButton;
// 	protected FixedFilter(String text){
// 		panel = new JPanel();
// 		filterText = new JLabel(text);
// 		
// 		closeButton = new JButton("X");
// 		closeButton.addActionListener(new ActionListener(){
// 			@Override
// 			public void actionPerformed(ActionEvent e) {
// 				clearFilter();
// 			}
// 		});
// 		
// 		Box box = Box.createHorizontalBox();
// 		box.add(filterText);
// 		box.add(closeButton);
// 		panel.add(box);
// 		panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
// 		panel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
// 	}
// 	protected abstract void clearFilter();
// 	@Override
// 	public void actionPerformed(ActionEvent arg0) {}
// 	@Override
// 	public String description() {
// 		return null;
// 	}
// 
// 	@Override
// 	public JComponent getPanel() {
// 		return panel;
// 	}
// 
// }
// 
// Path: workspace/netvis/src/netvis/data/model/Packet.java
// public class Packet {
// 	public final int no, sport, dport, length;
// 	public final double time;
// 	public final String smac, dmac, info, protocol, sip, dip;
// 
// 	/**
// 	 * 
// 	 * @param no
// 	 *            Packet number
// 	 * @param time
// 	 *            Time elapsed since first packet (seconds)
// 	 * @param sip
// 	 *            Source IPv4/6 address
// 	 * @param smac
// 	 *            Source hardware (MAC) address
// 	 * @param sport
// 	 *            Source Port
// 	 * @param dip
// 	 *            Destination IPv4/6 address
// 	 * @param dmac
// 	 *            Destination hardware (MAC) address
// 	 * @param dport
// 	 *            Destination Port
// 	 * @param protocol
// 	 *            Communication protocol
// 	 * @param length
// 	 *            Packet Length(Bytes)
// 	 * @param info
// 	 *            Detected description of packet purpose
// 	 */
// 	public Packet(int no, double time, String sip, String smac, int sport, String dip, String dmac,
// 			int dport, String protocol, int length, String info) {
// 		this.no = no;
// 		this.time = time;
// 		this.sip = sip;
// 		this.smac = smac;
// 		this.sport = sport;
// 		this.dip = dip;
// 		this.dmac = dmac;
// 		this.dport = dport;
// 		this.protocol = protocol;
// 		this.length = length;
// 		this.info = info;
// 	}
// 
// }
// 
// Path: workspace/netvis/src/netvis/data/model/PacketFilter.java
// public interface PacketFilter extends ActionListener {
// 
// 	/**
// 	 * Returns TRUE if packet passes the filter test
// 	 */
// 	public boolean filter(Packet packet);
// 
// 	/**
// 	 * @return Description of this filter. May be used in the GUI Eg. Source
// 	 *         Port: Between 8000 and 9000 or Protocols: HTTP/HTTPS
// 	 */
// 	public String description();
// 
// 	/**
// 	 * 
// 	 * @return The JComponent that controls this filter. This class should also
// 	 *         act as a controller for the JComponent
// 	 */
// 	public JComponent getPanel();
// }


import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.Timer;
import netvis.data.filters.FixedFilter;
import netvis.data.model.Packet;
import netvis.data.model.PacketFilter;
	public DataController(DataFeeder dataFeeder, int updateInterval) {
		this.dataFeeder = dataFeeder;
		listeners = new ArrayList<DataControllerListener>();
		filters = new ArrayList<PacketFilter>();
		filteredPackets = new ArrayList<Packet>();
		allPackets = new ArrayList<Packet>();
		timer = new Timer(updateInterval, this);
		filterPanel = new JPanel();
		NormaliseFactory.INSTANCE.setDataController(this);
		filterPanel.setLayout(new BoxLayout(filterPanel, BoxLayout.Y_AXIS));
		filterPanel.add(Box.createVerticalGlue());
		timer.start();
	}

	public void FinishEverything() {
		this.timer.stop();
		for (DataControllerListener l : listeners)
			l.everythingEnds();
	}

	public void addListener(DataControllerListener listener) {
		listeners.add(listener);
	}

	public void removeListener(DataControllerListener listener) {
		listeners.remove(listener);
	}

	public void addFilter(PacketFilter packetFilter) {
		filters.add(packetFilter);
// Path: workspace/netvis/src/netvis/data/filters/FixedFilter.java
// public abstract class FixedFilter implements PacketFilter{
// 
// 	protected final JPanel panel;
// 	protected final JLabel filterText;
// 	protected final JButton closeButton;
// 	protected FixedFilter(String text){
// 		panel = new JPanel();
// 		filterText = new JLabel(text);
// 		
// 		closeButton = new JButton("X");
// 		closeButton.addActionListener(new ActionListener(){
// 			@Override
// 			public void actionPerformed(ActionEvent e) {
// 				clearFilter();
// 			}
// 		});
// 		
// 		Box box = Box.createHorizontalBox();
// 		box.add(filterText);
// 		box.add(closeButton);
// 		panel.add(box);
// 		panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
// 		panel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
// 	}
// 	protected abstract void clearFilter();
// 	@Override
// 	public void actionPerformed(ActionEvent arg0) {}
// 	@Override
// 	public String description() {
// 		return null;
// 	}
// 
// 	@Override
// 	public JComponent getPanel() {
// 		return panel;
// 	}
// 
// }
// 
// Path: workspace/netvis/src/netvis/data/model/Packet.java
// public class Packet {
// 	public final int no, sport, dport, length;
// 	public final double time;
// 	public final String smac, dmac, info, protocol, sip, dip;
// 
// 	/**
// 	 * 
// 	 * @param no
// 	 *            Packet number
// 	 * @param time
// 	 *            Time elapsed since first packet (seconds)
// 	 * @param sip
// 	 *            Source IPv4/6 address
// 	 * @param smac
// 	 *            Source hardware (MAC) address
// 	 * @param sport
// 	 *            Source Port
// 	 * @param dip
// 	 *            Destination IPv4/6 address
// 	 * @param dmac
// 	 *            Destination hardware (MAC) address
// 	 * @param dport
// 	 *            Destination Port
// 	 * @param protocol
// 	 *            Communication protocol
// 	 * @param length
// 	 *            Packet Length(Bytes)
// 	 * @param info
// 	 *            Detected description of packet purpose
// 	 */
// 	public Packet(int no, double time, String sip, String smac, int sport, String dip, String dmac,
// 			int dport, String protocol, int length, String info) {
// 		this.no = no;
// 		this.time = time;
// 		this.sip = sip;
// 		this.smac = smac;
// 		this.sport = sport;
// 		this.dip = dip;
// 		this.dmac = dmac;
// 		this.dport = dport;
// 		this.protocol = protocol;
// 		this.length = length;
// 		this.info = info;
// 	}
// 
// }
// 
// Path: workspace/netvis/src/netvis/data/model/PacketFilter.java
// public interface PacketFilter extends ActionListener {
// 
// 	/**
// 	 * Returns TRUE if packet passes the filter test
// 	 */
// 	public boolean filter(Packet packet);
// 
// 	/**
// 	 * @return Description of this filter. May be used in the GUI Eg. Source
// 	 *         Port: Between 8000 and 9000 or Protocols: HTTP/HTTPS
// 	 */
// 	public String description();
// 
// 	/**
// 	 * 
// 	 * @return The JComponent that controls this filter. This class should also
// 	 *         act as a controller for the JComponent
// 	 */
// 	public JComponent getPanel();
// }


// Path: workspace/netvis/src/netvis/data/DataController.java
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.Timer;
import netvis.data.filters.FixedFilter;
import netvis.data.model.Packet;
import netvis.data.model.PacketFilter;

	public DataController(DataFeeder dataFeeder, int updateInterval) {
		this.dataFeeder = dataFeeder;
		listeners = new ArrayList<DataControllerListener>();
		filters = new ArrayList<PacketFilter>();
		filteredPackets = new ArrayList<Packet>();
		allPackets = new ArrayList<Packet>();
		timer = new Timer(updateInterval, this);
		filterPanel = new JPanel();
		NormaliseFactory.INSTANCE.setDataController(this);
		filterPanel.setLayout(new BoxLayout(filterPanel, BoxLayout.Y_AXIS));
		filterPanel.add(Box.createVerticalGlue());
		timer.start();
	}

	public void FinishEverything() {
		this.timer.stop();
		for (DataControllerListener l : listeners)
			l.everythingEnds();
	}

	public void addListener(DataControllerListener listener) {
		listeners.add(listener);
	}

	public void removeListener(DataControllerListener listener) {
		listeners.remove(listener);
	}

	public void addFilter(PacketFilter packetFilter) {
		filters.add(packetFilter);
		if (packetFilter instanceof FixedFilter) {