Ignore:
Timestamp:
Jan 6, 2011, 9:41:42 AM (14 years ago)
Author:
toshi
Message:

ultimo commit

Location:
branches/localSpectral/src/view
Files:
2 edited

Legend:

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

    r34 r36  
    1414    List<VertexScore<V>> pagerank;
    1515    V seed_node;
     16    List<V> cluster;
    1617
    1718    public VertexPaintRankTransformer(List<VertexScore<V>> ranking, V seed_node){
    1819        this.pagerank = ranking;
    1920        this.seed_node = seed_node;
     21        this.cluster = null;
    2022    }
    2123
     24    public VertexPaintRankTransformer(List<VertexScore<V>> ranking, V seed_node, List<V> cluster){
     25        this.pagerank = ranking;
     26        this.seed_node = seed_node;
     27        this.cluster = cluster;
     28    }
     29   
    2230    public Paint transform(V node) {
    2331
     
    2533            if (seed_node.equals(node)){
    2634                return (Paint) Color.GREEN;
     35            }
     36        }
     37        if(cluster != null){
     38            if (!cluster.contains(node)){
     39                return (Paint) Color.WHITE;
    2740            }
    2841        }
  • branches/localSpectral/src/view/Viewer.java

    r34 r36  
    2424import javax.swing.JPanel;
    2525import javax.swing.JTextArea;
    26 import javax.xml.bind.JAXB;
    2726import org.apache.commons.collections15.Transformer;
    2827
     
    8382    }
    8483
     84    public void viewClusterRankedInGraph(List<VertexScore<V>> pagerank, V seed_node, List<V> cluster){
     85         VertexPaintRankTransformer vertexPaint = new VertexPaintRankTransformer(pagerank,seed_node, cluster);
     86         vv.getRenderContext().setVertexFillPaintTransformer((Transformer<V, Paint>) vertexPaint);
     87
     88         frame.getContentPane().add(vv);
     89         frame.pack();
     90         frame.repaint();
     91         frame.setVisible(true);
     92    }
     93
    8594
    8695    public void viewGraph(List<V> cut){
     
    98107     }
    99108
     109
    100110}
Note: See TracChangeset for help on using the changeset viewer.