Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartSection.java @ 1986:3632150dbe0b
Implemented a ChartSettings with relevant Sections and Attributes for charts (NOTE: Work still in progress).
flys-artifacts/trunk@3418 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 14 Dec 2011 14:17:31 +0000 |
parents | |
children | 2ae0627f956e |
comparison
equal
deleted
inserted
replaced
1985:07b176b14205 | 1986:3632150dbe0b |
---|---|
1 package de.intevation.flys.exports; | |
2 | |
3 import de.intevation.artifactdatabase.state.Attribute; | |
4 import de.intevation.artifactdatabase.state.DefaultSection; | |
5 | |
6 | |
7 /** | |
8 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
9 */ | |
10 public class ChartSection extends DefaultSection { | |
11 | |
12 public static final String TITLE_ATTR = "title"; | |
13 public static final String SUBTITLE_ATTR = "subtitle"; | |
14 public static final String DISPLAYGRID_ATTR = "display-grid"; | |
15 | |
16 | |
17 public ChartSection() { | |
18 super("chart"); | |
19 } | |
20 | |
21 | |
22 public void setTitle(String title) { | |
23 if (title == null || title.length() == 0) { | |
24 return; | |
25 } | |
26 | |
27 Attribute attr = getAttribute(TITLE_ATTR); | |
28 if (attr == null) { | |
29 attr = new StringAttribute(TITLE_ATTR, title, true); | |
30 addAttribute(TITLE_ATTR, attr); | |
31 } | |
32 else { | |
33 attr.setValue(title); | |
34 } | |
35 } | |
36 | |
37 | |
38 public void setSubtitle(String subtitle) { | |
39 if (subtitle == null || subtitle.length() == 0) { | |
40 return; | |
41 } | |
42 | |
43 Attribute attr = getAttribute(SUBTITLE_ATTR); | |
44 if (attr == null) { | |
45 attr = new StringAttribute(SUBTITLE_ATTR, subtitle, true); | |
46 addAttribute(SUBTITLE_ATTR, attr); | |
47 } | |
48 else { | |
49 attr.setValue(subtitle); | |
50 } | |
51 } | |
52 | |
53 | |
54 public void setDisplayGird(boolean displayGrid) { | |
55 Attribute attr = getAttribute(DISPLAYGRID_ATTR); | |
56 if (attr == null) { | |
57 attr = new BooleanAttribute(DISPLAYGRID_ATTR, displayGrid, true); | |
58 addAttribute(DISPLAYGRID_ATTR, attr); | |
59 } | |
60 else { | |
61 attr.setValue(displayGrid); | |
62 } | |
63 } | |
64 } | |
65 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |