root / trunk / libraries / libTopology / src / com / vividsolutions / jcs / jump / FUTURE_CompositeStyle.java @ 22873
History | View | Annotate | Download (1.43 KB)
1 |
package com.vividsolutions.jcs.jump; |
---|---|
2 |
|
3 |
import java.awt.Graphics2D; |
4 |
import java.util.ArrayList; |
5 |
import java.util.Iterator; |
6 |
import java.util.List; |
7 |
|
8 |
import com.vividsolutions.jump.feature.Feature; |
9 |
import com.vividsolutions.jump.workbench.model.Layer; |
10 |
import com.vividsolutions.jump.workbench.ui.Viewport; |
11 |
import com.vividsolutions.jump.workbench.ui.renderer.style.Style; |
12 |
|
13 |
public class FUTURE_CompositeStyle implements Style { |
14 |
private List styles = new ArrayList(); |
15 |
public FUTURE_CompositeStyle add(Style style) { |
16 |
styles.add(style); |
17 |
return this; |
18 |
} |
19 |
public void paint(final Feature f, final Graphics2D g, final Viewport viewport) throws Exception { |
20 |
for (Iterator i = styles.iterator(); i.hasNext(); ) { |
21 |
Style style = (Style) i.next(); |
22 |
style.paint(f, g, viewport); |
23 |
} |
24 |
} |
25 |
public void initialize(Layer layer) { |
26 |
for (Iterator i = styles.iterator(); i.hasNext(); ) { |
27 |
Style style = (Style) i.next(); |
28 |
style.initialize(layer); |
29 |
} |
30 |
} |
31 |
public Object clone() { |
32 |
throw new UnsupportedOperationException(); |
33 |
} |
34 |
public void setEnabled(boolean enabled) { |
35 |
for (Iterator i = styles.iterator(); i.hasNext(); ) { |
36 |
Style style = (Style) i.next(); |
37 |
style.setEnabled(enabled); |
38 |
} |
39 |
} |
40 |
public boolean isEnabled() { |
41 |
return styles.isEmpty() ? false : ((Style)styles.iterator().next()).isEnabled(); |
42 |
} |
43 |
} |