comparison flys-artifacts/src/main/java/de/intevation/flys/jfree/CollisionFreeXYTextAnnotation.java @ 4048:6ed8ebd48d6e

Removed dead code.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sat, 06 Oct 2012 11:14:23 +0200
parents 0f7abd95c6e2
children
comparison
equal deleted inserted replaced
4047:3dc26ec2558d 4048:6ed8ebd48d6e
1 package de.intevation.flys.jfree; 1 package de.intevation.flys.jfree;
2
3 import org.apache.log4j.Logger;
4 2
5 import java.awt.Shape; 3 import java.awt.Shape;
6 import java.awt.geom.Rectangle2D; 4 import java.awt.geom.Rectangle2D;
7 5
8 import org.jfree.chart.entity.EntityCollection; 6 import org.jfree.chart.entity.EntityCollection;
21 /** 19 /**
22 * Custom Annotations class that is drawn only if no collisions with other 20 * Custom Annotations class that is drawn only if no collisions with other
23 * already drawn CustomAnnotations in current plot are found. 21 * already drawn CustomAnnotations in current plot are found.
24 */ 22 */
25 public class CollisionFreeXYTextAnnotation extends XYTextAnnotation { 23 public class CollisionFreeXYTextAnnotation extends XYTextAnnotation {
26
27 /** Logger for this class. */
28 private static Logger logger =
29 Logger.getLogger(CollisionFreeXYTextAnnotation.class);
30
31 24
32 public CollisionFreeXYTextAnnotation(String text, double x, double y) { 25 public CollisionFreeXYTextAnnotation(String text, double x, double y) {
33 super(text, x, y); 26 super(text, x, y);
34 } 27 }
35 28
80 Shape hotspot = TextUtilities.calculateRotatedStringBounds( 73 Shape hotspot = TextUtilities.calculateRotatedStringBounds(
81 getText(), g2, anchorX, anchorY, getTextAnchor(), 74 getText(), g2, anchorX, anchorY, getTextAnchor(),
82 getRotationAngle(), getRotationAnchor()); 75 getRotationAngle(), getRotationAnchor());
83 76
84 // Deviation from superclass: prevent collision. 77 // Deviation from superclass: prevent collision.
85 Rectangle2D hotspotBox = hotspot.getBounds2D();
86
87 if (JFreeUtil.collides(hotspot, info.getOwner().getEntityCollection(), 78 if (JFreeUtil.collides(hotspot, info.getOwner().getEntityCollection(),
88 XYAnnotationEntity.class)) { 79 XYAnnotationEntity.class)) {
89 return; 80 return;
90 } 81 }
91 82
108 String url = toolTip; 99 String url = toolTip;
109 100
110 if (toolTip != null || url != null) { 101 if (toolTip != null || url != null) {
111 addEntity(info, hotspot, rendererIndex, toolTip, url); 102 addEntity(info, hotspot, rendererIndex, toolTip, url);
112 } 103 }
104 // XXX: DEAD CODE (as long as a hard value is assigned to toolTip
105 /*
113 else { 106 else {
114 addEntity(info, hotspot, rendererIndex, 107 addEntity(info, hotspot, rendererIndex,
115 "CollisionFreeXYTextAnnotation", 108 "CollisionFreeXYTextAnnotation",
116 "CollisionFreeXYTextAnnotation"); 109 "CollisionFreeXYTextAnnotation");
117 } 110 }
111 */
118 } 112 }
119 113
120 /** 114 /**
121 * A utility method for adding an {@link CollisionFreeXYAnnotationEntity} to 115 * A utility method for adding an {@link CollisionFreeXYAnnotationEntity} to
122 * a {@link PlotRenderingInfo} instance. 116 * a {@link PlotRenderingInfo} instance.

http://dive4elements.wald.intevation.org