From: <mu...@us...> - 2008-06-24 08:35:06
|
Revision: 1219 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=1219&view=rev Author: mungady Date: 2008-06-24 01:35:01 -0700 (Tue, 24 Jun 2008) Log Message: ----------- Whitespace. Modified Paths: -------------- trunk/source/org/jfree/chart/plot/dial/DialLayerChangeEvent.java trunk/source/org/jfree/chart/plot/dial/DialLayerChangeListener.java trunk/source/org/jfree/chart/plot/dial/DialPlot.java trunk/source/org/jfree/chart/plot/dial/DialPointer.java trunk/source/org/jfree/chart/plot/dial/DialScale.java Modified: trunk/source/org/jfree/chart/plot/dial/DialLayerChangeEvent.java =================================================================== --- trunk/source/org/jfree/chart/plot/dial/DialLayerChangeEvent.java 2008-06-24 08:34:35 UTC (rev 1218) +++ trunk/source/org/jfree/chart/plot/dial/DialLayerChangeEvent.java 2008-06-24 08:35:01 UTC (rev 1219) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (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 + * 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 + * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ------------------------- * DialLayerChangeEvent.java * ------------------------- - * (C) Copyright 2006-2007, by Object Refinery Limited. + * (C) Copyright 2006-2008, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -43,9 +43,9 @@ import org.jfree.chart.event.ChartChangeEvent; /** - * An event that can be forwarded to any {@link DialLayerChangeListener} to + * An event that can be forwarded to any {@link DialLayerChangeListener} to * signal a change to a {@link DialLayer}. - * + * * @since 1.0.7 */ public class DialLayerChangeEvent extends ChartChangeEvent { Modified: trunk/source/org/jfree/chart/plot/dial/DialLayerChangeListener.java =================================================================== --- trunk/source/org/jfree/chart/plot/dial/DialLayerChangeListener.java 2008-06-24 08:34:35 UTC (rev 1218) +++ trunk/source/org/jfree/chart/plot/dial/DialLayerChangeListener.java 2008-06-24 08:35:01 UTC (rev 1219) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (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 + * 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 + * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ---------------------------- * DialLayerChangeListener.java * ---------------------------- - * (C) Copyright 2006-2007, by Object Refinery Limited. + * (C) Copyright 2006-2008, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -35,7 +35,7 @@ * Changes * ------- * 06-Nov-2006 : Version 1 (DG); - * + * */ package org.jfree.chart.plot.dial; @@ -43,18 +43,18 @@ import java.util.EventListener; /** - * The interface via which an object is notified of changes to a + * The interface via which an object is notified of changes to a * {@link DialLayer}. The {@link DialPlot} class listens for changes to its * layers in this way. - * + * * @since 1.0.7 */ public interface DialLayerChangeListener extends EventListener { - + /** - * A call-back method for receiving notification of a change to a + * A call-back method for receiving notification of a change to a * {@link DialLayer}. - * + * * @param event the event. */ public void dialLayerChanged(DialLayerChangeEvent event); Modified: trunk/source/org/jfree/chart/plot/dial/DialPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/dial/DialPlot.java 2008-06-24 08:34:35 UTC (rev 1218) +++ trunk/source/org/jfree/chart/plot/dial/DialPlot.java 2008-06-24 08:35:01 UTC (rev 1219) @@ -6,22 +6,22 @@ * * 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 + * 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 + * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ------------- @@ -41,7 +41,7 @@ * 24-Oct-2007 : Maintain pointers in their own list, so they can be * drawn after other layers (DG); * 15-Feb-2007 : Fixed clipping bug (1873160) (DG); - * + * */ package org.jfree.chart.plot.dial; @@ -68,7 +68,7 @@ /** * A dial plot. - * + * * @since 1.0.7 */ public class DialPlot extends Plot implements DialLayerChangeListener { @@ -77,27 +77,27 @@ * The background layer (optional). */ private DialLayer background; - + /** * The needle cap (optional). */ private DialLayer cap; - + /** * The dial frame. */ private DialFrame dialFrame; - + /** * The dataset(s) for the dial plot. */ private ObjectList datasets; - + /** - * The scale(s) for the dial plot. + * The scale(s) for the dial plot. */ private ObjectList scales; - + /** Storage for keys that map datasets to scales. */ private ObjectList datasetToScaleMap; @@ -105,42 +105,42 @@ * The drawing layers for the dial plot. */ private List layers; - - /** + + /** * The pointer(s) for the dial. */ private List pointers; - + /** * The x-coordinate for the view window. */ private double viewX; - + /** * The y-coordinate for the view window. */ private double viewY; - + /** * The width of the view window, expressed as a percentage. */ private double viewW; - + /** * The height of the view window, expressed as a percentage. */ private double viewH; - - /** + + /** * Creates a new instance of <code>DialPlot</code>. */ public DialPlot() { - this(null); + this(null); } - - /** + + /** * Creates a new instance of <code>DialPlot</code>. - * + * * @param dataset the dataset (<code>null</code> permitted). */ public DialPlot(ValueDataset dataset) { @@ -149,7 +149,7 @@ this.dialFrame = new ArcDialFrame(); this.datasets = new ObjectList(); if (dataset != null) { - this.setDataset(dataset); + this.setDataset(dataset); } this.scales = new ObjectList(); this.datasetToScaleMap = new ObjectList(); @@ -171,7 +171,7 @@ public DialLayer getBackground() { return this.background; } - + /** * Sets the background layer and sends a {@link PlotChangeEvent} to all * registered listeners. @@ -190,7 +190,7 @@ } fireChangeEvent(); } - + /** * Returns the cap. * @@ -201,9 +201,9 @@ public DialLayer getCap() { return this.cap; } - + /** - * Sets the cap and sends a {@link PlotChangeEvent} to all registered + * Sets the cap and sends a {@link PlotChangeEvent} to all registered * listeners. * * @param cap the cap (<code>null</code> permitted). @@ -231,9 +231,9 @@ public DialFrame getDialFrame() { return this.dialFrame; } - + /** - * Sets the dial's frame and sends a {@link PlotChangeEvent} to all + * Sets the dial's frame and sends a {@link PlotChangeEvent} to all * registered listeners. * * @param frame the frame (<code>null</code> not permitted). @@ -253,60 +253,60 @@ /** * Returns the x-coordinate of the viewing rectangle. This is specified * in the range 0.0 to 1.0, relative to the dial's framing rectangle. - * + * * @return The x-coordinate of the viewing rectangle. - * + * * @see #setView(double, double, double, double) */ public double getViewX() { return this.viewX; } - + /** * Returns the y-coordinate of the viewing rectangle. This is specified * in the range 0.0 to 1.0, relative to the dial's framing rectangle. - * + * * @return The y-coordinate of the viewing rectangle. - * + * * @see #setView(double, double, double, double) */ public double getViewY() { return this.viewY; } - + /** * Returns the width of the viewing rectangle. This is specified * in the range 0.0 to 1.0, relative to the dial's framing rectangle. - * + * * @return The width of the viewing rectangle. - * + * * @see #setView(double, double, double, double) */ public double getViewWidth() { return this.viewW; } - + /** * Returns the height of the viewing rectangle. This is specified * in the range 0.0 to 1.0, relative to the dial's framing rectangle. - * + * * @return The height of the viewing rectangle. - * + * * @see #setView(double, double, double, double) */ public double getViewHeight() { return this.viewH; } - + /** * Sets the viewing rectangle, relative to the dial's framing rectangle, * and sends a {@link PlotChangeEvent} to all registered listeners. - * + * * @param x the x-coordinate (in the range 0.0 to 1.0). * @param y the y-coordinate (in the range 0.0 to 1.0). * @param w the width (in the range 0.0 to 1.0). * @param h the height (in the range 0.0 to 1.0). - * + * * @see #getViewX() * @see #getViewY() * @see #getViewWidth() @@ -321,9 +321,9 @@ } /** - * Adds a layer to the plot and sends a {@link PlotChangeEvent} to all + * Adds a layer to the plot and sends a {@link PlotChangeEvent} to all * registered listeners. - * + * * @param layer the layer (<code>null</code> not permitted). */ public void addLayer(DialLayer layer) { @@ -334,12 +334,12 @@ layer.addChangeListener(this); fireChangeEvent(); } - + /** * Returns the index for the specified layer. - * + * * @param layer the layer (<code>null</code> not permitted). - * + * * @return The layer index. */ public int getLayerIndex(DialLayer layer) { @@ -348,11 +348,11 @@ } return this.layers.indexOf(layer); } - + /** - * Removes the layer at the specified index and sends a + * Removes the layer at the specified index and sends a * {@link PlotChangeEvent} to all registered listeners. - * + * * @param index the index. */ public void removeLayer(int index) { @@ -363,22 +363,22 @@ this.layers.remove(index); fireChangeEvent(); } - + /** * Removes the specified layer and sends a {@link PlotChangeEvent} to all * registered listeners. - * + * * @param layer the layer (<code>null</code> not permitted). */ public void removeLayer(DialLayer layer) { // defer argument checking removeLayer(getLayerIndex(layer)); } - + /** - * Adds a pointer to the plot and sends a {@link PlotChangeEvent} to all + * Adds a pointer to the plot and sends a {@link PlotChangeEvent} to all * registered listeners. - * + * * @param pointer the pointer (<code>null</code> not permitted). */ public void addPointer(DialPointer pointer) { @@ -389,12 +389,12 @@ pointer.addChangeListener(this); fireChangeEvent(); } - + /** * Returns the index for the specified pointer. - * + * * @param pointer the pointer (<code>null</code> not permitted). - * + * * @return The pointer index. */ public int getPointerIndex(DialPointer pointer) { @@ -403,11 +403,11 @@ } return this.pointers.indexOf(pointer); } - + /** - * Removes the pointer at the specified index and sends a + * Removes the pointer at the specified index and sends a * {@link PlotChangeEvent} to all registered listeners. - * + * * @param index the index. */ public void removePointer(int index) { @@ -418,11 +418,11 @@ this.pointers.remove(index); fireChangeEvent(); } - + /** * Removes the specified pointer and sends a {@link PlotChangeEvent} to all * registered listeners. - * + * * @param pointer the pointer (<code>null</code> not permitted). */ public void removePointer(DialPointer pointer) { @@ -433,9 +433,9 @@ /** * Returns the dial pointer that is associated with the specified * dataset, or <code>null</code>. - * + * * @param datasetIndex the dataset index. - * + * * @return The pointer. */ public DialPointer getPointerForDataset(int datasetIndex) { @@ -449,7 +449,7 @@ } return result; } - + /** * Returns the primary dataset for the plot. * @@ -475,8 +475,8 @@ } /** - * Sets the dataset for the plot, replacing the existing dataset, if there - * is one, and sends a {@link PlotChangeEvent} to all registered + * Sets the dataset for the plot, replacing the existing dataset, if there + * is one, and sends a {@link PlotChangeEvent} to all registered * listeners. * * @param dataset the dataset (<code>null</code> permitted). @@ -492,7 +492,7 @@ * @param dataset the dataset (<code>null</code> permitted). */ public void setDataset(int index, ValueDataset dataset) { - + ValueDataset existing = (ValueDataset) this.datasets.get(index); if (existing != null) { existing.removeChangeListener(this); @@ -501,11 +501,11 @@ if (dataset != null) { dataset.addChangeListener(this); } - + // send a dataset change event to self... DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); datasetChanged(event); - + } /** @@ -515,29 +515,29 @@ */ public int getDatasetCount() { return this.datasets.size(); - } - + } + /** * Draws the plot. This method is usually called by the {@link JFreeChart} * instance that manages the plot. - * + * * @param g2 the graphics target. * @param area the area in which the plot should be drawn. - * @param anchor the anchor point (typically the last point that the + * @param anchor the anchor point (typically the last point that the * mouse clicked on, <code>null</code> is permitted). * @param parentState the state for the parent plot (if any). - * @param info used to collect plot rendering info (<code>null</code> + * @param info used to collect plot rendering info (<code>null</code> * permitted). */ - public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, + public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info) { - + Shape origClip = g2.getClip(); g2.setClip(area); - + // first, expand the viewing area into a drawing frame Rectangle2D frame = viewToFrame(area); - + // draw the background if there is one... if (this.background != null && this.background.isVisible()) { if (this.background.isClippedToWindow()) { @@ -550,7 +550,7 @@ this.background.draw(g2, this, frame, area); } } - + Iterator iterator = this.layers.iterator(); while (iterator.hasNext()) { DialLayer current = (DialLayer) iterator.next(); @@ -566,7 +566,7 @@ } } } - + // draw the pointers iterator = this.pointers.iterator(); while (iterator.hasNext()) { @@ -596,20 +596,20 @@ this.cap.draw(g2, this, frame, area); } } - + if (this.dialFrame.isVisible()) { this.dialFrame.draw(g2, this, frame, area); } - + g2.setClip(origClip); - + } - + /** * Returns the frame surrounding the specified view rectangle. - * + * * @param view the view rectangle (<code>null</code> not permitted). - * + * * @return The frame rectangle. */ private Rectangle2D viewToFrame(Rectangle2D view) { @@ -619,12 +619,12 @@ double y = view.getY() - (height * this.viewY); return new Rectangle2D.Double(x, y, width, height); } - + /** * Returns the value from the specified dataset. - * + * * @param datasetIndex the dataset index. - * + * * @return The data value. */ public double getValue(int datasetIndex) { @@ -638,11 +638,11 @@ } return result; } - + /** - * Adds a dial scale to the plot and sends a {@link PlotChangeEvent} to + * Adds a dial scale to the plot and sends a {@link PlotChangeEvent} to * all registered listeners. - * + * * @param index the scale index. * @param scale the scale (<code>null</code> not permitted). */ @@ -657,9 +657,9 @@ this.layers.add(scale); this.scales.set(index, scale); scale.addChangeListener(this); - fireChangeEvent(); + fireChangeEvent(); } - + /** * Returns the scale at the given index. * @@ -677,41 +677,41 @@ /** * Maps a dataset to a particular scale. - * + * * @param index the dataset index (zero-based). * @param scaleIndex the scale index (zero-based). */ public void mapDatasetToScale(int index, int scaleIndex) { - this.datasetToScaleMap.set(index, new Integer(scaleIndex)); - fireChangeEvent(); + this.datasetToScaleMap.set(index, new Integer(scaleIndex)); + fireChangeEvent(); } - + /** * Returns the dial scale for a specific dataset. - * + * * @param datasetIndex the dataset index. - * + * * @return The dial scale. */ public DialScale getScaleForDataset(int datasetIndex) { - DialScale result = (DialScale) this.scales.get(0); + DialScale result = (DialScale) this.scales.get(0); Integer scaleIndex = (Integer) this.datasetToScaleMap.get(datasetIndex); if (scaleIndex != null) { result = getScale(scaleIndex.intValue()); } - return result; + return result; } - + /** * A utility method that computes a rectangle using relative radius values. - * + * * @param rect the reference rectangle (<code>null</code> not permitted). * @param radiusW the width radius (must be > 0.0) * @param radiusH the height radius. - * + * * @return A new rectangle. */ - public static Rectangle2D rectangleByRadius(Rectangle2D rect, + public static Rectangle2D rectangleByRadius(Rectangle2D rect, double radiusW, double radiusH) { if (rect == null) { throw new IllegalArgumentException("Null 'rect' argument."); @@ -722,11 +722,11 @@ double h = rect.getHeight() * radiusH; return new Rectangle2D.Double(x - w / 2.0, y - h / 2.0, w, h); } - + /** - * Receives notification when a layer has changed, and responds by + * Receives notification when a layer has changed, and responds by * forwarding a {@link PlotChangeEvent} to all registered listeners. - * + * * @param event the event. */ public void dialLayerChanged(DialLayerChangeEvent event) { @@ -734,8 +734,8 @@ } /** - * Tests this <code>DialPlot</code> instance for equality with an - * arbitrary object. The plot's dataset(s) is (are) not included in + * Tests this <code>DialPlot</code> instance for equality with an + * arbitrary object. The plot's dataset(s) is (are) not included in * the test. * * @param obj the object (<code>null</code> permitted). @@ -782,7 +782,7 @@ /** * Returns a hash code for this instance. - * + * * @return The hash code. */ public int hashCode() { @@ -800,16 +800,16 @@ result = 37 * result + (int) (temp ^ (temp >>> 32)); return result; } - + /** * Returns the plot type. - * + * * @return <code>"DialPlot"</code> */ public String getPlotType() { return "DialPlot"; } - + /** * Provides serialization support. * @@ -829,10 +829,10 @@ * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ - private void readObject(ObjectInputStream stream) + private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); } - + } Modified: trunk/source/org/jfree/chart/plot/dial/DialPointer.java =================================================================== --- trunk/source/org/jfree/chart/plot/dial/DialPointer.java 2008-06-24 08:34:35 UTC (rev 1218) +++ trunk/source/org/jfree/chart/plot/dial/DialPointer.java 2008-06-24 08:35:01 UTC (rev 1219) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (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 + * 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 + * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * ---------------- * DialPointer.java * ---------------- - * (C) Copyright 2006-2007, by Object Refinery Limited. + * (C) Copyright 2006-2008, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -38,9 +38,9 @@ * 17-Oct-2007 : Added equals() overrides (DG); * 24-Oct-2007 : Implemented PublicCloneable, changed default radius, * and added argument checks (DG); - * 23-Nov-2007 : Added fillPaint and outlinePaint attributes to + * 23-Nov-2007 : Added fillPaint and outlinePaint attributes to * DialPointer.Pointer (DG); - * + * */ package org.jfree.chart.plot.dial; @@ -67,101 +67,101 @@ /** * A base class for the pointer in a {@link DialPlot}. - * + * * @since 1.0.7 */ -public abstract class DialPointer extends AbstractDialLayer +public abstract class DialPointer extends AbstractDialLayer implements DialLayer, Cloneable, PublicCloneable, Serializable { - + /** The needle radius. */ double radius; - + /** * The dataset index for the needle. */ int datasetIndex; - - /** + + /** * Creates a new <code>DialPointer</code> instance. */ protected DialPointer() { this(0); } - + /** * Creates a new pointer for the specified dataset. - * + * * @param datasetIndex the dataset index. */ protected DialPointer(int datasetIndex) { this.radius = 0.9; this.datasetIndex = datasetIndex; } - + /** * Returns the dataset index that the pointer maps to. - * + * * @return The dataset index. - * + * * @see #getDatasetIndex() */ public int getDatasetIndex() { return this.datasetIndex; } - + /** - * Sets the dataset index for the pointer and sends a + * Sets the dataset index for the pointer and sends a * {@link DialLayerChangeEvent} to all registered listeners. - * + * * @param index the index. - * + * * @see #getDatasetIndex() */ public void setDatasetIndex(int index) { this.datasetIndex = index; notifyListeners(new DialLayerChangeEvent(this)); } - + /** * Returns the radius of the pointer, as a percentage of the dial's * framing rectangle. - * + * * @return The radius. - * + * * @see #setRadius(double) */ public double getRadius() { return this.radius; } - + /** - * Sets the radius of the pointer and sends a + * Sets the radius of the pointer and sends a * {@link DialLayerChangeEvent} to all registered listeners. - * + * * @param radius the radius. - * + * * @see #getRadius() */ public void setRadius(double radius) { this.radius = radius; notifyListeners(new DialLayerChangeEvent(this)); } - + /** - * Returns <code>true</code> to indicate that this layer should be + * Returns <code>true</code> to indicate that this layer should be * clipped within the dial window. - * + * * @return <code>true</code>. */ public boolean isClippedToWindow() { return true; } - + /** * Checks this instance for equality with an arbitrary object. - * + * * @param obj the object (<code>null</code> not permitted). - * + * * @return A boolean. */ public boolean equals(Object obj) { @@ -180,10 +180,10 @@ } return super.equals(obj); } - + /** * Returns a hash code. - * + * * @return A hash code. */ public int hashCode() { @@ -191,12 +191,12 @@ result = HashUtilities.hashCode(result, this.radius); return result; } - + /** * Returns a clone of the pointer. - * + * * @return a clone. - * + * * @throws CloneNotSupportedException if one of the attributes cannot * be cloned. */ @@ -208,52 +208,52 @@ * A dial pointer that draws a thin line (like a pin). */ public static class Pin extends DialPointer { - + /** For serialization. */ static final long serialVersionUID = -8445860485367689750L; /** The paint. */ private transient Paint paint; - + /** The stroke. */ private transient Stroke stroke; - + /** * Creates a new instance. */ public Pin() { this(0); } - + /** * Creates a new instance. - * + * * @param datasetIndex the dataset index. */ public Pin(int datasetIndex) { super(datasetIndex); this.paint = Color.red; - this.stroke = new BasicStroke(3.0f, BasicStroke.CAP_ROUND, + this.stroke = new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL); } - + /** * Returns the paint. - * + * * @return The paint (never <code>null</code>). - * + * * @see #setPaint(Paint) */ public Paint getPaint() { return this.paint; } - + /** - * Sets the paint and sends a {@link DialLayerChangeEvent} to all + * Sets the paint and sends a {@link DialLayerChangeEvent} to all * registered listeners. - * + * * @param paint the paint (<code>null</code> not permitted). - * + * * @see #getPaint() */ public void setPaint(Paint paint) { @@ -263,24 +263,24 @@ this.paint = paint; notifyListeners(new DialLayerChangeEvent(this)); } - + /** * Returns the stroke. - * + * * @return The stroke (never <code>null</code>). - * + * * @see #setStroke(Stroke) */ public Stroke getStroke() { return this.stroke; } - + /** - * Sets the stroke and sends a {@link DialLayerChangeEvent} to all + * Sets the stroke and sends a {@link DialLayerChangeEvent} to all * registered listeners. - * + * * @param stroke the stroke (<code>null</code> not permitted). - * + * * @see #getStroke() */ public void setStroke(Stroke stroke) { @@ -290,40 +290,40 @@ this.stroke = stroke; notifyListeners(new DialLayerChangeEvent(this)); } - + /** * Draws the pointer. - * + * * @param g2 the graphics target. * @param plot the plot. * @param frame the dial's reference frame. * @param view the dial's view. */ - public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, + public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view) { - + g2.setPaint(this.paint); g2.setStroke(this.stroke); - Rectangle2D arcRect = DialPlot.rectangleByRadius(frame, + Rectangle2D arcRect = DialPlot.rectangleByRadius(frame, this.radius, this.radius); double value = plot.getValue(this.datasetIndex); DialScale scale = plot.getScaleForDataset(this.datasetIndex); double angle = scale.valueToAngle(value); - + Arc2D arc = new Arc2D.Double(arcRect, angle, 0, Arc2D.OPEN); Point2D pt = arc.getEndPoint(); - - Line2D line = new Line2D.Double(frame.getCenterX(), + + Line2D line = new Line2D.Double(frame.getCenterX(), frame.getCenterY(), pt.getX(), pt.getY()); g2.draw(line); } - + /** * Tests this pointer for equality with an arbitrary object. - * + * * @param obj the object (<code>null</code> permitted). - * + * * @return A boolean. */ public boolean equals(Object obj) { @@ -342,10 +342,10 @@ } return super.equals(obj); } - + /** * Returns a hash code for this instance. - * + * * @return A hash code. */ public int hashCode() { @@ -354,7 +354,7 @@ result = HashUtilities.hashCode(result, this.stroke); return result; } - + /** * Provides serialization support. * @@ -376,38 +376,38 @@ * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ - private void readObject(ObjectInputStream stream) + private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.paint = SerialUtilities.readPaint(stream); this.stroke = SerialUtilities.readStroke(stream); } - + } - + /** * A dial pointer. */ public static class Pointer extends DialPointer { - + /** For serialization. */ static final long serialVersionUID = -4180500011963176960L; - + /** * The radius that defines the width of the pointer at the base. */ private double widthRadius; - - /** + + /** * The fill paint. - * + * * @since 1.0.8 */ private transient Paint fillPaint; - - /** + + /** * The outline paint. - * + * * @since 1.0.8 */ private transient Paint outlinePaint; @@ -418,10 +418,10 @@ public Pointer() { this(0); } - + /** * Creates a new instance. - * + * * @param datasetIndex the dataset index. */ public Pointer(int datasetIndex) { @@ -430,52 +430,52 @@ this.fillPaint = Color.gray; this.outlinePaint = Color.black; } - + /** * Returns the width radius. - * + * * @return The width radius. - * + * * @see #setWidthRadius(double) */ public double getWidthRadius() { return this.widthRadius; } - + /** - * Sets the width radius and sends a {@link DialLayerChangeEvent} to + * Sets the width radius and sends a {@link DialLayerChangeEvent} to * all registered listeners. - * + * * @param radius the radius - * + * * @see #getWidthRadius() */ public void setWidthRadius(double radius) { this.widthRadius = radius; notifyListeners(new DialLayerChangeEvent(this)); } - + /** * Returns the fill paint. - * + * * @return The paint (never <code>null</code>). - * + * * @see #setFillPaint(Paint) - * + * * @since 1.0.8 */ public Paint getFillPaint() { return this.fillPaint; } - + /** - * Sets the fill paint and sends a {@link DialLayerChangeEvent} to all + * Sets the fill paint and sends a {@link DialLayerChangeEvent} to all * registered listeners. - * + * * @param paint the paint (<code>null</code> not permitted). - * + * * @see #getFillPaint() - * + * * @since 1.0.8 */ public void setFillPaint(Paint paint) { @@ -485,28 +485,28 @@ this.fillPaint = paint; notifyListeners(new DialLayerChangeEvent(this)); } - + /** * Returns the outline paint. - * + * * @return The paint (never <code>null</code>). - * + * * @see #setOutlinePaint(Paint) - * + * * @since 1.0.8 */ public Paint getOutlinePaint() { return this.outlinePaint; } - + /** - * Sets the outline paint and sends a {@link DialLayerChangeEvent} to + * Sets the outline paint and sends a {@link DialLayerChangeEvent} to * all registered listeners. - * + * * @param paint the paint (<code>null</code> not permitted). - * + * * @see #getOutlinePaint() - * + * * @since 1.0.8 */ public void setOutlinePaint(Paint paint) { @@ -516,38 +516,38 @@ this.outlinePaint = paint; notifyListeners(new DialLayerChangeEvent(this)); } - + /** * Draws the pointer. - * + * * @param g2 the graphics target. * @param plot the plot. * @param frame the dial's reference frame. * @param view the dial's view. */ - public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, + public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view) { - + g2.setPaint(Color.blue); g2.setStroke(new BasicStroke(1.0f)); - Rectangle2D lengthRect = DialPlot.rectangleByRadius(frame, + Rectangle2D lengthRect = DialPlot.rectangleByRadius(frame, this.radius, this.radius); - Rectangle2D widthRect = DialPlot.rectangleByRadius(frame, + Rectangle2D widthRect = DialPlot.rectangleByRadius(frame, this.widthRadius, this.widthRadius); double value = plot.getValue(this.datasetIndex); DialScale scale = plot.getScaleForDataset(this.datasetIndex); double angle = scale.valueToAngle(value); - + Arc2D arc1 = new Arc2D.Double(lengthRect, angle, 0, Arc2D.OPEN); Point2D pt1 = arc1.getEndPoint(); - Arc2D arc2 = new Arc2D.Double(widthRect, angle - 90.0, 180.0, + Arc2D arc2 = new Arc2D.Double(widthRect, angle - 90.0, 180.0, Arc2D.OPEN); Point2D pt2 = arc2.getStartPoint(); Point2D pt3 = arc2.getEndPoint(); - Arc2D arc3 = new Arc2D.Double(widthRect, angle - 180.0, 0.0, + Arc2D arc3 = new Arc2D.Double(widthRect, angle - 180.0, 0.0, Arc2D.OPEN); Point2D pt4 = arc3.getStartPoint(); - + GeneralPath gp = new GeneralPath(); gp.moveTo((float) pt1.getX(), (float) pt1.getY()); gp.lineTo((float) pt2.getX(), (float) pt2.getY()); @@ -556,33 +556,33 @@ gp.closePath(); g2.setPaint(this.fillPaint); g2.fill(gp); - + g2.setPaint(this.outlinePaint); - Line2D line = new Line2D.Double(frame.getCenterX(), + Line2D line = new Line2D.Double(frame.getCenterX(), frame.getCenterY(), pt1.getX(), pt1.getY()); g2.draw(line); - + line.setLine(pt2, pt3); g2.draw(line); - + line.setLine(pt3, pt1); g2.draw(line); - + line.setLine(pt2, pt1); g2.draw(line); - + line.setLine(pt2, pt4); g2.draw(line); line.setLine(pt3, pt4); g2.draw(line); } - + /** * Tests this pointer for equality with an arbitrary object. - * + * * @param obj the object (<code>null</code> permitted). - * + * * @return A boolean. */ public boolean equals(Object obj) { @@ -593,7 +593,7 @@ return false; } DialPointer.Pointer that = (DialPointer.Pointer) obj; - + if (this.widthRadius != that.widthRadius) { return false; } @@ -605,10 +605,10 @@ } return super.equals(obj); } - + /** * Returns a hash code for this instance. - * + * * @return A hash code. */ public int hashCode() { @@ -618,7 +618,7 @@ result = HashUtilities.hashCode(result, this.outlinePaint); return result; } - + /** * Provides serialization support. * @@ -640,13 +640,13 @@ * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */ - private void readObject(ObjectInputStream stream) + private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.fillPaint = SerialUtilities.readPaint(stream); this.outlinePaint = SerialUtilities.readPaint(stream); } - + } } Modified: trunk/source/org/jfree/chart/plot/dial/DialScale.java =================================================================== --- trunk/source/org/jfree/chart/plot/dial/DialScale.java 2008-06-24 08:34:35 UTC (rev 1218) +++ trunk/source/org/jfree/chart/plot/dial/DialScale.java 2008-06-24 08:35:01 UTC (rev 1219) @@ -2,32 +2,32 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. + * (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 + * 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 + * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] * * -------------- * DialScale.java * -------------- - * (C) Copyright 2006-2007, by Object Refinery Limited. + * (C) Copyright 2006-2008, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -36,40 +36,40 @@ * ------- * 03-Nov-2006 : Version 1 (DG); * 17-Oct-2007 : Made this an extension of the DialLayer interface (DG); - * + * */ package org.jfree.chart.plot.dial; /** - * A dial scale is a specialised layer that has the ability to convert data + * A dial scale is a specialised layer that has the ability to convert data * values into angles. - * + * * @since 1.0.7 */ public interface DialScale extends DialLayer { - + /** - * Converts a data value to an angle (in degrees, using the same + * Converts a data value to an angle (in degrees, using the same * specification as Java's Arc2D class). * * @param value the data value. * * @return The angle in degrees. - * + * * @see #angleToValue(double) */ public double valueToAngle(double value); - + /** * Converts an angle (in degrees) to a data value. * * @param angle the angle (in degrees). * * @return The data value. - * + * * @see #valueToAngle(double) */ public double angleToValue(double angle); - + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |