package view; import java.awt.Color; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.commons.collections15.Transformer; public class VertexPaintTransformer implements Transformer{ Collection cluster; public VertexPaintTransformer(Collection cluster){ this.cluster = cluster; } public Paint transform(V node) { if(cluster.contains(node)){ Color c = new Color(0,255,0); return (Paint) c; } else return (Paint) Color.RED; } }