1 45 46 package org.jfree.chart.plot; 47 48 import java.awt.Paint ; 49 import java.awt.Stroke ; 50 51 import org.jfree.chart.event.MarkerChangeEvent; 52 53 57 public class ValueMarker extends Marker { 58 59 60 private double value; 61 62 67 public ValueMarker(double value) { 68 super(); 69 this.value = value; 70 } 71 72 79 public ValueMarker(double value, Paint paint, Stroke stroke) { 80 this(value, paint, stroke, paint, stroke, 1.0f); 81 } 82 83 93 public ValueMarker(double value, Paint paint, Stroke stroke, 94 Paint outlinePaint, Stroke outlineStroke, float alpha) { 95 super(paint, stroke, paint, stroke, alpha); 96 this.value = value; 97 } 98 99 104 public double getValue() { 105 return this.value; 106 } 107 108 116 public void setValue(double value) { 117 this.value = value; 118 notifyListeners(new MarkerChangeEvent(this)); 119 } 120 121 136 public boolean equals(Object obj) { 137 if (obj == this) { 138 return true; 139 } 140 if (!super.equals(obj)) { 141 return false; 142 } 143 if (!(obj instanceof ValueMarker)) { 144 return false; 145 } 146 ValueMarker that = (ValueMarker) obj; 147 if (this.value != that.value) { 148 return false; 149 } 150 return true; 151 } 152 } 153 | Popular Tags |