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

Last change on this file since 38 was 32, checked in by toshi, 14 years ago
File size: 580 bytes
RevLine 
[27]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) {
[32]20      if(cluster.contains(node)){
21         Color c = new Color(0,255,0);
22         return (Paint) c;
23      }
[27]24      else
25         return (Paint) Color.RED;
26     }
27
28
29}
Note: See TracBrowser for help on using the repository browser.