Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FlowVelocityData.java @ 4198:1cdbd8a0c994
Added two new tables ClickableQDTable and ClickableWTable and made Ws and Qs clickable in historical discharge calculation.
The new tables define listener interfaces (clicked lower or upper icon) to listen to user clicks.
In addition to this, there is an enum ClickMode with NONE, SINGLE and RANGE options, which allows to
specifiy, which icons are displayed in the tables. NONE means no icon for user clicks, SINGLE has 1
icon, RANGE 2 icons for lower and upper.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 22 Oct 2012 13:31:25 +0200 |
parents | 4bd3d8bbb60c |
children | 10e7bd292c47 |
line wrap: on
line source
package de.intevation.flys.artifacts.model; import java.io.Serializable; import gnu.trove.TDoubleArrayList; public class FlowVelocityData implements Serializable { private TDoubleArrayList km; private TDoubleArrayList vMain; private TDoubleArrayList vTotal; private TDoubleArrayList tauMain; private TDoubleArrayList q; private String zone; protected FlowVelocityData() { this.km = new TDoubleArrayList(); this.vMain = new TDoubleArrayList(); this.vTotal = new TDoubleArrayList(); this.tauMain = new TDoubleArrayList(); this.q = new TDoubleArrayList(); } public void addKM(double km) { this.km.add(km); } public double getKM(int idx) { return km.get(idx); } public void addVMain(double vMain) { this.vMain.add(vMain); } public double getVMain(int idx) { return vMain.get(idx); } public void addVTotal(double vTotal) { this.vTotal.add(vTotal); } public double getVTotal(int idx) { return vTotal.get(idx); } public void addTauMain(double tauMain) { this.tauMain.add(tauMain); } public double getTauMain(int idx) { return tauMain.get(idx); } public void addQ(double q) { this.q.add(q); } public double getQ(int idx) { return q.get(idx); } public void setZone(String zone) { this.zone = zone; } public String getZone() { return zone; } public int size() { return km.size(); } public double[][] getMainChannelPoints() { double[][] points = new double[2][size()]; for (int i = 0, n = size(); i < n; i++) { points[0][i] = getKM(i); points[1][i] = getVMain(i); } return points; } public double[][] getTotalChannelPoints() { double[][] points = new double[2][size()]; for (int i = 0, n = size(); i < n; i++) { points[0][i] = getKM(i); points[1][i] = getVTotal(i); } return points; } public double[][] getTauPoints() { double[][] points = new double[2][size()]; for (int i = 0, n = size(); i < n; i++) { points[0][i] = getKM(i); points[1][i] = getTauMain(i); } return points; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :