annotate artifacts/src/main/java/org/dive4elements/river/artifacts/charts/CrossSectionApp.java @ 5994:af13ceeba52a

Removed trailing whitespace.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 12 May 2013 18:13:50 +0200
parents 4897a58c8746
children
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
9 package org.dive4elements.river.artifacts.charts;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
11 import org.dive4elements.river.backend.SessionFactoryProvider;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
13 import org.dive4elements.river.artifacts.geom.Lines;
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
14
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
15 import org.dive4elements.river.model.CrossSection;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
16 import org.dive4elements.river.model.CrossSectionLine;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
17 import org.dive4elements.river.model.CrossSectionPoint;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
18
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
19 import org.dive4elements.river.utils.Pair;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
20
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4785
diff changeset
21 import org.dive4elements.river.jfree.StableXYDifferenceRenderer;
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
22
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
23 import java.awt.BorderLayout;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
24 import java.awt.Dimension;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
25 import java.awt.FlowLayout;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
27 import java.awt.event.ActionEvent;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
28 import java.awt.event.ActionListener;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
29 import java.awt.event.ItemEvent;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
30 import java.awt.event.ItemListener;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
31
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
32 import java.awt.geom.Point2D;
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
33 import java.awt.geom.Rectangle2D;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
34
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
35 import java.io.File;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
36 import java.io.FileWriter;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
37 import java.io.IOException;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
38 import java.io.PrintWriter;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
39
2655
60925be3c84f Make it compilable again after signature change in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2652
diff changeset
40 import java.math.BigDecimal;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
41 import java.math.MathContext;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
42
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
43 import java.util.ArrayList;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
44 import java.util.Arrays;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
45 import java.util.List;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
46 import java.util.Map;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
47 import java.util.TreeMap;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
48
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
49 import java.awt.Color;
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
50 import java.awt.Paint;
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
51 import java.awt.TexturePaint;
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
52
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
53 import java.awt.image.BufferedImage;
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
54
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
55 import javax.swing.DefaultComboBoxModel;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
56 import javax.swing.JButton;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
57 import javax.swing.JComboBox;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
58 import javax.swing.JPanel;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
59 import javax.swing.JScrollPane;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
60 import javax.swing.JTable;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
61 import javax.swing.JTextField;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
62
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
63 import javax.swing.event.TableModelEvent;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
64 import javax.swing.event.TableModelListener;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
65
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
66 import javax.swing.table.AbstractTableModel;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
67
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
68 import org.hibernate.Query;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
69 import org.hibernate.Session;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
70
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
71 import org.jfree.chart.ChartFactory;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
72 import org.jfree.chart.ChartPanel;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
73 import org.jfree.chart.ChartUtilities;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
74 import org.jfree.chart.JFreeChart;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
75
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
76 import org.jfree.chart.axis.NumberAxis;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
77
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
78 import org.jfree.chart.plot.PlotOrientation;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
79 import org.jfree.chart.plot.XYPlot;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
80
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
81 import org.jfree.data.xy.DefaultXYDataset;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
82 import org.jfree.data.xy.XYSeries;
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
83 import org.jfree.data.xy.XYDataset;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
84 import org.jfree.data.xy.XYSeriesCollection;
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
85 import org.jfree.chart.renderer.xy.XYItemRenderer;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
86
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
87 import org.jfree.ui.ApplicationFrame;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
88 import org.jfree.ui.RefineryUtilities;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
89
4785
522b424c9c2a CrossSectionApp: Doc and whitespace cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4050
diff changeset
90
2017
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1884
diff changeset
91 /**
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1884
diff changeset
92 * Standalone tech-demo.
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1884
diff changeset
93 */
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
94 public class CrossSectionApp
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
95 extends ApplicationFrame
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
96 {
1122
111794adf285 Get real (but yet not parameterized) data to display in CrossSection.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 938
diff changeset
97 public static final String RIVER = System.getProperty("river", "Saar");
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
99 public static final String WATER_LEVEL = System.getProperty("waterlevel");
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
100
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
101 public static final String KM = System.getProperty("km");
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
102
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
103 public static final double EPSILON = 1e-4;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105 protected Session session;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107 protected JComboBox crossSectionLinesCB;
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
108 protected JTextField waterlevelTF;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 protected ChartPanel chartPanel;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
112 protected Double lastWaterLevel;
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
113
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
114 protected List<CrossSection> crossSections;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
115 protected boolean [] drawCrossSection;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
116 protected boolean [] drawWaterLevel;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
117 protected boolean [] drawGround;
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
118 protected boolean [] drawFill;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
120 protected Map<Double, List<Pair<CrossSection, CrossSectionLine>>> km2lines;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
122 protected static final Paint TRANSPARENT = createTransparentPaint();
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
123
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
124 public class CrossSectionTableModel extends AbstractTableModel {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
125
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
126 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
127 public String getColumnName(int col) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
128 switch (col) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
129 case 0: return "Peilungsname";
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
130 case 1: return "Peilung";
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
131 case 2: return "Wasserstand";
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
132 case 3: return "Boden";
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
133 case 4: return "Wasser";
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
134 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
135 return "";
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
136 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
137
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
138 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
139 public int getColumnCount() {
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2655
diff changeset
140 return 5;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
141 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
142
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
143 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
144 public int getRowCount() {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
145 return crossSections != null ? crossSections.size() : 0;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
146 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
147
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
148 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
149 public Object getValueAt(int row, int col) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
150 if (crossSections == null) return null;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
151 switch (col) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
152 case 0: return crossSections.get(row).getDescription();
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
153 case 1: return drawCrossSection[row];
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
154 case 2: return drawWaterLevel[row];
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
155 case 3: return drawGround[row];
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
156 case 4: return drawFill[row];
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
157 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
158 return null;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
159 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
160
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
161 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
162 public void setValueAt(Object value, int row, int col) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
163 switch (col) {
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2655
diff changeset
164 case 1:
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
165 if (change(drawCrossSection, row, (Boolean)value)) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
166 fireTableCellUpdated(row, col);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
167 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
168 break;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
169 case 2:
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
170 if (change(drawWaterLevel, row, (Boolean)value)) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
171 fireTableCellUpdated(row, col);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
172 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
173 break;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
174 case 3:
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
175 if (change(drawGround, row, (Boolean)value)) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
176 fireTableCellUpdated(row, col);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
177 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
178 break;
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
179 case 4:
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
180 if (change(drawFill, row, (Boolean)value)) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
181 fireTableCellUpdated(row, col);
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
182 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
183 break;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
184 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
185 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
186
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
187 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
188 public Class<?> getColumnClass(int columnIndex) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
189 switch (columnIndex) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
190 case 0: return String.class;
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
191 case 1:
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
192 case 2:
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2655
diff changeset
193 case 3:
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
194 case 4: return Boolean.class;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
195 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
196 return null;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
197 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
198
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
199 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
200 public boolean isCellEditable(
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
201 int rowIndex,
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
202 int columnIndex
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
203 ) {
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
204 return columnIndex >= 1 && columnIndex <= 4;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
205 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
206 } // class CrossSectionTableModel
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
207
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
208 private static boolean change(
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
209 boolean [] values,
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2655
diff changeset
210 int index,
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
211 boolean value
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
212 ) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
213 if (values[index] != value) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
214 values[index] = value;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
215 return true;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
216 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
217 return false;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
218 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
219
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
220 public static class CrossSectionLineItem {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
221
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
222 Double km;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
223 List<Pair<CrossSection, CrossSectionLine>> lines;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
224
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
225 public CrossSectionLineItem(
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2655
diff changeset
226 Double km,
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
227 List<Pair<CrossSection, CrossSectionLine>> lines
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
228 ) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
229 this.km = km;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
230 this.lines = lines;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
231 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
232
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
233 public String toString() {
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
234 return String.valueOf(km);
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
235 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
236 } // CrossSectionLineItem
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
237
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
238 public CrossSectionApp(String title) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
239 super(title);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
240
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
241 session = SessionFactoryProvider
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
242 .createSessionFactory()
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
243 .openSession();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
244
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
245 JPanel content = createContent();
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
246 content.setPreferredSize(new Dimension(800, 480));
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
247 setContentPane(content);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
248 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
249
4785
522b424c9c2a CrossSectionApp: Doc and whitespace cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4050
diff changeset
250
522b424c9c2a CrossSectionApp: Doc and whitespace cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4050
diff changeset
251 /** Query and return CrossSections for named river. */
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
252 public List<CrossSection> crossSections(String river) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
253 Query query = session.createQuery(
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
254 "from CrossSection where river.name = :river");
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
255 query.setParameter("river", river);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
256 return query.list();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
257 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
258
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
259 protected Map<Double, List<Pair<CrossSection, CrossSectionLine>>>
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
260 loadAllLines(List<CrossSection> crossSections) {
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
261 Map<Double, List<Pair<CrossSection, CrossSectionLine>>> km2lines =
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
262 new TreeMap<Double, List<Pair<CrossSection, CrossSectionLine>>>();
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
263 for (CrossSection cs: crossSections) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
264 List<CrossSectionLine> lines = cs.getLines();
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
265 for (CrossSectionLine csl: lines) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
266 Double km = Math.round(csl.getKm().doubleValue() * 1000d)/1000d;
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
267 List<Pair<CrossSection, CrossSectionLine>> ls
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
268 = km2lines.get(km);
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
269 if (ls == null) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
270 ls = new ArrayList<Pair<CrossSection, CrossSectionLine>>(2);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
271 km2lines.put(km, ls);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
272 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
273 ls.add(new Pair<CrossSection, CrossSectionLine>(cs, csl));
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
274 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
275 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
276 return km2lines;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
277 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
278
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
279 public JPanel createContent() {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
280 JPanel panel = new JPanel(new BorderLayout());
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
281
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
282 JPanel nav = new JPanel(new FlowLayout());
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
283
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
284 crossSections = crossSections(RIVER);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
285 km2lines = loadAllLines(crossSections);
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
286
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
287 int CS = crossSections.size();
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
288 Arrays.fill(drawCrossSection = new boolean[CS], true);
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
289 drawWaterLevel = new boolean[CS];
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
290 drawGround = new boolean[CS];
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
291 drawFill = new boolean[CS];
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
292
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
293 Object [] clis = createCrossSectionLineItems(km2lines);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
294
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
295 DefaultComboBoxModel dcbm = new DefaultComboBoxModel(clis);
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
296
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
297 crossSectionLinesCB = new JComboBox(dcbm);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
298
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
299 if (KM != null) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
300 try {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
301 double km = Double.parseDouble(KM);
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
302
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
303 CrossSectionLineItem found = null;
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
304
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
305 for (Object o: clis) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
306 CrossSectionLineItem csli = (CrossSectionLineItem)o;
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
307 if (Math.abs(csli.km - km) < EPSILON) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
308 found = csli;
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
309 break;
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
310 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
311 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
312
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
313 if (found != null) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
314 crossSectionLinesCB.setSelectedItem(found);
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
315 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
316 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
317 catch (NumberFormatException nfe) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
318 System.err.println("km is not a number: "
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
319 + nfe.getMessage());
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
320 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
321 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
322
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
323 nav.add(crossSectionLinesCB);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
324
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
325 crossSectionLinesCB.addItemListener(new ItemListener() {
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
326 @Override
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
327 public void itemStateChanged(ItemEvent ie) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
328 if (ie.getStateChange() == ItemEvent.SELECTED) {
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
329 updateChart();
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
330 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
331 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
332 });
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
333
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
334 waterlevelTF = new JTextField(5);
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
335
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
336 if (WATER_LEVEL != null) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
337 try {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
338 waterlevelTF.setText(
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
339 (lastWaterLevel = Double.valueOf(WATER_LEVEL)).toString());
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
340 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
341 catch (NumberFormatException nfe) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
342 System.err.println("Water level not a number: " +
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
343 nfe.getMessage());
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
344 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
345 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
346
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
347 waterlevelTF.addActionListener(new ActionListener() {
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
348 @Override
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
349 public void actionPerformed(ActionEvent ae) {
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
350 waterLevelChanged();
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
351 }
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
352 });
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
353
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
354 nav.add(waterlevelTF);
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
355
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
356 JButton dump = new JButton("dump");
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
357
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
358 dump.addActionListener(new ActionListener() {
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
359 @Override
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
360 public void actionPerformed(ActionEvent ae) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
361 dumpData();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
362 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
363 });
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
364
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
365 nav.add(dump);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
366
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
367
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
368 chartPanel = createChartPanel();
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
369
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
370 panel.add(chartPanel, BorderLayout.CENTER);
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
371
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
372
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
373 CrossSectionTableModel cstm = new CrossSectionTableModel();
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
374
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
375 cstm.addTableModelListener(new TableModelListener() {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
376 @Override
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
377 public void tableChanged(TableModelEvent e) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
378 updateChart();
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
379 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
380 });
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
381
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
382 JTable crossTable = new JTable(cstm);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
383
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
384 JPanel west = new JPanel(new BorderLayout());
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
385 JScrollPane scrollPane = new JScrollPane(crossTable);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
386 west.add(scrollPane);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
387
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
388 west.add(nav, BorderLayout.SOUTH);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
389
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
390 panel.add(west, BorderLayout.WEST);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
391
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
392 return panel;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
393 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
394
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
395 protected void waterLevelChanged() {
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
396 String value = waterlevelTF.getText();
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
397 try {
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
398 lastWaterLevel = Double.valueOf(value);
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
399 }
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
400 catch (NumberFormatException nfe) {
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
401 waterlevelTF.setText(
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
402 lastWaterLevel != null ? lastWaterLevel.toString() : "");
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
403 return;
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
404 }
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
405 updateChart();
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
406 }
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
407
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
408 protected void updateChart() {
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
409
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
410 JFreeChart chart = createChart();
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
411
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
412 chartPanel.setChart(chart);
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
413 }
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
414
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
415 protected ChartPanel createChartPanel() {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
416
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
417 JFreeChart chart = createChart();
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
418
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
419 return new ChartPanel(chart);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
420 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
421
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
422 protected void dumpData() {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
423
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
424 CrossSectionLineItem csli =
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
425 (CrossSectionLineItem)crossSectionLinesCB.getSelectedItem();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
426
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
427 if (csli == null) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
428 return;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
429 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
430
1820
d562772a418e CrossSectionApp: Re-enabled dumping data to disk.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1817
diff changeset
431 double km = Math.round(csli.km.doubleValue() * 1000d)/1000d;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
432
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
433 String kmS = String.valueOf(km).replace(".", "-");
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
434
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
435 int i = 1;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
436 File file = new File("cross-section-" + kmS + ".txt");
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
437 while (file.exists()) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
438 file = new File("cross-section-" + kmS + "[" + (i++) + "].txt");
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
439 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
440
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
441 System.err.println("dump points to file '" + file + "'");
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
442
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
443 PrintWriter out = null;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
444
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
445 MathContext mc = new MathContext(3);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
446
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
447 try {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
448 out =
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
449 new PrintWriter(
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
450 new FileWriter(file));
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
451
1820
d562772a418e CrossSectionApp: Re-enabled dumping data to disk.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1817
diff changeset
452 for (Pair<CrossSection, CrossSectionLine> pair: csli.lines) {
d562772a418e CrossSectionApp: Re-enabled dumping data to disk.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1817
diff changeset
453 out.println("# " + pair.getA().getDescription());
d562772a418e CrossSectionApp: Re-enabled dumping data to disk.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1817
diff changeset
454 for (CrossSectionPoint point: pair.getB().getPoints()) {
d562772a418e CrossSectionApp: Re-enabled dumping data to disk.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1817
diff changeset
455 out.println(
2655
60925be3c84f Make it compilable again after signature change in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2652
diff changeset
456 new BigDecimal(point.getX()).round(mc) + " " +
60925be3c84f Make it compilable again after signature change in backend.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2652
diff changeset
457 new BigDecimal(point.getY()).round(mc));
1820
d562772a418e CrossSectionApp: Re-enabled dumping data to disk.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1817
diff changeset
458 }
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
459 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
460
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
461 out.flush();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
462 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
463 catch (IOException ioe) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
464 ioe.printStackTrace();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
465 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
466 finally {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
467 if (out != null) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
468 out.close();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
469 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
470 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
471 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
472
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
473 public void generateWaterLevels(
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
474 List<Point2D> points,
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
475 List<Pair<XYDataset, XYItemRenderer>> datasets
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
476 ) {
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
477 if (points == null || points.isEmpty() || lastWaterLevel == null) {
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
478 return;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
479 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
480
2652
9d2a06c3a134 Added DataType for lines that also stores width, use it. Added HasLabel interface for some series.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2017
diff changeset
481 double [][] data = Lines.createWaterLines(points, lastWaterLevel).points;
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
482 XYSeries series =
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
483 new XYSeries(String.valueOf(lastWaterLevel), false);
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
484
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
485 double [] x = data[0];
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
486 double [] y = data[1];
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
487 for (int i = 0; i < x.length; ++i) {
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
488 series.add(x[i], y[i], false);
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
489 }
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
490
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
491 datasets.add(new Pair<XYDataset, XYItemRenderer>(
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
492 new XYSeriesCollection(series), null));
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
493 }
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
494
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
495 public void generateFill(
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
496 List<Point2D> points,
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
497 String legend,
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
498 List<Pair<XYDataset, XYItemRenderer>> datasets
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
499 ) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
500 if (points == null || points.isEmpty() || lastWaterLevel == null) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
501 return;
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
502 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
503
2652
9d2a06c3a134 Added DataType for lines that also stores width, use it. Added HasLabel interface for some series.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2017
diff changeset
504 double [][] data = Lines.createWaterLines(points, lastWaterLevel).points;
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
505 double [][] values = CrossSectionLine.fetchCrossSectionProfile(points);
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
506
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
507 DefaultXYDataset dataset = new DefaultXYDataset();
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
508
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
509 dataset.addSeries(legend + "-Linie", values);
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
510 dataset.addSeries(legend + "-Fl\u00e4che", data);
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
511
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
512 datasets.add(new Pair<XYDataset, XYItemRenderer>(
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
513 dataset,
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
514 new StableXYDifferenceRenderer(
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
515 TRANSPARENT, Color.blue, false)));
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
516 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
517
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
518 public void generateProfile(
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
519 List<Point2D> points,
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
520 String legend,
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
521 List<Pair<XYDataset, XYItemRenderer>> datasets
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
522 ) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
523 if (points == null || points.isEmpty()) {
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
524 return;
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
525 }
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
526
1651
a7def20539fb flys/issue317: Removed dependency from cross section demo app.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1122
diff changeset
527 double [][] values = CrossSectionLine.fetchCrossSectionProfile(points);
a7def20539fb flys/issue317: Removed dependency from cross section demo app.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1122
diff changeset
528
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
529 XYSeries series = new XYSeries(legend, false);
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
530
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
531 double [] x = values[0];
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
532 double [] y = values[1];
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
533 for (int i = 0; i < x.length; ++i) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
534 series.add(x[i], y[i], false);
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
535 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
536
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
537 datasets.add(new Pair<XYDataset, XYItemRenderer>(
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
538 new XYSeriesCollection(series), null));;
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
539 }
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
540
2017
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1884
diff changeset
541
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1884
diff changeset
542 /**
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1884
diff changeset
543 * @param legend the legend entry.
e384d78ff78b Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 1884
diff changeset
544 */
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
545 public void generateGround(
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
546 List<Point2D> points,
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
547 String legend,
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
548 List<Pair<XYDataset, XYItemRenderer>> datasets
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
549 ) {
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
550 if (points == null || points.isEmpty()) {
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
551 return;
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
552 }
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
553
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
554 double [][] values = CrossSectionLine.fetchCrossSectionProfile(points);
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
555
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
556 DefaultXYDataset dataset = new DefaultXYDataset();
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
557
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
558 dataset.addSeries(legend, values);
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
559
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
560 StableXYDifferenceRenderer renderer =
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
561 new StableXYDifferenceRenderer();
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
562
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
563 datasets.add(new Pair<XYDataset, XYItemRenderer>(
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
564 dataset, renderer));
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
565 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
566
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
567 public List<Pair<XYDataset, XYItemRenderer>> generateDatasets() {
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
568
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
569 List<Pair<XYDataset, XYItemRenderer>> datasets =
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
570 new ArrayList<Pair<XYDataset, XYItemRenderer>>();
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
571
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
572 CrossSectionLineItem csli =
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
573 (CrossSectionLineItem)crossSectionLinesCB.getSelectedItem();
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
574
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
575 for (int i = 0; i < drawCrossSection.length; ++i) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
576 List<Point2D> points = null;
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
577 CrossSection cs = crossSections.get(i);
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
578
1884
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
579 if (drawGround[i]) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
580 for (Pair<CrossSection, CrossSectionLine> csl: csli.lines) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
581 if (csl.getA() == cs) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
582 if (points == null) {
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
583 points = csl.getB().fetchCrossSectionLinesPoints();
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
584 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
585 generateGround(
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
586 points,
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
587 cs.getDescription() + "/Boden",
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
588 datasets);
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
589 break;
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
590 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
591 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
592 }
4ae9c92feb8c StableXYDifferenceRenderer: Make rendering work with definition holes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1883
diff changeset
593
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
594 if (drawFill[i]) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
595 for (Pair<CrossSection, CrossSectionLine> csl: csli.lines) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
596 if (csl.getA() == cs) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
597 if (points == null) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
598 points = csl.getB().fetchCrossSectionLinesPoints();
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
599 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
600
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
601 generateFill(
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
602 points, cs.getDescription(), datasets);
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
603 break;
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
604 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
605 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
606 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
607
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
608 if (drawCrossSection[i]) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
609 for (Pair<CrossSection, CrossSectionLine> csl: csli.lines) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
610 if (csl.getA() == cs) {
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
611 if (points == null) {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
612 points = csl.getB().fetchCrossSectionLinesPoints();
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
613 }
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
614
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
615 generateProfile(
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
616 points, cs.getDescription(), datasets);
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
617 break;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
618 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
619 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
620 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
621
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
622 if (drawWaterLevel[i]) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
623 for (Pair<CrossSection, CrossSectionLine> csl: csli.lines) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
624 if (csl.getA() == cs) {
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
625 if (points == null) {
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
626 points = csl.getB().fetchCrossSectionLinesPoints();
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
627 }
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
628 generateWaterLevels(points, datasets);
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
629 break;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
630 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
631 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
632 }
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
633
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
634 }
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
635
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
636 return datasets;
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
637 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
638
1817
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
639 protected Object [] createCrossSectionLineItems(
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
640 Map<Double, List<Pair<CrossSection, CrossSectionLine>>> km2lines
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
641 ) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
642 Object [] result = new Object[km2lines.size()];
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
643 int i = 0;
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
644 for (Map.Entry<Double, List<Pair<CrossSection, CrossSectionLine>>> entry:
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
645 km2lines.entrySet()) {
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
646 result[i++] = new CrossSectionLineItem(
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
647 entry.getKey(),
595c404523a6 Rewritten CrossSectionApp to be useful as test bed for 'Raum/Flaeche' operations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1651
diff changeset
648 entry.getValue());
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
649 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
650 return result;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
651 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
652
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
653
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
654 public JFreeChart createChart() {
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
655 JFreeChart chart = ChartFactory.createXYLineChart(
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
656 null,
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
657 "Abstand [m]",
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
658 "H\u00f6he [m]",
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
659 null,
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
660 PlotOrientation.VERTICAL,
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
661 true,
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
662 true,
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
663 false);
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
664
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
665 List<Pair<XYDataset, XYItemRenderer>> datasets =
1881
0e9c0b49b4ef CrossSectionApp: draw ground with StableXYDifferenceRenderer
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1858
diff changeset
666 generateDatasets();
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
667
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
668 XYPlot plot = chart.getXYPlot();
1858
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
669
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
670 for (int i = 0, N = datasets.size(); i < N; ++i) {
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
671 Pair<XYDataset, XYItemRenderer> p = datasets.get(i);
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
672 plot.setDataset(i, p.getA());
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
673 plot.mapDatasetToRangeAxis(i, 0);
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
674 XYItemRenderer renderer = p.getB();
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
675 if (renderer != null) {
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
676 plot.setRenderer(i, renderer);
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
677 }
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
678 }
94871b7ce9e9 CrossSectionApp: split curves in separated datasets to make them renderable with different renderers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1820
diff changeset
679
938
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
680 NumberAxis yAxis = (NumberAxis)plot.getRangeAxis();
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
681 yAxis.setAutoRangeIncludesZero(false);
bd3683453928 Debugged the water fill algorithm.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 936
diff changeset
682
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
683 ChartUtilities.applyCurrentTheme(chart);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
684 return chart;
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
685 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
686
1883
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
687 protected static Paint createTransparentPaint() {
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
688 BufferedImage texture = new BufferedImage(
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
689 1, 1, BufferedImage.TYPE_4BYTE_ABGR);
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
690
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
691 return new TexturePaint(
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
692 texture, new Rectangle2D.Double(0d, 0d, 0d, 0d));
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
693 }
eb671699fbc2 CrossSectionApp: Draw water, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1881
diff changeset
694
936
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
695 public static void main(String [] args) {
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
696 CrossSectionApp csa = new CrossSectionApp("Querprofile");
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
697 csa.pack();
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
698 RefineryUtilities.centerFrameOnScreen(csa);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
699 csa.setVisible(true);
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
700 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
701 }
759808931a2e Add Swing standalone app to test/develope cross sections directly from database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
702 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org