// Path: src/main/java/uk/co/sleonard/unison/output/Relationship.java
// public class Relationship {
// 
// 	/** The directed. */
// 	private final static boolean directed = true;
// 
// 	/** The owner. */
// 	private final int owner;
// 
// 	/** The target. */
// 	private final int target;
// 
// 	/** The value. */
// 	private int value = 1;
// 
// 	/**
// 	 * Instantiates a new relationship.
// 	 *
// 	 * @param owner
// 	 *            the owner
// 	 * @param target
// 	 *            the target
// 	 */
// 	public Relationship(final int owner, final int target) {
// 		this.owner = owner;
// 		this.target = target;
// 	}
// 
// 	@Override
// 	public boolean equals(final Object obj) {
// 		if (this == obj) {
// 			return true;
// 		}
// 		if (obj == null) {
// 			return false;
// 		}
// 		if (this.getClass() != obj.getClass()) {
// 			return false;
// 		}
// 		final Relationship other = (Relationship) obj;
// 		if (this.owner != other.owner) {
// 			return false;
// 		}
// 		if (this.target != other.target) {
// 			return false;
// 		}
// 		if (this.value != other.value) {
// 			return false;
// 		}
// 		return true;
// 	}
// 
// 	/**
// 	 * Gets the owner.
// 	 *
// 	 * @return the owner
// 	 */
// 	public int getOwner() {
// 		return this.owner;
// 	}
// 
// 	/**
// 	 * Gets the target.
// 	 *
// 	 * @return the target
// 	 */
// 	public int getTarget() {
// 		return this.target;
// 	}
// 
// 	/**
// 	 * Gets the value.
// 	 *
// 	 * @return the value
// 	 */
// 	public int getValue() {
// 		return this.value;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = (prime * result) + this.owner;
// 		result = (prime * result) + this.target;
// 		result = (prime * result) + this.value;
// 		return result;
// 	}
// 
// 	/**
// 	 * Increment value.
// 	 *
// 	 * @return the int
// 	 */
// 	int incrementValue() {
// 		return ++this.value;
// 	}
// 
// 	/**
// 	 * Checks if is directed.
// 	 *
// 	 * @return true, if is directed
// 	 */
// 	public boolean isDirected() {
// 		return Relationship.directed;
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 *
// 	 * @see java.lang.Object#toString()
// 	 */
// 	@Override
// 	public String toString() {
// 		return this.owner + " " + this.target + " " + this.value;
// 	}
// }


import java.awt.Color;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JPanel;
import edu.uci.ics.jung.graph.ArchetypeVertex;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.Vertex;
import edu.uci.ics.jung.graph.decorators.DefaultToolTipFunction;
import edu.uci.ics.jung.graph.decorators.EdgeShape;
import edu.uci.ics.jung.graph.decorators.EllipseVertexShapeFunction;
import edu.uci.ics.jung.graph.decorators.PickableVertexPaintFunction;
import edu.uci.ics.jung.graph.decorators.VertexIconAndShapeFunction;
import edu.uci.ics.jung.graph.decorators.VertexStringer;
import edu.uci.ics.jung.graph.impl.DirectedSparseEdge;
import edu.uci.ics.jung.graph.impl.DirectedSparseGraph;
import edu.uci.ics.jung.graph.impl.DirectedSparseVertex;
import edu.uci.ics.jung.visualization.DefaultGraphLabelRenderer;
import edu.uci.ics.jung.visualization.FRLayout;
import edu.uci.ics.jung.visualization.GraphZoomScrollPane;
import edu.uci.ics.jung.visualization.PluggableRenderer;
import edu.uci.ics.jung.visualization.ShapePickSupport;
import edu.uci.ics.jung.visualization.VisualizationViewer;
import edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse;
import edu.uci.ics.jung.visualization.control.ModalGraphMouse;
import uk.co.sleonard.unison.UNISoNException;
import uk.co.sleonard.unison.output.Relationship;
	 * @param peopleList
	 *            the people list
	 * @return the vertex[]
	 * @throws UNISoNException
	 *             the UNI so n exception
	 */
	Vertex[] createEdges(final List<Relationship> links, final LinkedList<String> peopleList)
	        throws UNISoNException {
		final Vertex[] v = new Vertex[peopleList.size()];
		for (int i = 0; i < peopleList.size(); i++) {
			v[i] = this.graph.addVertex(new UsenetVertex(peopleList.get(i)));
		}
		for (final Relationship link : links) {
			try {
				// subtract one as index starts at 0 for arrays
				this.graph.addEdge(
				        new DirectedSparseEdge(v[link.getOwner() - 1], v[link.getTarget() - 1]));
			}
			catch (final ArrayIndexOutOfBoundsException e) {
				throw new UNISoNException("Array out of bounds: size " + v.length + " vs "
				        + link.getOwner() + " or " + link.getTarget(), e);

			}
		}
		return v;
	}

	/**
	 * The Class UnicodeVertexStringer.
	 */
// Path: src/main/java/uk/co/sleonard/unison/output/Relationship.java
// public class Relationship {
// 
// 	/** The directed. */
// 	private final static boolean directed = true;
// 
// 	/** The owner. */
// 	private final int owner;
// 
// 	/** The target. */
// 	private final int target;
// 
// 	/** The value. */
// 	private int value = 1;
// 
// 	/**
// 	 * Instantiates a new relationship.
// 	 *
// 	 * @param owner
// 	 *            the owner
// 	 * @param target
// 	 *            the target
// 	 */
// 	public Relationship(final int owner, final int target) {
// 		this.owner = owner;
// 		this.target = target;
// 	}
// 
// 	@Override
// 	public boolean equals(final Object obj) {
// 		if (this == obj) {
// 			return true;
// 		}
// 		if (obj == null) {
// 			return false;
// 		}
// 		if (this.getClass() != obj.getClass()) {
// 			return false;
// 		}
// 		final Relationship other = (Relationship) obj;
// 		if (this.owner != other.owner) {
// 			return false;
// 		}
// 		if (this.target != other.target) {
// 			return false;
// 		}
// 		if (this.value != other.value) {
// 			return false;
// 		}
// 		return true;
// 	}
// 
// 	/**
// 	 * Gets the owner.
// 	 *
// 	 * @return the owner
// 	 */
// 	public int getOwner() {
// 		return this.owner;
// 	}
// 
// 	/**
// 	 * Gets the target.
// 	 *
// 	 * @return the target
// 	 */
// 	public int getTarget() {
// 		return this.target;
// 	}
// 
// 	/**
// 	 * Gets the value.
// 	 *
// 	 * @return the value
// 	 */
// 	public int getValue() {
// 		return this.value;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = (prime * result) + this.owner;
// 		result = (prime * result) + this.target;
// 		result = (prime * result) + this.value;
// 		return result;
// 	}
// 
// 	/**
// 	 * Increment value.
// 	 *
// 	 * @return the int
// 	 */
// 	int incrementValue() {
// 		return ++this.value;
// 	}
// 
// 	/**
// 	 * Checks if is directed.
// 	 *
// 	 * @return true, if is directed
// 	 */
// 	public boolean isDirected() {
// 		return Relationship.directed;
// 	}
// 
// 	/*
// 	 * (non-Javadoc)
// 	 *
// 	 * @see java.lang.Object#toString()
// 	 */
// 	@Override
// 	public String toString() {
// 		return this.owner + " " + this.target + " " + this.value;
// 	}
// }


// Path: src/main/java/uk/co/sleonard/unison/gui/GraphPreviewPanel.java
import java.awt.Color;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JPanel;
import edu.uci.ics.jung.graph.ArchetypeVertex;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.Vertex;
import edu.uci.ics.jung.graph.decorators.DefaultToolTipFunction;
import edu.uci.ics.jung.graph.decorators.EdgeShape;
import edu.uci.ics.jung.graph.decorators.EllipseVertexShapeFunction;
import edu.uci.ics.jung.graph.decorators.PickableVertexPaintFunction;
import edu.uci.ics.jung.graph.decorators.VertexIconAndShapeFunction;
import edu.uci.ics.jung.graph.decorators.VertexStringer;
import edu.uci.ics.jung.graph.impl.DirectedSparseEdge;
import edu.uci.ics.jung.graph.impl.DirectedSparseGraph;
import edu.uci.ics.jung.graph.impl.DirectedSparseVertex;
import edu.uci.ics.jung.visualization.DefaultGraphLabelRenderer;
import edu.uci.ics.jung.visualization.FRLayout;
import edu.uci.ics.jung.visualization.GraphZoomScrollPane;
import edu.uci.ics.jung.visualization.PluggableRenderer;
import edu.uci.ics.jung.visualization.ShapePickSupport;
import edu.uci.ics.jung.visualization.VisualizationViewer;
import edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse;
import edu.uci.ics.jung.visualization.control.ModalGraphMouse;
import uk.co.sleonard.unison.UNISoNException;
import uk.co.sleonard.unison.output.Relationship;

	 * @param peopleList
	 *            the people list
	 * @return the vertex[]
	 * @throws UNISoNException
	 *             the UNI so n exception
	 */
	Vertex[] createEdges(final List<Relationship> links, final LinkedList<String> peopleList)
	        throws UNISoNException {
		final Vertex[] v = new Vertex[peopleList.size()];
		for (int i = 0; i < peopleList.size(); i++) {
			v[i] = this.graph.addVertex(new UsenetVertex(peopleList.get(i)));
		}
		for (final Relationship link : links) {
			try {
				// subtract one as index starts at 0 for arrays
				this.graph.addEdge(
				        new DirectedSparseEdge(v[link.getOwner() - 1], v[link.getTarget() - 1]));
			}
			catch (final ArrayIndexOutOfBoundsException e) {
				throw new UNISoNException("Array out of bounds: size " + v.length + " vs "
				        + link.getOwner() + " or " + link.getTarget(), e);

			}
		}
		return v;
	}

	/**
	 * The Class UnicodeVertexStringer.
	 */
	private class UnicodeVertexStringer implements VertexStringer {