1 43 44 package org.jfree.chart.needle; 45 46 import java.awt.Graphics2D ; 47 import java.awt.geom.Point2D ; 48 import java.awt.geom.Rectangle2D ; 49 import java.io.Serializable ; 50 51 57 public class WindNeedle extends ArrowNeedle implements Serializable { 58 59 60 private static final long serialVersionUID = -2861061368907167834L; 61 62 65 public WindNeedle() { 66 super(false); } 68 69 77 protected void drawNeedle(Graphics2D g2, Rectangle2D plotArea, 78 Point2D rotate, double angle) { 79 80 super.drawNeedle(g2, plotArea, rotate, angle); 81 if ((rotate != null) && (plotArea != null)) { 82 83 int spacing = getSize() * 3; 84 Rectangle2D newArea = new Rectangle2D.Double (); 85 86 Point2D newRotate = rotate; 87 newArea.setRect( 88 plotArea.getMinX() - spacing, plotArea.getMinY(), 89 plotArea.getWidth(), plotArea.getHeight() 90 ); 91 super.drawNeedle(g2, newArea, newRotate, angle); 92 93 newArea.setRect( 94 plotArea.getMinX() + spacing, plotArea.getMinY(), 95 plotArea.getWidth(), plotArea.getHeight() 96 ); 97 super.drawNeedle(g2, newArea, newRotate, angle); 98 99 } 100 } 101 102 109 public boolean equals(Object object) { 110 if (object == null) { 111 return false; 112 } 113 if (object == this) { 114 return true; 115 } 116 if (super.equals(object) && object instanceof WindNeedle) { 117 return true; 118 } 119 return false; 120 } 121 122 } 123 124 | Popular Tags |