Changeset 32 for branches/localSpectral/src/view
- Timestamp:
- Oct 21, 2010, 9:47:43 PM (14 years ago)
- Location:
- branches/localSpectral/src/view
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/localSpectral/src/view/VertexPaintTransformer.java
r27 r32 18 18 19 19 public Paint transform(V node) { 20 if(cluster.contains(node)) 21 return (Paint) Color.GREEN; 20 if(cluster.contains(node)){ 21 Color c = new Color(0,255,0); 22 return (Paint) c; 23 } 22 24 else 23 25 return (Paint) Color.RED; -
branches/localSpectral/src/view/Viewer.java
r27 r32 2 2 package view; 3 3 4 import clustering.VertexScore; 5 import clustering.VertexString; 4 6 import edu.uci.ics.jung.algorithms.layout.FRLayout; 5 7 import edu.uci.ics.jung.algorithms.layout.Layout; … … 8 10 import java.awt.Color; 9 11 import java.awt.Dimension; 12 import java.awt.LayoutManager; 10 13 import java.awt.Paint; 11 14 import java.util.ArrayList; … … 34 37 } 35 38 39 public void setGraph(Graph<V, E> graph) { 40 this.graph = graph; 41 layout.setGraph(graph); 42 frame.repaint(); 43 } 44 45 public void viewGraphRank(List<VertexScore<V>> pagerank, List<V> cluster){ 46 VertexPaintRankTransformer vertexPaint = new VertexPaintRankTransformer(pagerank,cluster); 47 vv.getRenderContext().setVertexFillPaintTransformer((Transformer<V, Paint>) vertexPaint); 48 49 frame.getContentPane().add(vv); 50 frame.pack(); 51 frame.repaint(); 52 frame.setVisible(true); 53 } 54 36 55 37 56 public void viewGraph(List<V> cut){
Note: See TracChangeset
for help on using the changeset viewer.