Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/jfree/EnhancedLineAndShapeRenderer.java @ 3625:f2a5fe968b98
issue814 line labels always visible.
flys-artifacts/trunk@5319 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 30 Aug 2012 14:51:48 +0000 |
parents | 0b9b2a0c4e64 |
children |
comparison
equal
deleted
inserted
replaced
3624:84a19de5f16a | 3625:f2a5fe968b98 |
---|---|
302 Color oldColor = g2.getColor(); | 302 Color oldColor = g2.getColor(); |
303 g2.setFont(this.getLineLabelFont(series)); | 303 g2.setFont(this.getLineLabelFont(series)); |
304 g2.setColor(this.getLineLabelTextColor(series)); | 304 g2.setColor(this.getLineLabelTextColor(series)); |
305 g2.setBackground(Color.black); | 305 g2.setBackground(Color.black); |
306 | 306 |
307 // Try to always display label if the data is visible. | |
308 if (!isPointInRect(dataArea, xx, yy)) { | |
309 // Move into the data area. | |
310 xx = Math.max(xx, dataArea.getMinX()); | |
311 xx = Math.min(xx, dataArea.getMaxX()); | |
312 yy = Math.max(yy, dataArea.getMinY()); | |
313 yy = Math.min(yy, dataArea.getMaxY()); | |
314 } | |
315 | |
307 // Move to right until no collisions exist anymore | 316 // Move to right until no collisions exist anymore |
308 Shape hotspot = TextUtilities.calculateRotatedStringBounds( | 317 Shape hotspot = TextUtilities.calculateRotatedStringBounds( |
309 waterlevelLabel, g2, (float)xx, (float)yy-3f, | 318 waterlevelLabel, g2, (float)xx, (float)yy-3f, |
310 TextAnchor.CENTER_LEFT, | 319 TextAnchor.CENTER_LEFT, |
311 0f, TextAnchor.CENTER_LEFT); | 320 0f, TextAnchor.CENTER_LEFT); |