KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > chart > MarkerLabelPosition


1 /* ======================================
2  * JFreeChart : a free Java chart library
3  * ======================================
4  *
5  * Project Info: http://www.jfree.org/jfreechart/index.html
6  * Project Lead: David Gilbert (david.gilbert@object-refinery.com);
7  *
8  * (C) Copyright 2000-2003, by Object Refinery Limited and Contributors.
9  *
10  * This library is free software; you can redistribute it and/or modify it under the terms
11  * of the GNU Lesser General Public License as published by the Free Software Foundation;
12  * either version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License along with this
19  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20  * Boston, MA 02111-1307, USA.
21  *
22  * ------------------------
23  * MarkerLabelPosition.java
24  * ------------------------
25  * (C) Copyright 2003 by Object Refinery Limited.
26  *
27  * Original Author: David Gilbert (for Object Refinery Limited);
28  * Contributor(s): -;
29  *
30  * $Id: MarkerLabelPosition.java,v 1.4 2003/11/07 13:48:08 mungady Exp $
31  *
32  * Changes:
33  * --------
34  * 21-May-2003 (DG);
35  */

36
37 package org.jfree.chart;
38
39 import java.io.Serializable JavaDoc;
40
41 /**
42  * Used to indicate the position of a label relative to a marker.
43  *
44  * @author David Gilbert
45  */

46 public class MarkerLabelPosition implements Serializable JavaDoc {
47
48     /** Top/left. */
49     public static final MarkerLabelPosition TOP_LEFT
50         = new MarkerLabelPosition("MarkerLabelPosition.TOP_LEFT");
51
52     /** Top/right. */
53     public static final MarkerLabelPosition TOP_RIGHT
54         = new MarkerLabelPosition("MarkerLabelPosition.TOP_RIGHT");
55
56     /** Bottom/left. */
57     public static final MarkerLabelPosition BOTTOM_LEFT
58         = new MarkerLabelPosition("MarkerLabelPosition.BOTTOM_LEFT");
59
60     /** Bottom/right. */
61     public static final MarkerLabelPosition BOTTOM_RIGHT
62         = new MarkerLabelPosition("MarkerLabelPosition.BOTTOM_RIGHT");
63
64     /** The name. */
65     private String JavaDoc name;
66
67     /**
68      * Private constructor.
69      *
70      * @param name the name.
71      */

72     private MarkerLabelPosition(String JavaDoc name) {
73         this.name = name;
74     }
75
76     /**
77      * Returns a string representing the object.
78      *
79      * @return The string.
80      */

81     public String JavaDoc toString() {
82         return this.name;
83     }
84
85     /**
86      * Returns <code>true</code> if this object is equal to the specified object, and
87      * <code>false</code> otherwise.
88      *
89      * @param o the other object.
90      *
91      * @return A boolean.
92      */

93     public boolean equals(Object JavaDoc o) {
94
95         if (this == o) {
96             return true;
97         }
98         if (!(o instanceof MarkerLabelPosition)) {
99             return false;
100         }
101
102         final MarkerLabelPosition order = (MarkerLabelPosition) o;
103         if (!this.name.equals(order.toString())) {
104             return false;
105         }
106
107         return true;
108
109     }
110
111 }
112
Popular Tags