comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 2710:013882485011

Cosmetics (docs). flys-artifacts/trunk@4432 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 16 May 2012 20:17:24 +0000
parents d8444fcb4e44
children fa8ae7dbcb72
comparison
equal deleted inserted replaced
2709:cd6bcca17de6 2710:013882485011
105 } 105 }
106 range = Range.combine(range, subRange); 106 range = Range.combine(range, subRange);
107 } 107 }
108 108
109 109
110 /** Add a dataset to internal list for this axis. */
110 @Override 111 @Override
111 public void addDataset(XYDataset dataset) { 112 public void addDataset(XYDataset dataset) {
112 datasets.add(dataset); 113 datasets.add(dataset);
113 includeYRange(((XYSeriesCollection) dataset).getSeries(0)); 114 includeYRange(((XYSeriesCollection) dataset).getSeries(0));
114 } 115 }
117 public void addDataset(XYSeries series) { 118 public void addDataset(XYSeries series) {
118 addDataset(new XYSeriesCollection(series)); 119 addDataset(new XYSeriesCollection(series));
119 } 120 }
120 121
121 122
123 /** Set Range for this axis. */
122 @Override 124 @Override
123 public void setRange(Range range) { 125 public void setRange(Range range) {
124 this.range = range; 126 this.range = range;
125 } 127 }
126 128
127 129
130 /** Get Range for this axis. */
128 @Override 131 @Override
129 public Range getRange() { 132 public Range getRange() {
130 return range; 133 return range;
131 } 134 }
132 135
133 136
137 /** Get Array of Datasets. */
134 @Override 138 @Override
135 public XYDataset[] getDatasets() { 139 public XYDataset[] getDatasets() {
136 return (XYDataset[]) 140 return (XYDataset[])
137 datasets.toArray(new XYDataset[datasets.size()]); 141 datasets.toArray(new XYDataset[datasets.size()]);
138 } 142 }
139 143
144
145 /** Add a Dataset that describes an area. */
140 public void addArea(StyledAreaSeriesCollection series) { 146 public void addArea(StyledAreaSeriesCollection series) {
141 this.datasets.add(series); 147 this.datasets.add(series);
142 } 148 }
143 149
144 // TODO obsolete? 150 // TODO obsolete?
170 public int getPlotAxisIndex() { 176 public int getPlotAxisIndex() {
171 return this.plotAxisIndex; 177 return this.plotAxisIndex;
172 } 178 }
173 } // class AxisDataset 179 } // class AxisDataset
174 180
181 /** Enumerator over existing axes. */
175 protected abstract YAxisWalker getYAxisWalker(); 182 protected abstract YAxisWalker getYAxisWalker();
176 183
177 public static final int AXIS_SPACE = 5; 184 public static final int AXIS_SPACE = 5;
178 185
179 /** The logger that is used in this generator. */ 186 /** The logger that is used in this generator. */
620 return false; 627 return false;
621 } 628 }
622 629
623 630
624 /** 631 /**
625 * This method extracts the minimum and maximum values for x and y axes 632 * Extract the minimum and maximum values for x and y axes
626 * which are stored in <i>xRanges</i> and <i>yRanges</i>. 633 * which are stored in <i>xRanges</i> and <i>yRanges</i>.
627 * 634 *
628 * @param index The index of the y-Axis. 635 * @param index The index of the y-Axis.
629 * 636 *
630 * @return a Range[] as follows: [x-Range, y-Range]. 637 * @return a Range[] as follows: [x-Range, y-Range].
652 new Range(ry.getLower().doubleValue(), ry.getUpper().doubleValue()) 659 new Range(ry.getLower().doubleValue(), ry.getUpper().doubleValue())
653 }; 660 };
654 } 661 }
655 662
656 663
664 /** Get X (usually horizontal) extent for given axis. */
657 @Override 665 @Override
658 public Bounds getXBounds(int axis) { 666 public Bounds getXBounds(int axis) {
659 return xBounds.get(axis); 667 return xBounds.get(axis);
660 } 668 }
661 669
662 670
671 /** Set X (usually horizontal) extent for given axis. */
663 @Override 672 @Override
664 protected void setXBounds(int axis, Bounds bounds) { 673 protected void setXBounds(int axis, Bounds bounds) {
665 xBounds.put(axis, bounds); 674 xBounds.put(axis, bounds);
666 } 675 }
667 676
668 677
678 /** Get Y (usually vertical) extent for given axis. */
669 @Override 679 @Override
670 public Bounds getYBounds(int axis) { 680 public Bounds getYBounds(int axis) {
671 return yBounds.get(axis); 681 return yBounds.get(axis);
672 } 682 }
673 683
674 684
685 /** Set Y (usually vertical) extent for given axis. */
675 @Override 686 @Override
676 protected void setYBounds(int axis, Bounds bounds) { 687 protected void setYBounds(int axis, Bounds bounds) {
677 yBounds.put(axis, bounds); 688 yBounds.put(axis, bounds);
678 } 689 }
679 690
1104 return null; 1115 return null;
1105 } 1116 }
1106 if (items.size() == 1) { 1117 if (items.size() == 1) {
1107 return items.get(0).getLabel(); 1118 return items.get(0).getLabel();
1108 } 1119 }
1120
1109 // TODO consider using regionMathches for implementation. 1121 // TODO consider using regionMathches for implementation.
1110 int lastMatchedChar = 0; 1122 int lastMatchedChar = 0;
1111 boolean first = true; 1123 boolean first = true;
1112 String startPattern = ""; 1124 String startPattern = "";
1113 String endPattern = ""; 1125 String endPattern = "";

http://dive4elements.wald.intevation.org