comparison flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 2000:e71719483546

Improved the ChartSettings - now, each chart writes proper AxisSections into the ChartSettings. flys-artifacts/trunk@3441 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 16 Dec 2011 13:37:58 +0000
parents 210020108ca4
children 3c3693e9c538
comparison
equal deleted inserted replaced
1999:02ce03329ef5 2000:e71719483546
98 public LongitudinalSectionGenerator() { 98 public LongitudinalSectionGenerator() {
99 super(); 99 super();
100 } 100 }
101 101
102 102
103 @Override
104 protected YAxisWalker getYAxisWalker() {
105 return new YAxisWalker() {
106 @Override
107 public int length() {
108 return YAXIS.values().length;
109 }
110
111 @Override
112 public String getId(int idx) {
113 YAXIS[] yaxes = YAXIS.values();
114 return yaxes[idx].toString();
115 }
116 };
117 }
118
119
103 public boolean isInverted() { 120 public boolean isInverted() {
104 return inverted; 121 return inverted;
105 } 122 }
106 123
107 124
461 478
462 return prefix != null && prefix.length() > 0 479 return prefix != null && prefix.length() > 0
463 ? prefix + "(" + name +")" 480 ? prefix + "(" + name +")"
464 : name; 481 : name;
465 } 482 }
466
467
468 @Override
469 protected List<Section> buildAxisSections() {
470 List<Section> axisSections = super.buildAxisSections();
471
472 for (YAXIS axis: YAXIS.values()) {
473 String identifier = axis.toString();
474
475 AxisSection axisSection = new AxisSection();
476 axisSection.setIdentifier(identifier);
477 axisSection.setLabel(getYAxisLabel(axis.idx));
478 axisSection.setFontSize(14);
479 axisSection.setFixed(false);
480
481 // XXX We are able to find better default ranges that [0,0], the
482 // only problem is, that we do NOT have a better range than [0,0]
483 // for each axis, because the initial chart will not have a dataset
484 // for each axis set!
485 axisSection.setUpperRange(0d);
486 axisSection.setLowerRange(0d);
487
488 axisSections.add(axisSection);
489 }
490
491 return axisSections;
492 }
493 } 483 }
494 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 484 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org