Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/raster/DemuxRingsHandler.java @ 875:5e9efdda6894
merged gnv-artifacts/1.0
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:13:56 +0200 |
parents | feae2f9d6c6f |
children | f953c9a559d8 |
comparison
equal
deleted
inserted
replaced
722:bb3ffe7d719e | 875:5e9efdda6894 |
---|---|
1 package de.intevation.gnv.raster; | |
2 | |
3 import de.intevation.gnv.raster.Vectorizer.Edge; | |
4 import de.intevation.gnv.raster.Vectorizer.RingsHandler; | |
5 | |
6 import java.util.ArrayList; | |
7 import java.util.List; | |
8 | |
9 /** | |
10 * Ring Handler that demultiplexes to a list of other ring handlers. | |
11 * Handy if you want to pipe the polygons and line strings produced | |
12 * by the Vectorize to more than one handler at once. | |
13 * | |
14 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> | |
15 */ | |
16 public class DemuxRingsHandler | |
17 implements RingsHandler | |
18 { | |
19 /** | |
20 * The list of internal ring handlers. | |
21 */ | |
22 protected ArrayList<RingsHandler> handlers; | |
23 | |
24 /** | |
25 * Default constructor. | |
26 */ | |
27 public DemuxRingsHandler() { | |
28 handlers = new ArrayList<RingsHandler>(); | |
29 } | |
30 | |
31 /** | |
32 * Add a ring handler to the list of handlers. | |
33 * @param handler The handler to add to the internal list. | |
34 */ | |
35 public void addHandler(RingsHandler handler) { | |
36 handlers.add(handler); | |
37 } | |
38 | |
39 public void handleRings( | |
40 List<Edge> rings, | |
41 int value, | |
42 int width, | |
43 int height | |
44 ) { | |
45 for (RingsHandler handler: handlers) { | |
46 handler.handleRings(rings, value, width, height); | |
47 } | |
48 } | |
49 | |
50 /** | |
51 * Empties the internal list of ring handlers. | |
52 */ | |
53 public void clear() { | |
54 handlers.clear(); | |
55 } | |
56 } | |
57 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |