comparison artifacts/src/main/java/org/dive4elements/river/exports/ExportSection.java @ 9123:1cc7653ca84f

Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
author gernotbelger
date Tue, 05 Jun 2018 19:21:16 +0200
parents af13ceeba52a
children
comparison
equal deleted inserted replaced
9122:b8e7f6becf78 9123:1cc7653ca84f
16 public class ExportSection extends TypeSection { 16 public class ExportSection extends TypeSection {
17 17
18 public static final String WIDTH_ATTR = "width"; 18 public static final String WIDTH_ATTR = "width";
19 public static final String HEIGHT_ATTR = "height"; 19 public static final String HEIGHT_ATTR = "height";
20 20
21 private static final String METADATA_ATTR = "chart_settings_export_metadata";
22
21 23
22 public ExportSection() { 24 public ExportSection() {
23 super("export"); 25 super("export");
24 } 26 }
25 27
26 28
27 public void setWidth(int width) { 29 public void setWidth(final int width) {
28 if (width <= 0) { 30 if (width <= 0) {
29 return; 31 return;
30 } 32 }
31 33
32 setIntegerValue(WIDTH_ATTR, width); 34 setIntegerValue(WIDTH_ATTR, width);
36 public Integer getWidth() { 38 public Integer getWidth() {
37 return getIntegerValue(WIDTH_ATTR); 39 return getIntegerValue(WIDTH_ATTR);
38 } 40 }
39 41
40 42
41 public void setHeight(int height) { 43 public void setHeight(final int height) {
42 if (height <= 0) { 44 if (height <= 0) {
43 return; 45 return;
44 } 46 }
45 47
46 setIntegerValue(HEIGHT_ATTR, height); 48 setIntegerValue(HEIGHT_ATTR, height);
48 50
49 51
50 public Integer getHeight() { 52 public Integer getHeight() {
51 return getIntegerValue(HEIGHT_ATTR); 53 return getIntegerValue(HEIGHT_ATTR);
52 } 54 }
55
56 public void setMetadata(final boolean metadata) {
57 setBooleanValue(METADATA_ATTR, metadata);
58 }
59
60 public boolean getMetadata() {
61 return getBooleanValue(METADATA_ATTR, true);
62 }
53 } 63 }
54 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org