Source for org.jfree.chart.entity.ContourEntity

   1: /* ===========================================================
   2:  * JFreeChart : a free chart library for the Java(tm) platform
   3:  * ===========================================================
   4:  *
   5:  * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors.
   6:  *
   7:  * Project Info:  http://www.jfree.org/jfreechart/index.html
   8:  *
   9:  * This library is free software; you can redistribute it and/or modify it 
  10:  * under the terms of the GNU Lesser General Public License as published by 
  11:  * the Free Software Foundation; either version 2.1 of the License, or 
  12:  * (at your option) any later version.
  13:  *
  14:  * This library is distributed in the hope that it will be useful, but 
  15:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
  16:  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
  17:  * License for more details.
  18:  *
  19:  * You should have received a copy of the GNU Lesser General Public
  20:  * License along with this library; if not, write to the Free Software
  21:  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
  22:  * USA.  
  23:  *
  24:  * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
  25:  * in the United States and other countries.]
  26:  *
  27:  * ------------------
  28:  * ContourEntity.java
  29:  * ------------------
  30:  * (C) Copyright 2002-2007, by David M. O'Donnell and Contributors.
  31:  *
  32:  * Original Author:  David M. O'Donnell;
  33:  * Contributor(s):   David Gilbert (for Object Refinery Limited);
  34:  *
  35:  * $Id: ContourEntity.java,v 1.3.2.3 2007/02/13 16:04:16 mungady Exp $
  36:  *
  37:  * Changes
  38:  * -------
  39:  * 26-Nov-2002 : Version 1 contributed by David M. O'Donnell (DG);
  40:  * 20-May-2004 : Added equals() and clone() methods and implemented 
  41:  *               Serializable (DG);
  42:  * ------------- JFREECHART 1.0.x ---------------------------------------------
  43:  * 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG);
  44:  *
  45:  */
  46: 
  47: package org.jfree.chart.entity;
  48: 
  49: import java.awt.Shape;
  50: import java.io.Serializable;
  51: 
  52: /**
  53:  * Represents an item on a contour chart.
  54:  *
  55:  * @deprecated This class is no longer supported (as of version 1.0.4).
  56:  */
  57: public class ContourEntity extends ChartEntity 
  58:                            implements Cloneable, Serializable {
  59: 
  60:     /** For serialization. */
  61:     private static final long serialVersionUID = 1249570520505992847L;
  62:     
  63:     /** Holds the index into the dataset for this entity. */
  64:     private int index = -1;
  65: 
  66:     /**
  67:      * Constructor for ContourEntity.
  68:      *
  69:      * @param area  the area.
  70:      * @param toolTipText  the tooltip text.
  71:      */
  72:     public ContourEntity(Shape area, String toolTipText) {
  73:         super(area, toolTipText);
  74:     }
  75: 
  76:     /**
  77:      * Constructor for ContourEntity.
  78:      *
  79:      * @param area  the area.
  80:      * @param toolTipText  the tooltip text.
  81:      * @param urlText  the URL text.
  82:      */
  83:     public ContourEntity(Shape area, String toolTipText, String urlText) {
  84:         super(area, toolTipText, urlText);
  85:     }
  86: 
  87:     /**
  88:      * Returns the index.
  89:      *
  90:      * @return The index.
  91:      */
  92:     public int getIndex() {
  93:         return this.index;
  94:     }
  95: 
  96:     /**
  97:      * Sets the index.
  98:      *
  99:      * @param index  the index.
 100:      */
 101:     public void setIndex(int index) {
 102:         this.index = index;
 103:     }
 104: 
 105:     /**
 106:      * Tests the entity for equality with an arbitrary object.
 107:      * 
 108:      * @param obj  the object (<code>null</code> permitted).
 109:      * 
 110:      * @return A boolean.
 111:      */
 112:     public boolean equals(Object obj) {
 113:         if (obj == this) {
 114:             return true;   
 115:         }
 116:         if (obj instanceof ContourEntity && super.equals(obj)) {
 117:             ContourEntity ce = (ContourEntity) obj;
 118:             if (this.index != ce.index) {
 119:                 return false;   
 120:             }
 121:             return true;
 122:         }
 123:         return false;
 124:     }
 125:     
 126:     /**
 127:      * Returns a clone of the entity.
 128:      * 
 129:      * @return A clone.
 130:      * 
 131:      * @throws CloneNotSupportedException if cloning is not supported.
 132:      */
 133:     public Object clone() throws CloneNotSupportedException {
 134:         return super.clone();
 135:     }
 136:     
 137: }