Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/jfree/StyledTimeSeries.java @ 9555:ef5754ba5573
Implemented legend aggregation based on type of themes.
Added theme-editor style configuration for aggregated legend entries.
Only configured themes get aggregated.
author | gernotbelger |
---|---|
date | Tue, 23 Oct 2018 16:26:48 +0200 |
parents | ddcd52d239cd |
children |
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:
2321
diff
changeset
|
9 package org.dive4elements.river.jfree; |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
9360
ddcd52d239cd
Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents:
8202
diff
changeset
|
11 import java.awt.Shape; |
ddcd52d239cd
Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents:
8202
diff
changeset
|
12 |
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; |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
14 import org.jfree.chart.LegendItem; |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import org.jfree.data.time.TimeSeries; |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 /** |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 */ |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 public class StyledTimeSeries extends TimeSeries implements StyledSeries { |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
22 private static final long serialVersionUID = 1L; |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
24 private final Style style; |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
25 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
26 private final String themeType; |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
27 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
28 public StyledTimeSeries(final String themeType, final String key, final ThemeDocument theme) { |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
29 this(themeType, key, theme, null); |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
30 } |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
31 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
32 public StyledTimeSeries(final String themeType, final String key, final ThemeDocument theme, final Shape shape) { |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 super(key); |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
34 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
35 this.style = new XYStyle(theme, shape); |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
36 this.themeType = themeType; |
9360
ddcd52d239cd
Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents:
8202
diff
changeset
|
37 } |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 @Override |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
40 public String getThemeType() { |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
41 return this.themeType; |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 } |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 @Override |
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 public Style getStyle() { |
9555
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
46 return this.style; |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
47 } |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
48 |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
49 @Override |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
50 public void applyAggregatedLegendTheme(final LegendItem item, final ThemeDocument theme) { |
ef5754ba5573
Implemented legend aggregation based on type of themes.
gernotbelger
parents:
9360
diff
changeset
|
51 this.style.applyAggregatedLegendTheme(item, theme); |
2321
991e4a5df323
Enabled styling in timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 } |
9360
ddcd52d239cd
Outliers in fixation calculation are now shown within the other 'B' event themes and get a separate symbol (triangle).
gernotbelger
parents:
8202
diff
changeset
|
53 } |