Source Code Cross Referenced for IntervalMarker.java in  » Chart » jfreechart » org » jfree » chart » plot » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Chart » jfreechart » org.jfree.chart.plot 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* ===========================================================
002:         * JFreeChart : a free chart library for the Java(tm) platform
003:         * ===========================================================
004:         *
005:         * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors.
006:         *
007:         * Project Info:  http://www.jfree.org/jfreechart/index.html
008:         *
009:         * This library is free software; you can redistribute it and/or modify it 
010:         * under the terms of the GNU Lesser General Public License as published by 
011:         * the Free Software Foundation; either version 2.1 of the License, or 
012:         * (at your option) any later version.
013:         *
014:         * This library is distributed in the hope that it will be useful, but 
015:         * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
016:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
017:         * License for more details.
018:         *
019:         * You should have received a copy of the GNU Lesser General Public
020:         * License along with this library; if not, write to the Free Software
021:         * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
022:         * USA.  
023:         *
024:         * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
025:         * in the United States and other countries.]
026:         *
027:         * -------------------
028:         * IntervalMarker.java
029:         * -------------------
030:         * (C) Copyright 2002-2006, by Object Refinery Limited.
031:         *
032:         * Original Author:  David Gilbert (for Object Refinery Limited);
033:         * Contributor(s):   -;
034:         *
035:         * $Id: IntervalMarker.java,v 1.6.2.4 2006/10/25 15:47:16 mungady Exp $
036:         *
037:         * Changes (since 20-Aug-2002)
038:         * --------------------------
039:         * 20-Aug-2002 : Added stroke to constructor in Marker class (DG);
040:         * 02-Oct-2002 : Fixed errors reported by Checkstyle (DG);
041:         * 26-Mar-2003 : Implemented Serializable (DG);
042:         * ------------- JFREECHART 1.0.x ---------------------------------------------
043:         * 05-Sep-2006 : Added MarkerChangeEvent notification (DG);
044:         *
045:         */
046:
047:        package org.jfree.chart.plot;
048:
049:        import java.awt.BasicStroke;
050:        import java.awt.Color;
051:        import java.awt.Paint;
052:        import java.awt.Stroke;
053:        import java.io.Serializable;
054:
055:        import org.jfree.chart.event.MarkerChangeEvent;
056:        import org.jfree.ui.GradientPaintTransformer;
057:        import org.jfree.ui.LengthAdjustmentType;
058:        import org.jfree.util.ObjectUtilities;
059:
060:        /**
061:         * Represents an interval to be highlighted in some way.
062:         */
063:        public class IntervalMarker extends Marker implements  Cloneable,
064:                Serializable {
065:
066:            /** For serialization. */
067:            private static final long serialVersionUID = -1762344775267627916L;
068:
069:            /** The start value. */
070:            private double startValue;
071:
072:            /** The end value. */
073:            private double endValue;
074:
075:            /** The gradient paint transformer (optional). */
076:            private GradientPaintTransformer gradientPaintTransformer;
077:
078:            /**
079:             * Constructs an interval marker.
080:             *
081:             * @param start  the start of the interval.
082:             * @param end  the end of the interval.
083:             */
084:            public IntervalMarker(double start, double end) {
085:                this (start, end, Color.gray, new BasicStroke(0.5f), Color.gray,
086:                        new BasicStroke(0.5f), 0.8f);
087:            }
088:
089:            /**
090:             * Constructs an interval marker.
091:             *
092:             * @param start  the start of the interval.
093:             * @param end  the end of the interval.
094:             * @param paint  the paint.
095:             * @param stroke  the stroke.
096:             * @param outlinePaint  the outline paint.
097:             * @param outlineStroke  the outline stroke.
098:             * @param alpha  the alpha transparency.
099:             */
100:            public IntervalMarker(double start, double end, Paint paint,
101:                    Stroke stroke, Paint outlinePaint, Stroke outlineStroke,
102:                    float alpha) {
103:
104:                super (paint, stroke, outlinePaint, outlineStroke, alpha);
105:                this .startValue = start;
106:                this .endValue = end;
107:                this .gradientPaintTransformer = null;
108:                setLabelOffsetType(LengthAdjustmentType.CONTRACT);
109:
110:            }
111:
112:            /**
113:             * Returns the start value for the interval.
114:             *
115:             * @return The start value.
116:             */
117:            public double getStartValue() {
118:                return this .startValue;
119:            }
120:
121:            /**
122:             * Sets the start value for the marker and sends a 
123:             * {@link MarkerChangeEvent} to all registered listeners.
124:             * 
125:             * @param value  the value.
126:             * 
127:             * @since 1.0.3
128:             */
129:            public void setStartValue(double value) {
130:                this .startValue = value;
131:                notifyListeners(new MarkerChangeEvent(this ));
132:            }
133:
134:            /**
135:             * Returns the end value for the interval.
136:             *
137:             * @return The end value.
138:             */
139:            public double getEndValue() {
140:                return this .endValue;
141:            }
142:
143:            /**
144:             * Sets the end value for the marker and sends a 
145:             * {@link MarkerChangeEvent} to all registered listeners.
146:             * 
147:             * @param value  the value.
148:             * 
149:             * @since 1.0.3
150:             */
151:            public void setEndValue(double value) {
152:                this .endValue = value;
153:                notifyListeners(new MarkerChangeEvent(this ));
154:            }
155:
156:            /**
157:             * Returns the gradient paint transformer.
158:             * 
159:             * @return The gradient paint transformer (possibly <code>null</code>).
160:             */
161:            public GradientPaintTransformer getGradientPaintTransformer() {
162:                return this .gradientPaintTransformer;
163:            }
164:
165:            /**
166:             * Sets the gradient paint transformer and sends a 
167:             * {@link MarkerChangeEvent} to all registered listeners.
168:             * 
169:             * @param transformer  the transformer (<code>null</code> permitted).
170:             */
171:            public void setGradientPaintTransformer(
172:                    GradientPaintTransformer transformer) {
173:                this .gradientPaintTransformer = transformer;
174:                notifyListeners(new MarkerChangeEvent(this ));
175:            }
176:
177:            /**
178:             * Tests the marker for equality with an arbitrary object.
179:             * 
180:             * @param obj  the object (<code>null</code> permitted).
181:             * 
182:             * @return A boolean.
183:             */
184:            public boolean equals(Object obj) {
185:                if (obj == this ) {
186:                    return true;
187:                }
188:                if (!(obj instanceof  IntervalMarker)) {
189:                    return false;
190:                }
191:                if (!super .equals(obj)) {
192:                    return false;
193:                }
194:                IntervalMarker that = (IntervalMarker) obj;
195:                if (this .startValue != that.startValue) {
196:                    return false;
197:                }
198:                if (this .endValue != that.endValue) {
199:                    return false;
200:                }
201:                if (!ObjectUtilities.equal(this .gradientPaintTransformer,
202:                        that.gradientPaintTransformer)) {
203:                    return false;
204:                }
205:                return true;
206:            }
207:
208:            /**
209:             * Returns a clone of the marker.
210:             * 
211:             * @return A clone.
212:             * 
213:             * @throws CloneNotSupportedException Not thrown by this class, but the 
214:             *         exception is declared for the use of subclasses.
215:             */
216:            public Object clone() throws CloneNotSupportedException {
217:                return super.clone();
218:            }
219:
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.