Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationGenerator.java @ 6869:68fd84c474b7
issue738: Adjust S/Q-Relation Diagram subtitles.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 19 Aug 2013 16:37:04 +0200 |
parents | af13ceeba52a |
children | 1b35b2ddfc28 |
comparison
equal
deleted
inserted
replaced
6868:08e3c22500f3 | 6869:68fd84c474b7 |
---|---|
8 | 8 |
9 package org.dive4elements.river.exports.sq; | 9 package org.dive4elements.river.exports.sq; |
10 | 10 |
11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | 11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
12 import org.dive4elements.artifactdatabase.state.Facet; | 12 import org.dive4elements.artifactdatabase.state.Facet; |
13 | |
14 import org.dive4elements.river.artifacts.D4EArtifact; | |
15 | |
16 import org.dive4elements.river.artifacts.access.SQRelationAccess; | |
13 | 17 |
14 import org.dive4elements.river.artifacts.model.FacetTypes; | 18 import org.dive4elements.river.artifacts.model.FacetTypes; |
15 | 19 |
16 import org.dive4elements.river.artifacts.model.sq.SQ; | 20 import org.dive4elements.river.artifacts.model.sq.SQ; |
17 import org.dive4elements.river.artifacts.model.sq.SQFunction; | 21 import org.dive4elements.river.artifacts.model.sq.SQFunction; |
52 "chart.sq_relation.xaxis.label"; | 56 "chart.sq_relation.xaxis.label"; |
53 | 57 |
54 public static final String I18N_YAXIS_LABEL = | 58 public static final String I18N_YAXIS_LABEL = |
55 "chart.sq_relation.yaxis.label"; | 59 "chart.sq_relation.yaxis.label"; |
56 | 60 |
61 public static final String I18N_SUBTITLE = | |
62 "chart.computed.discharge.curve.subtitle"; | |
63 | |
64 /** Needed to access data to create subtitle. */ | |
65 protected D4EArtifact artifact; | |
57 | 66 |
58 /** The logger that is used in this generator. */ | 67 /** The logger that is used in this generator. */ |
59 private static Logger logger = Logger.getLogger(SQRelationGenerator.class); | 68 private static Logger logger = Logger.getLogger(SQRelationGenerator.class); |
60 | 69 |
61 | 70 |
73 return yaxes[idx].toString(); | 82 return yaxes[idx].toString(); |
74 } | 83 } |
75 }; | 84 }; |
76 } | 85 } |
77 | 86 |
87 /** | |
88 * Returns the default subtitle for this chart. | |
89 * | |
90 * @return the default subtitle for this chart. | |
91 */ | |
92 @Override | |
93 protected String getDefaultChartSubtitle() { | |
94 SQRelationAccess sqAccess = new SQRelationAccess(artifact); | |
95 Object[] args = null; | |
96 args = new Object[] { | |
97 sqAccess.getRiver(), | |
98 sqAccess.getLocation() | |
99 }; | |
100 return msg(I18N_SUBTITLE, "", args); | |
101 } | |
102 | |
103 | |
78 | 104 |
79 @Override | 105 @Override |
80 public String getDefaultChartTitle() { | 106 public String getDefaultChartTitle() { |
81 return "TODO: CHART TITLE"; | 107 return "TODO: CHART TITLE"; |
82 } | 108 } |
111 ArtifactAndFacet artifactAndFacet, | 137 ArtifactAndFacet artifactAndFacet, |
112 Document attr, | 138 Document attr, |
113 boolean visible | 139 boolean visible |
114 ) { | 140 ) { |
115 logger.debug("doOut"); | 141 logger.debug("doOut"); |
142 | |
143 this.artifact = (D4EArtifact) artifactAndFacet.getArtifact(); | |
116 | 144 |
117 Facet facet = artifactAndFacet.getFacet(); | 145 Facet facet = artifactAndFacet.getFacet(); |
118 String name = facet != null ? facet.getName() : null; | 146 String name = facet != null ? facet.getName() : null; |
119 | 147 |
120 if (name == null || name.length() == 0) { | 148 if (name == null || name.length() == 0) { |