annotate artifacts/src/main/java/org/dive4elements/river/exports/process/Processor.java @ 8472:3f505fba522f

(issue1772) Use 0.001km tolarance instead of 0.1 to find matching km. There is no sense to use a define here. I will not write static final double NULLPOINTNULLNULLONE=0.001 if i just want to use that value and not any other value which may make sense in some other place. Using hardcoded values can have its merits and makes the code easier to read.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 18 Nov 2014 15:24:40 +0100
parents 01e103ad8845
children 5e38e2924c07
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
9 package org.dive4elements.river.exports.process;
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
10
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4736
diff changeset
12 import org.dive4elements.river.exports.XYChartGenerator;
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
13 import org.dive4elements.river.themes.ThemeDocument;
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
14 import org.dive4elements.river.exports.DiagramGenerator;
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
15
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
16 /**
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
17 * A processor is intended to generate an output e.g. curve in a chart diagramm from
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
18 * arbitrary data input which can be reused in several generators.
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
19 *
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
20 * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
21 */
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
22 public interface Processor {
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
23 /**
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
24 * Set the axis for this processor.
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
25 * This should be done before doOut is called for the first time.
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
26 *
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
27 * @param axisName The name of the Axis this processor should use.
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
28 */
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
29 public void setAxisName(String axisName);
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
30
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
31 /**
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
32 * Get the axis for this processor.
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
33 *
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
34 * @return The name of the axis that is used.
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
35 */
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
36 public String getAxisName();
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
37
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
38 /**
7084
f0731aa7b735 Implement Label handling
Andre Heinecke <aheinecke@intevation.de>
parents: 7075
diff changeset
39 * Get the axis label for this processor.
f0731aa7b735 Implement Label handling
Andre Heinecke <aheinecke@intevation.de>
parents: 7075
diff changeset
40 *
f0731aa7b735 Implement Label handling
Andre Heinecke <aheinecke@intevation.de>
parents: 7075
diff changeset
41 * @return The label of the axis.
f0731aa7b735 Implement Label handling
Andre Heinecke <aheinecke@intevation.de>
parents: 7075
diff changeset
42 */
f0731aa7b735 Implement Label handling
Andre Heinecke <aheinecke@intevation.de>
parents: 7075
diff changeset
43 public String getAxisLabel(DiagramGenerator generator);
f0731aa7b735 Implement Label handling
Andre Heinecke <aheinecke@intevation.de>
parents: 7075
diff changeset
44
f0731aa7b735 Implement Label handling
Andre Heinecke <aheinecke@intevation.de>
parents: 7075
diff changeset
45 /**
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
46 * Processes data to generate e.g. a chart.
7288
01e103ad8845 More doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7287
diff changeset
47 * Called for generators configured in the new-style way.
01e103ad8845 More doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7287
diff changeset
48 * In contrast to other doOut, no axis is given, as its name
01e103ad8845 More doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7287
diff changeset
49 * is in the given configuration.
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
50 *
7288
01e103ad8845 More doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7287
diff changeset
51 * @param generator DiagramGenerator to add output on.
7287
836411185200 Processor: Doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7088
diff changeset
52 * @param bundle The artifact and facet
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
53 * @param theme The theme that contains styling information.
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
54 * @param visible The visibility of the curve.
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
55 */
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
56 public void doOut(
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
57 DiagramGenerator generator,
7075
253d80af5b7f More Processor refactoring
Andre Heinecke <aheinecke@intevation.de>
parents: 7059
diff changeset
58 ArtifactAndFacet bundle,
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
59 ThemeDocument theme,
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
60 boolean visible);
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
61
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
62 /**
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
63 * Processes data to generate e.g. a chart.
7288
01e103ad8845 More doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7287
diff changeset
64 * Called for 'unconconfigured' (old-style) generators.
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
65 *
7288
01e103ad8845 More doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7287
diff changeset
66 * @param generator XYChartGenerator to add output on.
7287
836411185200 Processor: Doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7088
diff changeset
67 * @param bundle The artifact and facet.
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
68 * @param theme The theme that contains styling information.
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
69 * @param visible The visibility of the curve.
7287
836411185200 Processor: Doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7088
diff changeset
70 * @param index The index of the axis.
7059
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
71 */
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
72 @Deprecated
f9d5020af0af Remove AxisProcessor "glue" class and extend Processor interface
Andre Heinecke <aheinecke@intevation.de>
parents: 6905
diff changeset
73 public void doOut(
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
74 XYChartGenerator generator,
7075
253d80af5b7f More Processor refactoring
Andre Heinecke <aheinecke@intevation.de>
parents: 7059
diff changeset
75 ArtifactAndFacet bundle,
6905
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
76 ThemeDocument theme,
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
77 boolean visible,
1b35b2ddfc28 Artifacts: Introduce ThemeDocument & make stuff compileable again. THIS BREAKS THE SYSTEM! TODO: Move ThemeUtils into ThemeDocument.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
78 int index);
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
79
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
80 /**
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
81 * Returns true if the Processor class is able to generate output for a facet type
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4443
diff changeset
82 *
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
83 * @param facettype Name of the facet type
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
84 * @return true if the facettype can be processed
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
85 */
4736
b195fede1c3b Remove trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4443
diff changeset
86 public boolean canHandle(String facettype);
4443
af728a5e0329 Introduce a new Interface to abstract the data to curve generation
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
87 }

http://dive4elements.wald.intevation.org