1 package prefuse.visual.tuple; 2 3 import java.util.Iterator ; 4 5 import prefuse.data.Edge; 6 import prefuse.data.Graph; 7 import prefuse.data.Node; 8 import prefuse.data.Table; 9 import prefuse.visual.NodeItem; 10 11 17 public class TableNodeItem extends TableVisualItem implements NodeItem { 18 19 protected Graph m_graph; 20 21 31 protected void init(Table table, Graph graph, int row) { 32 m_table = table; 33 m_graph = graph; 34 m_row = m_table.isValidRow(row) ? row : -1; 35 } 36 37 40 public Graph getGraph() { 41 return m_graph; 42 } 43 44 48 51 public int getInDegree() { 52 return m_graph.getInDegree(this); 53 } 54 55 58 public int getOutDegree() { 59 return m_graph.getOutDegree(this); 60 } 61 62 65 public int getDegree() { 66 return m_graph.getDegree(this); 67 } 68 69 72 public Iterator inEdges() { 73 return m_graph.inEdges(this); 74 } 75 76 79 public Iterator outEdges() { 80 return m_graph.outEdges(this); 81 } 82 83 86 public Iterator edges() { 87 return m_graph.edges(this); 88 } 89 90 93 public Iterator inNeighbors() { 94 return m_graph.inNeighbors(this); 95 } 96 97 100 public Iterator outNeighbors() { 101 return m_graph.outNeighbors(this); 102 } 103 104 107 public Iterator neighbors() { 108 return m_graph.neighbors(this); 109 } 110 111 113 116 public Node getParent() { 117 return m_graph.getSpanningTree().getParent(this); 118 } 119 120 123 public Edge getParentEdge() { 124 return m_graph.getSpanningTree().getParentEdge(this); 125 } 126 127 130 public int getChildCount() { 131 return m_graph.getSpanningTree().getChildCount(m_row); 132 } 133 134 137 public int getChildIndex(Node child) { 138 return m_graph.getSpanningTree().getChildIndex(this, child); 139 } 140 141 144 public Node getChild(int idx) { 145 return m_graph.getSpanningTree().getChild(this, idx); 146 } 147 148 151 public Node getFirstChild() { 152 return m_graph.getSpanningTree().getFirstChild(this); 153 } 154 155 158 public Node getLastChild() { 159 return m_graph.getSpanningTree().getLastChild(this); 160 } 161 162 165 public Node getPreviousSibling() { 166 return m_graph.getSpanningTree().getPreviousSibling(this); 167 } 168 169 172 public Node getNextSibling() { 173 return m_graph.getSpanningTree().getNextSibling(this); 174 } 175 176 179 public Iterator children() { 180 return m_graph.getSpanningTree().children(this); 181 } 182 183 186 public Iterator childEdges() { 187 return m_graph.getSpanningTree().childEdges(this); 188 } 189 190 193 public int getDepth() { 194 return m_graph.getSpanningTree().getDepth(m_row); 195 } 196 197 } | Popular Tags |