1 package prefuse.visual.tuple; 2 3 import prefuse.data.Graph; 4 import prefuse.data.Node; 5 import prefuse.data.Table; 6 import prefuse.visual.EdgeItem; 7 import prefuse.visual.NodeItem; 8 9 15 public class TableEdgeItem extends TableVisualItem implements EdgeItem { 16 17 protected Graph m_graph; 18 19 29 protected void init(Table table, Graph graph, int row) { 30 m_table = table; 31 m_graph = graph; 32 m_row = m_table.isValidRow(row) ? row : -1; 33 } 34 35 38 public Graph getGraph() { 39 return m_graph; 40 } 41 42 45 public boolean isDirected() { 46 return m_graph.isDirected(); 47 } 48 49 52 public Node getSourceNode() { 53 return m_graph.getSourceNode(this); 54 } 55 56 59 public Node getTargetNode() { 60 return m_graph.getTargetNode(this); 61 } 62 63 66 public Node getAdjacentNode(Node n) { 67 return m_graph.getAdjacentNode(this, n); 68 } 69 70 73 public NodeItem getSourceItem() { 74 return (NodeItem)getSourceNode(); 75 } 76 77 80 public NodeItem getTargetItem() { 81 return (NodeItem)getTargetNode(); 82 } 83 84 87 public NodeItem getAdjacentItem(NodeItem n) { 88 return (NodeItem)getAdjacentNode(n); 89 } 90 91 } | Popular Tags |