# HG changeset patch # User Sascha L. Teichmann # Date 1301061069 0 # Node ID c904d52cdfd01a833af0e3f2d65a83bab3325a13 # Parent 5a7662bb948c0d8be2139fbbb6cc62709b80e5c7 Don't used interleaved x/y data. flys-artifacts/trunk@1574 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 5a7662bb948c -r c904d52cdfd0 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Mar 25 11:03:51 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Mar 25 13:51:09 2011 +0000 @@ -1,3 +1,9 @@ +2011-03-25 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java: + Store data in a double [][] instead of interleaved double [] + to be compatible with org.jfree.data.xy.DefaultXYDataset. + 2011-03-25 Ingo Weinzierl * TODO: Removed 'i18n' and 'step-back' TODOs and added an issue to remove diff -r 5a7662bb948c -r c904d52cdfd0 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Fri Mar 25 11:03:51 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/DischargeTables.java Fri Mar 25 13:51:09 2011 +0000 @@ -28,7 +28,7 @@ protected String riverName; - protected Map values; + protected Map values; public DischargeTables() { } @@ -42,15 +42,15 @@ this.gaugeNames = gaugeNames; } - public Map getValues() { + public Map getValues() { if (values == null) { values = loadValues(); } return values; } - protected Map loadValues() { - Map values = new HashMap(); + protected Map loadValues() { + Map values = new HashMap(); SessionFactory sf = SessionFactoryProvider.getSessionFactory(); Session session = sf.openSession(); @@ -84,12 +84,13 @@ List dtvs = table.getDischargeTableValues(); - double [] vs = new double[dtvs.size() << 1]; + double [][] vs = new double[2][dtvs.size()]; int idx = 0; for (DischargeTableValue dtv: dtvs) { - vs[idx++] = dtv.getW().doubleValue(); - vs[idx++] = dtv.getQ().doubleValue(); + vs[0][idx] = dtv.getW().doubleValue(); + vs[1][idx] = dtv.getQ().doubleValue(); + ++idx; } values.put(gaugeName, vs);