[PATCH 8 of 8] Polish labels and remove unused classes. SQOverview is currently broken
Wald Commits
scm-commit at wald.intevation.org
Fri Oct 4 17:56:42 CEST 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1380902162 -7200
# Node ID 69709f490d927f56fc91a0a45d494082b6363084
# Parent 32db4f89b65fac671f3ad3dafaffa2f3782b3e2f
Polish labels and remove unused classes. SQOverview is currently broken.
diff -r 32db4f89b65f -r 69709f490d92 artifacts/doc/conf/sqrelation-diagram-defaults.xml
--- a/artifacts/doc/conf/sqrelation-diagram-defaults.xml Fri Oct 04 17:02:01 2013 +0200
+++ b/artifacts/doc/conf/sqrelation-diagram-defaults.xml Fri Oct 04 17:56:02 2013 +0200
@@ -7,7 +7,7 @@
axis="Transport"/>
<subtitle key="chart.computed.discharge.curve.subtitle" default="-">
<arg expr="artifact.river"/>
- <arg expr="artifact.ld_locations"/>
+ <arg expr="artifact.ld_locations" type="double"/>
</subtitle>
</longitudinal-defaults>
diff -r 32db4f89b65f -r 69709f490d92 artifacts/src/main/java/org/dive4elements/river/exports/sq/SQOverviewGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQOverviewGenerator.java Fri Oct 04 17:02:01 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQOverviewGenerator.java Fri Oct 04 17:56:02 2013 +0200
@@ -35,7 +35,7 @@
import org.dive4elements.artifacts.common.utils.XMLUtils;
import org.dive4elements.river.artifacts.context.RiverContext;
import org.dive4elements.river.collections.D4EArtifactCollection;
-import org.dive4elements.river.exports.ChartGenerator;
+import org.dive4elements.river.exports.ChartGenerator2;
import org.dive4elements.river.exports.OutGenerator;
import org.dive4elements.river.exports.OutputHelper;
import org.dive4elements.river.themes.ThemeDocument;
@@ -87,8 +87,8 @@
String name = artifactAndFacet.getData(context).toString();
if(name != null) {
logger.debug("name: " + name);
- ChartGenerator g =
- (ChartGenerator)RiverContext.getOutGenerator(
+ ChartGenerator2 g =
+ (ChartGenerator2)RiverContext.getOutGenerator(
context,
name,
null);
diff -r 32db4f89b65f -r 69709f490d92 artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationGenerator.java Fri Oct 04 17:02:01 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,245 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.exports.sq;
-
-import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
-import org.dive4elements.artifactdatabase.state.Facet;
-
-import org.dive4elements.river.artifacts.D4EArtifact;
-
-import org.dive4elements.river.artifacts.access.SQRelationAccess;
-
-import org.dive4elements.river.artifacts.model.FacetTypes;
-
-import org.dive4elements.river.artifacts.model.sq.SQ;
-import org.dive4elements.river.artifacts.model.sq.SQFunction;
-
-import org.dive4elements.river.exports.XYChartGenerator;
-
-import org.dive4elements.river.jfree.JFreeUtil;
-import org.dive4elements.river.jfree.StyledXYSeries;
-import org.dive4elements.river.themes.ThemeDocument;
-
-import org.apache.log4j.Logger;
-
-import org.jfree.chart.axis.LogarithmicAxis;
-import org.jfree.chart.axis.NumberAxis;
-
-import org.jfree.data.xy.XYSeries;
-
-
-/**
- * An OutGenerator that generates charts for MINFO sq relation.
- *
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class SQRelationGenerator
-extends XYChartGenerator
-implements FacetTypes
-{
- public enum YAXIS {
- S(0);
- protected int idx;
- private YAXIS(int c) {
- idx = c;
- }
- }
-
-
- public static final String I18N_XAXIS_LABEL =
- "chart.sq_relation.xaxis.label";
-
- public static final String I18N_YAXIS_LABEL =
- "chart.sq_relation.yaxis.label";
-
- public static final String I18N_SUBTITLE =
- "chart.computed.discharge.curve.subtitle";
-
- /** Needed to access data to create subtitle. */
- protected D4EArtifact artifact;
-
- /** The logger that is used in this generator. */
- private static Logger logger = Logger.getLogger(SQRelationGenerator.class);
-
-
- @Override
- protected YAxisWalker getYAxisWalker() {
- return new YAxisWalker() {
- @Override
- public int length() {
- return YAXIS.values().length;
- }
-
- @Override
- public String getId(int idx) {
- YAXIS[] yaxes = YAXIS.values();
- return yaxes[idx].toString();
- }
- };
- }
-
- /**
- * Returns the default subtitle for this chart.
- *
- * @return the default subtitle for this chart.
- */
- @Override
- protected String getDefaultChartSubtitle() {
- SQRelationAccess sqAccess = new SQRelationAccess(artifact);
- Object[] args = null;
- args = new Object[] {
- sqAccess.getRiver(),
- sqAccess.getLocation()
- };
- return msg(I18N_SUBTITLE, "", args);
- }
-
-
-
- @Override
- public String getDefaultChartTitle() {
- return "TODO: CHART TITLE";
- }
-
-
- @Override
- protected String getDefaultXAxisLabel() {
- return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL);
- }
-
-
- @Override
- protected String getDefaultYAxisLabel(int index) {
- return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL);
- }
-
-
- @Override
- protected NumberAxis createXAxis(String label) {
- return new LogarithmicAxis(label);
- }
-
-
- @Override
- protected NumberAxis createYAxis(int index) {
- return new LogarithmicAxis(getDefaultYAxisLabel(index));
- }
-
-
- @Override
- public void doOut(
- ArtifactAndFacet artifactAndFacet,
- ThemeDocument attr,
- boolean visible
- ) {
- logger.debug("doOut");
-
- this.artifact = (D4EArtifact) artifactAndFacet.getArtifact();
-
- Facet facet = artifactAndFacet.getFacet();
- String name = facet != null ? facet.getName() : null;
-
- if (name == null || name.length() == 0) {
- logger.warn("Invalid facet with no name given!");
- return;
- }
-
- if (IS.SQ_CURVE(name)) {
- doSQCurveOut(artifactAndFacet, attr, visible);
- }
- else if (IS.SQ_MEASUREMENT(name)) {
- doSQOut(artifactAndFacet, attr, visible);
- }
- else if (IS.SQ_OUTLIER(name)) {
- doSQOut(artifactAndFacet, attr, visible);
- }
- else if (IS.MANUALPOINTS(name)) {
- doPoints(
- artifactAndFacet.getData(context),
- artifactAndFacet,
- attr,
- visible,
- YAXIS.S.idx);
- }
- }
-
-
- protected void doSQCurveOut(
- ArtifactAndFacet artifactAndFacet,
- ThemeDocument attr,
- boolean visible
- ) {
- String desc = artifactAndFacet.getFacetDescription();
- logger.debug("doSQCurveOut: " + desc);
-
- SQFunction func = (SQFunction) artifactAndFacet.getData(context);
-
- if (func == null) {
- return;
- }
-
- XYSeries series = JFreeUtil.sampleFunction2DPositive(
- func.getFunction(),
- attr,
- desc,
- 500,
- Math.max(func.getMinQ(), 0.01),
- Math.max(func.getMaxQ(), 0.02));
-
- if (logger.isDebugEnabled()) {
- logger.debug("Series '" + desc + "' has "
- + series.getItemCount() + " items.");
-
- logger.debug(" -> min x = " + series.getMinX());
- logger.debug(" -> max x = " + series.getMaxX());
- logger.debug(" -> min y = " + series.getMinY());
- logger.debug(" -> max y = " + series.getMaxY());
- }
-
- addAxisSeries(series, YAXIS.S.idx, visible);
- }
-
-
- protected void doSQOut(
- ArtifactAndFacet artifactAndFacet,
- ThemeDocument attr,
- boolean visible
- ) {
- String desc = artifactAndFacet.getFacetDescription();
- logger.debug("doSQOut: " + desc);
-
- SQ[] sqs = (SQ[]) artifactAndFacet.getData(context);
- if (sqs == null) {
- logger.debug("No SQs found for facet");
- return;
- }
- XYSeries series = new StyledXYSeries(desc, attr);
-
- for (SQ sq: sqs) {
- double q = sq.getQ();
- double s = sq.getS();
- if (s > 0d && q > 0d) {
- series.add(q, s, false);
- }
- }
-
- if (logger.isDebugEnabled()) {
- logger.debug("Series '" + desc + "' has "
- + series.getItemCount() + " items.");
-
- logger.debug(" -> min x = " + series.getMinX());
- logger.debug(" -> max x = " + series.getMaxX());
- logger.debug(" -> min y = " + series.getMinY());
- logger.debug(" -> max y = " + series.getMaxY());
- }
-
- addAxisSeries(series, YAXIS.S.idx, visible);
- }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 32db4f89b65f -r 69709f490d92 artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationInfoGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationInfoGenerator.java Fri Oct 04 17:02:01 2013 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.exports.sq;
-
-import org.dive4elements.river.exports.ChartInfoGenerator;
-
-
-/**
- * A ChartInfoGenerator that generates meta information for specific
- * sq relation charts.
- *
- * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
- */
-public class SQRelationInfoGenerator
-extends ChartInfoGenerator
-{
- public SQRelationInfoGenerator() {
- super(new SQRelationGenerator());
- }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 32db4f89b65f -r 69709f490d92 gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Fri Oct 04 17:02:01 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Fri Oct 04 17:56:02 2013 +0200
@@ -638,6 +638,7 @@
fix_parameters_export = Angepasste Koeffizienten
fix_parameters = CSV
sq_overview=\u00dcbersicht
+sq_relations=Feststofftransport-Abfluss-Beziehung
gauge_zero = PNP
gauge_q_unit = m\u00b3/s
diff -r 32db4f89b65f -r 69709f490d92 gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties Fri Oct 04 17:02:01 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties Fri Oct 04 17:56:02 2013 +0200
@@ -613,6 +613,7 @@
fix_parameters_export = Adjusted coefficient
fix_parameters = CSV
sq_overview=Overview
+sq_relations=SQ Relations
gauge_zero = GZG
gauge_q_unit = m\u00b3/s
More information about the Dive4elements-commits
mailing list