Ignore:
Timestamp:
Oct 21, 2010, 9:47:43 PM (14 years ago)
Author:
toshi
Message:
 
Location:
branches/localSpectral/src/view
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/localSpectral/src/view/VertexPaintTransformer.java

    r27 r32  
    1818
    1919    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      }
    2224      else
    2325         return (Paint) Color.RED;
  • branches/localSpectral/src/view/Viewer.java

    r27 r32  
    22package view;
    33
     4import clustering.VertexScore;
     5import clustering.VertexString;
    46import edu.uci.ics.jung.algorithms.layout.FRLayout;
    57import edu.uci.ics.jung.algorithms.layout.Layout;
     
    810import java.awt.Color;
    911import java.awt.Dimension;
     12import java.awt.LayoutManager;
    1013import java.awt.Paint;
    1114import java.util.ArrayList;
     
    3437    }
    3538
     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
    3655
    3756    public void viewGraph(List<V> cut){
Note: See TracChangeset for help on using the changeset viewer.