|
jfreechart example source code file (XYShapeAnnotation.java)
The jfreechart XYShapeAnnotation.java source code
/* ===========================================================
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
* (C) Copyright 2000-2008, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
* in the United States and other countries.]
*
* ----------------------
* XYShapeAnnotation.java
* ----------------------
* (C) Copyright 2003-2008, by Ondax, Inc. and Contributors.
*
* Original Author: Greg Steckman (for Ondax, Inc.);
* Contributor(s): David Gilbert (for Object Refinery Limited);
*
* Changes:
* --------
* 15-Aug-2003 : Version 1, adapted from
* org.jfree.chart.annotations.XYLineAnnotation (GS);
* 21-Jan-2004 : Update for renamed method in ValueAxis (DG);
* 20-Apr-2004 : Added new constructor and fixed bug 934258 (DG);
* 29-Sep-2004 : Added 'fillPaint' to allow for colored shapes, now extends
* AbstractXYAnnotation to add tool tip and URL support, and
* implemented equals() and Cloneable (DG);
* 21-Jan-2005 : Modified constructor for consistency with other
* constructors (DG);
* 06-Jun-2005 : Fixed equals() method to handle GradientPaint (DG);
* ------------- JFREECHART 1.0.x ---------------------------------------------
* 24-Oct-2006 : Calculate AffineTransform on shape's bounding rectangle
* rather than sample points (0, 0) and (1, 1) (DG);
* 06-Mar-2007 : Implemented hashCode() (DG);
*
*/
package org.jfree.chart.annotations;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import org.jfree.chart.HashUtilities;
import org.jfree.chart.axis.ValueAxis;
import org.jfree.chart.plot.Plot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.PlotRenderingInfo;
import org.jfree.chart.plot.XYPlot;
import org.jfree.io.SerialUtilities;
import org.jfree.ui.RectangleEdge;
import org.jfree.util.ObjectUtilities;
import org.jfree.util.PaintUtilities;
import org.jfree.util.PublicCloneable;
/**
* A simple <code>Shape annotation that can be placed on an
* {@link XYPlot}. The shape coordinates are specified in data space.
*/
public class XYShapeAnnotation extends AbstractXYAnnotation
implements Cloneable, PublicCloneable, Serializable {
/** For serialization. */
private static final long serialVersionUID = -8553218317600684041L;
/** The shape. */
private transient Shape shape;
/** The stroke used to draw the shape's outline. */
private transient Stroke stroke;
/** The paint used to draw the shape's outline. */
private transient Paint outlinePaint;
/** The paint used to fill the shape. */
private transient Paint fillPaint;
/**
* Creates a new annotation (where, by default, the shape is drawn
* with a black outline).
*
* @param shape the shape (coordinates in data space, <code>null
* not permitted).
*/
public XYShapeAnnotation(Shape shape) {
this(shape, new BasicStroke(1.0f), Color.black);
}
/**
* Creates a new annotation where the shape is drawn as an outline using
* the specified <code>stroke and
Other jfreechart examples (source code examples)Here is a short list of links related to this jfreechart XYShapeAnnotation.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.