annotate flys-artifacts/src/main/java/de/intevation/flys/exports/LegendSection.java @ 2058:f97cf2e350c9

Some refactoring done: all Sections subclass TypeSection now to be able to use the convinience methods for string, integer, double and boolean attributes. flys-artifacts/trunk@3550 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Dec 2011 11:37:23 +0000
parents 2ae0627f956e
children ca8997aa683e
rev   line source
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.exports;
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import de.intevation.artifactdatabase.state.Attribute;
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import de.intevation.artifactdatabase.state.DefaultSection;
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 /**
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 */
2058
f97cf2e350c9 Some refactoring done: all Sections subclass TypeSection now to be able to use the convinience methods for string, integer, double and boolean attributes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
10 public class LegendSection extends TypeSection {
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 public static final String VISIBILITY_ATTR = "visibility";
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 public static final String FONTSIZE_ATTR = "font-size";
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 public LegendSection() {
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 super("legend");
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 }
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 public void setFontSize(int fontSize) {
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 if (fontSize <= 0) {
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 return;
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 }
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25
2058
f97cf2e350c9 Some refactoring done: all Sections subclass TypeSection now to be able to use the convinience methods for string, integer, double and boolean attributes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
26 setIntegerValue(FONTSIZE_ATTR, fontSize);
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 }
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
30 public Integer getFontSize() {
2058
f97cf2e350c9 Some refactoring done: all Sections subclass TypeSection now to be able to use the convinience methods for string, integer, double and boolean attributes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
31 return getIntegerValue(FONTSIZE_ATTR);
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
32 }
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
33
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
34
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 public void setVisibility(boolean visibility) {
2058
f97cf2e350c9 Some refactoring done: all Sections subclass TypeSection now to be able to use the convinience methods for string, integer, double and boolean attributes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
36 setBooleanValue(VISIBILITY_ATTR, visibility);
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 }
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
38
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
39
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
40 public Boolean getVisibility() {
2058
f97cf2e350c9 Some refactoring done: all Sections subclass TypeSection now to be able to use the convinience methods for string, integer, double and boolean attributes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2046
diff changeset
41 return getBooleanValue(VISIBILITY_ATTR);
2046
2ae0627f956e Improved ChartSettings and depending classes to avoid a lot of casting.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1990
diff changeset
42 }
1990
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 }
5c1e7c1e9e09 Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org