comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/charts/CrossSectionApp.java @ 4785:522b424c9c2a

CrossSectionApp: Doc and whitespace cosmetics.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 08 Jan 2013 12:33:27 +0100
parents 975f608dd254
children
comparison
equal deleted inserted replaced
4784:170cf87a042a 4785:522b424c9c2a
76 import org.jfree.data.xy.XYSeriesCollection; 76 import org.jfree.data.xy.XYSeriesCollection;
77 import org.jfree.chart.renderer.xy.XYItemRenderer; 77 import org.jfree.chart.renderer.xy.XYItemRenderer;
78 78
79 import org.jfree.ui.ApplicationFrame; 79 import org.jfree.ui.ApplicationFrame;
80 import org.jfree.ui.RefineryUtilities; 80 import org.jfree.ui.RefineryUtilities;
81
81 82
82 /** 83 /**
83 * Standalone tech-demo. 84 * Standalone tech-demo.
84 */ 85 */
85 public class CrossSectionApp 86 public class CrossSectionApp
234 .openSession(); 235 .openSession();
235 236
236 JPanel content = createContent(); 237 JPanel content = createContent();
237 content.setPreferredSize(new Dimension(800, 480)); 238 content.setPreferredSize(new Dimension(800, 480));
238 setContentPane(content); 239 setContentPane(content);
239 240 }
240 } 241
241 242
243 /** Query and return CrossSections for named river. */
242 public List<CrossSection> crossSections(String river) { 244 public List<CrossSection> crossSections(String river) {
243 Query query = session.createQuery( 245 Query query = session.createQuery(
244 "from CrossSection where river.name = :river"); 246 "from CrossSection where river.name = :river");
245 query.setParameter("river", river); 247 query.setParameter("river", river);
246 return query.list(); 248 return query.list();
267 } 269 }
268 270
269 public JPanel createContent() { 271 public JPanel createContent() {
270 JPanel panel = new JPanel(new BorderLayout()); 272 JPanel panel = new JPanel(new BorderLayout());
271 273
272
273 JPanel nav = new JPanel(new FlowLayout()); 274 JPanel nav = new JPanel(new FlowLayout());
274 275
275 crossSections = crossSections(RIVER); 276 crossSections = crossSections(RIVER);
276 km2lines = loadAllLines(crossSections); 277 km2lines = loadAllLines(crossSections);
277 278
416 (CrossSectionLineItem)crossSectionLinesCB.getSelectedItem(); 417 (CrossSectionLineItem)crossSectionLinesCB.getSelectedItem();
417 418
418 if (csli == null) { 419 if (csli == null) {
419 return; 420 return;
420 } 421 }
421
422 422
423 double km = Math.round(csli.km.doubleValue() * 1000d)/1000d; 423 double km = Math.round(csli.km.doubleValue() * 1000d)/1000d;
424 424
425 String kmS = String.valueOf(km).replace(".", "-"); 425 String kmS = String.valueOf(km).replace(".", "-");
426 426

http://dive4elements.wald.intevation.org