|
Last change
on this file since 28 was
27,
checked in by toshi, 15 years ago
|
|
creato il branch local spectral
|
|
File size:
542 bytes
|
| Rev | Line | |
|---|
| [27] | 1 | |
|---|
| 2 | package view; |
|---|
| 3 | |
|---|
| 4 | import java.awt.Color; |
|---|
| 5 | import java.util.ArrayList; |
|---|
| 6 | import java.util.Collection; |
|---|
| 7 | import java.util.List; |
|---|
| 8 | import org.apache.commons.collections15.Transformer; |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | public 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.