Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ChartSection.java @ 2046:2ae0627f956e
Improved ChartSettings and depending classes to avoid a lot of casting.
flys-artifacts/trunk@3534 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 23 Dec 2011 08:51:28 +0000 |
parents | 3632150dbe0b |
children | f97cf2e350c9 |
comparison
equal
deleted
inserted
replaced
2045:d13be39cfd1d | 2046:2ae0627f956e |
---|---|
33 attr.setValue(title); | 33 attr.setValue(title); |
34 } | 34 } |
35 } | 35 } |
36 | 36 |
37 | 37 |
38 public String getTitle() { | |
39 StringAttribute attr = (StringAttribute) getAttribute(TITLE_ATTR); | |
40 return attr != null ? (String) attr.getValue() : null; | |
41 } | |
42 | |
43 | |
38 public void setSubtitle(String subtitle) { | 44 public void setSubtitle(String subtitle) { |
39 if (subtitle == null || subtitle.length() == 0) { | 45 if (subtitle == null || subtitle.length() == 0) { |
40 return; | 46 return; |
41 } | 47 } |
42 | 48 |
49 attr.setValue(subtitle); | 55 attr.setValue(subtitle); |
50 } | 56 } |
51 } | 57 } |
52 | 58 |
53 | 59 |
60 public String getSubtitle() { | |
61 StringAttribute attr = (StringAttribute) getAttribute(SUBTITLE_ATTR); | |
62 return attr != null ? (String) attr.getValue() : null; | |
63 } | |
64 | |
65 | |
54 public void setDisplayGird(boolean displayGrid) { | 66 public void setDisplayGird(boolean displayGrid) { |
55 Attribute attr = getAttribute(DISPLAYGRID_ATTR); | 67 Attribute attr = getAttribute(DISPLAYGRID_ATTR); |
56 if (attr == null) { | 68 if (attr == null) { |
57 attr = new BooleanAttribute(DISPLAYGRID_ATTR, displayGrid, true); | 69 attr = new BooleanAttribute(DISPLAYGRID_ATTR, displayGrid, true); |
58 addAttribute(DISPLAYGRID_ATTR, attr); | 70 addAttribute(DISPLAYGRID_ATTR, attr); |
59 } | 71 } |
60 else { | 72 else { |
61 attr.setValue(displayGrid); | 73 attr.setValue(displayGrid); |
62 } | 74 } |
63 } | 75 } |
76 | |
77 | |
78 public Boolean getDisplayGrid() { | |
79 BooleanAttribute ba = (BooleanAttribute) getAttribute(DISPLAYGRID_ATTR); | |
80 return ba != null ? (Boolean) ba.getValue() : null; | |
81 } | |
64 } | 82 } |
65 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 83 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |