Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/QWSeriesCollection.java @ 3729:e727e3ebdf85
Factored out a pure QW model to be more reusable.
flys-artifacts/trunk@5402 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sat, 08 Sep 2012 14:19:40 +0000 |
parents | 04d090d06d3f |
children |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/QWSeriesCollection.java Sat Sep 08 13:36:06 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/QWSeriesCollection.java Sat Sep 08 14:19:40 2012 +0000 @@ -1,6 +1,6 @@ package de.intevation.flys.artifacts.services; -import de.intevation.flys.artifacts.model.fixings.QW; +import de.intevation.flys.artifacts.model.fixings.QWI; import de.intevation.flys.java2d.ShapeUtils; @@ -38,7 +38,7 @@ implements XYItemLabelGenerator { public interface LabelGenerator { - String createLabel(QW qw); + String createLabel(QWI qw); } // interface LabelGenerator public static class DateFormatLabelGenerator @@ -59,7 +59,7 @@ } @Override - public String createLabel(QW qw) { + public String createLabel(QWI qw) { Date date = qw.getDate(); return date != null ? format.format(date) : ""; } @@ -71,7 +71,7 @@ protected Date minDate; protected Date maxDate; - protected List<List<QW>> labels; + protected List<List<QWI>> labels; protected Rectangle2D area; @@ -81,7 +81,7 @@ new HashMap<ShapeRenderer.Entry, Integer>(); public QWSeriesCollection() { - labels = new ArrayList<List<QW>>(); + labels = new ArrayList<List<QWI>>(); labelGenerator = SIMPLE_GENERATOR; } @@ -90,7 +90,7 @@ this.labelGenerator = labelGenerator; } - protected static ShapeRenderer.Entry classify(QW qw) { + protected static ShapeRenderer.Entry classify(QWI qw) { boolean interpolated = qw.getInterpolated(); Shape shape = interpolated @@ -103,7 +103,7 @@ return new ShapeRenderer.Entry(shape, color, filled); } - public void add(QW qw) { + public void add(QWI qw) { ShapeRenderer.Entry key = classify(qw); @@ -116,7 +116,7 @@ knownShapes.put(key, seriesNo); series = new XYSeries(seriesNo, false); addSeries(series); - labels.add(new ArrayList<QW>()); + labels.add(new ArrayList<QWI>()); } else { series = getSeries(seriesNo); @@ -130,7 +130,7 @@ extendArea(qw); } - protected void extendDateRange(QW qw) { + protected void extendDateRange(QWI qw) { Date date = qw.getDate(); if (date != null) { if (minDate == null) { @@ -147,7 +147,7 @@ } } - protected void extendArea(QW qw) { + protected void extendArea(QWI qw) { if (area == null) { area = new Rectangle2D.Double( qw.getQ(), qw.getW(), 0d, 0d);