source: branches/localSpectral/src/view/VertexPaintTransformer.java @ 28

Last change on this file since 28 was 27, checked in by toshi, 14 years ago

creato il branch local spectral

File size: 542 bytes
Line 
1
2package view;
3
4import java.awt.Color;
5import java.util.ArrayList;
6import java.util.Collection;
7import java.util.List;
8import org.apache.commons.collections15.Transformer;
9
10
11public class VertexPaintTransformer<V,Paint> implements Transformer<V,Paint>{
12
13    Collection<V> cluster;
14
15    public VertexPaintTransformer(Collection<V> cluster){
16        this.cluster = cluster;
17    }
18
19    public Paint transform(V node) {
20      if(cluster.contains(node))
21         return (Paint) Color.GREEN;
22      else
23         return (Paint) Color.RED;
24     }
25
26
27}
Note: See TracBrowser for help on using the repository browser.