1 package prefuse.visual; 2 3 import prefuse.Visualization; 4 import prefuse.data.Table; 5 import prefuse.data.Tree; 6 import prefuse.data.event.EventConstants; 7 import prefuse.util.collections.IntIterator; 8 9 18 public class VisualTree extends Tree implements VisualTupleSet { 19 20 private Visualization m_vis; 21 private String m_group; 22 23 33 public VisualTree(VisualTable nodes, VisualTable edges, 34 String nodeKey, String sourceKey, String targetKey) 35 { 36 super(nodes, edges, nodeKey, sourceKey, targetKey); 37 } 38 39 44 protected void fireGraphEvent(Table t, 45 int first, int last, int col, int type) 46 { 47 if ( type==EventConstants.UPDATE && 49 col==VisualItem.IDX_VALIDATED && t==getNodeTable() ) 50 { 51 VisualTable nodes = (VisualTable)t; 52 VisualTable edges = (VisualTable)getEdgeTable(); 53 54 for ( int i=first; i<=last; ++i ) { 55 if ( nodes.isValidated(i) ) 56 continue; 58 IntIterator erows = edgeRows(i); 59 while ( erows.hasNext() ) { 60 int erow = erows.nextInt(); 61 edges.setValidated(erow, false); 62 } 63 } 64 } 65 super.fireGraphEvent(t, first, last, col, type); 67 } 68 69 72 75 public Visualization getVisualization() { 76 return m_vis; 77 } 78 79 83 public void setVisualization(Visualization vis) { 84 m_vis = vis; 85 } 86 87 91 public String getGroup() { 92 return m_group; 93 } 94 95 99 public void setGroup(String group) { 100 m_group = group; 101 } 102 103 } | Popular Tags |