Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 3621:6772e9f9b65f
Deal with inverted axes in longitudinal charts and logos.
flys-artifacts/trunk@5297 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 29 Aug 2012 14:43:26 +0000 |
parents | 97ad960f5579 |
children | 0eca080fc162 |
comparison
equal
deleted
inserted
replaced
3620:1cd6114603d9 | 3621:6772e9f9b65f |
---|---|
114 } | 114 } |
115 }; | 115 }; |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 /** True if x axis has been inverted. */ | |
119 public boolean isInverted() { | 120 public boolean isInverted() { |
120 return inverted; | 121 return inverted; |
121 } | 122 } |
122 | 123 |
123 | 124 |
125 /** Set to true if x axis has been inverted. */ | |
124 public void setInverted(boolean inverted) { | 126 public void setInverted(boolean inverted) { |
125 this.inverted = inverted; | 127 this.inverted = inverted; |
128 } | |
129 | |
130 /** | |
131 * Return left most data points x value (on first axis). | |
132 * Overridden because axis could be inverted. | |
133 */ | |
134 @Override | |
135 protected double getLeftX() { | |
136 if (isInverted()) { | |
137 return (Double)getXBounds(0).getUpper(); | |
138 } | |
139 return (Double)getXBounds(0).getLower(); | |
140 } | |
141 | |
142 | |
143 /** | |
144 * Return right most data points x value (on first axis). | |
145 * Overridden because axis could be inverted. | |
146 */ | |
147 @Override | |
148 protected double getRightX() { | |
149 if (isInverted()) { | |
150 return (Double)getXBounds(0).getLower(); | |
151 } | |
152 return (Double)getXBounds(0).getUpper(); | |
126 } | 153 } |
127 | 154 |
128 | 155 |
129 /** | 156 /** |
130 * Returns the default title for this chart. | 157 * Returns the default title for this chart. |