01: package com.vividsolutions.jump.workbench.ui.renderer.style;
02:
03: import java.awt.Graphics2D;
04:
05: import com.vividsolutions.jump.feature.Feature;
06: import com.vividsolutions.jump.workbench.model.Layer;
07: import com.vividsolutions.jump.workbench.ui.Viewport;
08: import com.vividsolutions.jump.workbench.ui.renderer.style.DummyStyle;
09: import com.vividsolutions.jump.workbench.ui.renderer.style.Style;
10:
11: public class DelegatingStyle implements Style {
12: private Style style = DummyStyle.instance();
13:
14: public DelegatingStyle setStyle(Style style) {
15: this .style = style;
16: return this ;
17: }
18:
19: public void paint(Feature f, Graphics2D g, Viewport viewport)
20: throws Exception {
21: style.paint(f, g, viewport);
22: }
23:
24: public void initialize(Layer layer) {
25: style.initialize(layer);
26: }
27:
28: public Object clone() {
29: return new DelegatingStyle().setStyle((Style) style.clone());
30: }
31:
32: public void setEnabled(boolean enabled) {
33: style.setEnabled(enabled);
34: }
35:
36: public boolean isEnabled() {
37: return style.isEnabled();
38: }
39: }
|