/** * Tests the entity for equality with an arbitrary object. * * @param obj the object to test against ({@code null} permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChartEntity)) { return false; } JFreeChartEntity that = (JFreeChartEntity) obj; if (!getArea().equals(that.getArea())) { return false; } if (!ObjectUtils.equal(getToolTipText(), that.getToolTipText())) { return false; } if (!ObjectUtils.equal(getURLText(), that.getURLText())) { return false; } if (!(this.chart.equals(that.chart))) { return false; } return true; }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); setArea(SerialUtils.readShape(stream)); }
/** * Returns a hash code for this instance. * * @return A hash code. */ @Override public int hashCode() { int result = 39; result = HashUtils.hashCode(result, getToolTipText()); result = HashUtils.hashCode(result, getURLText()); return result; }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtils.writeShape(getArea(), stream); }
/** * Returns a string representation of the chart entity, useful for * debugging. * * @return A string. */ public String toString() { StringBuffer buf = new StringBuffer("JFreeChartEntity: "); buf.append("tooltip = "); buf.append(getToolTipText()); return buf.toString(); }
entities.add(new JFreeChartEntity((Rectangle2D) chartArea.clone(), this));
/** * Returns a hash code for this instance. * * @return A hash code. */ public int hashCode() { int result = 39; result = HashUtilities.hashCode(result, getToolTipText()); result = HashUtilities.hashCode(result, getURLText()); return result; }
/** * Provides serialization support. * * @param stream the output stream. * * @throws IOException if there is an I/O error. */ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writeShape(getArea(), stream); }
/** * Returns a string representation of the chart entity, useful for * debugging. * * @return A string. */ @Override public String toString() { StringBuilder sb = new StringBuilder("JFreeChartEntity: "); sb.append("tooltip = "); sb.append(getToolTipText()); return sb.toString(); }
entities.add(new JFreeChartEntity((Rectangle2D) chartArea.clone(), this));
/** * Tests the entity for equality with an arbitrary object. * * @param obj the object to test against (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof JFreeChartEntity)) { return false; } JFreeChartEntity that = (JFreeChartEntity) obj; if (!getArea().equals(that.getArea())) { return false; } if (!ObjectUtilities.equal(getToolTipText(), that.getToolTipText())) { return false; } if (!ObjectUtilities.equal(getURLText(), that.getURLText())) { return false; } if (!(this.chart.equals(that.chart))) { return false; } return true; }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); setArea(SerialUtilities.readShape(stream)); }