Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/LegendSection.java @ 2008:8971276d32bc
Register area artifact factory.
flys-artifacts/trunk@3450 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 16 Dec 2011 14:55:29 +0000 |
parents | 5c1e7c1e9e09 |
children | 2ae0627f956e |
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 */ |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 public class LegendSection extends DefaultSection { |
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 |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 Attribute attr = getAttribute(FONTSIZE_ATTR); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 if (attr == null) { |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 attr = new IntegerAttribute(FONTSIZE_ATTR, fontSize, true); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 addAttribute(FONTSIZE_ATTR, attr); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 } |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 else { |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 attr.setValue(fontSize); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 } |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 } |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 public void setVisibility(boolean visibility) { |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 Attribute attr = getAttribute(VISIBILITY_ATTR); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 if (attr == null) { |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 attr = new BooleanAttribute(VISIBILITY_ATTR, visibility, true); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 addAttribute(VISIBILITY_ATTR, attr); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 } |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 else { |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 attr.setValue(visibility); |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 } |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 } |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 } |
5c1e7c1e9e09
Improved the ChartSettings returned by charts - it now contains a legend specific section.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |