From: <mu...@us...> - 2007-06-19 13:15:20
|
Revision: 3 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=3&view=rev Author: mungady Date: 2007-06-19 06:15:18 -0700 (Tue, 19 Jun 2007) Log Message: ----------- 2007-06-19 David Gilbert <dav...@ob...> * source/org/jfree/chart/axis/CategoryAxis.java (drawCategoryLabels): Removed (previously deprecated). Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/axis/CategoryAxis.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-19 10:05:26 UTC (rev 2) +++ trunk/ChangeLog 2007-06-19 13:15:18 UTC (rev 3) @@ -1,3 +1,10 @@ +2007-06-19 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/axis/CategoryAxis.java + (drawCategoryLabels): Removed (previously deprecated). + +---------- JFREECHART 1.0.6 RELEASED ------------------------ + 2007-06-15 David Gilbert <dav...@ob...> * swt/org/jfree/experimental/swt/SWTGraphics2D.java Modified: trunk/source/org/jfree/chart/axis/CategoryAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/CategoryAxis.java 2007-06-19 10:05:26 UTC (rev 2) +++ trunk/source/org/jfree/chart/axis/CategoryAxis.java 2007-06-19 13:15:18 UTC (rev 3) @@ -83,6 +83,7 @@ * 30-Oct-2006 : Updated refreshTicks() method to account for possibility of * multiple domain axes (DG); * 07-Mar-2007 : Fixed bug in axis label positioning (DG); + * 19-Jun-2007 : Removed deprecated code (DG); * */ @@ -827,34 +828,6 @@ return state; } - - /** - * Draws the category labels and returns the updated axis state. - * - * @param g2 the graphics device (<code>null</code> not permitted). - * @param dataArea the area inside the axes (<code>null</code> not - * permitted). - * @param edge the axis location (<code>null</code> not permitted). - * @param state the axis state (<code>null</code> not permitted). - * @param plotState collects information about the plot (<code>null</code> - * permitted). - * - * @return The updated axis state (never <code>null</code>). - * - * @deprecated Use {@link #drawCategoryLabels(Graphics2D, Rectangle2D, - * Rectangle2D, RectangleEdge, AxisState, PlotRenderingInfo)}. - */ - protected AxisState drawCategoryLabels(Graphics2D g2, - Rectangle2D dataArea, - RectangleEdge edge, - AxisState state, - PlotRenderingInfo plotState) { - - // this method is deprecated because we really need the plotArea - // when drawing the labels - see bug 1277726 - return drawCategoryLabels(g2, dataArea, dataArea, edge, state, - plotState); - } /** * Draws the category labels and returns the updated axis state. @@ -869,6 +842,8 @@ * permitted). * * @return The updated axis state (never <code>null</code>). + * + * @since 1.0.2 */ protected AxisState drawCategoryLabels(Graphics2D g2, Rectangle2D plotArea, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-19 13:29:14
|
Revision: 4 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=4&view=rev Author: mungady Date: 2007-06-19 06:29:13 -0700 (Tue, 19 Jun 2007) Log Message: ----------- 2007-06-19 David Gilbert <dav...@ob...> * source/org/jfree/chart/axis/ColorBar.java: Removed (previously deprecated); * source/org/jfree/chart/editor/DefaultColorBarEditor.java: Likewise, * source/org/jfree/chart/editor/DefaultPlotEditor.java (colorBarAxisPropertyPanel): Removed, (DefaultPlotEditor(Plot)): Removed references to colorBarAxisPropertyPanel, (updatePlotProperties): Likewise, * source/org/jfree/chart/plot/ContourPlot.java: Removed (previously deprecated), * tests/org/jfree/chart/axis/junit/AxisPackageTests.java (suite): Removed ColorBarTests, * tests/org/jfree/chart/axis/junit/ColorBarTests.java: Removed (previously deprecated), * tests/org/jfree/chart/plot/junit/ContourPlotTests.java: Likewise, * tests/org/jfree/chart/plot/junit/PlotPackageTests.java (suite): Removed ContourPlotTests. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java trunk/tests/org/jfree/chart/axis/junit/AxisPackageTests.java trunk/tests/org/jfree/chart/plot/junit/PlotPackageTests.java Removed Paths: ------------- trunk/source/org/jfree/chart/axis/ColorBar.java trunk/source/org/jfree/chart/editor/DefaultColorBarEditor.java trunk/source/org/jfree/chart/plot/ContourPlot.java trunk/tests/org/jfree/chart/axis/junit/ColorBarTests.java trunk/tests/org/jfree/chart/plot/junit/ContourPlotTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-19 13:15:18 UTC (rev 3) +++ trunk/ChangeLog 2007-06-19 13:29:13 UTC (rev 4) @@ -1,5 +1,25 @@ 2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/axis/ColorBar.java: Removed (previously + deprecated); + * source/org/jfree/chart/editor/DefaultColorBarEditor.java: Likewise, + * source/org/jfree/chart/editor/DefaultPlotEditor.java + (colorBarAxisPropertyPanel): Removed, + (DefaultPlotEditor(Plot)): Removed references to + colorBarAxisPropertyPanel, + (updatePlotProperties): Likewise, + * source/org/jfree/chart/plot/ContourPlot.java: Removed (previously + deprecated), + * tests/org/jfree/chart/axis/junit/AxisPackageTests.java + (suite): Removed ColorBarTests, + * tests/org/jfree/chart/axis/junit/ColorBarTests.java: Removed + (previously deprecated), + * tests/org/jfree/chart/plot/junit/ContourPlotTests.java: Likewise, + * tests/org/jfree/chart/plot/junit/PlotPackageTests.java + (suite): Removed ContourPlotTests. + +2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/axis/CategoryAxis.java (drawCategoryLabels): Removed (previously deprecated). Deleted: trunk/source/org/jfree/chart/axis/ColorBar.java =================================================================== --- trunk/source/org/jfree/chart/axis/ColorBar.java 2007-06-19 13:15:18 UTC (rev 3) +++ trunk/source/org/jfree/chart/axis/ColorBar.java 2007-06-19 13:29:13 UTC (rev 4) @@ -1,473 +0,0 @@ -/* =========================================================== - * JFreeChart : a free chart library for the Java(tm) platform - * =========================================================== - * - * (C) Copyright 2000-2007, 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.] - * - * ------------- - * ColorBar.java - * ------------- - * (C) Copyright 2002-2007, by David M. O'Donnell and Contributors. - * - * Original Author: David M. O'Donnell; - * Contributor(s): David Gilbert (for Object Refinery Limited); - * - * $Id: ColorBar.java,v 1.6.2.5 2007/04/30 21:16:23 mungady Exp $ - * - * Changes - * ------- - * 26-Nov-2002 : Version 1 contributed by David M. O'Donnell (DG); - * 14-Jan-2003 : Changed autoRangeMinimumSize from Number --> double (DG); - * 17-Jan-2003 : Moved plot classes to separate package (DG); - * 20-Jan-2003 : Removed unnecessary constructors (DG); - * 26-Mar-2003 : Implemented Serializable (DG); - * 09-Jul-2003 : Changed ColorBar from extending axis classes to enclosing - * them (DG); - * 05-Aug-2003 : Applied changes in bug report 780298 (DG); - * 14-Aug-2003 : Implemented Cloneable (DG); - * 08-Sep-2003 : Changed ValueAxis API (DG); - * 21-Jan-2004 : Update for renamed method in ValueAxis (DG); - * ------------- JFREECHART 1.0.x --------------------------------------------- - * 31-Jan-2007 : Deprecated (DG); - * - */ - -package org.jfree.chart.axis; - -import java.awt.BasicStroke; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.RenderingHints; -import java.awt.Stroke; -import java.awt.geom.Line2D; -import java.awt.geom.Rectangle2D; -import java.io.Serializable; - -import org.jfree.chart.plot.ColorPalette; -import org.jfree.chart.plot.ContourPlot; -import org.jfree.chart.plot.Plot; -import org.jfree.chart.plot.RainbowPalette; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYBlockRenderer; -import org.jfree.ui.RectangleEdge; - -/** - * A color bar. - * - * @deprecated This class is no longer supported (as of version 1.0.4). If - * you are creating contour plots, please try to use {@link XYPlot} and - * {@link XYBlockRenderer}. - */ -public class ColorBar implements Cloneable, Serializable { - - /** For serialization. */ - private static final long serialVersionUID = -2101776212647268103L; - - /** The default color bar thickness. */ - public static final int DEFAULT_COLORBAR_THICKNESS = 0; - - /** The default color bar thickness percentage. */ - public static final double DEFAULT_COLORBAR_THICKNESS_PERCENT = 0.10; - - /** The default outer gap. */ - public static final int DEFAULT_OUTERGAP = 2; - - /** The axis. */ - private ValueAxis axis; - - /** The color bar thickness. */ - private int colorBarThickness = DEFAULT_COLORBAR_THICKNESS; - - /** - * The color bar thickness as a percentage of the height of the data area. - */ - private double colorBarThicknessPercent - = DEFAULT_COLORBAR_THICKNESS_PERCENT; - - /** The color palette. */ - private ColorPalette colorPalette = null; - - /** The color bar length. */ - private int colorBarLength = 0; // default make height of plotArea - - /** The amount of blank space around the colorbar. */ - private int outerGap; - - /** - * Constructs a horizontal colorbar axis, using default values where - * necessary. - * - * @param label the axis label. - */ - public ColorBar(String label) { - - NumberAxis a = new NumberAxis(label); - a.setAutoRangeIncludesZero(false); - this.axis = a; - this.axis.setLowerMargin(0.0); - this.axis.setUpperMargin(0.0); - - this.colorPalette = new RainbowPalette(); - this.colorBarThickness = DEFAULT_COLORBAR_THICKNESS; - this.colorBarThicknessPercent = DEFAULT_COLORBAR_THICKNESS_PERCENT; - this.outerGap = DEFAULT_OUTERGAP; - this.colorPalette.setMinZ(this.axis.getRange().getLowerBound()); - this.colorPalette.setMaxZ(this.axis.getRange().getUpperBound()); - - } - - /** - * Configures the color bar. - * - * @param plot the plot. - */ - public void configure(ContourPlot plot) { - double minZ = plot.getDataset().getMinZValue(); - double maxZ = plot.getDataset().getMaxZValue(); - setMinimumValue(minZ); - setMaximumValue(maxZ); - } - - /** - * Returns the axis. - * - * @return The axis. - */ - public ValueAxis getAxis() { - return this.axis; - } - - /** - * Sets the axis. - * - * @param axis the axis. - */ - public void setAxis(ValueAxis axis) { - this.axis = axis; - } - - /** - * Rescales the axis to ensure that all data are visible. - */ - public void autoAdjustRange() { - this.axis.autoAdjustRange(); - this.colorPalette.setMinZ(this.axis.getLowerBound()); - this.colorPalette.setMaxZ(this.axis.getUpperBound()); - } - - /** - * Draws the plot on a Java 2D graphics device (such as the screen or a - * printer). - * - * @param g2 the graphics device. - * @param cursor the cursor. - * @param plotArea the area within which the chart should be drawn. - * @param dataArea the area within which the plot should be drawn (a - * subset of the drawArea). - * @param reservedArea the reserved area. - * @param edge the color bar location. - * - * @return The new cursor location. - */ - public double draw(Graphics2D g2, double cursor, - Rectangle2D plotArea, Rectangle2D dataArea, - Rectangle2D reservedArea, RectangleEdge edge) { - - - Rectangle2D colorBarArea = null; - - double thickness = calculateBarThickness(dataArea, edge); - if (this.colorBarThickness > 0) { - thickness = this.colorBarThickness; // allow fixed thickness - } - - double length = 0.0; - if (RectangleEdge.isLeftOrRight(edge)) { - length = dataArea.getHeight(); - } - else { - length = dataArea.getWidth(); - } - - if (this.colorBarLength > 0) { - length = this.colorBarLength; - } - - if (edge == RectangleEdge.BOTTOM) { - colorBarArea = new Rectangle2D.Double(dataArea.getX(), - plotArea.getMaxY() + this.outerGap, length, thickness); - } - else if (edge == RectangleEdge.TOP) { - colorBarArea = new Rectangle2D.Double(dataArea.getX(), - reservedArea.getMinY() + this.outerGap, length, thickness); - } - else if (edge == RectangleEdge.LEFT) { - colorBarArea = new Rectangle2D.Double(plotArea.getX() - thickness - - this.outerGap, dataArea.getMinY(), thickness, length); - } - else if (edge == RectangleEdge.RIGHT) { - colorBarArea = new Rectangle2D.Double(plotArea.getMaxX() - + this.outerGap, dataArea.getMinY(), thickness, length); - } - - // update, but dont draw tick marks (needed for stepped colors) - this.axis.refreshTicks(g2, new AxisState(), colorBarArea, edge); - - drawColorBar(g2, colorBarArea, edge); - - AxisState state = null; - if (edge == RectangleEdge.TOP) { - cursor = colorBarArea.getMinY(); - state = this.axis.draw(g2, cursor, reservedArea, colorBarArea, - RectangleEdge.TOP, null); - } - else if (edge == RectangleEdge.BOTTOM) { - cursor = colorBarArea.getMaxY(); - state = this.axis.draw(g2, cursor, reservedArea, colorBarArea, - RectangleEdge.BOTTOM, null); - } - else if (edge == RectangleEdge.LEFT) { - cursor = colorBarArea.getMinX(); - state = this.axis.draw(g2, cursor, reservedArea, colorBarArea, - RectangleEdge.LEFT, null); - } - else if (edge == RectangleEdge.RIGHT) { - cursor = colorBarArea.getMaxX(); - state = this.axis.draw(g2, cursor, reservedArea, colorBarArea, - RectangleEdge.RIGHT, null); - } - return state.getCursor(); - - } - - /** - * Draws the plot on a Java 2D graphics device (such as the screen or a - * printer). - * - * @param g2 the graphics device. - * @param colorBarArea the area within which the axis should be drawn. - * @param edge the location. - */ - public void drawColorBar(Graphics2D g2, Rectangle2D colorBarArea, - RectangleEdge edge) { - - Object antiAlias = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING); - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_OFF); - - // setTickValues was missing from ColorPalette v. 0.96 - //colorPalette.setTickValues(this.axis.getTicks()); - - Stroke strokeSaved = g2.getStroke(); - g2.setStroke(new BasicStroke(1.0f)); - - if (RectangleEdge.isTopOrBottom(edge)) { - double y1 = colorBarArea.getY(); - double y2 = colorBarArea.getMaxY(); - double xx = colorBarArea.getX(); - Line2D line = new Line2D.Double(); - while (xx <= colorBarArea.getMaxX()) { - double value = this.axis.java2DToValue(xx, colorBarArea, edge); - line.setLine(xx, y1, xx, y2); - g2.setPaint(getPaint(value)); - g2.draw(line); - xx += 1; - } - } - else { - double y1 = colorBarArea.getX(); - double y2 = colorBarArea.getMaxX(); - double xx = colorBarArea.getY(); - Line2D line = new Line2D.Double(); - while (xx <= colorBarArea.getMaxY()) { - double value = this.axis.java2DToValue(xx, colorBarArea, edge); - line.setLine(y1, xx, y2, xx); - g2.setPaint(getPaint(value)); - g2.draw(line); - xx += 1; - } - } - - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, antiAlias); - g2.setStroke(strokeSaved); - - } - - /** - * Returns the color palette. - * - * @return The color palette. - */ - public ColorPalette getColorPalette() { - return this.colorPalette; - } - - /** - * Returns the Paint associated with a value. - * - * @param value the value. - * - * @return The paint. - */ - public Paint getPaint(double value) { - return this.colorPalette.getPaint(value); - } - - /** - * Sets the color palette. - * - * @param palette the new palette. - */ - public void setColorPalette(ColorPalette palette) { - this.colorPalette = palette; - } - - /** - * Sets the maximum value. - * - * @param value the maximum value. - */ - public void setMaximumValue(double value) { - this.colorPalette.setMaxZ(value); - this.axis.setUpperBound(value); - } - - /** - * Sets the minimum value. - * - * @param value the minimum value. - */ - public void setMinimumValue(double value) { - this.colorPalette.setMinZ(value); - this.axis.setLowerBound(value); - } - - /** - * Reserves the space required to draw the color bar. - * - * @param g2 the graphics device. - * @param plot the plot that the axis belongs to. - * @param plotArea the area within which the plot should be drawn. - * @param dataArea the data area. - * @param edge the axis location. - * @param space the space already reserved. - * - * @return The space required to draw the axis in the specified plot area. - */ - public AxisSpace reserveSpace(Graphics2D g2, Plot plot, - Rectangle2D plotArea, - Rectangle2D dataArea, RectangleEdge edge, - AxisSpace space) { - - AxisSpace result = this.axis.reserveSpace(g2, plot, plotArea, edge, - space); - double thickness = calculateBarThickness(dataArea, edge); - result.add(thickness + 2 * this.outerGap, edge); - return result; - - } - - /** - * Calculates the bar thickness. - * - * @param plotArea the plot area. - * @param edge the location. - * - * @return The thickness. - */ - private double calculateBarThickness(Rectangle2D plotArea, - RectangleEdge edge) { - double result = 0.0; - if (RectangleEdge.isLeftOrRight(edge)) { - result = plotArea.getWidth() * this.colorBarThicknessPercent; - } - else { - result = plotArea.getHeight() * this.colorBarThicknessPercent; - } - return result; - } - - /** - * Returns a clone of the object. - * - * @return A clone. - * - * @throws CloneNotSupportedException if some component of the color bar - * does not support cloning. - */ - public Object clone() throws CloneNotSupportedException { - - ColorBar clone = (ColorBar) super.clone(); - clone.axis = (ValueAxis) this.axis.clone(); - return clone; - - } - - /** - * Tests this object for equality with another. - * - * @param obj the object to test against. - * - * @return A boolean. - */ - public boolean equals(Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof ColorBar)) { - return false; - } - ColorBar that = (ColorBar) obj; - if (!this.axis.equals(that.axis)) { - return false; - } - if (this.colorBarThickness != that.colorBarThickness) { - return false; - } - if (this.colorBarThicknessPercent != that.colorBarThicknessPercent) { - return false; - } - if (!this.colorPalette.equals(that.colorPalette)) { - return false; - } - if (this.colorBarLength != that.colorBarLength) { - return false; - } - if (this.outerGap != that.outerGap) { - return false; - } - return true; - - } - - /** - * Returns a hash code for this object. - * - * @return A hash code. - */ - public int hashCode() { - return this.axis.hashCode(); - } - -} Deleted: trunk/source/org/jfree/chart/editor/DefaultColorBarEditor.java =================================================================== --- trunk/source/org/jfree/chart/editor/DefaultColorBarEditor.java 2007-06-19 13:15:18 UTC (rev 3) +++ trunk/source/org/jfree/chart/editor/DefaultColorBarEditor.java 2007-06-19 13:29:13 UTC (rev 4) @@ -1,228 +0,0 @@ -/* =========================================================== - * JFreeChart : a free chart library for the Java(tm) platform - * =========================================================== - * - * (C) Copyright 2000-2007, 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.] - * - * -------------------------- - * DefaultColorBarEditor.java - * -------------------------- - * (C) Copyright 2002-2007, by David M. O'Donnell and Contributors. - * - * Original Author: David M. O'Donnell; - * Contributor(s): David Gilbert (for Object Refinery Limited); - * Arnaud Lelievre; - * - * $Id: DefaultColorBarEditor.java,v 1.1.2.2 2007/02/02 14:33:12 mungady Exp $ - * - * Changes - * ------- - * 26-Nov-2002 : Version 1 contributed by David M. O'Donnell (DG); - * 08-Sep-2003 : Added internationalization via use of properties - * resourceBundle (RFE 690236) (AL); - * 24-Nov-2005 : Moved and renamed: org.jfree.chart.ui.ColorBarPropertyEditPanel - * --> DefaultColorBarEditor (DG); - * 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG); - * - */ - -package org.jfree.chart.editor; - -import java.awt.event.ActionEvent; -import java.util.ResourceBundle; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JTabbedPane; - -import org.jfree.chart.axis.ColorBar; -import org.jfree.chart.axis.NumberAxis; -import org.jfree.chart.plot.GreyPalette; -import org.jfree.chart.plot.RainbowPalette; -import org.jfree.layout.LCBLayout; - - -/** - * A DefaultColorBarEditor. Extends DefaultNumberAxisEditor to allow - * change general axis type parameters. - */ -class DefaultColorBarEditor extends DefaultNumberAxisEditor { - - /** - * A checkbox that indicates whether or not the color indices should run - * high to low. - */ - private JCheckBox invertPaletteCheckBox; - - /** Flag set by invertPaletteCheckBox. */ - private boolean invertPalette = false; - - /** A checkbox that indicates whether the palette is stepped. */ - private JCheckBox stepPaletteCheckBox; - - /** Flag set by stepPaletteCheckBox. */ - private boolean stepPalette = false; - - /** The Palette Sample displaying the current Palette. */ - private PaletteSample currentPalette; - - /** An array of availiable sample palettes. */ - private PaletteSample[] availablePaletteSamples; - - /** The resourceBundle for the localization. */ - protected static ResourceBundle localizationResources = - ResourceBundle.getBundle("org.jfree.chart.editor.LocalizationBundle"); - - /** - * Creates a new edit panel for a color bar. - * - * @param colorBar the color bar. - */ - public DefaultColorBarEditor(ColorBar colorBar) { - super((NumberAxis) colorBar.getAxis()); - this.invertPalette = colorBar.getColorPalette().isInverse(); - this.stepPalette = colorBar.getColorPalette().isStepped(); - this.currentPalette = new PaletteSample(colorBar.getColorPalette()); - this.availablePaletteSamples = new PaletteSample[2]; - this.availablePaletteSamples[0] - = new PaletteSample(new RainbowPalette()); - this.availablePaletteSamples[1] - = new PaletteSample(new GreyPalette()); - - JTabbedPane other = getOtherTabs(); - - JPanel palettePanel = new JPanel(new LCBLayout(4)); - palettePanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); - - palettePanel.add(new JPanel()); - this.invertPaletteCheckBox = new JCheckBox( - localizationResources.getString("Invert_Palette"), - this.invertPalette - ); - this.invertPaletteCheckBox.setActionCommand("invertPalette"); - this.invertPaletteCheckBox.addActionListener(this); - palettePanel.add(this.invertPaletteCheckBox); - palettePanel.add(new JPanel()); - - palettePanel.add(new JPanel()); - this.stepPaletteCheckBox = new JCheckBox( - localizationResources.getString("Step_Palette"), - this.stepPalette - ); - this.stepPaletteCheckBox.setActionCommand("stepPalette"); - this.stepPaletteCheckBox.addActionListener(this); - palettePanel.add(this.stepPaletteCheckBox); - palettePanel.add(new JPanel()); - - palettePanel.add( - new JLabel(localizationResources.getString("Palette")) - ); - JButton button - = new JButton(localizationResources.getString("Set_palette...")); - button.setActionCommand("PaletteChoice"); - button.addActionListener(this); - palettePanel.add(this.currentPalette); - palettePanel.add(button); - - other.add(localizationResources.getString("Palette"), palettePanel); - - } - - /** - * Handles actions from within the property panel. - * - * @param event the event. - */ - public void actionPerformed(ActionEvent event) { - String command = event.getActionCommand(); - if (command.equals("PaletteChoice")) { - attemptPaletteSelection(); - } - else if (command.equals("invertPalette")) { - this.invertPalette = this.invertPaletteCheckBox.isSelected(); - } - else if (command.equals("stepPalette")) { - this.stepPalette = this.stepPaletteCheckBox.isSelected(); - } - else { - super.actionPerformed(event); // pass to super-class for handling - } - } - - /** - * Handle a palette selection. - */ - private void attemptPaletteSelection() { - PaletteChooserPanel panel - = new PaletteChooserPanel(null, this.availablePaletteSamples); - int result = JOptionPane.showConfirmDialog( - this, panel, localizationResources.getString("Palette_Selection"), - JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE - ); - - if (result == JOptionPane.OK_OPTION) { - double zmin = this.currentPalette.getPalette().getMinZ(); - double zmax = this.currentPalette.getPalette().getMaxZ(); - this.currentPalette.setPalette(panel.getSelectedPalette()); - this.currentPalette.getPalette().setMinZ(zmin); - this.currentPalette.getPalette().setMaxZ(zmax); - } - } - - /** - * Sets the properties of the specified axis to match the properties - * defined on this panel. - * - * @param colorBar the color bar. - */ - public void setAxisProperties(ColorBar colorBar) { - super.setAxisProperties(colorBar.getAxis()); - colorBar.setColorPalette(this.currentPalette.getPalette()); - colorBar.getColorPalette().setInverse(this.invertPalette); //dmo added - colorBar.getColorPalette().setStepped(this.stepPalette); //dmo added - } - - /** - * A static method that returns a panel that is appropriate for the axis - * type. - * - * @param colorBar the color bar. - * - * @return A panel or <code>null</code< if axis is <code>null</code>. - */ - public static DefaultColorBarEditor getInstance(ColorBar colorBar) { - - if (colorBar != null) { - return new DefaultColorBarEditor(colorBar); - } - else { - return null; - } - - } - -} Modified: trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java =================================================================== --- trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java 2007-06-19 13:15:18 UTC (rev 3) +++ trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java 2007-06-19 13:29:13 UTC (rev 4) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ---------------------- * DefaultPlotEditor.java * ---------------------- - * (C) Copyright 2005, by Object Refinery Limited and Contributors. + * (C) Copyright 2005, 2007, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): Andrzej Porebski; @@ -39,7 +39,8 @@ * Changes: * -------- * 24-Nov-2005 : Version 1, based on PlotPropertyEditPanel.java (DG); - * + * 19-Jun-2007 : Removed DefaultColorBarEditor which has been deprecated (DG); + * */ package org.jfree.chart.editor; @@ -64,9 +65,7 @@ import javax.swing.JTabbedPane; import org.jfree.chart.axis.Axis; -import org.jfree.chart.axis.ColorBar; import org.jfree.chart.plot.CategoryPlot; -import org.jfree.chart.plot.ContourPlot; import org.jfree.chart.plot.Plot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; @@ -110,12 +109,6 @@ */ private DefaultAxisEditor rangeAxisPropertyPanel; - /** - * A panel used to display/edit the properties of the colorbar axis (if - * any). - */ - private DefaultColorBarEditor colorBarAxisPropertyPanel; - /** An array of stroke samples to choose from. */ private StrokeSample[] availableStrokeSamples; @@ -356,25 +349,6 @@ ); } -//dmo: added this panel for colorbar control. (start dmo additions) - ColorBar colorBar = null; - if (plot instanceof ContourPlot) { - colorBar = ((ContourPlot) plot).getColorBar(); - } - - this.colorBarAxisPropertyPanel - = DefaultColorBarEditor.getInstance(colorBar); - if (this.colorBarAxisPropertyPanel != null) { - this.colorBarAxisPropertyPanel.setBorder( - BorderFactory.createEmptyBorder(2, 2, 2, 2) - ); - tabs.add( - localizationResources.getString("Color_Bar"), - this.colorBarAxisPropertyPanel - ); - } -//dmo: (end dmo additions) - tabs.add(localizationResources.getString("Appearance"), appearance); panel.add(tabs); @@ -662,19 +636,6 @@ } } -//dmo: added this panel for colorbar control. (start dmo additions) - if (this.colorBarAxisPropertyPanel != null) { - ColorBar colorBar = null; - if (plot instanceof ContourPlot) { - ContourPlot p = (ContourPlot) plot; - colorBar = p.getColorBar(); - } - if (colorBar != null) { - this.colorBarAxisPropertyPanel.setAxisProperties(colorBar); - } - } -//dmo: (end dmo additions) - } } Deleted: trunk/source/org/jfree/chart/plot/ContourPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/ContourPlot.java 2007-06-19 13:15:18 UTC (rev 3) +++ trunk/source/org/jfree/chart/plot/ContourPlot.java 2007-06-19 13:29:13 UTC (rev 4) @@ -1,1862 +0,0 @@ -/* =========================================================== - * JFreeChart : a free chart library for the Java(tm) platform - * =========================================================== - * - * (C) Copyright 2000-2007, 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.] - * - * ---------------- - * ContourPlot.java - * ---------------- - * (C) Copyright 2002-2007, by David M. O'Donnell and Contributors. - * - * Original Author: David M. O'Donnell; - * Contributor(s): David Gilbert (for Object Refinery Limited); - * Arnaud Lelievre; - * Nicolas Brodu; - * - * $Id: ContourPlot.java,v 1.16.2.5 2007/01/31 15:56:18 mungady Exp $ - * - * Changes - * ------- - * 26-Nov-2002 : Version 1 contributed by David M. O'Donnell (DG); - * 14-Jan-2003 : Added crosshair attributes (DG); - * 23-Jan-2003 : Removed two constructors (DG); - * 21-Mar-2003 : Bug fix 701744 (DG); - * 26-Mar-2003 : Implemented Serializable (DG); - * 09-Jul-2003 : Changed ColorBar from extending axis classes to enclosing - * them (DG); - * 05-Aug-2003 : Applied changes in bug report 780298 (DG); - * 08-Sep-2003 : Added internationalization via use of properties - * resourceBundle (RFE 690236) (AL); - * 11-Sep-2003 : Cloning support (NB); - * 16-Sep-2003 : Changed ChartRenderingInfo --> PlotRenderingInfo (DG); - * 17-Jan-2004 : Removed references to DefaultContourDataset class, replaced - * with ContourDataset interface (with changes to the interface). - * See bug 741048 (DG); - * 21-Jan-2004 : Update for renamed method in ValueAxis (DG); - * 25-Feb-2004 : Replaced CrosshairInfo with CrosshairState (DG); - * 06-Oct-2004 : Updated for changes in DatasetUtilities class (DG); - * 11-Nov-2004 : Renamed zoom methods to match ValueAxisPlot interface (DG); - * 25-Nov-2004 : Small update to clone() implementation (DG); - * 11-Jan-2005 : Removed deprecated code in preparation for 1.0.0 release (DG); - * 05-May-2005 : Updated draw() method parameters (DG); - * 16-Jun-2005 : Added default constructor (DG); - * 01-Sep-2005 : Moved dataAreaRatio from Plot to here (DG); - * ------------- JFREECHART 1.0.x --------------------------------------------- - * 31-Jan-2007 : Deprecated (DG); - * - */ - -package org.jfree.chart.plot; - -import java.awt.AlphaComposite; -import java.awt.Composite; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.RenderingHints; -import java.awt.Shape; -import java.awt.Stroke; -import java.awt.geom.Ellipse2D; -import java.awt.geom.GeneralPath; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; -import java.awt.geom.Rectangle2D; -import java.awt.geom.RectangularShape; -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.io.Serializable; -import java.util.Iterator; -import java.util.List; -import java.util.ResourceBundle; - -import org.jfree.chart.ClipPath; -import org.jfree.chart.annotations.XYAnnotation; -import org.jfree.chart.axis.AxisSpace; -import org.jfree.chart.axis.ColorBar; -import org.jfree.chart.axis.NumberAxis; -import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.ContourEntity; -import org.jfree.chart.entity.EntityCollection; -import org.jfree.chart.event.AxisChangeEvent; -import org.jfree.chart.event.PlotChangeEvent; -import org.jfree.chart.labels.ContourToolTipGenerator; -import org.jfree.chart.labels.StandardContourToolTipGenerator; -import org.jfree.chart.renderer.xy.XYBlockRenderer; -import org.jfree.chart.urls.XYURLGenerator; -import org.jfree.data.Range; -import org.jfree.data.contour.ContourDataset; -import org.jfree.data.general.DatasetChangeEvent; -import org.jfree.data.general.DatasetUtilities; -import org.jfree.ui.RectangleEdge; -import org.jfree.ui.RectangleInsets; -import org.jfree.util.ObjectUtilities; - -/** - * A class for creating shaded contours. - * - * @deprecated This plot is no longer supported, please use {@link XYPlot} with - * an {@link XYBlockRenderer}. - */ -public class ContourPlot extends Plot implements ContourValuePlot, - ValueAxisPlot, - PropertyChangeListener, - Serializable, - Cloneable { - - /** For serialization. */ - private static final long serialVersionUID = 7861072556590502247L; - - /** The default insets. */ - protected static final RectangleInsets DEFAULT_INSETS - = new RectangleInsets(2.0, 2.0, 100.0, 10.0); - - /** The domain axis (used for the x-values). */ - private ValueAxis domainAxis; - - /** The range axis (used for the y-values). */ - private ValueAxis rangeAxis; - - /** The dataset. */ - private ContourDataset dataset; - - /** The colorbar axis (used for the z-values). */ - private ColorBar colorBar = null; - - /** The color bar location. */ - private RectangleEdge colorBarLocation; - - /** A flag that controls whether or not a domain crosshair is drawn..*/ - private boolean domainCrosshairVisible; - - /** The domain crosshair value. */ - private double domainCrosshairValue; - - /** The pen/brush used to draw the crosshair (if any). */ - private transient Stroke domainCrosshairStroke; - - /** The color used to draw the crosshair (if any). */ - private transient Paint domainCrosshairPaint; - - /** - * A flag that controls whether or not the crosshair locks onto actual data - * points. - */ - private boolean domainCrosshairLockedOnData = true; - - /** A flag that controls whether or not a range crosshair is drawn..*/ - private boolean rangeCrosshairVisible; - - /** The range crosshair value. */ - private double rangeCrosshairValue; - - /** The pen/brush used to draw the crosshair (if any). */ - private transient Stroke rangeCrosshairStroke; - - /** The color used to draw the crosshair (if any). */ - private transient Paint rangeCrosshairPaint; - - /** - * A flag that controls whether or not the crosshair locks onto actual data - * points. - */ - private boolean rangeCrosshairLockedOnData = true; - - /** - * Defines dataArea rectangle as the ratio formed from dividing height by - * width (of the dataArea). Modifies plot area calculations. - * ratio>0 will attempt to layout the plot so that the - * dataArea.height/dataArea.width = ratio. - * ratio<0 will attempt to layout the plot so that the - * dataArea.height/dataArea.width in plot units (not java2D units as when - * ratio>0) = -1.*ratio. - */ //dmo - private double dataAreaRatio = 0.0; //zero when the parameter is not set - - /** A list of markers (optional) for the domain axis. */ - private List domainMarkers; - - /** A list of markers (optional) for the range axis. */ - private List rangeMarkers; - - /** A list of annotations (optional) for the plot. */ - private List annotations; - - /** The tool tip generator. */ - private ContourToolTipGenerator toolTipGenerator; - - /** The URL text generator. */ - private XYURLGenerator urlGenerator; - - /** - * Controls whether data are render as filled rectangles or rendered as - * points - */ - private boolean renderAsPoints = false; - - /** - * Size of points rendered when renderAsPoints = true. Size is relative to - * dataArea - */ - private double ptSizePct = 0.05; - - /** Contains the a ClipPath to "trim" the contours. */ - private transient ClipPath clipPath = null; - - /** Set to Paint to represent missing values. */ - private transient Paint missingPaint = null; - - /** The resourceBundle for the localization. */ - protected static ResourceBundle localizationResources = - ResourceBundle.getBundle("org.jfree.chart.plot.LocalizationBundle"); - - /** - * Creates a new plot with no dataset or axes. - */ - public ContourPlot() { - this(null, null, null, null); - } - - /** - * Constructs a contour plot with the specified axes (other attributes take - * default values). - * - * @param dataset The dataset. - * @param domainAxis The domain axis. - * @param rangeAxis The range axis. - * @param colorBar The z-axis axis. - */ - public ContourPlot(ContourDataset dataset, - ValueAxis domainAxis, ValueAxis rangeAxis, - ColorBar colorBar) { - - super(); - - this.dataset = dataset; - if (dataset != null) { - dataset.addChangeListener(this); - } - - this.domainAxis = domainAxis; - if (domainAxis != null) { - domainAxis.setPlot(this); - domainAxis.addChangeListener(this); - } - - this.rangeAxis = rangeAxis; - if (rangeAxis != null) { - rangeAxis.setPlot(this); - rangeAxis.addChangeListener(this); - } - - this.colorBar = colorBar; - if (colorBar != null) { - colorBar.getAxis().setPlot(this); - colorBar.getAxis().addChangeListener(this); - colorBar.configure(this); - } - this.colorBarLocation = RectangleEdge.LEFT; - - this.toolTipGenerator = new StandardContourToolTipGenerator(); - - } - - /** - * Returns the color bar location. - * - * @return The color bar location. - */ - public RectangleEdge getColorBarLocation() { - return this.colorBarLocation; - } - - /** - * Sets the color bar location and sends a {@link PlotChangeEvent} to all - * registered listeners. - * - * @param edge the location. - */ - public void setColorBarLocation(RectangleEdge edge) { - this.colorBarLocation = edge; - notifyListeners(new PlotChangeEvent(this)); - } - - /** - * Returns the primary dataset for the plot. - * - * @return The primary dataset (possibly <code>null</code>). - */ - public ContourDataset getDataset() { - return this.dataset; - } - - /** - * Sets the dataset for the plot, replacing the existing dataset if there - * is one. - * - * @param dataset the dataset (<code>null</code> permitted). - */ - public void setDataset(ContourDataset dataset) { - - // if there is an existing dataset, remove the plot from the list of - // change listeners... - ContourDataset existing = this.dataset; - if (existing != null) { - existing.removeChangeListener(this); - } - - // set the new dataset, and register the chart as a change listener... - this.dataset = dataset; - if (dataset != null) { - setDatasetGroup(dataset.getGroup()); - dataset.addChangeListener(this); - } - - // send a dataset change event to self... - DatasetChangeEvent event = new DatasetChangeEvent(this, dataset); - datasetChanged(event); - - } - - /** - * Returns the domain axis for the plot. - * - * @return The domain axis. - */ - public ValueAxis getDomainAxis() { - - ValueAxis result = this.domainAxis; - - return result; - - } - - /** - * Sets the domain axis for the plot (this must be compatible with the plot - * type or an exception is thrown). - * - * @param axis The new axis. - */ - public void setDomainAxis(ValueAxis axis) { - - if (isCompatibleDomainAxis(axis)) { - - if (axis != null) { - axis.setPlot(this); - axis.addChangeListener(this); - } - - // plot is likely registered as a listener with the existing axis... - if (this.domainAxis != null) { - this.domainAxis.removeChangeListener(this); - } - - this.domainAxis = axis; - notifyListeners(new PlotChangeEvent(this)); - - } - - } - - /** - * Returns the range axis for the plot. - * - * @return The range axis. - */ - public ValueAxis getRangeAxis() { - - ValueAxis result = this.rangeAxis; - - return result; - - } - - /** - * Sets the range axis for the plot. - * <P> - * An exception is thrown if the new axis and the plot are not mutually - * compatible. - * - * @param axis The new axis (null permitted). - */ - public void setRangeAxis(ValueAxis axis) { - - if (axis != null) { - axis.setPlot(this); - axis.addChangeListener(this); - } - - // plot is likely registered as a listener with the existing axis... - if (this.rangeAxis != null) { - this.rangeAxis.removeChangeListener(this); - } - - this.rangeAxis = axis; - notifyListeners(new PlotChangeEvent(this)); - - } - - /** - * Sets the colorbar for the plot. - * - * @param axis The new axis (null permitted). - */ - public void setColorBarAxis(ColorBar axis) { - - this.colorBar = axis; - notifyListeners(new PlotChangeEvent(this)); - - } - - /** - * Returns the data area ratio. - * - * @return The ratio. - */ - public double getDataAreaRatio() { - return this.dataAreaRatio; - } - - /** - * Sets the data area ratio. - * - * @param ratio the ratio. - */ - public void setDataAreaRatio(double ratio) { - this.dataAreaRatio = ratio; - } - - /** - * Adds a marker for the domain axis. - * <P> - * Typically a marker will be drawn by the renderer as a line perpendicular - * to the range axis, however this is entirely up to the renderer. - * - * @param marker the marker. - */ - public void addDomainMarker(Marker marker) { - - if (this.domainMarkers == null) { - this.domainMarkers = new java.util.ArrayList(); - } - this.domainMarkers.add(marker); - notifyListeners(new PlotChangeEvent(this)); - - } - - /** - * Clears all the domain markers. - */ - public void clearDomainMarkers() { - if (this.domainMarkers != null) { - this.domainMarkers.clear(); - notifyListeners(new PlotChangeEvent(this)); - } - } - - /** - * Adds a marker for the range axis. - * <P> - * Typically a marker will be drawn by the renderer as a line perpendicular - * to the range axis, however this is entirely up to the renderer. - * - * @param marker The marker. - */ - public void addRangeMarker(Marker marker) { - - if (this.rangeMarkers == null) { - this.rangeMarkers = new java.util.ArrayList(); - } - this.rangeMarkers.add(marker); - notifyListeners(new PlotChangeEvent(this)); - - } - - /** - * Clears all the range markers. - */ - public void clearRangeMarkers() { - if (this.rangeMarkers != null) { - this.rangeMarkers.clear(); - notifyListeners(new PlotChangeEvent(this)); - } - } - - /** - * Adds an annotation to the plot. - * - * @param annotation the annotation. - */ - public void addAnnotation(XYAnnotation annotation) { - - if (this.annotations == null) { - this.annotations = new java.util.ArrayList(); - } - this.annotations.add(annotation); - notifyListeners(new PlotChangeEvent(this)); - - } - - /** - * Clears all the annotations. - */ - public void clearAnnotations() { - if (this.annotations != null) { - this.annotations.clear(); - notifyListeners(new PlotChangeEvent(this)); - } - } - - /** - * Checks the compatibility of a domain axis, returning true if the axis is - * compatible with the plot, and false otherwise. - * - * @param axis The proposed axis. - * - * @return <code>true</code> if the axis is compatible with the plot. - */ - public boolean isCompatibleDomainAxis(ValueAxis axis) { - - return true; - - } - - /** - * Draws the plot on a Java 2D graphics device (such as the screen or a - * printer). - * <P> - * The optional <code>info</code> argument collects information about the - * rendering of the plot (dimensions, tooltip information etc). Just pass - * in <code>null</code> if you do not need this information. - * - * @param g2 the graphics device. - * @param area the area within which the plot (including axis labels) - * should be drawn. - * @param anchor the anchor point (<code>null</code> permitted). - * @param parentState the state from the parent plot, if there is one. - * @param info collects chart drawing information (<code>null</code> - * permitted). - */ - public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, - PlotState parentState, - PlotRenderingInfo info) { - - // if the plot area is too small, just return... - boolean b1 = (area.getWidth() <= MINIMUM_WIDTH_TO_DRAW); - boolean b2 = (area.getHeight() <= MINIMUM_HEIGHT_TO_DRAW); - if (b1 || b2) { - return; - } - - // record the plot area... - if (info != null) { - info.setPlotArea(area); - } - - // adjust the drawing area for plot insets (if any)... - RectangleInsets insets = getInsets(); - insets.trim(area); - - AxisSpace space = new AxisSpace(); - - space = this.domainAxis.reserveSpace(g2, this, area, - RectangleEdge.BOTTOM, space); - space = this.rangeAxis.reserveSpace(g2, this, area, - RectangleEdge.LEFT, space); - - Rectangle2D estimatedDataArea = space.shrink(area, null); - - AxisSpace space2 = new AxisSpace(); - space2 = this.colorBar.reserveSpace(g2, this, area, estimatedDataArea, - this.colorBarLocation, space2); - Rectangle2D adjustedPlotArea = space2.shrink(area, null); - - Rectangle2D dataArea = space.shrink(adjustedPlotArea, null); - - Rectangle2D colorBarArea = space2.reserved(area, this.colorBarLocation); - - // additional dataArea modifications - if (getDataAreaRatio() != 0.0) { //check whether modification is - double ratio = getDataAreaRatio(); - Rectangle2D tmpDataArea = (Rectangle2D) dataArea.clone(); - double h = tmpDataArea.getHeight(); - double w = tmpDataArea.getWidth(); - - if (ratio > 0) { // ratio represents pixels - if (w * ratio <= h) { - h = ratio * w; - } - else { - w = h / ratio; - } - } - else { // ratio represents axis units - ratio *= -1.0; - double xLength = getDomainAxis().getRange().getLength(); - double yLength = getRangeAxis().getRange().getLength(); - double unitRatio = yLength / xLength; - - ratio = unitRatio * ratio; - - if (w * ratio <= h) { - h = ratio * w; - } - else { - w = h / ratio; - } - } - - dataArea.setRect(tmpDataArea.getX() + tmpDataArea.getWidth() / 2 - - w / 2, tmpDataArea.getY(), w, h); - } - - if (info != null) { - info.setDataArea(dataArea); - } - - CrosshairState crosshairState = new CrosshairState(); - crosshairState.setCrosshairDistance(Double.POSITIVE_INFINITY); - - // draw the plot background... - drawBackground(g2, dataArea); - - double cursor = dataArea.getMaxY(); - if (this.domainAxis != null) { - this.domainAxis.draw(g2, cursor, adjustedPlotArea, dataArea, - RectangleEdge.BOTTOM, info); - } - - if (this.rangeAxis != null) { - cursor = dataArea.getMinX(); - this.rangeAxis.draw(g2, cursor, adjustedPlotArea, dataArea, - RectangleEdge.LEFT, info); - } - - if (this.colorBar != null) { - cursor = 0.0; - cursor = this.colorBar.draw(g2, cursor, adjustedPlotArea, dataArea, - colorBarArea, this.colorBarLocation); - } - Shape originalClip = g2.getClip(); - Composite originalComposite = g2.getComposite(); - - g2.clip(dataArea); - g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, - getForegroundAlpha())); - render(g2, dataArea, info, crosshairState); - - if (this.domainMarkers != null) { - Iterator iterator = this.domainMarkers.iterator(); - while (iterator.hasNext()) { - Marker marker = (Marker) iterator.next(); - drawDomainMarker(g2, this, getDomainAxis(), marker, dataArea); - } - } - - if (this.rangeMarkers != null) { - Iterator iterator = this.rangeMarkers.iterator(); - while (iterator.hasNext()) { - Marker marker = (Marker) iterator.next(); - drawRangeMarker(g2, this, getRangeAxis(), marker, dataArea); - } - } - -// TO DO: these annotations only work with XYPlot, see if it is possible to -// make ContourPlot a subclass of XYPlot (DG); - -// // draw the annotations... -// if (this.annotations != null) { -// Iterator iterator = this.annotations.iterator(); -// while (iterator.hasNext()) { -// Annotation annotation = (Annotation) iterator.next(); -// if (annotation instanceof XYAnnotation) { -// XYAnnotation xya = (XYAnnotation) annotation; -// // get the annotation to draw itself... -// xya.draw(g2, this, dataArea, getDomainAxis(), -// getRangeAxis()); -// } -// } -// } - - g2.setClip(originalClip); - g2.setComposite(originalComposite); - drawOutline(g2, dataArea); - - } - - /** - * Draws a representation of the data within the dataArea region, using the - * current renderer. - * <P> - * The <code>info</code> and <code>crosshairState</code> arguments may be - * <code>null</code>. - * - * @param g2 the graphics device. - * @param dataArea the region in which the data is to be drawn. - * @param info an optional object for collection dimension information. - * @param crosshairState an optional object for collecting crosshair info. - */ - public void render(Graphics2D g2, Rectangle2D dataArea, - PlotRenderingInfo info, CrosshairState crosshairState) { - - // now get the data and plot it (the visual representation will depend - // on the renderer that has been set)... - ContourDataset data = getDataset(); - if (data != null) { - - ColorBar zAxis = getColorBar(); - - if (this.clipPath != null) { - GeneralPath clipper = getClipPath().draw(g2, dataArea, - this.domainAxis, this.rangeAxis); - if (this.clipPath.isClip()) { - g2.clip(clipper); - } - } - - if (this.renderAsPoints) { - pointRenderer(g2, dataArea, info, this, this.domainAxis, - this.rangeAxis, zAxis, data, crosshairState); - } - else { - contourRenderer(g2, dataArea, info, this, this.domainAxis, - this.rangeAxis, zAxis, data, crosshairState); - } - - // draw vertical crosshair if required... - setDomainCrosshairValue(crosshairState.getCrosshairX(), false); - if (isDomainCrosshairVisible()) { - drawVerticalLine(g2, dataArea, - getDomainCrosshairValue(), - getDomainCrosshairStroke(), - getDomainCrosshairPaint()); - } - - // draw horizontal crosshair if required... - setRangeCrosshairValue(crosshairState.getCrosshairY(), false); - if (isRangeCrosshairVisible()) { - drawHorizontalLine(g2, dataArea, - getRangeCrosshairValue(), - getRangeCrosshairStroke(), - getRangeCrosshairPaint()); - } - - } - else if (this.clipPath != null) { - getClipPath().draw(g2, dataArea, this.domainAxis, this.rangeAxis); - } - - } - - /** - * Fills the plot. - * - * @param g2 the graphics device. - * @param dataArea the area within which the data is being drawn. - * @param info collects information about the drawing. - * @param plot the plot (can be used to obtain standard color - * information etc). - * @param horizontalAxis the domain (horizontal) axis. - * @param verticalAxis the range (vertical) axis. - * @param colorBar the color bar axis. - * @param data the dataset. - * @param crosshairState information about crosshairs on a plot. - */ - public void contourRenderer(Graphics2D g2, - Rectangle2D dataArea, - PlotRenderingInfo info, - ContourPlot plot, - ValueAxis horizontalAxis, - ValueAxis verticalAxis, - ColorBar colorBar, - ContourDataset data, - CrosshairState crosshairState) { - - // setup for collecting optional entity info... - Rectangle2D.Double entityArea = null; - EntityCollection entities = null; - if (info != null) { - entities = info.getOwner().getEntityCollection(); - } - - Rectangle2D.Double rect = null; - rect = new Rectangle2D.Double(); - - //turn off anti-aliasing when filling rectangles - Object antiAlias = g2.getRenderingHint(RenderingHints.KEY_ANTIALIASING); - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_OFF); - - // get the data points - Number[] xNumber = data.getXValues(); - Number[] yNumber = data.getYValues(); - Number[] zNumber = data.getZValues(); - - double[] x = new double[xNumber.length]; - double[] y = new double[yNumber.length]; - - for (int i = 0; i < x.length; i++) { - x[i] = xNumber[i].doubleValue(); - y[i] = yNumber[i].doubleValue(); - } - - int[] xIndex = data.indexX(); - int[] indexX = data.getXIndices(); - boolean vertInverted = ((NumberAxis) verticalAxis).isInverted(); - boolean horizInverted = false; - if (horizontalAxis instanceof NumberAxis) { - horizInverted = ((NumberAxis) horizontalAxis).isInverted(); - } - double transX = 0.0; - double transXm1 = 0.0; - double transXp1 = 0.0; - double transDXm1 = 0.0; - double transDXp1 = 0.0; - double transDX = 0.0; - double transY = 0.0; - double transYm1 = 0.0; - double transYp1 = 0.0; - double transDYm1 = 0.0; - double transDYp1 = 0.0; - double transDY = 0.0; - int iMax = xIndex[xIndex.length - 1]; - for (int k = 0; k < x.length; k++) { - int i = xIndex[k]; - if (indexX[i] == k) { // this is a new column - if (i == 0) { - transX = horizontalAxis.valueToJava2D(x[k], dataArea, - RectangleEdge.BOTTOM... [truncated message content] |
From: <mu...@us...> - 2007-06-19 13:45:39
|
Revision: 5 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=5&view=rev Author: mungady Date: 2007-06-19 06:45:35 -0700 (Tue, 19 Jun 2007) Log Message: ----------- 2007-06-19 David Gilbert <dav...@ob...> * source/org/jfree/chart/axis/ValueAxis.java (DEFAULT_LOWER_BOUND): Removed, previously deprecated, (DEFAULT_UPPER_BOUND): Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/axis/ValueAxis.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-19 13:29:13 UTC (rev 4) +++ trunk/ChangeLog 2007-06-19 13:45:35 UTC (rev 5) @@ -1,5 +1,11 @@ 2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/axis/ValueAxis.java + (DEFAULT_LOWER_BOUND): Removed, previously deprecated, + (DEFAULT_UPPER_BOUND): Likewise. + +2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/axis/ColorBar.java: Removed (previously deprecated); * source/org/jfree/chart/editor/DefaultColorBarEditor.java: Likewise, Modified: trunk/source/org/jfree/chart/axis/ValueAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/ValueAxis.java 2007-06-19 13:29:13 UTC (rev 4) +++ trunk/source/org/jfree/chart/axis/ValueAxis.java 2007-06-19 13:45:35 UTC (rev 5) @@ -158,22 +158,6 @@ /** The default value for the upper margin (0.05 = 5%). */ public static final double DEFAULT_UPPER_MARGIN = 0.05; - /** - * The default lower bound for the axis. - * - * @deprecated From 1.0.5 onwards, the axis defines a defaultRange - * attribute (see {@link #getDefaultAutoRange()}). - */ - public static final double DEFAULT_LOWER_BOUND = 0.0; - - /** - * The default upper bound for the axis. - * - * @deprecated From 1.0.5 onwards, the axis defines a defaultRange - * attribute (see {@link #getDefaultAutoRange()}). - */ - public static final double DEFAULT_UPPER_BOUND = 1.0; - /** The default auto-tick-unit-selection value. */ public static final boolean DEFAULT_AUTO_TICK_UNIT_SELECTION = true; @@ -1034,6 +1018,7 @@ * @return The default auto range (never <code>null</code>). * * @see #setDefaultAutoRange(Range) + * * @since 1.0.5 */ public Range getDefaultAutoRange() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-19 13:54:24
|
Revision: 6 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=6&view=rev Author: mungady Date: 2007-06-19 06:54:17 -0700 (Tue, 19 Jun 2007) Log Message: ----------- 2007-06-19 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/AbstractBlock.java (getBorder): Removed, previously deprecated, (setBorder(BlockBorder)): Likewise, (setBorder(double, double, double, double)): Likewise, * source/org/jfree/chart/title/PaintScaleLegend.java (draw(Graphics2D, Rectangle2D, Object)): Fixed deprecation warnings, * tests/org/jfree/chart/title/junit/CompositeTitleTests.java (testEquals): Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/block/AbstractBlock.java trunk/source/org/jfree/chart/title/PaintScaleLegend.java trunk/tests/org/jfree/chart/title/junit/CompositeTitleTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-19 13:45:35 UTC (rev 5) +++ trunk/ChangeLog 2007-06-19 13:54:17 UTC (rev 6) @@ -1,5 +1,16 @@ 2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/AbstractBlock.java + (getBorder): Removed, previously deprecated, + (setBorder(BlockBorder)): Likewise, + (setBorder(double, double, double, double)): Likewise, + * source/org/jfree/chart/title/PaintScaleLegend.java + (draw(Graphics2D, Rectangle2D, Object)): Fixed deprecation warnings, + * tests/org/jfree/chart/title/junit/CompositeTitleTests.java + (testEquals): Likewise. + +2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/axis/ValueAxis.java (DEFAULT_LOWER_BOUND): Removed, previously deprecated, (DEFAULT_UPPER_BOUND): Likewise. Modified: trunk/source/org/jfree/chart/block/AbstractBlock.java =================================================================== --- trunk/source/org/jfree/chart/block/AbstractBlock.java 2007-06-19 13:45:35 UTC (rev 5) +++ trunk/source/org/jfree/chart/block/AbstractBlock.java 2007-06-19 13:54:17 UTC (rev 6) @@ -45,6 +45,7 @@ * ------------- JFREECHART 1.0.x --------------------------------------------- * 16-Mar-2007 : Changed border from BlockBorder to BlockFrame, updated * equals(), and implemented Cloneable (DG); + * 19-Jun-2007 : Removed get/setBorder() methods, previously deprecated (DG); * */ @@ -226,51 +227,8 @@ double right) { setMargin(new RectangleInsets(top, left, bottom, right)); } - - /** - * Returns the border. - * - * @return The border (never <code>null</code>). - * - * @deprecated Use {@link #getFrame()} instead. - */ - public BlockBorder getBorder() { - if (this.frame instanceof BlockBorder) { - return (BlockBorder) this.frame; - } - else { - return null; - } - } /** - * Sets the border for the block (use {@link BlockBorder#NONE} for - * no border). - * - * @param border the border (<code>null</code> not permitted). - * - * @see #getBorder() - * - * @deprecated Use {@link #setFrame(BlockFrame)} instead. - */ - public void setBorder(BlockBorder border) { - setFrame(border); - } - - /** - * Sets a black border with the specified line widths. - * - * @param top the top border line width. - * @param left the left border line width. - * @param bottom the bottom border line width. - * @param right the right border line width. - */ - public void setBorder(double top, double left, double bottom, - double right) { - setFrame(new BlockBorder(top, left, bottom, right)); - } - - /** * Returns the current frame (border). * * @return The frame. Modified: trunk/source/org/jfree/chart/title/PaintScaleLegend.java =================================================================== --- trunk/source/org/jfree/chart/title/PaintScaleLegend.java 2007-06-19 13:45:35 UTC (rev 5) +++ trunk/source/org/jfree/chart/title/PaintScaleLegend.java 2007-06-19 13:54:17 UTC (rev 6) @@ -37,6 +37,7 @@ * Changes * ------- * 22-Jan-2007 : Version 1 (DG); + * 19-Jun-2007 : Fixed deprecation warnings (DG); * */ @@ -484,8 +485,8 @@ g2.setPaint(this.backgroundPaint); g2.fill(target); } - getBorder().draw(g2, target); - getBorder().getInsets().trim(target); + getFrame().draw(g2, target); + getFrame().getInsets().trim(target); target = trimPadding(target); double base = this.axis.getLowerBound(); double increment = this.axis.getRange().getLength() / SUBDIVISIONS; Modified: trunk/tests/org/jfree/chart/title/junit/CompositeTitleTests.java =================================================================== --- trunk/tests/org/jfree/chart/title/junit/CompositeTitleTests.java 2007-06-19 13:45:35 UTC (rev 5) +++ trunk/tests/org/jfree/chart/title/junit/CompositeTitleTests.java 2007-06-19 13:54:17 UTC (rev 6) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ------------------------ * CompositeTitleTests.java * ------------------------ - * (C) Copyright 2005, by Object Refinery Limited and Contributors. + * (C) Copyright 2005, 2007, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -37,6 +37,7 @@ * Changes * ------- * 04-Feb-2005 : Version 1 (DG); + * 19-Jun-2007 : Fixed deprecation warnings (DG); * */ @@ -98,10 +99,10 @@ t2.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0)); assertTrue(t1.equals(t2)); - // border - t1.setBorder(new BlockBorder(Color.red)); + // frame + t1.setFrame(new BlockBorder(Color.red)); assertFalse(t1.equals(t2)); - t2.setBorder(new BlockBorder(Color.red)); + t2.setFrame(new BlockBorder(Color.red)); assertTrue(t1.equals(t2)); // padding This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-19 13:59:35
|
Revision: 7 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=7&view=rev Author: mungady Date: 2007-06-19 06:59:30 -0700 (Tue, 19 Jun 2007) Log Message: ----------- 2007-06-19 David Gilbert <dav...@ob...> * source/org/jfree/chart/editor/PaletteChooserPanel.java: Removed, * source/org/jfree/chart/editor/PaletteSample.java: Likewise. Modified Paths: -------------- trunk/ChangeLog Removed Paths: ------------- trunk/source/org/jfree/chart/editor/PaletteChooserPanel.java trunk/source/org/jfree/chart/editor/PaletteSample.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-19 13:54:17 UTC (rev 6) +++ trunk/ChangeLog 2007-06-19 13:59:30 UTC (rev 7) @@ -1,5 +1,10 @@ 2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/editor/PaletteChooserPanel.java: Removed, + * source/org/jfree/chart/editor/PaletteSample.java: Likewise. + +2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/AbstractBlock.java (getBorder): Removed, previously deprecated, (setBorder(BlockBorder)): Likewise, Deleted: trunk/source/org/jfree/chart/editor/PaletteChooserPanel.java =================================================================== --- trunk/source/org/jfree/chart/editor/PaletteChooserPanel.java 2007-06-19 13:54:17 UTC (rev 6) +++ trunk/source/org/jfree/chart/editor/PaletteChooserPanel.java 2007-06-19 13:59:30 UTC (rev 7) @@ -1,92 +0,0 @@ -/* =========================================================== - * JFreeChart : a free chart library for the Java(tm) platform - * =========================================================== - * - * (C) Copyright 2000-2007, 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.] - * - * ------------------------ - * PaletteChooserPanel.java - * ------------------------ - * (C) Copyright 2002-2007, by David M. O'Donnell. - * - * Original Author: David M. O'Donnell; - * Contributor(s): David Gilbert (for Object Refinery Limited); - * - * $Id: PaletteChooserPanel.java,v 1.1.2.2 2007/01/31 15:56:18 mungady Exp $ - * - * Changes - * ------- - * 27-Jan-2003 : Added standard header (DG); - * 31-Jan-2007 : Deprecated (DG); - * - */ - -package org.jfree.chart.editor; - -import java.awt.BorderLayout; - -import javax.swing.JComboBox; -import javax.swing.JPanel; - -import org.jfree.chart.plot.ColorPalette; -import org.jfree.chart.plot.RainbowPalette; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYBlockRenderer; - -/** - * A component for choosing a palette from a list of available palettes. - * - * @deprecated This class is no longer supported. If you are creating - * contour plots, please try to use {@link XYPlot} and - * {@link XYBlockRenderer}. - */ -class PaletteChooserPanel extends JPanel { - - /** A combo for selecting the stroke. */ - private JComboBox selector; - - /** - * Constructor. - * - * @param current the current palette sample. - * @param available an array of 'available' palette samples. - */ - public PaletteChooserPanel(PaletteSample current, - PaletteSample[] available) { - setLayout(new BorderLayout()); - this.selector = new JComboBox(available); - this.selector.setSelectedItem(current); - this.selector.setRenderer(new PaletteSample(new RainbowPalette())); - add(this.selector); - } - - /** - * Returns the selected palette. - * - * @return The selected palette. - */ - public ColorPalette getSelectedPalette() { - PaletteSample sample = (PaletteSample) this.selector.getSelectedItem(); - return sample.getPalette(); - } -} Deleted: trunk/source/org/jfree/chart/editor/PaletteSample.java =================================================================== --- trunk/source/org/jfree/chart/editor/PaletteSample.java 2007-06-19 13:54:17 UTC (rev 6) +++ trunk/source/org/jfree/chart/editor/PaletteSample.java 2007-06-19 13:59:30 UTC (rev 7) @@ -1,175 +0,0 @@ -/* =========================================================== - * JFreeChart : a free chart library for the Java(tm) platform - * =========================================================== - * - * (C) Copyright 2000-2007, 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.] - * - * ------------------ - * PaletteSample.java - * ------------------ - * (C) Copyright 2002-2007, by David M. O'Donnell. - * - * Original Author: David M. O'Donnell; - * Contributor(s): David Gilbert (for Object Refinery Limited); - * - * $Id: PaletteSample.java,v 1.1.2.3 2007/04/04 09:09:52 mungady Exp $ - * - * Changes - * ------- - * 21-Jan-2003 : Added standard header (DG); - * ------------- JFREECHART 1.0.x --------------------------------------------- - * 31-Jan-2007 : Deprecated (DG); - * - */ - -package org.jfree.chart.editor; - -import java.awt.BasicStroke; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; -import java.awt.RenderingHints; -import java.awt.geom.Line2D; - -import javax.swing.JComponent; -import javax.swing.JList; -import javax.swing.ListCellRenderer; - -import org.jfree.chart.plot.ColorPalette; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYBlockRenderer; - - -/** - * A panel that displays a palette sample. - * - * @deprecated This class is no longer supported (as of version 1.0.4). If - * you are creating contour plots, please try to use {@link XYPlot} and - * {@link XYBlockRenderer}. - */ -public class PaletteSample extends JComponent implements ListCellRenderer { - - /** The palette being displayed. */ - private ColorPalette palette; - - /** The preferred size of the component; */ - private Dimension preferredSize; - - /** - * Creates a new sample. - * - * @param palette the palette. - */ - public PaletteSample(ColorPalette palette) { - this.palette = palette; - this.preferredSize = new Dimension(80, 18); - } - - /** - * Returns a list cell renderer for the stroke, so the sample can be - * displayed in a list or combo. - * - * @param list the list component. - * @param value the value. - * @param index the index. - * @param isSelected a flag that indicates whether or not the item is - * selected. - * @param cellHasFocus a flag that indicates whether or not the cell has - * the focus. - * - * @return The renderer. - */ - public Component getListCellRendererComponent(JList list, Object value, - int index, - boolean isSelected, - boolean cellHasFocus) { - if (value instanceof PaletteSample) { - PaletteSample in = (PaletteSample) value; - setPalette(in.getPalette()); - } - return this; - } - - /** - * Returns the current palette object being displayed. - * - * @return The palette. - */ - public ColorPalette getPalette() { - return this.palette; - } - - /** - * Returns the preferred size of the component. - * - * @return The preferred size. - */ - public Dimension getPreferredSize() { - return this.preferredSize; - } - - /** - * Draws the sample. - * - * @param g the graphics device. - */ - public void paintComponent(Graphics g) { - - Graphics2D g2 = (Graphics2D) g; - g2.setRenderingHint( - RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF - ); - Dimension size = getSize(); - Insets insets = getInsets(); - double ww = size.getWidth() - insets.left - insets.right; - double hh = size.getHeight() - insets.top - insets.bottom; - - g2.setStroke(new BasicStroke(1.0f)); - - double y1 = insets.top; - double y2 = y1 + hh; - double xx = insets.left; - Line2D line = new Line2D.Double(); - int count = 0; - while (xx <= insets.left + ww) { - count++; - line.setLine(xx, y1, xx, y2); - g2.setPaint(this.palette.getColor(count)); - g2.draw(line); - xx += 1; - } - } - - /** - * Sets the palette object being displayed. - * - * @param palette the palette. - */ - public void setPalette(ColorPalette palette) { - this.palette = palette; - this.repaint(); - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-19 14:02:07
|
Revision: 8 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=8&view=rev Author: mungady Date: 2007-06-19 07:02:02 -0700 (Tue, 19 Jun 2007) Log Message: ----------- 2007-06-19 David Gilbert <dav...@ob...> * source/org/jfree/chart/ClipPath.java: Removed, * source/org/jfree/chart/DrawableLegendItem.java: Likewise. Modified Paths: -------------- trunk/ChangeLog Removed Paths: ------------- trunk/source/org/jfree/chart/ClipPath.java trunk/source/org/jfree/chart/DrawableLegendItem.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-19 13:59:30 UTC (rev 7) +++ trunk/ChangeLog 2007-06-19 14:02:02 UTC (rev 8) @@ -1,5 +1,10 @@ 2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/ClipPath.java: Removed, + * source/org/jfree/chart/DrawableLegendItem.java: Likewise. + +2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/editor/PaletteChooserPanel.java: Removed, * source/org/jfree/chart/editor/PaletteSample.java: Likewise. Deleted: trunk/source/org/jfree/chart/ClipPath.java =================================================================== --- trunk/source/org/jfree/chart/ClipPath.java 2007-06-19 13:59:30 UTC (rev 7) +++ trunk/source/org/jfree/chart/ClipPath.java 2007-06-19 14:02:02 UTC (rev 8) @@ -1,441 +0,0 @@ -/* =========================================================== - * JFreeChart : a free chart library for the Java(tm) platform - * =========================================================== - * - * (C) Copyright 2000-2007, 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.] - * - * ------------- - * ClipPath.java - * ------------- - * (C) Copyright 2003, 2004, 2007, by David M. O'Donnell and Contributors. - * - * Original Author: David M. O'Donnell; - * Contributor(s): David Gilbert (for Object Refinery Limited); - * Nicolas Brodu; - * - * $Id: ClipPath.java,v 1.2.2.3 2007/04/04 09:04:35 mungady Exp $ - * - * Changes - * ------- - * 22-Apr-2003 : Added standard header (DG); - * 09-May-2003 : Added AxisLocation (DG); - * 11-Sep-2003 : Implemented Cloneable (NB); - * 21-Jan-2004 : Update for renamed method in ValueAxis (DG); - * ------------- JFREECHART 1.0.x --------------------------------------------- - * 31-Jan-2007 : Deprecated (DG); - * - */ - -package org.jfree.chart; - -import java.awt.BasicStroke; -import java.awt.Composite; -import java.awt.Graphics2D; -import java.awt.Paint; -import java.awt.Stroke; -import java.awt.geom.GeneralPath; -import java.awt.geom.Rectangle2D; - -import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.plot.XYPlot; -import org.jfree.chart.renderer.xy.XYBlockRenderer; -import org.jfree.ui.RectangleEdge; - -/** - * This class would typically be used with a - * {@link org.jfree.chart.plot.ContourPlot}. It allows the user to define a - * <code>GeneralPath</code> curve in plot coordinates. This curve can then be - * used mask off or define regions within the contour plot. The data must be - * sorted. - * - * @deprecated This class is no longer supported (as of version 1.0.4). If - * you are creating contour plots, please try to use {@link XYPlot} and - * {@link XYBlockRenderer}. - */ -public class ClipPath implements Cloneable { - - /** The x values. */ - private double[] xValue = null; - - /** The y values. */ - private double[] yValue = null; - - /** Controls whether drawing will be clipped ( - * false would still allow the drawing or filling of path */ - private boolean clip = true; - - /** Controls whether the path is drawn as an outline. */ - private boolean drawPath = false; - - /** Controls whether the path is filled. */ - private boolean fillPath = false; - - /** The fill paint. */ - private Paint fillPaint = null; - - /** The draw paint. */ - private Paint drawPaint = null; - - /** The draw stroke. */ - private Stroke drawStroke = null; - - /** The composite. */ - private Composite composite = null; - - /** - * Constructor for ClipPath. - */ - public ClipPath() { - super(); - } - - /** - * Constructor for ClipPath. - * Default values are assumed for the fillPath and drawPath options as - * false and true respectively. The fillPaint is set to Color.GRAY, the - * drawColor is Color.BLUE, the stroke is BasicStroke(1) - * and the composite is AlphaComposite.Src. - * - * @param xValue x coordinates of curved to be created - * @param yValue y coordinates of curved to be created - */ - public ClipPath(double[] xValue, double[] yValue) { - this(xValue, yValue, true, false, true); - } - - - /** - * Constructor for ClipPath. - * The fillPaint is set to Color.GRAY, the drawColor is Color.BLUE, the - * stroke is BasicStroke(1) and the composite is AlphaComposite.Src. - * - * @param xValue x coordinates of curved to be created - * @param yValue y coordinates of curved to be created - * @param clip clip? - * @param fillPath whether the path is to filled - * @param drawPath whether the path is to drawn as an outline - */ - public ClipPath(double[] xValue, double[] yValue, - boolean clip, boolean fillPath, boolean drawPath) { - this.xValue = xValue; - this.yValue = yValue; - - this.clip = clip; - this.fillPath = fillPath; - this.drawPath = drawPath; - - this.fillPaint = java.awt.Color.gray; - this.drawPaint = java.awt.Color.blue; - this.drawStroke = new BasicStroke(1); - this.composite = java.awt.AlphaComposite.Src; - } - - /** - * Constructor for ClipPath. - * - * @param xValue x coordinates of curved to be created - * @param yValue y coordinates of curved to be created - * @param fillPath whether the path is to filled - * @param drawPath whether the path is to drawn as an outline - * @param fillPaint the fill paint - * @param drawPaint the outline stroke color - * @param drawStroke the stroke style - * @param composite the composite rule - */ - public ClipPath(double[] xValue, double[] yValue, boolean fillPath, - boolean drawPath, Paint fillPaint, Paint drawPaint, - Stroke drawStroke, Composite composite) { - - this.xValue = xValue; - this.yValue = yValue; - - this.fillPath = fillPath; - this.drawPath = drawPath; - - this.fillPaint = fillPaint; - this.drawPaint = drawPaint; - this.drawStroke = drawStroke; - this.composite = composite; - - } - - /** - * Draws the clip path. - * - * @param g2 current graphics2D. - * @param dataArea the dataArea that the plot is being draw in. - * @param horizontalAxis the horizontal axis. - * @param verticalAxis the vertical axis. - * - * @return The GeneralPath defining the outline - */ - public GeneralPath draw(Graphics2D g2, - Rectangle2D dataArea, - ValueAxis horizontalAxis, ValueAxis verticalAxis) { - - GeneralPath generalPath = generateClipPath( - dataArea, horizontalAxis, verticalAxis - ); - if (this.fillPath || this.drawPath) { - Composite saveComposite = g2.getComposite(); - Paint savePaint = g2.getPaint(); - Stroke saveStroke = g2.getStroke(); - - if (this.fillPaint != null) { - g2.setPaint(this.fillPaint); - } - if (this.composite != null) { - g2.setComposite(this.composite); - } - if (this.fillPath) { - g2.fill(generalPath); - } - - if (this.drawStroke != null) { - g2.setStroke(this.drawStroke); - } - if (this.drawPath) { - g2.draw(generalPath); - } - g2.setPaint(savePaint); - g2.setComposite(saveComposite); - g2.setStroke(saveStroke); - } - return generalPath; - - } - - /** - * Generates the clip path. - * - * @param dataArea the dataArea that the plot is being draw in. - * @param horizontalAxis the horizontal axis. - * @param verticalAxis the vertical axis. - * - * @return The GeneralPath defining the outline - */ - public GeneralPath generateClipPath(Rectangle2D dataArea, - ValueAxis horizontalAxis, - ValueAxis verticalAxis) { - - GeneralPath generalPath = new GeneralPath(); - double transX = horizontalAxis.valueToJava2D( - this.xValue[0], dataArea, RectangleEdge.BOTTOM - ); - double transY = verticalAxis.valueToJava2D( - this.yValue[0], dataArea, RectangleEdge.LEFT - ); - generalPath.moveTo((float) transX, (float) transY); - for (int k = 0; k < this.yValue.length; k++) { - transX = horizontalAxis.valueToJava2D( - this.xValue[k], dataArea, RectangleEdge.BOTTOM - ); - transY = verticalAxis.valueToJava2D( - this.yValue[k], dataArea, RectangleEdge.LEFT - ); - generalPath.lineTo((float) transX, (float) transY); - } - generalPath.closePath(); - - return generalPath; - - } - - /** - * Returns the composite. - * - * @return Composite - */ - public Composite getComposite() { - return this.composite; - } - - /** - * Returns the drawPaint. - * - * @return Paint - */ - public Paint getDrawPaint() { - return this.drawPaint; - } - - /** - * Returns the drawPath. - * - * @return boolean - */ - public boolean isDrawPath() { - return this.drawPath; - } - - /** - * Returns the drawStroke. - * - * @return Stroke - */ - public Stroke getDrawStroke() { - return this.drawStroke; - } - - /** - * Returns the fillPaint. - * - * @return Paint - */ - public Paint getFillPaint() { - return this.fillPaint; - } - - /** - * Returns the fillPath. - * - * @return boolean - */ - public boolean isFillPath() { - return this.fillPath; - } - - /** - * Returns the xValue. - * - * @return double[] - */ - public double[] getXValue() { - return this.xValue; - } - - /** - * Returns the yValue. - * - * @return double[] - */ - public double[] getYValue() { - return this.yValue; - } - - /** - * Sets the composite. - * - * @param composite The composite to set - */ - public void setComposite(Composite composite) { - this.composite = composite; - } - - /** - * Sets the drawPaint. - * - * @param drawPaint The drawPaint to set - */ - public void setDrawPaint(Paint drawPaint) { - this.drawPaint = drawPaint; - } - - /** - * Sets the drawPath. - * - * @param drawPath The drawPath to set - */ - public void setDrawPath(boolean drawPath) { - this.drawPath = drawPath; - } - - /** - * Sets the drawStroke. - * - * @param drawStroke The drawStroke to set - */ - public void setDrawStroke(Stroke drawStroke) { - this.drawStroke = drawStroke; - } - - /** - * Sets the fillPaint. - * - * @param fillPaint The fillPaint to set - */ - public void setFillPaint(Paint fillPaint) { - this.fillPaint = fillPaint; - } - - /** - * Sets the fillPath. - * - * @param fillPath The fillPath to set - */ - public void setFillPath(boolean fillPath) { - this.fillPath = fillPath; - } - - /** - * Sets the xValue. - * - * @param xValue The xValue to set - */ - public void setXValue(double[] xValue) { - this.xValue = xValue; - } - - /** - * Sets the yValue. - * - * @param yValue The yValue to set - */ - public void setYValue(double[] yValue) { - this.yValue = yValue; - } - - /** - * Returns the clip. - * - * @return boolean - */ - public boolean isClip() { - return this.clip; - } - - /** - * Sets the clip. - * - * @param clip The clip to set - */ - public void setClip(boolean clip) { - this.clip = clip; - } - - /** - * Returns a clone of the object (a deeper clone than default to avoid bugs - * when setting values in cloned object). - * - * @return The clone. - * - * @throws CloneNotSupportedException if cloning is not supported. - */ - public Object clone() throws CloneNotSupportedException { - ClipPath clone = (ClipPath) super.clone(); - clone.xValue = (double[]) this.xValue.clone(); - clone.yValue = (double[]) this.yValue.clone(); - return clone; - } - -} Deleted: trunk/source/org/jfree/chart/DrawableLegendItem.java =================================================================== --- trunk/source/org/jfree/chart/DrawableLegendItem.java 2007-06-19 13:59:30 UTC (rev 7) +++ trunk/source/org/jfree/chart/DrawableLegendItem.java 2007-06-19 14:02:02 UTC (rev 8) @@ -1,255 +0,0 @@ -/* =========================================================== - * JFreeChart : a free chart library for the Java(tm) platform - * =========================================================== - * - * (C) Copyright 2000-2006, 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.] - * - * ----------------------- - * DrawableLegendItem.java - * ----------------------- - * (C) Copyright 2002-2006, by Object Refinery Limited and Contributors. - * - * Original Author: David Gilbert (for Object Refinery Limited); - * Contributor(s): Luke Quinane; - * Barak Naveh; - * - * $Id: DrawableLegendItem.java,v 1.3.2.2 2006/08/01 16:10:44 mungady Exp $ - * - * Changes - * ------- - * 07-Feb-2002 : Version 1 (DG); - * 23-Sep-2002 : Renamed LegendItem --> DrawableLegendItem (DG); - * 02-Oct-2002 : Fixed errors reported by Checkstyle (DG); - * 08-Oct-2003 : Applied patch for displaying series line style, contributed by - * Luke Quinane (DG); - * 27-Mar-2004 : Added getMaxX() and getMaxY() methods (BN); - * 27-Jan-2005 : Cleared out code that belongs in the LegendItem class (DG); - * - */ - -package org.jfree.chart; - -import java.awt.Shape; -import java.awt.geom.Line2D; -import java.awt.geom.Point2D; - -/** - * This class contains a single legend item along with position details for - * drawing the item on a particular chart. - * - * @deprecated This class is not used by JFreeChart. - */ -public class DrawableLegendItem { - - /** - * The legend item (encapsulates information about the label, color and - * shape). - */ - private LegendItem item; - - /** The x-coordinate for the item's location. */ - private double x; - - /** The y-coordinate for the item's location. */ - private double y; - - /** The width of the item. */ - private double width; - - /** The height of the item. */ - private double height; - - /** A shape used to indicate color on the legend. */ - private Shape marker; - - /** A line used to indicate the series stroke on the legend */ - private Line2D line; - - /** The label position within the item. */ - private Point2D labelPosition; - - /** - * Create a legend item. - * - * @param item the legend item for display. - */ - public DrawableLegendItem(LegendItem item) { - this.item = item; - } - - /** - * Returns the legend item. - * - * @return The legend item. - */ - public LegendItem getItem() { - return this.item; - } - - /** - * Get the x-coordinate for the item's location. - * - * @return The x-coordinate for the item's location. - */ - public double getX() { - return this.x; - } - - /** - * Set the x-coordinate for the item's location. - * - * @param x the x-coordinate. - */ - public void setX(double x) { - this.x = x; - } - - /** - * Get the y-coordinate for the item's location. - * - * @return The y-coordinate for the item's location. - */ - public double getY() { - return this.y; - } - - /** - * Set the y-coordinate for the item's location. - * - * @param y the y-coordinate. - */ - public void setY(double y) { - this.y = y; - } - - /** - * Get the width of this item. - * - * @return The width. - */ - public double getWidth() { - return this.width; - } - - /** - * Get the height of this item. - * - * @return The height. - */ - public double getHeight() { - return this.height; - } - - /** - * Returns the largest X coordinate of the framing rectangle of this legend - * item. - * - * @return The largest x coordinate of the framing rectangle of this legend - * item. - */ - public double getMaxX() { - return getX() + getWidth(); - } - - /** - * Returns the largest Y coordinate of the framing rectangle of this legend - * item. - * - * @return The largest Y coordinate of the framing rectangle of this legend - * item. - */ - public double getMaxY() { - return getY() + getHeight(); - } - - /** - * Get the marker. - * - * @return The shape used to indicate color on the legend for this item. - */ - public Shape getMarker() { - return this.marker; - } - - /** - * Set the marker. - * - * @param marker a shape used to indicate color on the legend for this - * item. - */ - public void setMarker(Shape marker) { - this.marker = marker; - } - - /** - * Sets the line used to label this series. - * - * @param l the new line to use. - */ - public void setLine(Line2D l) { - this.line = l; - } - - /** - * Returns the list. - * - * @return The line. - */ - public Line2D getLine() { - return this.line; - } - - /** - * Returns the label position. - * - * @return The label position. - */ - public Point2D getLabelPosition() { - return this.labelPosition; - } - - /** - * Sets the label position. - * - * @param position the label position. - */ - public void setLabelPosition(Point2D position) { - this.labelPosition = position; - } - - /** - * Set the bounds of this item. - * - * @param x x-coordinate for the item's location. - * @param y y-coordinate for the item's location. - * @param width the width of this item. - * @param height the height of this item. - */ - public void setBounds(double x, double y, double width, double height) { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-19 14:11:06
|
Revision: 9 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=9&view=rev Author: mungady Date: 2007-06-19 07:11:04 -0700 (Tue, 19 Jun 2007) Log Message: ----------- 2007-06-19 David Gilbert <dav...@ob...> * source/org/jfree/chart/entity/CategoryItemEntity.java (series): Removed, previously deprecated, (category): Likewise, (categoryIndex): Likewise, (CategoryItemEntity()): Likewise, (getSeries): Likewise, (setSeries): Likewise, (getCategory): Likewise, (setCategory): Likewise, (getCategoryIndex): Likewise, (setCategoryIndex): Likewise, * source/org/jfree/chart/entity/junit/CategoryItemEntityTests.java (testEquals): Updated for removed methods. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/entity/CategoryItemEntity.java trunk/tests/org/jfree/chart/entity/junit/CategoryItemEntityTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-19 14:02:02 UTC (rev 8) +++ trunk/ChangeLog 2007-06-19 14:11:04 UTC (rev 9) @@ -1,5 +1,21 @@ 2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/entity/CategoryItemEntity.java + (series): Removed, previously deprecated, + (category): Likewise, + (categoryIndex): Likewise, + (CategoryItemEntity()): Likewise, + (getSeries): Likewise, + (setSeries): Likewise, + (getCategory): Likewise, + (setCategory): Likewise, + (getCategoryIndex): Likewise, + (setCategoryIndex): Likewise, + * source/org/jfree/chart/entity/junit/CategoryItemEntityTests.java + (testEquals): Updated for removed methods. + +2007-06-19 David Gilbert <dav...@ob...> + * source/org/jfree/chart/ClipPath.java: Removed, * source/org/jfree/chart/DrawableLegendItem.java: Likewise. Modified: trunk/source/org/jfree/chart/entity/CategoryItemEntity.java =================================================================== --- trunk/source/org/jfree/chart/entity/CategoryItemEntity.java 2007-06-19 14:02:02 UTC (rev 8) +++ trunk/source/org/jfree/chart/entity/CategoryItemEntity.java 2007-06-19 14:11:04 UTC (rev 9) @@ -49,6 +49,7 @@ * 11-Jan-2005 : Removed deprecated code in preparation for 1.0.0 release (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 18-May-2007 : Updated to use row and column keys to identify item (DG); + * 19-Jun-2007 : Removed deprecated code (DG); * */ @@ -71,31 +72,7 @@ /** The dataset. */ private CategoryDataset dataset; - - /** - * The series (zero-based index). - * - * @deprecated As of 1.0.6, this field is redundant as you can derive the - * index from the <code>rowKey</code> field. - */ - private int series; - - /** - * The category. - * - * @deprecated As of 1.0.6, this field is deprecated in favour of the - * <code>columnKey</code> field. - */ - private Object category; - /** - * The category index. - * - * @deprecated As of 1.0.6, this field is redundant as you can derive the - * index from the <code>columnKey</code> field. - */ - private int categoryIndex; - /** * The row key. * @@ -109,36 +86,6 @@ * @since 1.0.6 */ private Comparable columnKey; - - /** - * Creates a new category item entity. - * - * @param area the area (<code>null</code> not permitted). - * @param toolTipText the tool tip text. - * @param urlText the URL text for HTML image maps. - * @param dataset the dataset. - * @param series the series (zero-based index). - * @param category the category. - * @param categoryIndex the category index. - * - * @deprecated As of 1.0.6, use {@link #CategoryItemEntity(Shape, String, - * String, CategoryDataset, Comparable, Comparable)}. - */ - public CategoryItemEntity(Shape area, String toolTipText, String urlText, - CategoryDataset dataset, - int series, Object category, int categoryIndex) { - - super(area, toolTipText, urlText); - if (dataset == null) { - throw new IllegalArgumentException("Null 'dataset' argument."); - } - this.dataset = dataset; - this.series = series; - this.category = category; - this.categoryIndex = categoryIndex; - this.rowKey = dataset.getRowKey(series); - this.columnKey = dataset.getColumnKey(categoryIndex); - } /** * Creates a new entity instance for an item in the specified dataset. @@ -161,11 +108,6 @@ this.dataset = dataset; this.rowKey = rowKey; this.columnKey = columnKey; - - // populate the deprecated fields - this.series = dataset.getRowIndex(rowKey); - this.category = columnKey; - this.categoryIndex = dataset.getColumnIndex(columnKey); } /** @@ -219,8 +161,6 @@ */ public void setRowKey(Comparable rowKey) { this.rowKey = rowKey; - // update the deprecated field - this.series = this.dataset.getRowIndex(rowKey); } /** @@ -247,96 +187,9 @@ */ public void setColumnKey(Comparable columnKey) { this.columnKey = columnKey; - // update the deprecated fields - this.category = columnKey; - this.categoryIndex = this.dataset.getColumnIndex(columnKey); } /** - * Returns the series index. - * - * @return The series index. - * - * @see #setSeries(int) - * - * @deprecated As of 1.0.6, you can derive this information from the - * {@link #getRowKey()} method. - */ - public int getSeries() { - return this.series; - } - - /** - * Sets the series index. - * - * @param series the series index (zero-based). - * - * @see #getSeries() - * - * @deprecated As of 1.0.6, you should use {@link #setRowKey(Comparable)} - * to designate the series. - */ - public void setSeries(int series) { - this.series = series; - } - - /** - * Returns the category. - * - * @return The category (possibly <code>null</code>). - * - * @see #setCategory(Object) - * - * @deprecated The return type for this method should be - * <code>Comparable</code>, so it has been deprecated as of - * version 1.0.6 and replaced by {@link #getColumnKey()}. - */ - public Object getCategory() { - return this.category; - } - - /** - * Sets the category. - * - * @param category the category (<code>null</code> permitted). - * - * @see #getCategory() - * - * @deprecated As of version 1.0.6, use {@link #setColumnKey(Comparable)}. - */ - public void setCategory(Object category) { - this.category = category; - } - - /** - * Returns the category index. - * - * @return The index. - * - * @see #setCategoryIndex(int) - * - * @deprecated As of 1.0.6, you can derive this information from the - * {@link #getColumnKey()} method. - */ - public int getCategoryIndex() { - return this.categoryIndex; - } - - /** - * Sets the category index. - * - * @param index the category index. - * - * @see #getCategoryIndex() - * - * @deprecated As of 1.0.6, use {@link #setColumnKey(Comparable)} to - * designate the category. - */ - public void setCategoryIndex(int index) { - this.categoryIndex = index; - } - - /** * Returns a string representing this object (useful for debugging * purposes). * @@ -371,17 +224,6 @@ if (!ObjectUtilities.equal(this.dataset, that.dataset)) { return false; } - - // check the deprecated fields - if (this.categoryIndex != that.categoryIndex) { - return false; - } - if (this.series != that.series) { - return false; - } - if (!ObjectUtilities.equal(this.category, that.category)) { - return false; - } return super.equals(obj); } Modified: trunk/tests/org/jfree/chart/entity/junit/CategoryItemEntityTests.java =================================================================== --- trunk/tests/org/jfree/chart/entity/junit/CategoryItemEntityTests.java 2007-06-19 14:02:02 UTC (rev 8) +++ trunk/tests/org/jfree/chart/entity/junit/CategoryItemEntityTests.java 2007-06-19 14:11:04 UTC (rev 9) @@ -37,6 +37,7 @@ * Changes * ------- * 20-May-2004 : Version 1 (DG); + * 19-Jun-2007 : Updated for deprecation removals (DG); * */ @@ -90,9 +91,9 @@ d.addValue(3.0, "R2", "C1"); d.addValue(4.0, "R2", "C2"); CategoryItemEntity e1 = new CategoryItemEntity(new Rectangle2D.Double( - 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, 1, "C2", 1); + 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, "R2", "C2"); CategoryItemEntity e2 = new CategoryItemEntity(new Rectangle2D.Double( - 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, 1, "C2", 1); + 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, "R2", "C2"); assertTrue(e1.equals(e2)); e1.setArea(new Rectangle2D.Double(4.0, 3.0, 2.0, 1.0)); @@ -110,21 +111,16 @@ e2.setURLText("New URL"); assertTrue(e1.equals(e2)); - e1.setCategory("C1"); + e1.setColumnKey("C1"); assertFalse(e1.equals(e2)); - e2.setCategory("C1"); + e2.setColumnKey("C1"); assertTrue(e1.equals(e2)); - e1.setCategoryIndex(0); + e1.setRowKey("R1"); assertFalse(e1.equals(e2)); - e2.setCategoryIndex(0); + e2.setRowKey("R1"); assertTrue(e1.equals(e2)); - e1.setSeries(0); - assertFalse(e1.equals(e2)); - e2.setSeries(0); - assertTrue(e1.equals(e2)); - } /** @@ -137,7 +133,7 @@ d.addValue(3.0, "R2", "C1"); d.addValue(4.0, "R2", "C2"); CategoryItemEntity e1 = new CategoryItemEntity(new Rectangle2D.Double( - 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, 1, "C2", 1); + 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, "C2", "C2"); CategoryItemEntity e2 = null; try { @@ -161,7 +157,7 @@ d.addValue(3.0, "R2", "C1"); d.addValue(4.0, "R2", "C2"); CategoryItemEntity e1 = new CategoryItemEntity(new Rectangle2D.Double( - 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, 1, "C2", 1); + 1.0, 2.0, 3.0, 4.0), "ToolTip", "URL", d, "R2", "C2"); CategoryItemEntity e2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); @@ -177,7 +173,6 @@ catch (Exception e) { e.printStackTrace(); } - boolean b = e1.equals(e2); assertEquals(e1, e2); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-20 09:08:23
|
Revision: 20 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=20&view=rev Author: mungady Date: 2007-06-20 02:08:18 -0700 (Wed, 20 Jun 2007) Log Message: ----------- 2007-06-20 David Gilbert <dav...@ob...> * source/org/jfree/cahrt/renderer/LookupPaintScale.java (add(Number, Paint)): Removed, * tests/org/jfree/chart/renderer/junit/LookupPaintScaleTests.java: Updated for deprecated code removal, * tests/org/jfree/chart/renderer/xy/junit/XYBlockRendererTests.java: Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/renderer/LookupPaintScale.java trunk/tests/org/jfree/chart/renderer/junit/LookupPaintScaleTests.java trunk/tests/org/jfree/chart/renderer/xy/junit/XYBlockRendererTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-20 08:56:07 UTC (rev 19) +++ trunk/ChangeLog 2007-06-20 09:08:18 UTC (rev 20) @@ -1,5 +1,14 @@ 2007-06-20 David Gilbert <dav...@ob...> + * source/org/jfree/cahrt/renderer/LookupPaintScale.java + (add(Number, Paint)): Removed, + * tests/org/jfree/chart/renderer/junit/LookupPaintScaleTests.java: + Updated for deprecated code removal, + * tests/org/jfree/chart/renderer/xy/junit/XYBlockRendererTests.java: + Likewise. + +2007-06-20 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/AbstractRenderer.java (seriesVisible): Removed, (seriesVisibleInLegend): Likewise, @@ -6094,4 +6103,4 @@ * source/org/jfree/chart/renderer/category/StackedBarRenderer.java (drawItem): use item outline stroke, not regular stroke. -For changes prior to 30-Sep-2005, please refer to the file CHANGELOG.txt. \ No newline at end of file +For changes prior to 30-Sep-2005, you'll need to search the archives. \ No newline at end of file Modified: trunk/source/org/jfree/chart/renderer/LookupPaintScale.java =================================================================== --- trunk/source/org/jfree/chart/renderer/LookupPaintScale.java 2007-06-20 08:56:07 UTC (rev 19) +++ trunk/source/org/jfree/chart/renderer/LookupPaintScale.java 2007-06-20 09:08:18 UTC (rev 20) @@ -40,6 +40,7 @@ * 31-Jan-2007 : Fixed serialization support (DG); * 09-Mar-2007 : Fixed cloning (DG); * 14-Jun-2007 : Use double primitive in PaintItem (DG); + * 20-Jun-2007 : Removed deprecated code (DG); * */ @@ -229,20 +230,6 @@ public double getUpperBound() { return this.upperBound; } - - /** - * Adds an entry to the lookup table. Any values from <code>n</code> up - * to but not including the next value in the table take on the specified - * <code>paint</code>. - * - * @param value the data value (<code>null</code> not permitted). - * @param paint the paint. - * - * @deprecated Use {@link #add(double, Paint)}. - */ - public void add(Number value, Paint paint) { - add(value.doubleValue(), paint); - } /** * Adds an entry to the lookup table. Any values from <code>n</code> up Modified: trunk/tests/org/jfree/chart/renderer/junit/LookupPaintScaleTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/junit/LookupPaintScaleTests.java 2007-06-20 08:56:07 UTC (rev 19) +++ trunk/tests/org/jfree/chart/renderer/junit/LookupPaintScaleTests.java 2007-06-20 09:08:18 UTC (rev 20) @@ -40,6 +40,7 @@ * 31-Jan-2007 : Additional serialization tests (DG); * 07-Mar-2007 : Added new tests (DG); * 09-Mar-2007 : Check independence in testCloning() (DG); + * 20-Jun-2007 : Updated for deprecated code removal (DG); * */ @@ -97,11 +98,11 @@ g2 = new LookupPaintScale(1.0, 2.0, Color.red); assertTrue(g1.equals(g2)); - g1.add(new Double(1.5), new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, - 4.0f, Color.blue)); + g1.add(1.5, new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, + Color.blue)); assertFalse(g1.equals(g2)); - g2.add(new Double(1.5), new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, - 4.0f, Color.blue)); + g2.add(1.5, new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, + Color.blue)); assertTrue(g1.equals(g2)); } @@ -122,16 +123,16 @@ assertTrue(g1.equals(g2)); // check independence - g1.add(new Double(0.5), Color.red); + g1.add(0.5, Color.red); assertFalse(g1.equals(g2)); - g2.add(new Double(0.5), Color.red); + g2.add(0.5, Color.red); assertTrue(g1.equals(g2)); // try with gradient paint g1 = new LookupPaintScale(1.0, 2.0, new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.green)); - g1.add(new Double(1.5), new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, - 4.0f, Color.blue)); + g1.add(1.5, new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, + Color.blue)); g2 = null; try { g2 = (LookupPaintScale) g1.clone(); @@ -168,7 +169,7 @@ g1 = new LookupPaintScale(1.0, 2.0, new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); - g1.add(new Double(1.5), new GradientPaint(1.1f, 2.2f, Color.red, 3.3f, + g1.add(1.5, new GradientPaint(1.1f, 2.2f, Color.red, 3.3f, 4.4f, Color.blue)); g2 = null; try { @@ -221,21 +222,21 @@ assertEquals(Color.black, s.getPaint(100.0)); assertEquals(Color.black, s.getPaint(101.0)); - s.add(new Double(50.0), Color.blue); + s.add(50.0, Color.blue); assertEquals(Color.black, s.getPaint(-1.0)); assertEquals(Color.black, s.getPaint(0.0)); assertEquals(Color.blue, s.getPaint(50.0)); assertEquals(Color.blue, s.getPaint(100.0)); assertEquals(Color.black, s.getPaint(101.0)); - s.add(new Double(50.0), Color.red); + s.add(50.0, Color.red); assertEquals(Color.black, s.getPaint(-1.0)); assertEquals(Color.black, s.getPaint(0.0)); assertEquals(Color.red, s.getPaint(50.0)); assertEquals(Color.red, s.getPaint(100.0)); assertEquals(Color.black, s.getPaint(101.0)); - s.add(new Double(25.0), Color.green); + s.add(25.0, Color.green); assertEquals(Color.black, s.getPaint(-1.0)); assertEquals(Color.black, s.getPaint(0.0)); assertEquals(Color.green, s.getPaint(25.0)); @@ -243,7 +244,7 @@ assertEquals(Color.red, s.getPaint(100.0)); assertEquals(Color.black, s.getPaint(101.0)); - s.add(new Double(75.0), Color.yellow); + s.add(75.0, Color.yellow); assertEquals(Color.black, s.getPaint(-1.0)); assertEquals(Color.black, s.getPaint(0.0)); assertEquals(Color.green, s.getPaint(25.0)); Modified: trunk/tests/org/jfree/chart/renderer/xy/junit/XYBlockRendererTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/xy/junit/XYBlockRendererTests.java 2007-06-20 08:56:07 UTC (rev 19) +++ trunk/tests/org/jfree/chart/renderer/xy/junit/XYBlockRendererTests.java 2007-06-20 09:08:18 UTC (rev 20) @@ -38,6 +38,7 @@ * ------- * 05-Jul-2006 : Version 1 (DG); * 09-Mar-2007 : Added independence check to testCloning (DG); + * 20-Jun-2007 : Updated for deprecated code removal (DG); * */ @@ -144,10 +145,10 @@ assertTrue(r1.equals(r2)); // check independence - scale1.add(new Double(0.5), Color.red); + scale1.add(0.5, Color.red); assertFalse(r1.equals(r2)); LookupPaintScale scale2 = (LookupPaintScale) r2.getPaintScale(); - scale2.add(new Double(0.5), Color.red); + scale2.add(0.5, Color.red); assertTrue(r1.equals(r2)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-20 09:50:55
|
Revision: 28 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=28&view=rev Author: mungady Date: 2007-06-20 02:50:54 -0700 (Wed, 20 Jun 2007) Log Message: ----------- 2007-06-20 David Gilbert <dav...@ob...> * source/org/jfree/data/xy/XYSeries.java (update(int, Number)): Removed. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/data/xy/XYSeries.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-20 09:47:33 UTC (rev 27) +++ trunk/ChangeLog 2007-06-20 09:50:54 UTC (rev 28) @@ -1,5 +1,10 @@ 2007-06-20 David Gilbert <dav...@ob...> + * source/org/jfree/data/xy/XYSeries.java + (update(int, Number)): Removed. + +2007-06-20 David Gilbert <dav...@ob...> + * source/org/jfree/data/time/TimeSeriesCollection.java (domainIsPointsInTime): Removed, (TimeSeriesCollection(TimeSeries, TimeZone)): Updated for removed field, Modified: trunk/source/org/jfree/data/xy/XYSeries.java =================================================================== --- trunk/source/org/jfree/data/xy/XYSeries.java 2007-06-20 09:47:33 UTC (rev 27) +++ trunk/source/org/jfree/data/xy/XYSeries.java 2007-06-20 09:50:54 UTC (rev 28) @@ -67,6 +67,7 @@ * ------------- JFreeChart 1.0.x --------------------------------------------- * 11-Jan-2005 : Renamed update(int, Number) --> updateByIndex() (DG); * 15-Jan-2007 : Added toArray() method (DG); + * 20-Jun-2007 : Removed deprecated code (DG); * */ @@ -470,33 +471,19 @@ /** * Updates the value of an item in the series and sends a * {@link SeriesChangeEvent} to all registered listeners. - * + * * @param index the item (zero based index). * @param y the new value (<code>null</code> permitted). * - * @deprecated Renamed {@link #updateByIndex(int, Number)} to avoid - * confusion with the {@link #update(Number, Number)} method. + * @since 1.0.1 */ - public void update(int index, Number y) { + public void updateByIndex(int index, Number y) { XYDataItem item = getDataItem(index); item.setY(y); fireSeriesChanged(); } /** - * Updates the value of an item in the series and sends a - * {@link SeriesChangeEvent} to all registered listeners. - * - * @param index the item (zero based index). - * @param y the new value (<code>null</code> permitted). - * - * @since 1.0.1 - */ - public void updateByIndex(int index, Number y) { - update(index, y); - } - - /** * Updates an item in the series. * * @param x the x-value (<code>null</code> not permitted). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-20 12:46:36
|
Revision: 34 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=34&view=rev Author: mungady Date: 2007-06-20 05:46:31 -0700 (Wed, 20 Jun 2007) Log Message: ----------- 2007-06-20 David Gilbert <dav...@ob...> * experimental/org/jfree/experimental/chart/demo/DialDemo1.java: Removed JCommon dependencies, * experimental/org/jfree/experimental/chart/demo/DialDemo2.java: Likewise, * experimental/org/jfree/experimental/chart/demo/DialDemo3.java: Likewise, * experimental/org/jfree/experimental/chart/demo/DialDemo4.java: Likewise, * experimental/org/jfree/experimental/chart/demo/DialDemo5.java: Likewise, * experimental/org/jfree/experimental/chart/plot/dial/DialBackground.java: Likewise, * experimental/org/jfree/experimental/chart/plot/dial/junit/DialBackgroundTests.java: Likewise, * source/org/jfree/chart/LegendItem.java: Likewise, * source/org/jfree/chart/plot/IntervalMarker.java: Likewise, * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java: Likewise, * source/org/jfree/chart/renderer/category/BarRenderer.java: Likewise, * source/org/jfree/chart/renderer/category/LayeredBarRenderer.java: Likewise, * source/org/jfree/chart/renderer/category/StackedBarRenderer.java: Likewise, * source/org/jfree/chart/renderer/category/WaterfallBarRenderer.java: Likewise, * source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java: Likewise, * source/org/jfree/chart/renderer/xy/XYBarRenderer.java: Likewise, * source/org/jfree/chart/title/LegendGraphics.java: Likewise, * source/org/jfree/chart/util/GradientPaintTransformer.java: New class copied from JCommon, * source/org/jfree/chart/util/GradientPaintTransformType.java: Likewise, * source/org/jfree/chart/util/StandardGradientPaintTransformer.java: Likewise, * tests/org/jfree/chart/junit/LegendItemtests.java: Removed JCommon dependencies, * tests/org/jfree/chart/plot/junit/IntervalMarkerTests.java: Likewise, * tests/org/jfree/chart/renderer/category/junit/BarRendererTests.java: Likewise, * tests/org/jfree/chart/renderer/xy/XYBarRendererTests.java: Likewise, * tests/org/jfree/chart/title/junit/LegendGraphicTests.java: Likewise. Modified Paths: -------------- trunk/experimental/org/jfree/experimental/chart/demo/DialDemo1.java trunk/experimental/org/jfree/experimental/chart/demo/DialDemo2.java trunk/experimental/org/jfree/experimental/chart/demo/DialDemo3.java trunk/experimental/org/jfree/experimental/chart/demo/DialDemo4.java trunk/experimental/org/jfree/experimental/chart/demo/DialDemo5.java trunk/experimental/org/jfree/experimental/chart/plot/dial/DialBackground.java trunk/experimental/org/jfree/experimental/chart/plot/dial/junit/DialBackgroundTests.java trunk/source/org/jfree/chart/LegendItem.java trunk/source/org/jfree/chart/plot/IntervalMarker.java trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java trunk/source/org/jfree/chart/renderer/category/BarRenderer.java trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java trunk/source/org/jfree/chart/renderer/category/StackedBarRenderer.java trunk/source/org/jfree/chart/renderer/category/WaterfallBarRenderer.java trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java trunk/source/org/jfree/chart/renderer/xy/XYBarRenderer.java trunk/source/org/jfree/chart/title/LegendGraphic.java trunk/tests/org/jfree/chart/junit/LegendItemTests.java trunk/tests/org/jfree/chart/plot/junit/IntervalMarkerTests.java trunk/tests/org/jfree/chart/renderer/category/junit/BarRendererTests.java trunk/tests/org/jfree/chart/renderer/xy/junit/XYBarRendererTests.java trunk/tests/org/jfree/chart/title/junit/LegendGraphicTests.java Added Paths: ----------- trunk/source/org/jfree/chart/util/GradientPaintTransformType.java trunk/source/org/jfree/chart/util/GradientPaintTransformer.java trunk/source/org/jfree/chart/util/StandardGradientPaintTransformer.java Modified: trunk/experimental/org/jfree/experimental/chart/demo/DialDemo1.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/demo/DialDemo1.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/experimental/org/jfree/experimental/chart/demo/DialDemo1.java 2007-06-20 12:46:31 UTC (rev 34) @@ -1,7 +1,7 @@ /* -------------- * DialDemo1.java * -------------- - * (C) Copyright 2006, by Object Refinery Limited. + * (C) Copyright 2006, 2007, by Object Refinery Limited. */ package org.jfree.experimental.chart.demo; @@ -12,25 +12,27 @@ import java.awt.Font; import java.awt.GradientPaint; import java.awt.Point; + import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JSlider; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; + import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; +import org.jfree.data.general.DefaultValueDataset; +import org.jfree.experimental.chart.plot.dial.DialBackground; +import org.jfree.experimental.chart.plot.dial.DialCap; import org.jfree.experimental.chart.plot.dial.DialPlot; +import org.jfree.experimental.chart.plot.dial.DialPointer; +import org.jfree.experimental.chart.plot.dial.DialTextAnnotation; +import org.jfree.experimental.chart.plot.dial.DialValueIndicator; import org.jfree.experimental.chart.plot.dial.SimpleDialFrame; -import org.jfree.experimental.chart.plot.dial.DialTextAnnotation; import org.jfree.experimental.chart.plot.dial.StandardDialRange; import org.jfree.experimental.chart.plot.dial.StandardDialScale; -import org.jfree.experimental.chart.plot.dial.DialBackground; -import org.jfree.experimental.chart.plot.dial.DialCap; -import org.jfree.experimental.chart.plot.dial.DialPointer; -import org.jfree.experimental.chart.plot.dial.DialValueIndicator; -import org.jfree.data.general.DefaultValueDataset; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; /** * A sample application showing the use of a {@link DialPlot}. Modified: trunk/experimental/org/jfree/experimental/chart/demo/DialDemo2.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/demo/DialDemo2.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/experimental/org/jfree/experimental/chart/demo/DialDemo2.java 2007-06-20 12:46:31 UTC (rev 34) @@ -1,7 +1,7 @@ /* -------------- * DialDemo2.java * -------------- - * (C) Copyright 2006, by Object Refinery Limited. + * (C) Copyright 2006, 2007, by Object Refinery Limited. */ package org.jfree.experimental.chart.demo; @@ -23,6 +23,8 @@ import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.general.DefaultValueDataset; import org.jfree.experimental.chart.plot.dial.DialBackground; import org.jfree.experimental.chart.plot.dial.DialCap; @@ -32,8 +34,6 @@ import org.jfree.experimental.chart.plot.dial.DialValueIndicator; import org.jfree.experimental.chart.plot.dial.SimpleDialFrame; import org.jfree.experimental.chart.plot.dial.StandardDialScale; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; /** * A sample application showing the use of a {@link DialPlot}. Modified: trunk/experimental/org/jfree/experimental/chart/demo/DialDemo3.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/demo/DialDemo3.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/experimental/org/jfree/experimental/chart/demo/DialDemo3.java 2007-06-20 12:46:31 UTC (rev 34) @@ -1,7 +1,7 @@ /* -------------- * DialDemo3.java * -------------- - * (C) Copyright 2006, by Object Refinery Limited. + * (C) Copyright 2006, 2007, by Object Refinery Limited. */ package org.jfree.experimental.chart.demo; @@ -21,14 +21,14 @@ import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.general.DefaultValueDataset; import org.jfree.experimental.chart.plot.dial.DialBackground; import org.jfree.experimental.chart.plot.dial.DialPlot; import org.jfree.experimental.chart.plot.dial.DialPointer; import org.jfree.experimental.chart.plot.dial.StandardDialFrame; import org.jfree.experimental.chart.plot.dial.StandardDialScale; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; /** * A sample application showing the use of a {@link DialPlot}. Modified: trunk/experimental/org/jfree/experimental/chart/demo/DialDemo4.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/demo/DialDemo4.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/experimental/org/jfree/experimental/chart/demo/DialDemo4.java 2007-06-20 12:46:31 UTC (rev 34) @@ -1,7 +1,7 @@ /* -------------- * DialDemo4.java * -------------- - * (C) Copyright 2006, by Object Refinery Limited. + * (C) Copyright 2006, 2007, by Object Refinery Limited. */ package org.jfree.experimental.chart.demo; @@ -22,14 +22,14 @@ import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.general.DefaultValueDataset; import org.jfree.experimental.chart.plot.dial.DialBackground; import org.jfree.experimental.chart.plot.dial.DialPlot; import org.jfree.experimental.chart.plot.dial.DialPointer; import org.jfree.experimental.chart.plot.dial.StandardDialFrame; import org.jfree.experimental.chart.plot.dial.StandardDialScale; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; /** * A sample application showing the use of a {@link DialPlot}. Modified: trunk/experimental/org/jfree/experimental/chart/demo/DialDemo5.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/demo/DialDemo5.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/experimental/org/jfree/experimental/chart/demo/DialDemo5.java 2007-06-20 12:46:31 UTC (rev 34) @@ -1,7 +1,7 @@ /* -------------- * DialDemo5.java * -------------- - * (C) Copyright 2006, by Object Refinery Limited. + * (C) Copyright 2006, 2007, by Object Refinery Limited. */ package org.jfree.experimental.chart.demo; @@ -21,6 +21,8 @@ import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.general.DefaultValueDataset; import org.jfree.experimental.chart.plot.dial.DialBackground; import org.jfree.experimental.chart.plot.dial.DialCap; @@ -28,8 +30,6 @@ import org.jfree.experimental.chart.plot.dial.DialPointer; import org.jfree.experimental.chart.plot.dial.SimpleDialFrame; import org.jfree.experimental.chart.plot.dial.StandardDialScale; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; /** * A sample application showing the use of a {@link DialPlot}. Modified: trunk/experimental/org/jfree/experimental/chart/plot/dial/DialBackground.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/plot/dial/DialBackground.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/experimental/org/jfree/experimental/chart/plot/dial/DialBackground.java 2007-06-20 12:46:31 UTC (rev 34) @@ -37,6 +37,7 @@ * Changes * ------- * 03-Nov-2006 : Version 1 (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -53,9 +54,9 @@ import java.io.Serializable; import org.jfree.chart.HashUtilities; +import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.io.SerialUtilities; -import org.jfree.ui.GradientPaintTransformer; -import org.jfree.ui.StandardGradientPaintTransformer; import org.jfree.util.PaintUtilities; import org.jfree.util.PublicCloneable; Modified: trunk/experimental/org/jfree/experimental/chart/plot/dial/junit/DialBackgroundTests.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/plot/dial/junit/DialBackgroundTests.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/experimental/org/jfree/experimental/chart/plot/dial/junit/DialBackgroundTests.java 2007-06-20 12:46:31 UTC (rev 34) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ------------------------ * DialBackgroundTests.java * ------------------------ - * (C) Copyright 2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2006, 2007, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -37,6 +37,7 @@ * Changes * ------- * 03-Nov-2006 : Version 1 (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -55,9 +56,9 @@ import junit.framework.TestCase; import junit.framework.TestSuite; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.experimental.chart.plot.dial.DialBackground; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; /** * Tests for the {@link DialBackground} class. Modified: trunk/source/org/jfree/chart/LegendItem.java =================================================================== --- trunk/source/org/jfree/chart/LegendItem.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/LegendItem.java 2007-06-20 12:46:31 UTC (rev 34) @@ -55,6 +55,7 @@ * 20-Jul-2006 : Added dataset and series index fields (DG); * 13-Dec-2006 : Added fillPaintTransformer attribute (DG); * 18-May-2007 : Added dataset and seriesKey fields (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -73,10 +74,10 @@ import java.text.AttributedString; import java.text.CharacterIterator; +import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.general.Dataset; import org.jfree.io.SerialUtilities; -import org.jfree.ui.GradientPaintTransformer; -import org.jfree.ui.StandardGradientPaintTransformer; import org.jfree.util.AttributedStringUtilities; import org.jfree.util.ObjectUtilities; import org.jfree.util.ShapeUtilities; Modified: trunk/source/org/jfree/chart/plot/IntervalMarker.java =================================================================== --- trunk/source/org/jfree/chart/plot/IntervalMarker.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/plot/IntervalMarker.java 2007-06-20 12:46:31 UTC (rev 34) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ------------------- * IntervalMarker.java * ------------------- - * (C) Copyright 2002-2006, by Object Refinery Limited. + * (C) Copyright 2002-2007, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -41,6 +41,7 @@ * 26-Mar-2003 : Implemented Serializable (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 05-Sep-2006 : Added MarkerChangeEvent notification (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -53,7 +54,7 @@ import java.io.Serializable; import org.jfree.chart.event.MarkerChangeEvent; -import org.jfree.ui.GradientPaintTransformer; +import org.jfree.chart.util.GradientPaintTransformer; import org.jfree.ui.LengthAdjustmentType; import org.jfree.util.ObjectUtilities; Modified: trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -95,7 +95,7 @@ * itemLabelGenerator, toolTipGenerator and itemURLGenerator * override fields (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); - * 20-Jun-2007 : Removed deprecated code (DG); + * 20-Jun-2007 : Removed deprecated code and removed JCommon dependencies (DG); * */ @@ -136,11 +136,11 @@ import org.jfree.chart.plot.ValueMarker; import org.jfree.chart.renderer.AbstractRenderer; import org.jfree.chart.urls.CategoryURLGenerator; +import org.jfree.chart.util.GradientPaintTransformer; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.data.general.DatasetUtilities; import org.jfree.text.TextUtilities; -import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.LengthAdjustmentType; import org.jfree.ui.RectangleAnchor; import org.jfree.ui.RectangleInsets; Modified: trunk/source/org/jfree/chart/renderer/category/BarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/BarRenderer.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/renderer/category/BarRenderer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -111,13 +111,13 @@ import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; +import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.data.general.DatasetUtilities; import org.jfree.text.TextUtilities; -import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.RectangleEdge; -import org.jfree.ui.StandardGradientPaintTransformer; import org.jfree.util.ObjectUtilities; import org.jfree.util.PublicCloneable; Modified: trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -47,6 +47,7 @@ * 18-Aug-2006 : Fixed the bar width calculation to respect the maximum bar * width setting (thanks to Zoheb Borbora) (DG); * 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -67,8 +68,8 @@ import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; +import org.jfree.chart.util.GradientPaintTransformer; import org.jfree.data.category.CategoryDataset; -import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.RectangleEdge; import org.jfree.util.ObjectList; Modified: trunk/source/org/jfree/chart/renderer/category/StackedBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/StackedBarRenderer.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/renderer/category/StackedBarRenderer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -88,6 +88,7 @@ * 1304139 (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 11-Oct-2006 : Source reformatting (DG); + * 20-Jun-2007 : Removed JCommon dependency (DG); * */ @@ -108,11 +109,11 @@ import org.jfree.chart.labels.ItemLabelPosition; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; +import org.jfree.chart.util.GradientPaintTransformer; import org.jfree.data.DataUtilities; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.data.general.DatasetUtilities; -import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.RectangleEdge; import org.jfree.ui.TextAnchor; import org.jfree.util.PublicCloneable; Modified: trunk/source/org/jfree/chart/renderer/category/WaterfallBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/WaterfallBarRenderer.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/renderer/category/WaterfallBarRenderer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -50,6 +50,7 @@ * 20-Apr-2005 : Renamed CategoryLabelGenerator * --> CategoryItemLabelGenerator (DG); * 09-Jun-2005 : Use addItemEntity() from superclass (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -74,13 +75,13 @@ import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.renderer.AbstractRenderer; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; import org.jfree.data.general.DatasetUtilities; import org.jfree.io.SerialUtilities; -import org.jfree.ui.GradientPaintTransformType; import org.jfree.ui.RectangleEdge; -import org.jfree.ui.StandardGradientPaintTransformer; import org.jfree.util.PaintUtilities; import org.jfree.util.PublicCloneable; Modified: trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -101,7 +101,7 @@ * 20-Apr-2007 : Updated getLegendItem() for renderer change, and deprecated * itemLabelGenerator and toolTipGenerator override fields (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); - * 20-Jun-2007 : Removed deprecated code (DG); + * 20-Jun-2007 : Removed deprecated code and removed JCommon dependencies (DG); * */ @@ -146,11 +146,11 @@ import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.AbstractRenderer; import org.jfree.chart.urls.XYURLGenerator; +import org.jfree.chart.util.GradientPaintTransformer; import org.jfree.data.Range; import org.jfree.data.general.DatasetUtilities; import org.jfree.data.xy.XYDataset; import org.jfree.text.TextUtilities; -import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.Layer; import org.jfree.ui.LengthAdjustmentType; import org.jfree.ui.RectangleAnchor; Modified: trunk/source/org/jfree/chart/renderer/xy/XYBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/xy/XYBarRenderer.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/renderer/xy/XYBarRenderer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -118,15 +118,15 @@ import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.Range; import org.jfree.data.general.DatasetUtilities; import org.jfree.data.xy.IntervalXYDataset; import org.jfree.data.xy.XYDataset; import org.jfree.io.SerialUtilities; import org.jfree.text.TextUtilities; -import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.RectangleEdge; -import org.jfree.ui.StandardGradientPaintTransformer; import org.jfree.util.ObjectUtilities; import org.jfree.util.PublicCloneable; import org.jfree.util.ShapeUtilities; Modified: trunk/source/org/jfree/chart/title/LegendGraphic.java =================================================================== --- trunk/source/org/jfree/chart/title/LegendGraphic.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/source/org/jfree/chart/title/LegendGraphic.java 2007-06-20 12:46:31 UTC (rev 34) @@ -66,11 +66,11 @@ import org.jfree.chart.block.Block; import org.jfree.chart.block.LengthConstraintType; import org.jfree.chart.block.RectangleConstraint; +import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.io.SerialUtilities; -import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.RectangleAnchor; import org.jfree.ui.Size2D; -import org.jfree.ui.StandardGradientPaintTransformer; import org.jfree.util.ObjectUtilities; import org.jfree.util.PaintUtilities; import org.jfree.util.PublicCloneable; Added: trunk/source/org/jfree/chart/util/GradientPaintTransformType.java =================================================================== --- trunk/source/org/jfree/chart/util/GradientPaintTransformType.java (rev 0) +++ trunk/source/org/jfree/chart/util/GradientPaintTransformType.java 2007-06-20 12:46:31 UTC (rev 34) @@ -0,0 +1,156 @@ +/* =========================================================== + * JFreeChart : a free chart library for the Java(tm) platform + * =========================================================== + * + * (C) Copyright 2000-2007, 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.] + * + * ------------------------------- + * GradientPaintTransformType.java + * ------------------------------- + * (C) Copyright 2003-2007, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * $Id: GradientPaintTransformType.java,v 1.4 2005/10/18 13:18:34 mungady Exp $ + * + * Changes: + * -------- + * 21-Oct-2003 : Version 1 (DG); + * 20-Jun-2007 : Copied from JCommon (DG); + * + */ + +package org.jfree.chart.util; + +import java.io.ObjectStreamException; +import java.io.Serializable; + +/** + * Represents a type of transform for a <code>GradientPaint</code>. + */ +public final class GradientPaintTransformType implements Serializable { + + /** For serialization. */ + private static final long serialVersionUID = 8331561784933982450L; + + /** Vertical. */ + public static final GradientPaintTransformType VERTICAL + = new GradientPaintTransformType("GradientPaintTransformType.VERTICAL"); + + /** Horizontal. */ + public static final GradientPaintTransformType HORIZONTAL + = new GradientPaintTransformType( + "GradientPaintTransformType.HORIZONTAL"); + + /** Center/vertical. */ + public static final GradientPaintTransformType CENTER_VERTICAL + = new GradientPaintTransformType( + "GradientPaintTransformType.CENTER_VERTICAL"); + + /** Center/horizontal. */ + public static final GradientPaintTransformType CENTER_HORIZONTAL + = new GradientPaintTransformType( + "GradientPaintTransformType.CENTER_HORIZONTAL"); + + /** The name. */ + private String name; + + /** + * Private constructor. + * + * @param name the name. + */ + private GradientPaintTransformType(String name) { + this.name = name; + } + + /** + * Returns a string representing the object. + * + * @return The string. + */ + public String toString() { + return this.name; + } + + /** + * Returns <code>true</code> if this object is equal to the specified + * object, and <code>false</code> otherwise. + * + * @param obj the other object. + * + * @return A boolean. + */ + public boolean equals(Object obj) { + + if (this == obj) { + return true; + } + if (!(obj instanceof GradientPaintTransformType)) { + return false; + } + + GradientPaintTransformType t = (GradientPaintTransformType) obj; + if (!this.name.equals(t.name)) { + return false; + } + + return true; + } + + /** + * Returns a hash code value for the object. + * + * @return the hashcode + */ + public int hashCode() { + return this.name.hashCode(); + } + + /** + * Ensures that serialization returns the unique instances. + * + * @return The object. + * + * @throws ObjectStreamException if there is a problem. + */ + private Object readResolve() throws ObjectStreamException { + GradientPaintTransformType result = null; + if (this.equals(GradientPaintTransformType.HORIZONTAL)) { + result = GradientPaintTransformType.HORIZONTAL; + } + else if (this.equals(GradientPaintTransformType.VERTICAL)) { + result = GradientPaintTransformType.VERTICAL; + } + else if (this.equals(GradientPaintTransformType.CENTER_HORIZONTAL)) { + result = GradientPaintTransformType.CENTER_HORIZONTAL; + } + else if (this.equals(GradientPaintTransformType.CENTER_VERTICAL)) { + result = GradientPaintTransformType.CENTER_VERTICAL; + } + return result; + } + +} + Added: trunk/source/org/jfree/chart/util/GradientPaintTransformer.java =================================================================== --- trunk/source/org/jfree/chart/util/GradientPaintTransformer.java (rev 0) +++ trunk/source/org/jfree/chart/util/GradientPaintTransformer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -0,0 +1,67 @@ +/* =========================================================== + * JFreeChart : a free chart library for the Java(tm) platform + * =========================================================== + * + * (C) Copyright 2000-2007, 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.] + * + * ----------------------------- + * GradientPaintTransformer.java + * ----------------------------- + * (C) Copyright 2003-2007, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * $Id: GradientPaintTransformer.java,v 1.4 2007/04/03 12:34:13 mungady Exp $ + * + * Changes + * ------- + * 28-Oct-2003 : Version 1 (DG); + * 20-Jun-2007 : Copied from JCommon (DG); + * + */ + +package org.jfree.chart.util; + +import java.awt.GradientPaint; +import java.awt.Shape; + +/** + * The interface for a class that can transform a <code>GradientPaint</code> to + * fit an arbitrary shape. + */ +public interface GradientPaintTransformer { + + /** + * Transforms a <code>GradientPaint</code> instance to fit some target + * shape. Classes that implement this method typically return a new + * instance of <code>GradientPaint</code>. + * + * @param paint the original paint (not <code>null</code>). + * @param target the reference area (not <code>null</code>). + * + * @return A transformed paint. + */ + public GradientPaint transform(GradientPaint paint, Shape target); + +} Added: trunk/source/org/jfree/chart/util/StandardGradientPaintTransformer.java =================================================================== --- trunk/source/org/jfree/chart/util/StandardGradientPaintTransformer.java (rev 0) +++ trunk/source/org/jfree/chart/util/StandardGradientPaintTransformer.java 2007-06-20 12:46:31 UTC (rev 34) @@ -0,0 +1,184 @@ +/* =========================================================== + * JFreeChart : a free chart library for the Java(tm) platform + * =========================================================== + * + * (C) Copyright 2000-2007, 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.] + * + * ------------------------------------- + * StandardGradientPaintTransformer.java + * ------------------------------------- + * (C) Copyright 2003-2007, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * $Id: StandardGradientPaintTransformer.java,v 1.11 2007/04/03 13:55:13 mungady Exp $ + * + * Changes + * ------- + * 28-Oct-2003 : Version 1 (DG); + * 19-Mar-2004 : Added equals() method (DG); + * 20-Jun-2007 : Copied from JCommon (DG); + * + */ + +package org.jfree.chart.util; + +import java.awt.GradientPaint; +import java.awt.Shape; +import java.awt.geom.Rectangle2D; +import java.io.Serializable; + +import org.jfree.util.PublicCloneable; + +/** + * Transforms a <code>GradientPaint</code> to range over the width of a target + * shape. Instances of this class are immutable. + */ +public class StandardGradientPaintTransformer + implements GradientPaintTransformer, Cloneable, PublicCloneable, + Serializable { + + /** For serialization. */ + private static final long serialVersionUID = -8155025776964678320L; + + /** The transform type. */ + private GradientPaintTransformType type; + + /** + * Creates a new transformer with the type + * {@link GradientPaintTransformType#VERTICAL}. + */ + public StandardGradientPaintTransformer() { + this(GradientPaintTransformType.VERTICAL); + } + + /** + * Creates a new transformer with the specified type. + * + * @param type the transform type (<code>null</code> not permitted). + */ + public StandardGradientPaintTransformer(GradientPaintTransformType type) { + if (type == null) { + throw new IllegalArgumentException("Null 'type' argument."); + } + this.type = type; + } + + /** + * Returns the type of transform. + * + * @return The type of transform (never <code>null</code>). + */ + public GradientPaintTransformType getType() { + return this.type; + } + + /** + * Transforms a <code>GradientPaint</code> instance to fit the specified + * <code>target</code> shape. + * + * @param paint the original paint (<code>null</code> not permitted). + * @param target the target shape (<code>null</code> not permitted). + * + * @return The transformed paint. + */ + public GradientPaint transform(GradientPaint paint, Shape target) { + + GradientPaint result = paint; + Rectangle2D bounds = target.getBounds2D(); + + if (this.type.equals(GradientPaintTransformType.VERTICAL)) { + result = new GradientPaint((float) bounds.getCenterX(), + (float) bounds.getMinY(), paint.getColor1(), + (float) bounds.getCenterX(), (float) bounds.getMaxY(), + paint.getColor2()); + } + else if (this.type.equals(GradientPaintTransformType.HORIZONTAL)) { + result = new GradientPaint((float) bounds.getMinX(), + (float) bounds.getCenterY(), paint.getColor1(), + (float) bounds.getMaxX(), (float) bounds.getCenterY(), + paint.getColor2()); + } + else if (this.type.equals( + GradientPaintTransformType.CENTER_HORIZONTAL)) { + result = new GradientPaint((float) bounds.getCenterX(), + (float) bounds.getCenterY(), paint.getColor2(), + (float) bounds.getMaxX(), (float) bounds.getCenterY(), + paint.getColor1(), true); + } + else if (this.type.equals(GradientPaintTransformType.CENTER_VERTICAL)) { + result = new GradientPaint((float) bounds.getCenterX(), + (float) bounds.getMinY(), paint.getColor1(), + (float) bounds.getCenterX(), (float) bounds.getCenterY(), + paint.getColor2(), true); + } + + return result; + } + + /** + * Tests this instance for equality with an arbitrary object. + * + * @param obj the object (<code>null</code> permitted). + * + * @return A boolean. + */ + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof StandardGradientPaintTransformer)) { + return false; + } + StandardGradientPaintTransformer that + = (StandardGradientPaintTransformer) obj; + if (this.type != that.type) { + return false; + } + return true; + } + + /** + * Returns a clone of the transformer. Note that instances of this class + * are immutable, so cloning an instance isn't really necessary. + * + * @return A clone. + * + * @throws CloneNotSupportedException not thrown by this class, but + * subclasses (if any) might. + */ + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + /** + * Returns a hash code for this object. + * + * @return A hash code. + */ + public int hashCode() { + return (this.type != null ? this.type.hashCode() : 0); + } + +} Modified: trunk/tests/org/jfree/chart/junit/LegendItemTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/LegendItemTests.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/tests/org/jfree/chart/junit/LegendItemTests.java 2007-06-20 12:46:31 UTC (rev 34) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * -------------------- * LegendItemTests.java * -------------------- - * (C) Copyright 2004-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2004-2007, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -40,6 +40,7 @@ * 10-Dec-2005 : Addded new test to cover bug report 1374328 (DG); * 13-Dec-2006 : Extended testEquals() for new fillPaintTransformer * attribute (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -64,8 +65,8 @@ import junit.framework.TestSuite; import org.jfree.chart.LegendItem; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; /** * Tests for the {@link LegendItem} class. Modified: trunk/tests/org/jfree/chart/plot/junit/IntervalMarkerTests.java =================================================================== --- trunk/tests/org/jfree/chart/plot/junit/IntervalMarkerTests.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/tests/org/jfree/chart/plot/junit/IntervalMarkerTests.java 2007-06-20 12:46:31 UTC (rev 34) @@ -57,16 +57,15 @@ import org.jfree.chart.event.MarkerChangeEvent; import org.jfree.chart.event.MarkerChangeListener; import org.jfree.chart.plot.IntervalMarker; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.GradientPaintTransformer; -import org.jfree.ui.StandardGradientPaintTransformer; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.StandardGradientPaintTransformer; /** * Tests for the {@link IntervalMarker} class. */ -public class IntervalMarkerTests - extends TestCase - implements MarkerChangeListener { +public class IntervalMarkerTests extends TestCase + implements MarkerChangeListener { MarkerChangeEvent lastEvent; Modified: trunk/tests/org/jfree/chart/renderer/category/junit/BarRendererTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/category/junit/BarRendererTests.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/tests/org/jfree/chart/renderer/category/junit/BarRendererTests.java 2007-06-20 12:46:31 UTC (rev 34) @@ -42,6 +42,7 @@ * 18-May-2005 : Added field to equals() test (DG); * 22-Sep-2005 : Renamed getMaxBarWidth() --> getMaximumBarWidth() (DG); * 11-May-2007 : Added testGetLegendItem() (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -69,9 +70,9 @@ import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.renderer.category.BarRenderer; import org.jfree.chart.renderer.junit.RendererChangeDetector; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.category.DefaultCategoryDataset; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; import org.jfree.ui.TextAnchor; /** Modified: trunk/tests/org/jfree/chart/renderer/xy/junit/XYBarRendererTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/xy/junit/XYBarRendererTests.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/tests/org/jfree/chart/renderer/xy/junit/XYBarRendererTests.java 2007-06-20 12:46:31 UTC (rev 34) @@ -40,6 +40,7 @@ * 22-Oct-2003 : Added hashCode test (DG); * 09-Feb-2007 : Added to testCloning() (DG); * 17-May-2007 : Added testGetLegendItemSeriesIndex() (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -65,12 +66,12 @@ import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYBarRenderer; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.data.Range; import org.jfree.data.xy.XYBarDataset; import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; -import org.jfree.ui.GradientPaintTransformType; -import org.jfree.ui.StandardGradientPaintTransformer; /** * Tests for the {@link XYBarRenderer} class. Modified: trunk/tests/org/jfree/chart/title/junit/LegendGraphicTests.java =================================================================== --- trunk/tests/org/jfree/chart/title/junit/LegendGraphicTests.java 2007-06-20 11:37:13 UTC (rev 33) +++ trunk/tests/org/jfree/chart/title/junit/LegendGraphicTests.java 2007-06-20 12:46:31 UTC (rev 34) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ----------------------- * LegendGraphicTests.java * ----------------------- - * (C) Copyright 2005, 2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2005-2007, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -37,6 +37,7 @@ * Changes * ------- * 01-Sep-2005 : Version 1 (DG); + * 20-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -60,9 +61,9 @@ import junit.framework.TestSuite; import org.jfree.chart.title.LegendGraphic; -import org.jfree.ui.GradientPaintTransformType; +import org.jfree.chart.util.GradientPaintTransformType; +import org.jfree.chart.util.StandardGradientPaintTransformer; import org.jfree.ui.RectangleAnchor; -import org.jfree.ui.StandardGradientPaintTransformer; /** * Tests for the {@link LegendGraphic} class. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-20 13:11:11
|
Revision: 36 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=36&view=rev Author: mungady Date: 2007-06-20 06:10:53 -0700 (Wed, 20 Jun 2007) Log Message: ----------- 2007-06-20 David Gilbert <dav...@ob...> * source/org/jfree/chart/util/Layer.java: New class copied from JCommon, * source/org/jfree/chart/ChartFactory.java: Removed JCommon dependencies, * source/org/jfree/chart/plot/CategoryPlot.java: Likewise, * source/org/jfree/chart/plot/XYPlot.java: Likewise, * source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java: Likewise, * source/org/jfree/chart/renderer/xy/XYItemRenderer.java: Likewise, * tests/org/jfree/chart/plot/junit/CategoryPlotTests.java: Likewise, * tests/org/jfree/chart/plot/junit/XYPlotTests.java: Likewise, * tests/org/jfree/chart/renderer/xy/junit/YIntervalRendererTests.java: Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/ChartFactory.java trunk/source/org/jfree/chart/plot/CategoryPlot.java trunk/source/org/jfree/chart/plot/XYPlot.java trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java trunk/tests/org/jfree/chart/plot/junit/CategoryPlotTests.java trunk/tests/org/jfree/chart/plot/junit/XYPlotTests.java trunk/tests/org/jfree/chart/renderer/xy/junit/YIntervalRendererTests.java Added Paths: ----------- trunk/source/org/jfree/chart/util/Layer.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/ChangeLog 2007-06-20 13:10:53 UTC (rev 36) @@ -1,5 +1,20 @@ 2007-06-20 David Gilbert <dav...@ob...> + * source/org/jfree/chart/util/Layer.java: New class copied from JCommon, + * source/org/jfree/chart/ChartFactory.java: Removed JCommon + dependencies, + * source/org/jfree/chart/plot/CategoryPlot.java: Likewise, + * source/org/jfree/chart/plot/XYPlot.java: Likewise, + * source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java: + Likewise, + * source/org/jfree/chart/renderer/xy/XYItemRenderer.java: Likewise, + * tests/org/jfree/chart/plot/junit/CategoryPlotTests.java: Likewise, + * tests/org/jfree/chart/plot/junit/XYPlotTests.java: Likewise, + * tests/org/jfree/chart/renderer/xy/junit/YIntervalRendererTests.java: + Likewise. + +2007-06-20 David Gilbert <dav...@ob...> + * experimental/org/jfree/experimental/chart/demo/DialDemo1.java: Removed JCommon dependencies, * experimental/org/jfree/experimental/chart/demo/DialDemo2.java: Modified: trunk/source/org/jfree/chart/ChartFactory.java =================================================================== --- trunk/source/org/jfree/chart/ChartFactory.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/source/org/jfree/chart/ChartFactory.java 2007-06-20 13:10:53 UTC (rev 36) @@ -191,6 +191,7 @@ import org.jfree.chart.urls.StandardXYURLGenerator; import org.jfree.chart.urls.StandardXYZURLGenerator; import org.jfree.chart.urls.XYURLGenerator; +import org.jfree.chart.util.Layer; import org.jfree.chart.util.SortOrder; import org.jfree.data.category.CategoryDataset; import org.jfree.data.category.IntervalCategoryDataset; @@ -205,7 +206,6 @@ import org.jfree.data.xy.WindDataset; import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYZDataset; -import org.jfree.ui.Layer; import org.jfree.ui.RectangleEdge; import org.jfree.ui.RectangleInsets; import org.jfree.ui.TextAnchor; Modified: trunk/source/org/jfree/chart/plot/CategoryPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/CategoryPlot.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/source/org/jfree/chart/plot/CategoryPlot.java 2007-06-20 13:10:53 UTC (rev 36) @@ -197,6 +197,7 @@ import org.jfree.chart.event.RendererChangeListener; import org.jfree.chart.renderer.category.CategoryItemRenderer; import org.jfree.chart.renderer.category.CategoryItemRendererState; +import org.jfree.chart.util.Layer; import org.jfree.chart.util.SortOrder; import org.jfree.data.Range; import org.jfree.data.category.CategoryDataset; @@ -204,7 +205,6 @@ import org.jfree.data.general.DatasetChangeEvent; import org.jfree.data.general.DatasetUtilities; import org.jfree.io.SerialUtilities; -import org.jfree.ui.Layer; import org.jfree.ui.RectangleEdge; import org.jfree.ui.RectangleInsets; import org.jfree.util.ObjectList; Modified: trunk/source/org/jfree/chart/plot/XYPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/XYPlot.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/source/org/jfree/chart/plot/XYPlot.java 2007-06-20 13:10:53 UTC (rev 36) @@ -236,13 +236,13 @@ import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; import org.jfree.chart.renderer.xy.XYItemRenderer; import org.jfree.chart.renderer.xy.XYItemRendererState; +import org.jfree.chart.util.Layer; import org.jfree.data.Range; import org.jfree.data.general.Dataset; import org.jfree.data.general.DatasetChangeEvent; import org.jfree.data.general.DatasetUtilities; import org.jfree.data.xy.XYDataset; import org.jfree.io.SerialUtilities; -import org.jfree.ui.Layer; import org.jfree.ui.RectangleEdge; import org.jfree.ui.RectangleInsets; import org.jfree.util.ObjectList; Modified: trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2007-06-20 13:10:53 UTC (rev 36) @@ -147,11 +147,11 @@ import org.jfree.chart.renderer.AbstractRenderer; import org.jfree.chart.urls.XYURLGenerator; import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.Layer; import org.jfree.data.Range; import org.jfree.data.general.DatasetUtilities; import org.jfree.data.xy.XYDataset; import org.jfree.text.TextUtilities; -import org.jfree.ui.Layer; import org.jfree.ui.LengthAdjustmentType; import org.jfree.ui.RectangleAnchor; import org.jfree.ui.RectangleInsets; Modified: trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java 2007-06-20 13:10:53 UTC (rev 36) @@ -111,9 +111,9 @@ import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.urls.XYURLGenerator; +import org.jfree.chart.util.Layer; import org.jfree.data.Range; import org.jfree.data.xy.XYDataset; -import org.jfree.ui.Layer; /** * Interface for rendering the visual representation of a single (x, y) item on Added: trunk/source/org/jfree/chart/util/Layer.java =================================================================== --- trunk/source/org/jfree/chart/util/Layer.java (rev 0) +++ trunk/source/org/jfree/chart/util/Layer.java 2007-06-20 13:10:53 UTC (rev 36) @@ -0,0 +1,113 @@ +/** + * ---------- + * Layer.java + * ---------- + * (C) Copyright 2003-2007, by Object Refinery Limited. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * $Id: Layer.java,v 1.4 2005/10/18 13:18:34 mungady Exp $ + * + * Changes: + * -------- + * 17-Sep-2003 : Version 1 (DG); + * 20-Jun-2007 : Copied from JCommon (DG); + * + */ + +package org.jfree.chart.util; + +import java.io.ObjectStreamException; +import java.io.Serializable; + +/** + * Used to indicate either the foreground or background layer. + */ +public final class Layer implements Serializable { + + /** For serialization. */ + private static final long serialVersionUID = -1470104570733183430L; + + /** Foreground. */ + public static final Layer FOREGROUND = new Layer("Layer.FOREGROUND"); + + /** Background. */ + public static final Layer BACKGROUND = new Layer("Layer.BACKGROUND"); + + /** The name. */ + private String name; + + /** + * Private constructor. + * + * @param name the name. + */ + private Layer(String name) { + this.name = name; + } + + /** + * Returns a string representing the object. + * + * @return The string. + */ + public String toString() { + return this.name; + } + + /** + * Returns <code>true</code> if this object is equal to the specified + * object, and <code>false</code> otherwise. + * + * @param obj the other object. + * + * @return A boolean. + */ + public boolean equals(Object obj) { + + if (this == obj) { + return true; + } + if (!(obj instanceof Layer)) { + return false; + } + + Layer layer = (Layer) obj; + if (!this.name.equals(layer.name)) { + return false; + } + + return true; + + } + + /** + * Returns a hash code value for the object. + * + * @return the hashcode + */ + public int hashCode() { + return this.name.hashCode(); + } + + /** + * Ensures that serialization returns the unique instances. + * + * @return The object. + * + * @throws ObjectStreamException if there is a problem. + */ + private Object readResolve() throws ObjectStreamException { + Layer result = null; + if (this.equals(Layer.FOREGROUND)) { + result = Layer.FOREGROUND; + } + else if (this.equals(Layer.BACKGROUND)) { + result = Layer.BACKGROUND; + } + return result; + } + +} + Modified: trunk/tests/org/jfree/chart/plot/junit/CategoryPlotTests.java =================================================================== --- trunk/tests/org/jfree/chart/plot/junit/CategoryPlotTests.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/tests/org/jfree/chart/plot/junit/CategoryPlotTests.java 2007-06-20 13:10:53 UTC (rev 36) @@ -86,10 +86,10 @@ import org.jfree.chart.renderer.category.BarRenderer; import org.jfree.chart.renderer.category.CategoryItemRenderer; import org.jfree.chart.renderer.category.LineAndShapeRenderer; +import org.jfree.chart.util.Layer; import org.jfree.chart.util.SortOrder; import org.jfree.data.Range; import org.jfree.data.category.DefaultCategoryDataset; -import org.jfree.ui.Layer; import org.jfree.ui.RectangleInsets; /** Modified: trunk/tests/org/jfree/chart/plot/junit/XYPlotTests.java =================================================================== --- trunk/tests/org/jfree/chart/plot/junit/XYPlotTests.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/tests/org/jfree/chart/plot/junit/XYPlotTests.java 2007-06-20 13:10:53 UTC (rev 36) @@ -87,6 +87,7 @@ import org.jfree.chart.renderer.xy.XYBarRenderer; import org.jfree.chart.renderer.xy.XYItemRenderer; import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; +import org.jfree.chart.util.Layer; import org.jfree.data.time.Day; import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesCollection; @@ -96,7 +97,6 @@ import org.jfree.data.xy.XYSeries; import org.jfree.data.xy.XYSeriesCollection; import org.jfree.date.MonthConstants; -import org.jfree.ui.Layer; import org.jfree.ui.RectangleInsets; /** Modified: trunk/tests/org/jfree/chart/renderer/xy/junit/YIntervalRendererTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/xy/junit/YIntervalRendererTests.java 2007-06-20 12:47:49 UTC (rev 35) +++ trunk/tests/org/jfree/chart/renderer/xy/junit/YIntervalRendererTests.java 2007-06-20 13:10:53 UTC (rev 36) @@ -65,9 +65,9 @@ import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.YIntervalRenderer; import org.jfree.chart.urls.StandardXYURLGenerator; +import org.jfree.chart.util.Layer; import org.jfree.data.xy.YIntervalSeries; import org.jfree.data.xy.YIntervalSeriesCollection; -import org.jfree.ui.Layer; /** * Tests for the {@link YIntervalRenderer} class. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-21 11:18:12
|
Revision: 52 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=52&view=rev Author: mungady Date: 2007-06-21 04:18:10 -0700 (Thu, 21 Jun 2007) Log Message: ----------- Removed JCommon dependencies. Modified Paths: -------------- trunk/experimental/org/jfree/experimental/chart/plot/dial/DialPlot.java trunk/source/org/jfree/chart/annotations/AbstractXYAnnotation.java trunk/source/org/jfree/chart/axis/CategoryTick.java trunk/source/org/jfree/chart/axis/DateAxis.java trunk/source/org/jfree/chart/axis/DateTick.java trunk/source/org/jfree/chart/axis/DateTickUnit.java trunk/source/org/jfree/chart/axis/MarkerAxisBand.java trunk/source/org/jfree/chart/axis/NumberAxis.java trunk/source/org/jfree/chart/axis/Tick.java trunk/source/org/jfree/chart/block/Block.java trunk/source/org/jfree/chart/block/BorderArrangement.java trunk/source/org/jfree/chart/entity/CategoryItemEntity.java trunk/source/org/jfree/chart/entity/LegendItemEntity.java trunk/source/org/jfree/chart/labels/AbstractXYItemLabelGenerator.java trunk/source/org/jfree/chart/labels/BubbleXYItemLabelGenerator.java trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java trunk/source/org/jfree/chart/labels/StandardXYZToolTipGenerator.java trunk/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java trunk/source/org/jfree/chart/plot/CombinedDomainXYPlot.java trunk/source/org/jfree/chart/renderer/DefaultPolarItemRenderer.java trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java trunk/source/org/jfree/chart/text/TextUtilities.java trunk/source/org/jfree/chart/title/ImageTitle.java trunk/source/org/jfree/chart/title/Title.java trunk/source/org/jfree/chart/urls/StandardCategoryURLGenerator.java trunk/source/org/jfree/chart/urls/StandardPieURLGenerator.java trunk/source/org/jfree/chart/urls/StandardXYURLGenerator.java Modified: trunk/experimental/org/jfree/experimental/chart/plot/dial/DialPlot.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/plot/dial/DialPlot.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/experimental/org/jfree/experimental/chart/plot/dial/DialPlot.java 2007-06-21 11:18:10 UTC (rev 52) @@ -38,6 +38,7 @@ * ------- * 03-Nov-2006 : Version 1 (DG); * 08-Mar-2007 : Fix in hashCode() (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -58,10 +59,10 @@ import org.jfree.chart.plot.Plot; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.PlotState; +import org.jfree.chart.util.ObjectList; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.general.DatasetChangeEvent; import org.jfree.data.general.ValueDataset; -import org.jfree.util.ObjectList; -import org.jfree.util.ObjectUtilities; /** * A dial plot. Modified: trunk/source/org/jfree/chart/annotations/AbstractXYAnnotation.java =================================================================== --- trunk/source/org/jfree/chart/annotations/AbstractXYAnnotation.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/annotations/AbstractXYAnnotation.java 2007-06-21 11:18:10 UTC (rev 52) @@ -39,6 +39,7 @@ * 29-Sep-2004 : Version 1 (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 06-Mar-2007 : Implemented hashCode() (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -53,7 +54,7 @@ import org.jfree.chart.entity.XYAnnotationEntity; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.XYPlot; -import org.jfree.util.ObjectUtilities; +import org.jfree.chart.util.ObjectUtilities; /** * The interface that must be supported by annotations that are to be added to Modified: trunk/source/org/jfree/chart/axis/CategoryTick.java =================================================================== --- trunk/source/org/jfree/chart/axis/CategoryTick.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/axis/CategoryTick.java 2007-06-21 11:18:10 UTC (rev 52) @@ -47,7 +47,7 @@ import org.jfree.chart.text.TextAnchor; import org.jfree.chart.text.TextBlock; import org.jfree.chart.text.TextBlockAnchor; -import org.jfree.util.ObjectUtilities; +import org.jfree.chart.util.ObjectUtilities; /** * A tick for a {@link CategoryAxis}. Modified: trunk/source/org/jfree/chart/axis/DateAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/DateAxis.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/axis/DateAxis.java 2007-06-21 11:18:10 UTC (rev 52) @@ -141,6 +141,7 @@ import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.ValueAxisPlot; import org.jfree.chart.text.TextAnchor; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.chart.util.RectangleEdge; import org.jfree.chart.util.RectangleInsets; import org.jfree.data.Range; @@ -148,7 +149,6 @@ import org.jfree.data.time.Month; import org.jfree.data.time.RegularTimePeriod; import org.jfree.data.time.Year; -import org.jfree.util.ObjectUtilities; /** * The base class for axes that display dates. You will find it easier to Modified: trunk/source/org/jfree/chart/axis/DateTick.java =================================================================== --- trunk/source/org/jfree/chart/axis/DateTick.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/axis/DateTick.java 2007-06-21 11:18:10 UTC (rev 52) @@ -47,7 +47,7 @@ import java.util.Date; import org.jfree.chart.text.TextAnchor; -import org.jfree.util.ObjectUtilities; +import org.jfree.chart.util.ObjectUtilities; /** * A tick used by the {@link DateAxis} class. Modified: trunk/source/org/jfree/chart/axis/DateTickUnit.java =================================================================== --- trunk/source/org/jfree/chart/axis/DateTickUnit.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/axis/DateTickUnit.java 2007-06-21 11:18:10 UTC (rev 52) @@ -49,6 +49,7 @@ * 21-Mar-2007 : Added toString() for debugging (DG); * 04-Apr-2007 : Added new methods addToDate(Date, TimeZone) and rollDate(Date, * TimeZone) (CB); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -60,7 +61,7 @@ import java.util.Date; import java.util.TimeZone; -import org.jfree.util.ObjectUtilities; +import org.jfree.chart.util.ObjectUtilities; /** * A tick unit for use by subclasses of {@link DateAxis}. Instances of this Modified: trunk/source/org/jfree/chart/axis/MarkerAxisBand.java =================================================================== --- trunk/source/org/jfree/chart/axis/MarkerAxisBand.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/axis/MarkerAxisBand.java 2007-06-21 11:18:10 UTC (rev 52) @@ -64,8 +64,8 @@ import org.jfree.chart.plot.IntervalMarker; import org.jfree.chart.text.TextUtilities; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.chart.util.RectangleEdge; -import org.jfree.util.ObjectUtilities; /** * A band that can be added to a number axis to display regions. Modified: trunk/source/org/jfree/chart/axis/NumberAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/NumberAxis.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/axis/NumberAxis.java 2007-06-21 11:18:10 UTC (rev 52) @@ -115,11 +115,11 @@ import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.ValueAxisPlot; import org.jfree.chart.text.TextAnchor; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.chart.util.RectangleEdge; import org.jfree.chart.util.RectangleInsets; import org.jfree.data.Range; import org.jfree.data.RangeType; -import org.jfree.util.ObjectUtilities; /** * An axis for displaying numerical data. Modified: trunk/source/org/jfree/chart/axis/Tick.java =================================================================== --- trunk/source/org/jfree/chart/axis/Tick.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/axis/Tick.java 2007-06-21 11:18:10 UTC (rev 52) @@ -51,7 +51,7 @@ import java.io.Serializable; import org.jfree.chart.text.TextAnchor; -import org.jfree.util.ObjectUtilities; +import org.jfree.chart.util.ObjectUtilities; /** * The base class used to represent labelled ticks along an axis. Modified: trunk/source/org/jfree/chart/block/Block.java =================================================================== --- trunk/source/org/jfree/chart/block/Block.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/block/Block.java 2007-06-21 11:18:10 UTC (rev 52) @@ -49,8 +49,8 @@ import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; +import org.jfree.chart.Drawable; import org.jfree.chart.util.Size2D; -import org.jfree.ui.Drawable; /** * A block is an arbitrary item that can be drawn (in Java2D space) within a Modified: trunk/source/org/jfree/chart/block/BorderArrangement.java =================================================================== --- trunk/source/org/jfree/chart/block/BorderArrangement.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/block/BorderArrangement.java 2007-06-21 11:18:10 UTC (rev 52) @@ -51,10 +51,10 @@ import java.awt.geom.Rectangle2D; import java.io.Serializable; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.chart.util.RectangleEdge; import org.jfree.chart.util.Size2D; import org.jfree.data.Range; -import org.jfree.util.ObjectUtilities; /** * An arrangement manager that lays out blocks in a similar way to Modified: trunk/source/org/jfree/chart/entity/CategoryItemEntity.java =================================================================== --- trunk/source/org/jfree/chart/entity/CategoryItemEntity.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/entity/CategoryItemEntity.java 2007-06-21 11:18:10 UTC (rev 52) @@ -49,7 +49,7 @@ * 11-Jan-2005 : Removed deprecated code in preparation for 1.0.0 release (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 18-May-2007 : Updated to use row and column keys to identify item (DG); - * 19-Jun-2007 : Removed deprecated code (DG); + * 19-Jun-2007 : Removed deprecated code and JCommon dependencies (DG); * */ @@ -58,8 +58,8 @@ import java.awt.Shape; import java.io.Serializable; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.category.CategoryDataset; -import org.jfree.util.ObjectUtilities; /** * A chart entity that represents one item within a category plot. Modified: trunk/source/org/jfree/chart/entity/LegendItemEntity.java =================================================================== --- trunk/source/org/jfree/chart/entity/LegendItemEntity.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/entity/LegendItemEntity.java 2007-06-21 11:18:10 UTC (rev 52) @@ -41,6 +41,7 @@ * Serializable (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 18-May-2007 : Added dataset and seriesKey fields (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -49,8 +50,8 @@ import java.awt.Shape; import java.io.Serializable; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.general.Dataset; -import org.jfree.util.ObjectUtilities; /** * An entity that represents an item within a legend. Modified: trunk/source/org/jfree/chart/labels/AbstractXYItemLabelGenerator.java =================================================================== --- trunk/source/org/jfree/chart/labels/AbstractXYItemLabelGenerator.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/labels/AbstractXYItemLabelGenerator.java 2007-06-21 11:18:10 UTC (rev 52) @@ -47,6 +47,7 @@ * ------------- JFREECHART 1.0.x -------------------------------------------- * 26-Jan-2006 : Minor API doc update (DG); * 25-Jan-2007 : Added new constructor and fixed bug in clone() method (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -58,8 +59,8 @@ import java.text.NumberFormat; import java.util.Date; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.xy.XYDataset; -import org.jfree.util.ObjectUtilities; /** * A base class for creating item label generators. Modified: trunk/source/org/jfree/chart/labels/BubbleXYItemLabelGenerator.java =================================================================== --- trunk/source/org/jfree/chart/labels/BubbleXYItemLabelGenerator.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/labels/BubbleXYItemLabelGenerator.java 2007-06-21 11:18:10 UTC (rev 52) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * ------------------------------- * BubbleXYItemLabelGenerator.java * ------------------------------- - * (C) Copyright 2005, 2006, by Object Refinery Limited. + * (C) Copyright 2005-2007, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -39,6 +39,7 @@ * 13-Dec-2005 : Version 1, based on StandardXYZToolTipGenerator (DG); * 26-Jan-2006 : Renamed StandardXYZItemLabelGenerator * --> BubbleXYItemLabelGenerator (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -50,9 +51,9 @@ import java.text.NumberFormat; import org.jfree.chart.renderer.xy.XYBubbleRenderer; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYZDataset; -import org.jfree.util.ObjectUtilities; /** * An item label generator defined for use with the {@link XYBubbleRenderer} Modified: trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java =================================================================== --- trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java 2007-06-21 11:18:10 UTC (rev 52) @@ -41,6 +41,7 @@ * ------------- JFREECHART 1.0.x --------------------------------------------- * 03-May-2006 : Modified DEFAULT_SECTION_LABEL_FORMAT (DG); * 10-Jan-2007 : Include attributedLabels in equals() test (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -53,8 +54,8 @@ import java.text.AttributedString; import java.text.NumberFormat; +import org.jfree.chart.util.ObjectList; import org.jfree.data.general.PieDataset; -import org.jfree.util.ObjectList; /** * A standard item label generator for plots that use data from a Modified: trunk/source/org/jfree/chart/labels/StandardXYZToolTipGenerator.java =================================================================== --- trunk/source/org/jfree/chart/labels/StandardXYZToolTipGenerator.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/labels/StandardXYZToolTipGenerator.java 2007-06-21 11:18:10 UTC (rev 52) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * -------------------------------- * StandardXYZToolTipGenerator.java * -------------------------------- - * (C) Copyright 2004, 2005, by Object Refinery Limited. + * (C) Copyright 2004-2007, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -38,6 +38,7 @@ * ------- * 11-May-2003 : Version 1, split from StandardXYZItemLabelGenerator (DG); * 15-Jul-2004 : Switched getZ() and getZValue() methods (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -48,9 +49,9 @@ import java.text.MessageFormat; import java.text.NumberFormat; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.xy.XYDataset; import org.jfree.data.xy.XYZDataset; -import org.jfree.util.ObjectUtilities; /** * A standard item label generator for use with {@link XYZDataset} data. Each Modified: trunk/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/plot/CombinedDomainCategoryPlot.java 2007-06-21 11:18:10 UTC (rev 52) @@ -74,10 +74,10 @@ import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.event.PlotChangeEvent; import org.jfree.chart.event.PlotChangeListener; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.chart.util.PublicCloneable; import org.jfree.chart.util.RectangleEdge; import org.jfree.chart.util.RectangleInsets; -import org.jfree.util.ObjectUtilities; /** * A combined category plot where the domain axis is shared. Modified: trunk/source/org/jfree/chart/plot/CombinedDomainXYPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/CombinedDomainXYPlot.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/plot/CombinedDomainXYPlot.java 2007-06-21 11:18:10 UTC (rev 52) @@ -105,11 +105,11 @@ import org.jfree.chart.event.PlotChangeEvent; import org.jfree.chart.event.PlotChangeListener; import org.jfree.chart.renderer.xy.XYItemRenderer; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.chart.util.PublicCloneable; import org.jfree.chart.util.RectangleEdge; import org.jfree.chart.util.RectangleInsets; import org.jfree.data.Range; -import org.jfree.util.ObjectUtilities; /** * An extension of {@link XYPlot} that contains multiple subplots that share a Modified: trunk/source/org/jfree/chart/renderer/DefaultPolarItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/DefaultPolarItemRenderer.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/renderer/DefaultPolarItemRenderer.java 2007-06-21 11:18:10 UTC (rev 52) @@ -48,6 +48,7 @@ * 14-Mar-2007 : Fixed clone() method (DG); * 04-May-2007 : Fixed lookup for series paint and stroke (DG); * 18-May-2007 : Set dataset for LegendItem (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -72,11 +73,10 @@ import org.jfree.chart.plot.DrawingSupplier; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.PolarPlot; +import org.jfree.chart.text.TextAnchor; +import org.jfree.chart.text.TextUtilities; +import org.jfree.chart.util.BooleanList; import org.jfree.data.xy.XYDataset; -import org.jfree.text.TextUtilities; -import org.jfree.ui.TextAnchor; -import org.jfree.util.BooleanList; -import org.jfree.util.BooleanUtilities; /** * A renderer that can be used with the {@link PolarPlot} class. @@ -157,7 +157,7 @@ * @param filled the flag. */ public void setSeriesFilled(int series, boolean filled) { - this.seriesFilled.setBoolean(series, BooleanUtilities.valueOf(filled)); + this.seriesFilled.setBoolean(series, Boolean.valueOf(filled)); } /** Modified: trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java 2007-06-21 11:18:10 UTC (rev 52) @@ -69,9 +69,9 @@ import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.util.GradientPaintTransformer; +import org.jfree.chart.util.ObjectList; import org.jfree.chart.util.RectangleEdge; import org.jfree.data.category.CategoryDataset; -import org.jfree.util.ObjectList; /** * A {@link CategoryItemRenderer} that represents data using bars which are Modified: trunk/source/org/jfree/chart/text/TextUtilities.java =================================================================== --- trunk/source/org/jfree/chart/text/TextUtilities.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/text/TextUtilities.java 2007-06-21 11:18:10 UTC (rev 52) @@ -52,6 +52,7 @@ * 27-Jun-2005 : Added code to getTextBounds() method to work around Sun's bug * parade item 6183356 (DG); * 06-Jan-2006 : Reformatted (DG); + * 21-Jun-2007 : Copied from JCommon (DG); * */ @@ -69,7 +70,7 @@ import java.awt.geom.Rectangle2D; import java.text.BreakIterator; -import org.jfree.util.ObjectUtilities; +import org.jfree.chart.util.ObjectUtilities; /** * Some utility methods for working with text. Modified: trunk/source/org/jfree/chart/title/ImageTitle.java =================================================================== --- trunk/source/org/jfree/chart/title/ImageTitle.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/title/ImageTitle.java 2007-06-21 11:18:10 UTC (rev 52) @@ -66,8 +66,8 @@ import org.jfree.chart.util.HorizontalAlignment; import org.jfree.chart.util.RectangleEdge; import org.jfree.chart.util.RectangleInsets; +import org.jfree.chart.util.Size2D; import org.jfree.chart.util.VerticalAlignment; -import org.jfree.ui.Size2D; /** * A chart title that displays an image. This is useful, for example, if you Modified: trunk/source/org/jfree/chart/title/Title.java =================================================================== --- trunk/source/org/jfree/chart/title/Title.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/title/Title.java 2007-06-21 11:18:10 UTC (rev 52) @@ -76,10 +76,10 @@ import org.jfree.chart.event.TitleChangeEvent; import org.jfree.chart.event.TitleChangeListener; import org.jfree.chart.util.HorizontalAlignment; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.chart.util.RectangleEdge; import org.jfree.chart.util.RectangleInsets; import org.jfree.chart.util.VerticalAlignment; -import org.jfree.util.ObjectUtilities; /** * The base class for all chart titles. A chart can have multiple titles, Modified: trunk/source/org/jfree/chart/urls/StandardCategoryURLGenerator.java =================================================================== --- trunk/source/org/jfree/chart/urls/StandardCategoryURLGenerator.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/urls/StandardCategoryURLGenerator.java 2007-06-21 11:18:10 UTC (rev 52) @@ -51,6 +51,7 @@ * ------------- JFREECHART 1.0.x --------------------------------------------- * 02-Feb-2007 : Removed author tags from all over JFreeChart sources (DG); * 17-Apr-2007 : Use new URLUtilities class to encode URLs (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -58,8 +59,8 @@ import java.io.Serializable; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.category.CategoryDataset; -import org.jfree.util.ObjectUtilities; /** * A URL generator that can be assigned to a Modified: trunk/source/org/jfree/chart/urls/StandardPieURLGenerator.java =================================================================== --- trunk/source/org/jfree/chart/urls/StandardPieURLGenerator.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/urls/StandardPieURLGenerator.java 2007-06-21 11:18:10 UTC (rev 52) @@ -27,7 +27,7 @@ * ---------------------------- * StandardPieURLGenerator.java * ---------------------------- - * (C) Copyright 2002-2006, by Richard Atkinson and Contributors. + * (C) Copyright 2002-2007, by Richard Atkinson and Contributors. * * Original Author: Richard Atkinson; * Contributors: David Gilbert (for Object Refinery Limited); @@ -47,6 +47,7 @@ * ------------- JFREECHART 1.0.x --------------------------------------------- * 24-Nov-2006 : Fixed equals() method and added argument checks (DG); * 17-Apr-2007 : Encode section key in generateURL() (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -54,8 +55,8 @@ import java.io.Serializable; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.general.PieDataset; -import org.jfree.util.ObjectUtilities; /** * A URL generator for pie charts. Instances of this class are immutable. Modified: trunk/source/org/jfree/chart/urls/StandardXYURLGenerator.java =================================================================== --- trunk/source/org/jfree/chart/urls/StandardXYURLGenerator.java 2007-06-21 11:17:12 UTC (rev 51) +++ trunk/source/org/jfree/chart/urls/StandardXYURLGenerator.java 2007-06-21 11:18:10 UTC (rev 52) @@ -45,6 +45,7 @@ * 13-Jan-2005 : Modified for XHTML 1.0 compliance (DG); * ------------- JFREECHART 1.0.x --------------------------------------------- * 02-Feb-2007 : Removed author tags from all over JFreeChart sources (DG); + * 21-Jun-2007 : Removed JCommon dependencies (DG); * */ @@ -52,8 +53,8 @@ import java.io.Serializable; +import org.jfree.chart.util.ObjectUtilities; import org.jfree.data.xy.XYDataset; -import org.jfree.util.ObjectUtilities; /** * A URL generator. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-26 14:42:42
|
Revision: 82 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=82&view=rev Author: mungady Date: 2007-06-26 07:42:39 -0700 (Tue, 26 Jun 2007) Log Message: ----------- 2007-06-27 David Gilbert <dav...@ob...> * source/org/jfree/chart/ChartFactory.java (createAreaChart): Updated for renamed method, (createBarChart): Likewise, (createBarChart3D): Likewise, (createGanttChart): Likewise, (createLineChart): Likewise, (createLineChart3D): Likewise, (createStackedAreaChart): Likewise, (createStackedBarChart): Likewise, (createStackedBarChart3D): Likewise, (createWaterfallChart): Likewise, * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (itemURLGeneratorList): Renamed urlGeneratorList, (baseItemURLGenerator): Renamed baseURLGenerator, (AbstractCategoryItemRenderer): Updated for renamed fields, (getItemURLGenerator): Updated for renamed fields, (getSeriesItemURLGenerator): Renamed getSeriesURLGenerator, (setSeriesItemURLGenerator): Renamed setSeriesURLGenerator, (getBaseItemURLGenerator): Renamed getBaseURLGenerator, (setBaseItemURLGenerator): Renamed setBaseURLGenerator, (equals): Updated for renamed fields, (clone): Likewise, * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java (getSeriesItemURLGenerator): Renamed getSeriesURLGenerator, (setSeriesItemURLGenerator): Renamed setSeriesURLGenerator, (getBaseItemURLGenerator): Renamed getBaseURLGenerator, (setBaseItemURLGenerator): Renamed setBaseURLGenerator. Modified Paths: -------------- trunk/source/org/jfree/chart/ChartFactory.java trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java trunk/tests/org/jfree/chart/junit/AreaChartTests.java trunk/tests/org/jfree/chart/junit/BarChart3DTests.java trunk/tests/org/jfree/chart/junit/BarChartTests.java trunk/tests/org/jfree/chart/junit/GanttChartTests.java trunk/tests/org/jfree/chart/junit/LineChart3DTests.java trunk/tests/org/jfree/chart/junit/LineChartTests.java trunk/tests/org/jfree/chart/junit/StackedAreaChartTests.java trunk/tests/org/jfree/chart/junit/StackedBarChart3DTests.java trunk/tests/org/jfree/chart/junit/StackedBarChartTests.java trunk/tests/org/jfree/chart/junit/WaterfallChartTests.java trunk/tests/org/jfree/chart/renderer/category/junit/AbstractCategoryItemRendererTests.java Modified: trunk/source/org/jfree/chart/ChartFactory.java =================================================================== --- trunk/source/org/jfree/chart/ChartFactory.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/source/org/jfree/chart/ChartFactory.java 2007-06-26 14:42:39 UTC (rev 82) @@ -116,6 +116,8 @@ * 17-Jan-2007 : Added createBoxAndWhiskerChart() method from patch 1603937 * submitted by Darren Jung (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 26-Jun-2007 : Updated some code for method name changes in + * the CategoryItemRenderer interface (DG); * */ @@ -613,8 +615,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, @@ -670,8 +671,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, @@ -725,8 +725,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, @@ -790,8 +789,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } // create the plot... @@ -855,8 +853,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, @@ -911,8 +908,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, @@ -966,8 +962,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); @@ -1020,8 +1015,7 @@ new StandardCategoryToolTipGenerator()); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); @@ -1070,8 +1064,7 @@ "{3} - {4}", DateFormat.getDateInstance())); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, dateAxis, @@ -1142,8 +1135,7 @@ renderer.setBaseToolTipGenerator(generator); } if (urls) { - renderer.setBaseItemURLGenerator( - new StandardCategoryURLGenerator()); + renderer.setBaseURLGenerator(new StandardCategoryURLGenerator()); } CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, Modified: trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2007-06-26 14:42:39 UTC (rev 82) @@ -96,7 +96,8 @@ * override fields (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); * 20-Jun-2007 : Removed deprecated code and removed JCommon dependencies (DG); - * 26-Jun-2007 : Added some new methods with 'notify' argument (DG); + * 26-Jun-2007 : Added some new methods with 'notify' argument, renamed + * methods containing 'ItemURL' to just 'URL' (DG); * */ @@ -176,11 +177,11 @@ /** The base tool tip generator. */ private CategoryToolTipGenerator baseToolTipGenerator; - /** A list of item label generators (one per series). */ - private ObjectList itemURLGeneratorList; + /** A list of label generators (one per series). */ + private ObjectList urlGeneratorList; - /** The base item label generator. */ - private CategoryURLGenerator baseItemURLGenerator; + /** The base label generator. */ + private CategoryURLGenerator baseURLGenerator; /** The legend item label generator. */ private CategorySeriesLabelGenerator legendItemLabelGenerator; @@ -207,7 +208,7 @@ protected AbstractCategoryItemRenderer() { this.itemLabelGeneratorList = new ObjectList(); this.toolTipGeneratorList = new ObjectList(); - this.itemURLGeneratorList = new ObjectList(); + this.urlGeneratorList = new ObjectList(); this.legendItemLabelGenerator = new StandardCategorySeriesLabelGenerator(); } @@ -497,7 +498,7 @@ * @return The URL generator. */ public CategoryURLGenerator getItemURLGenerator(int row, int column) { - return getSeriesItemURLGenerator(row); + return getSeriesURLGenerator(row); } /** @@ -507,15 +508,15 @@ * * @return The URL generator for the series. * - * @see #setSeriesItemURLGenerator(int, CategoryURLGenerator) + * @see #setSeriesURLGenerator(int, CategoryURLGenerator) */ - public CategoryURLGenerator getSeriesItemURLGenerator(int series) { + public CategoryURLGenerator getSeriesURLGenerator(int series) { // look up the generator table - CategoryURLGenerator generator - = (CategoryURLGenerator) this.itemURLGeneratorList.get(series); + CategoryURLGenerator generator + = (CategoryURLGenerator) this.urlGeneratorList.get(series); if (generator == null) { - generator = this.baseItemURLGenerator; + generator = this.baseURLGenerator; } return generator; @@ -528,11 +529,11 @@ * @param series the series index (zero based). * @param generator the generator. * - * @see #getSeriesItemURLGenerator(int) + * @see #getSeriesURLGenerator(int) */ - public void setSeriesItemURLGenerator(int series, + public void setSeriesURLGenerator(int series, CategoryURLGenerator generator) { - setSeriesItemURLGenerator(series, generator, true); + setSeriesURLGenerator(series, generator, true); } /** @@ -545,11 +546,11 @@ * * @since 1.2.0 * - * @see #getSeriesItemURLGenerator(int) + * @see #getSeriesURLGenerator(int) */ - public void setSeriesItemURLGenerator(int series, + public void setSeriesURLGenerator(int series, CategoryURLGenerator generator, boolean notify) { - this.itemURLGeneratorList.set(series, generator); + this.urlGeneratorList.set(series, generator); if (notify) { notifyListeners(new RendererChangeEvent(this)); } @@ -560,10 +561,10 @@ * * @return The item URL generator. * - * @see #setBaseItemURLGenerator(CategoryURLGenerator) + * @see #setBaseURLGenerator(CategoryURLGenerator) */ - public CategoryURLGenerator getBaseItemURLGenerator() { - return this.baseItemURLGenerator; + public CategoryURLGenerator getBaseURLGenerator() { + return this.baseURLGenerator; } /** @@ -571,10 +572,10 @@ * * @param generator the item URL generator. * - * @see #getBaseItemURLGenerator() + * @see #getBaseURLGenerator() */ - public void setBaseItemURLGenerator(CategoryURLGenerator generator) { - setBaseItemURLGenerator(generator, true); + public void setBaseURLGenerator(CategoryURLGenerator generator) { + setBaseURLGenerator(generator, true); } /** @@ -583,13 +584,13 @@ * @param generator the item URL generator (<code>null</code> permitted). * @param notify notify listeners? * - * @see #getBaseItemURLGenerator() + * @see #getBaseURLGenerator() * * @since 1.2.0 */ - public void setBaseItemURLGenerator(CategoryURLGenerator generator, + public void setBaseURLGenerator(CategoryURLGenerator generator, boolean notify) { - this.baseItemURLGenerator = generator; + this.baseURLGenerator = generator; if (notify) { notifyListeners(new RendererChangeEvent(this)); } @@ -1222,12 +1223,12 @@ that.baseToolTipGenerator)) { return false; } - if (!ObjectUtilities.equal(this.itemURLGeneratorList, - that.itemURLGeneratorList)) { + if (!ObjectUtilities.equal(this.urlGeneratorList, + that.urlGeneratorList)) { return false; } - if (!ObjectUtilities.equal(this.baseItemURLGenerator, - that.baseItemURLGenerator)) { + if (!ObjectUtilities.equal(this.baseURLGenerator, + that.baseURLGenerator)) { return false; } if (!ObjectUtilities.equal(this.legendItemLabelGenerator, @@ -1366,16 +1367,14 @@ } } - if (this.itemURLGeneratorList != null) { - clone.itemURLGeneratorList - = (ObjectList) this.itemURLGeneratorList.clone(); + if (this.urlGeneratorList != null) { + clone.urlGeneratorList = (ObjectList) this.urlGeneratorList.clone(); } - if (this.baseItemURLGenerator != null) { - if (this.baseItemURLGenerator instanceof PublicCloneable) { - PublicCloneable pc - = (PublicCloneable) this.baseItemURLGenerator; - clone.baseItemURLGenerator = (CategoryURLGenerator) pc.clone(); + if (this.baseURLGenerator != null) { + if (this.baseURLGenerator instanceof PublicCloneable) { + PublicCloneable pc = (PublicCloneable) this.baseURLGenerator; + clone.baseURLGenerator = (CategoryURLGenerator) pc.clone(); } else { throw new CloneNotSupportedException( Modified: trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-26 14:42:39 UTC (rev 82) @@ -1590,26 +1590,27 @@ public CategoryURLGenerator getItemURLGenerator(int series, int item); /** - * Returns the item URL generator for a series. + * Returns the URL generator for a series. * * @param series the series index (zero-based). * * @return The URL generator. * - * @see #setSeriesItemURLGenerator(int, CategoryURLGenerator) + * @see #setSeriesURLGenerator(int, CategoryURLGenerator) */ - public CategoryURLGenerator getSeriesItemURLGenerator(int series); + public CategoryURLGenerator getSeriesURLGenerator(int series); /** - * Sets the item URL generator for a series. + * Sets the URL generator for a series and sends a + * {@link RendererChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * @param generator the generator. * - * @see #getSeriesItemURLGenerator(int) + * @see #getSeriesURLGenerator(int) */ - public void setSeriesItemURLGenerator(int series, - CategoryURLGenerator generator); + public void setSeriesURLGenerator(int series, + CategoryURLGenerator generator); /** * Sets the URL generator for a series and, if requested, sends a @@ -1621,27 +1622,27 @@ * * @since 1.2.0 */ - public void setSeriesItemURLGenerator(int series, + public void setSeriesURLGenerator(int series, CategoryURLGenerator generator, boolean notify); /** - * Returns the base item URL generator. + * Returns the base URL generator. * - * @return The item URL generator (possibly <code>null</code>). + * @return The URL generator (possibly <code>null</code>). * - * @see #setBaseItemURLGenerator(CategoryURLGenerator) + * @see #setBaseURLGenerator(CategoryURLGenerator) */ - public CategoryURLGenerator getBaseItemURLGenerator(); + public CategoryURLGenerator getBaseURLGenerator(); /** - * Sets the base item URL generator and sends a {@link RendererChangeEvent} + * Sets the base URL generator and sends a {@link RendererChangeEvent} * to all registered listeners. * - * @param generator the item URL generator (<code>null</code> permitted). + * @param generator the URL generator (<code>null</code> permitted). * - * @see #getBaseItemURLGenerator() + * @see #getBaseURLGenerator() */ - public void setBaseItemURLGenerator(CategoryURLGenerator generator); + public void setBaseURLGenerator(CategoryURLGenerator generator); /** * Sets the default URL generator and, if requested, sends a @@ -1652,7 +1653,7 @@ * * @since 1.2.0 */ - public void setBaseItemURLGenerator(CategoryURLGenerator generator, + public void setBaseURLGenerator(CategoryURLGenerator generator, boolean notify); /** Modified: trunk/tests/org/jfree/chart/junit/AreaChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/AreaChartTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/AreaChartTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -122,7 +122,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/BarChart3DTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/BarChart3DTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/BarChart3DTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -174,7 +174,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/BarChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/BarChartTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/BarChartTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -178,7 +178,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/GanttChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/GanttChartTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/GanttChartTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -175,7 +175,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/LineChart3DTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/LineChart3DTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/LineChart3DTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -173,7 +173,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/LineChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/LineChartTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/LineChartTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -173,7 +173,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/StackedAreaChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/StackedAreaChartTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/StackedAreaChartTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -173,7 +173,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/StackedBarChart3DTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/StackedBarChart3DTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/StackedBarChart3DTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -173,7 +173,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/StackedBarChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/StackedBarChartTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/StackedBarChartTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -179,7 +179,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/WaterfallChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/WaterfallChartTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/junit/WaterfallChartTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -143,7 +143,7 @@ CategoryItemRenderer renderer = plot.getRenderer(); StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); - renderer.setSeriesItemURLGenerator(0, url1); + renderer.setSeriesURLGenerator(0, url1); CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/renderer/category/junit/AbstractCategoryItemRendererTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/category/junit/AbstractCategoryItemRendererTests.java 2007-06-26 14:03:34 UTC (rev 81) +++ trunk/tests/org/jfree/chart/renderer/category/junit/AbstractCategoryItemRendererTests.java 2007-06-26 14:42:39 UTC (rev 82) @@ -2,7 +2,7 @@ * JFreeChart : a free chart library for the Java(tm) platform * =========================================================== * - * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2000-2007, by Object Refinery Limited and Contributors. * * Project Info: http://www.jfree.org/jfreechart/index.html * @@ -27,7 +27,7 @@ * -------------------------------------- * AbstractCategoryItemRendererTests.java * -------------------------------------- - * (C) Copyright 2004, 2006, by Object Refinery Limited and Contributors. + * (C) Copyright 2004-2007, by Object Refinery Limited and Contributors. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; @@ -113,16 +113,16 @@ assertTrue(r1.equals(r2)); // urlGeneratorList - r1.setSeriesItemURLGenerator(1, new StandardCategoryURLGenerator()); + r1.setSeriesURLGenerator(1, new StandardCategoryURLGenerator()); assertFalse(r1.equals(r2)); - r2.setSeriesItemURLGenerator(1, new StandardCategoryURLGenerator()); + r2.setSeriesURLGenerator(1, new StandardCategoryURLGenerator()); assertTrue(r1.equals(r2)); // baseItemURLGenerator - r1.setBaseItemURLGenerator(new StandardCategoryURLGenerator( + r1.setBaseURLGenerator(new StandardCategoryURLGenerator( "abc.html")); assertFalse(r1.equals(r2)); - r2.setBaseItemURLGenerator(new StandardCategoryURLGenerator( + r2.setBaseURLGenerator(new StandardCategoryURLGenerator( "abc.html")); assertTrue(r1.equals(r2)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-26 15:41:31
|
Revision: 85 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=85&view=rev Author: mungady Date: 2007-06-26 08:41:25 -0700 (Tue, 26 Jun 2007) Log Message: ----------- 2007-06-27 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/AbstractRenderer.java (getSeriesItemLabelsVisible): New method, * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java (setSeriesItemLabelsVisible): Likewise, * source/org/jfree/chart/renderer/xy/XYItemRenderer.java (setSeriesItemLabelsVisible): Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/renderer/AbstractRenderer.java trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-26 15:13:28 UTC (rev 84) +++ trunk/ChangeLog 2007-06-26 15:41:25 UTC (rev 85) @@ -1,5 +1,14 @@ 2007-06-27 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/AbstractRenderer.java + (getSeriesItemLabelsVisible): New method, + * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java + (setSeriesItemLabelsVisible): Likewise, + * source/org/jfree/chart/renderer/xy/XYItemRenderer.java + (setSeriesItemLabelsVisible): Likewise. + +2007-06-27 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (getItemLabelGenerator): Do lookup, (getSeriesItemLabelGenerator): Return per-series value only, even if Modified: trunk/source/org/jfree/chart/renderer/AbstractRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/AbstractRenderer.java 2007-06-26 15:13:28 UTC (rev 84) +++ trunk/source/org/jfree/chart/renderer/AbstractRenderer.java 2007-06-26 15:41:25 UTC (rev 85) @@ -78,6 +78,7 @@ * fields (DG); * 13-Jun-2007 : Added new autoPopulate flags for core series attributes (DG); * 20-Jun-2007 : Removed deprecated code and JCommon dependencies (DG); + * 27-Jun-2007 : Added getSeriesItemLabelsVisible(int) method (DG); * */ @@ -385,7 +386,7 @@ public boolean getItemVisible(int series, int item) { return isSeriesVisible(series); } - + /** * Returns a boolean that indicates whether or not the specified series * should be drawn. @@ -509,7 +510,7 @@ /** * Returns the flag that controls whether a series is visible in the * legend. This method returns only the "per series" settings - to - * incorporate the override and base settings as well, you need to use the + * do a lookup that falls back to the default, you need to use the * {@link #isSeriesVisibleInLegend(int)} method. * * @param series the series index (zero-based). @@ -1528,6 +1529,22 @@ return b.booleanValue(); } + + /** + * Returns a flag that controls whether or not item labels are displayed + * for the data items in the specified series. + * + * @param series the series index. + * + * @return The flag (possibly <code>null</code>). + * + * @since 1.2.0 + * + * @see #isSeriesItemLabelsVisible(int) + */ + public Boolean getSeriesItemLabelsVisible(int series) { + return this.itemLabelsVisibleList.getBoolean(series); + } /** * Sets a flag that controls the visibility of the item labels for a series. Modified: trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-26 15:13:28 UTC (rev 84) +++ trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-26 15:41:25 UTC (rev 85) @@ -330,7 +330,7 @@ /** * Returns the flag that controls whether a series is visible in the * legend. This method returns only the "per series" settings - to - * incorporate the override and base settings as well, you need to use the + * do a lookup that falls back to the default value, you need to use the * {@link #isSeriesVisibleInLegend(int)} method. * * @param series the series index (zero-based). @@ -919,6 +919,20 @@ public boolean isSeriesItemLabelsVisible(int series); /** + * Returns a flag that controls whether or not item labels are displayed + * for the data items in the specified series. + * + * @param series the series index. + * + * @return The flag (possibly <code>null</code>). + * + * @since 1.2.0 + * + * @see #isSeriesItemLabelsVisible(int) + */ + public Boolean getSeriesItemLabelsVisible(int series); + + /** * Sets a flag that controls the visibility of the item labels for a series. * * @param series the series index (zero-based). Modified: trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java 2007-06-26 15:13:28 UTC (rev 84) +++ trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java 2007-06-26 15:41:25 UTC (rev 85) @@ -84,6 +84,7 @@ * negativeItemLabelPosition and createEntities override * fields (DG); * 20-Jun-2007 : Removed deprecated methods (DG); + * 27-Jun-2007 : Added getSeriesItemLabelsVisible(int) method (DG); * */ @@ -614,7 +615,20 @@ */ public boolean isSeriesItemLabelsVisible(int series); + /** + * Returns the flag that controls whether or not item labels are displayed + * for the specified series. + * + * @param series the series index. + * + * @return The flag (possibly <code>null</code>). + * + * @since 1.2.0 + */ + public Boolean getSeriesItemLabelsVisible(int series); + + /** * Sets a flag that controls the visibility of the item labels for a series. * * @param series the series index (zero-based). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-27 13:15:04
|
Revision: 86 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=86&view=rev Author: mungady Date: 2007-06-27 06:15:01 -0700 (Wed, 27 Jun 2007) Log Message: ----------- 2007-06-27 David Gilbert <dav...@ob...> * source/org/jfree/chart/plot/XYPlot.java (drawDomainGridlines): Updated for method name change in XYItemRenderer, * source/org/jfree/chart/renderer/AbstractRenderer.java (baseItemLabelsVisible): Changed from Boolean to boolean, (AbstractRenderer): Updated for field type change, (isSeriesItemLabelsVisible): Likewise, (getBaseItemLabelsVisible): Modified return type, (setBaseItemLabelsVisible(boolean)): Updated for field type change, (setBaseItemLabelsVisible(Boolean)): Removed, (setBaseItemLabelsVisbile(boolean, boolean)): Updated for field type change, (equals): Likewise, * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java (getBaseItemLabelsVisible): Modified return type, (setBaseItemLabelsVisible(Boolean)): Removed, (setBaseItemLabelsVisible(Boolean, boolean)): Removed, (setBaseItemLabelsVisible(boolean)): New method, (setBaseItemLabelsVisible(boolean, boolean)): New method, (getLegendItemLabelGenerator): New method, (setLegendItemLabelGenerator): Likewise, (getLegendItemToolTipGenerator): Likewise, (setLegendItemToolTipGenerator): Likewise, (getLegendItemURLGenerator): Likewise, (setLegendItemURLGenerator): Likewise, * source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java (setSeriesItemLabelGenerator(int, XYItemLabelGenerator, boolean)): New method, (setBaseItemLabelGenerator(XYItemLabelGenerator, boolean)): Likewise, (setSeriesToolTipGenerator(int, XYToolTipGenerator, boolean)): Likewise, (setBaseToolTipGenerator(XYToolTipGenerator, boolean)): Likewise, (drawDomainGridline): Removed, * source/org/jfree/chart/renderer/xy/XYItemRenderer.java (setSeriesPaint(int, Paint, boolean)): New method, (setBasePaint(Paint, boolean)): Likewise, (getItemFillPaint(int, int)): Likewise, (getSeriesFillPaint(int)): Likewise, (setSeriesFillPaint(int, Paint)): Likewise, (setSeriesFillPaint(int, Paint, boolean)): Likewise, (getBaseFillPaint): Likewise, (setBaseFillPaint(Paint)): Likewise, (setBaseFillPaint(Paint, boolean)): Likewise, (setSeriesOutlinePaint(int, Paint, boolean)): Likewise, (setBaseOutlinePaint(Paint, boolean)): Likewise, (setSeriesStroke(int, Stroke, boolean)): Likewise, (setBaseStroke(Stroke, boolean)): Likewise, (setSeriesOutlineStroke(int, Stroke, boolean)): Likewise, (setBaseOutlineStroke(Stroke, boolean)): Likewise, (setSeriesShape(int, Shape, boolean)): Likewise, (setBaseShape(Shape, boolean)): Likewise, (getLegendItemToolTipGenerator): Likewise, (setLegendItemToolTipGenerator): Likewise, (getLegendItemURLGenerator)): Likewise, (setLegendItemURLGenerator)): Likewise, (setSeriesToolTipGenerator(int, XYToolTipGenerator, boolean)): Likewise, (setBaseToolTipGenerator(XYToolTipGenerator, boolean)): Likewise, (setSeriesItemLabelGenerator(int, XYItemLabelGenerator, boolean)): Likewise, (setBaseItemLabelGenerator(XYItemLabelGenerator, boolean)): Likewise, (setSeriesItemLabelFont(int, Font, boolean)): New method, (setBaseItemLabelFont(Font, boolean)): Likewise, (setSeriesItemLabelPaint(int, Paint, boolean)): Likewise, (setBaseItemLabelPaint(Paint, boolean)): Likewise, (getItemCreateEntity): Likewise, (getSeriesCreateEntities): Likewise, (setSeriesCreateEntities(int, Boolean)): Likewise, (setSeriesCreateEntities(int, Boolean, boolean)): Likewise, (getBaseCreateEntities): Likewise, (setBaseCreateEntities(boolean)): Likewise, (setBaseCreateEntities(boolean, boolean)): Likewise, (drawDomainLine): New method. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/plot/XYPlot.java trunk/source/org/jfree/chart/renderer/AbstractRenderer.java trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java trunk/tests/org/jfree/chart/renderer/junit/AbstractRendererTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-26 15:41:25 UTC (rev 85) +++ trunk/ChangeLog 2007-06-27 13:15:01 UTC (rev 86) @@ -1,13 +1,87 @@ 2007-06-27 David Gilbert <dav...@ob...> + * source/org/jfree/chart/plot/XYPlot.java + (drawDomainGridlines): Updated for method name change in + XYItemRenderer, * source/org/jfree/chart/renderer/AbstractRenderer.java + (baseItemLabelsVisible): Changed from Boolean to boolean, + (AbstractRenderer): Updated for field type change, + (isSeriesItemLabelsVisible): Likewise, + (getBaseItemLabelsVisible): Modified return type, + (setBaseItemLabelsVisible(boolean)): Updated for field type change, + (setBaseItemLabelsVisible(Boolean)): Removed, + (setBaseItemLabelsVisbile(boolean, boolean)): Updated for field type + change, + (equals): Likewise, + * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java + (getBaseItemLabelsVisible): Modified return type, + (setBaseItemLabelsVisible(Boolean)): Removed, + (setBaseItemLabelsVisible(Boolean, boolean)): Removed, + (setBaseItemLabelsVisible(boolean)): New method, + (setBaseItemLabelsVisible(boolean, boolean)): New method, + (getLegendItemLabelGenerator): New method, + (setLegendItemLabelGenerator): Likewise, + (getLegendItemToolTipGenerator): Likewise, + (setLegendItemToolTipGenerator): Likewise, + (getLegendItemURLGenerator): Likewise, + (setLegendItemURLGenerator): Likewise, + * source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java + (setSeriesItemLabelGenerator(int, XYItemLabelGenerator, boolean)): New + method, + (setBaseItemLabelGenerator(XYItemLabelGenerator, boolean)): Likewise, + (setSeriesToolTipGenerator(int, XYToolTipGenerator, boolean)): Likewise, + (setBaseToolTipGenerator(XYToolTipGenerator, boolean)): Likewise, + (drawDomainGridline): Removed, + * source/org/jfree/chart/renderer/xy/XYItemRenderer.java + (setSeriesPaint(int, Paint, boolean)): New method, + (setBasePaint(Paint, boolean)): Likewise, + (getItemFillPaint(int, int)): Likewise, + (getSeriesFillPaint(int)): Likewise, + (setSeriesFillPaint(int, Paint)): Likewise, + (setSeriesFillPaint(int, Paint, boolean)): Likewise, + (getBaseFillPaint): Likewise, + (setBaseFillPaint(Paint)): Likewise, + (setBaseFillPaint(Paint, boolean)): Likewise, + (setSeriesOutlinePaint(int, Paint, boolean)): Likewise, + (setBaseOutlinePaint(Paint, boolean)): Likewise, + (setSeriesStroke(int, Stroke, boolean)): Likewise, + (setBaseStroke(Stroke, boolean)): Likewise, + (setSeriesOutlineStroke(int, Stroke, boolean)): Likewise, + (setBaseOutlineStroke(Stroke, boolean)): Likewise, + (setSeriesShape(int, Shape, boolean)): Likewise, + (setBaseShape(Shape, boolean)): Likewise, + (getLegendItemToolTipGenerator): Likewise, + (setLegendItemToolTipGenerator): Likewise, + (getLegendItemURLGenerator)): Likewise, + (setLegendItemURLGenerator)): Likewise, + (setSeriesToolTipGenerator(int, XYToolTipGenerator, boolean)): Likewise, + (setBaseToolTipGenerator(XYToolTipGenerator, boolean)): Likewise, + (setSeriesItemLabelGenerator(int, XYItemLabelGenerator, boolean)): + Likewise, + (setBaseItemLabelGenerator(XYItemLabelGenerator, boolean)): Likewise, + (setSeriesItemLabelFont(int, Font, boolean)): New method, + (setBaseItemLabelFont(Font, boolean)): Likewise, + (setSeriesItemLabelPaint(int, Paint, boolean)): Likewise, + (setBaseItemLabelPaint(Paint, boolean)): Likewise, + (getItemCreateEntity): Likewise, + (getSeriesCreateEntities): Likewise, + (setSeriesCreateEntities(int, Boolean)): Likewise, + (setSeriesCreateEntities(int, Boolean, boolean)): Likewise, + (getBaseCreateEntities): Likewise, + (setBaseCreateEntities(boolean)): Likewise, + (setBaseCreateEntities(boolean, boolean)): Likewise, + (drawDomainLine): New method. + +2007-06-26 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/renderer/AbstractRenderer.java (getSeriesItemLabelsVisible): New method, * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java (setSeriesItemLabelsVisible): Likewise, * source/org/jfree/chart/renderer/xy/XYItemRenderer.java (setSeriesItemLabelsVisible): Likewise. -2007-06-27 David Gilbert <dav...@ob...> +2007-06-26 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (getItemLabelGenerator): Do lookup, @@ -16,7 +90,7 @@ (getItemURLGenerator): Do lookup, (getSeriesItemURLGenerator): Return per-series value only, even if null. -2007-06-27 David Gilbert <dav...@ob...> +2007-06-26 David Gilbert <dav...@ob...> * source/org/jfree/chart/ChartFactory.java (createAreaChart): Updated for renamed method, @@ -46,7 +120,7 @@ (getBaseItemURLGenerator): Renamed getBaseURLGenerator, (setBaseItemURLGenerator): Renamed setBaseURLGenerator. -2007-06-27 David Gilbert <dav...@ob...> +2007-06-26 David Gilbert <dav...@ob...> * source/org/jfree/chart/urls/StandardCategoryURLGenerator.java (generateURL): Use URLEncoder rather than URLUtilities, @@ -56,7 +130,7 @@ (generateURL): Likewise, * source/org/jfree/chart/urls/URLUtilities.java: Removed. -2007-06-26 David Gilbert <dav...@ob...> +2007-06-25 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)): Modified: trunk/source/org/jfree/chart/plot/XYPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/XYPlot.java 2007-06-26 15:41:25 UTC (rev 85) +++ trunk/source/org/jfree/chart/plot/XYPlot.java 2007-06-27 13:15:01 UTC (rev 86) @@ -188,7 +188,9 @@ * 07-Jun-2007 : Modified drawBackground() to pass orientation to * fillBackground() for handling GradientPaint (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); - * + * 27-Jun-2007 : Updated drawDomainGridlines() method for renamed method in + * XYItemRenderer interface. + * */ package org.jfree.chart.plot; @@ -3193,6 +3195,8 @@ * @param g2 the graphics device. * @param dataArea the data area. * @param ticks the ticks. + * + * @see #drawRangeGridlines(Graphics2D, Rectangle2D, List) */ protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) { @@ -3206,13 +3210,11 @@ if (isDomainGridlinesVisible()) { Stroke gridStroke = getDomainGridlineStroke(); Paint gridPaint = getDomainGridlinePaint(); - if ((gridStroke != null) && (gridPaint != null)) { - Iterator iterator = ticks.iterator(); - while (iterator.hasNext()) { - ValueTick tick = (ValueTick) iterator.next(); - getRenderer().drawDomainGridLine(g2, this, getDomainAxis(), - dataArea, tick.getValue()); - } + Iterator iterator = ticks.iterator(); + while (iterator.hasNext()) { + ValueTick tick = (ValueTick) iterator.next(); + getRenderer().drawDomainLine(g2, this, getDomainAxis(), + dataArea, tick.getValue(), gridPaint, gridStroke); } } } @@ -3224,6 +3226,8 @@ * @param g2 the graphics device. * @param area the data area. * @param ticks the ticks. + * + * @see #drawDomainGridlines(Graphics2D, Rectangle2D, List) */ protected void drawRangeGridlines(Graphics2D g2, Rectangle2D area, List ticks) { Modified: trunk/source/org/jfree/chart/renderer/AbstractRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/AbstractRenderer.java 2007-06-26 15:41:25 UTC (rev 85) +++ trunk/source/org/jfree/chart/renderer/AbstractRenderer.java 2007-06-27 13:15:01 UTC (rev 86) @@ -78,7 +78,8 @@ * fields (DG); * 13-Jun-2007 : Added new autoPopulate flags for core series attributes (DG); * 20-Jun-2007 : Removed deprecated code and JCommon dependencies (DG); - * 27-Jun-2007 : Added getSeriesItemLabelsVisible(int) method (DG); + * 27-Jun-2007 : Added getSeriesItemLabelsVisible(int) method, changed + * baseItemLabelsVisible from Boolean to boolean (DG); * */ @@ -259,7 +260,7 @@ private BooleanList itemLabelsVisibleList; /** The base item labels visible. */ - private Boolean baseItemLabelsVisible; + private boolean baseItemLabelsVisible; /** The item label font list (one font per series). */ private ObjectList itemLabelFontList; @@ -342,7 +343,7 @@ this.autoPopulateSeriesShape = true; this.itemLabelsVisibleList = new BooleanList(); - this.baseItemLabelsVisible = Boolean.FALSE; + this.baseItemLabelsVisible = false; this.itemLabelFontList = new ObjectList(); this.baseItemLabelFont = new Font("SansSerif", Font.PLAIN, 10); @@ -1517,17 +1518,11 @@ * @return A boolean. */ public boolean isSeriesItemLabelsVisible(int series) { - - // look up the boolean table Boolean b = this.itemLabelsVisibleList.getBoolean(series); - if (b == null) { - b = this.baseItemLabelsVisible; + if (b != null) { + return b.booleanValue(); } - if (b == null) { - b = Boolean.FALSE; - } - return b.booleanValue(); - + return this.baseItemLabelsVisible; } /** @@ -1584,15 +1579,11 @@ } /** - * Returns the base setting for item label visibility. A <code>null</code> - * result should be interpreted as equivalent to <code>Boolean.FALSE</code>. + * Returns the base setting for item label visibility. * * @return A flag (possibly <code>null</code>). */ - public Boolean getBaseItemLabelsVisible() { - // this should have been defined as a boolean primitive, because - // allowing null values is a nuisance...but it is part of the final - // API now, so we'll have to support it. + public boolean getBaseItemLabelsVisible() { return this.baseItemLabelsVisible; } @@ -1602,16 +1593,6 @@ * @param visible the flag. */ public void setBaseItemLabelsVisible(boolean visible) { - setBaseItemLabelsVisible(Boolean.valueOf(visible)); - } - - /** - * Sets the base setting for item label visibility. - * - * @param visible the flag (<code>null</code> is permitted, and viewed - * as equivalent to <code>Boolean.FALSE</code>). - */ - public void setBaseItemLabelsVisible(Boolean visible) { setBaseItemLabelsVisible(visible, true); } @@ -1619,12 +1600,10 @@ * Sets the base visibility for item labels and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * - * @param visible the flag (<code>null</code> is permitted, and viewed - * as equivalent to <code>Boolean.FALSE</code>). - * @param notify a flag that controls whether or not listeners are - * notified. + * @param visible the flag. + * @param notify notify listeners? */ - public void setBaseItemLabelsVisible(Boolean visible, boolean notify) { + public void setBaseItemLabelsVisible(boolean visible, boolean notify) { this.baseItemLabelsVisible = visible; if (notify) { fireChangeEvent(); @@ -2438,8 +2417,7 @@ that.itemLabelsVisibleList)) { return false; } - if (!ObjectUtilities.equal(this.baseItemLabelsVisible, - that.baseItemLabelsVisible)) { + if (this.baseItemLabelsVisible != that.baseItemLabelsVisible) { return false; } if (!ObjectUtilities.equal(this.itemLabelFontList, Modified: trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-26 15:41:25 UTC (rev 85) +++ trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-27 13:15:01 UTC (rev 86) @@ -96,6 +96,8 @@ * 26-Jun-2007 : Added a number of methods already implemented in the * AbstractCategoryItemRenderer class but missing from this * interface (DG); + * 27-Jun-2007 : Changed get/setBaseItemLabelsVisible from Boolean to + * boolean (DG); * */ @@ -115,6 +117,7 @@ import org.jfree.chart.event.RendererChangeEvent; import org.jfree.chart.event.RendererChangeListener; import org.jfree.chart.labels.CategoryItemLabelGenerator; +import org.jfree.chart.labels.CategorySeriesLabelGenerator; import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.labels.ItemLabelPosition; import org.jfree.chart.plot.CategoryMarker; @@ -971,9 +974,9 @@ * * @return A flag (possibly <code>null</code>). * - * @see #setBaseItemLabelsVisible(Boolean) + * @see #setBaseItemLabelsVisible(boolean) */ - public Boolean getBaseItemLabelsVisible(); + public boolean getBaseItemLabelsVisible(); /** * Sets the base flag that controls whether or not item labels are visible. @@ -985,15 +988,6 @@ public void setBaseItemLabelsVisible(boolean visible); /** - * Sets the base setting for item label visibility. - * - * @param visible the flag (<code>null</code> permitted). - * - * @see #getBaseItemLabelsVisible() - */ - public void setBaseItemLabelsVisible(Boolean visible); - - /** * Sets the base visibility for item labels and, if requested, sends a * {@link RendererChangeEvent} to all registered listeners. * @@ -1003,7 +997,7 @@ * * @see #getBaseItemLabelsVisible() */ - public void setBaseItemLabelsVisible(Boolean visible, boolean notify); + public void setBaseItemLabelsVisible(boolean visible, boolean notify); // ITEM LABEL GENERATOR @@ -1683,6 +1677,78 @@ public LegendItem getLegendItem(int datasetIndex, int series); /** + * Returns the legend item label generator. + * + * @return The label generator (never <code>null</code>). + * + * @see #setLegendItemLabelGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public CategorySeriesLabelGenerator getLegendItemLabelGenerator(); + + /** + * Sets the legend item label generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> not permitted). + * + * @see #getLegendItemLabelGenerator() + * + * @since 1.2.0 + */ + public void setLegendItemLabelGenerator( + CategorySeriesLabelGenerator generator); + + /** + * Returns the legend item tool tip generator. + * + * @return The tool tip generator (possibly <code>null</code>). + * + * @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public CategorySeriesLabelGenerator getLegendItemToolTipGenerator(); + + /** + * Sets the legend item tool tip generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public void setLegendItemToolTipGenerator( + CategorySeriesLabelGenerator generator); + + /** + * Returns the legend item URL generator. + * + * @return The URL generator (possibly <code>null</code>). + * + * @see #setLegendItemURLGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public CategorySeriesLabelGenerator getLegendItemURLGenerator(); + + /** + * Sets the legend item URL generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #getLegendItemURLGenerator() + * + * @since 1.2.0 + */ + public void setLegendItemURLGenerator( + CategorySeriesLabelGenerator generator); + + /** * Draws a background for the data area. * * @param g2 the graphics device. Modified: trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2007-06-26 15:41:25 UTC (rev 85) +++ trunk/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java 2007-06-27 13:15:01 UTC (rev 86) @@ -102,7 +102,9 @@ * itemLabelGenerator and toolTipGenerator override fields (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); * 20-Jun-2007 : Removed deprecated code and removed JCommon dependencies (DG); - * + * 27-Jun-2007 : Removed drawDomainGridline() method - use drawDomainLine() + * instead (DG); + * */ package org.jfree.chart.renderer.xy; @@ -139,7 +141,6 @@ import org.jfree.chart.plot.DrawingSupplier; import org.jfree.chart.plot.IntervalMarker; import org.jfree.chart.plot.Marker; -import org.jfree.chart.plot.Plot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; import org.jfree.chart.plot.ValueMarker; @@ -300,9 +301,8 @@ * @return The generator (possibly <code>null</code>). */ public XYItemLabelGenerator getItemLabelGenerator(int series, int item) { - // look up the generator table XYItemLabelGenerator generator - = (XYItemLabelGenerator) this.itemLabelGeneratorList.get(series); + = (XYItemLabelGenerator) this.itemLabelGeneratorList.get(series); if (generator == null) { generator = this.baseItemLabelGenerator; } @@ -315,6 +315,8 @@ * @param series the series index (zero based). * * @return The generator (possibly <code>null</code>). + * + * @see #setSeriesItemLabelGenerator(int, XYItemLabelGenerator) */ public XYItemLabelGenerator getSeriesItemLabelGenerator(int series) { return (XYItemLabelGenerator) this.itemLabelGeneratorList.get(series); @@ -326,6 +328,8 @@ * * @param series the series index (zero based). * @param generator the generator (<code>null</code> permitted). + * + * @see #getSeriesItemLabelGenerator(int) */ public void setSeriesItemLabelGenerator(int series, XYItemLabelGenerator generator) { @@ -334,6 +338,27 @@ } /** + * Sets the item label generator for the specified series and, if + * requested, sends a {@link RendererChangeEvent} to all registered + * listeners. + * + * @param series the series index. + * @param generator the label generator (<code>null</code> permitted); + * @param notify notify listeners? + * + * @see #getSeriesItemLabelGenerator(int) + * + * @since 1.2.0 + */ + public void setSeriesItemLabelGenerator(int series, + XYItemLabelGenerator generator, boolean notify) { + this.itemLabelGeneratorList.set(series, generator); + if (notify) { + notifyListeners(new RendererChangeEvent(this)); + } + } + + /** * Returns the base item label generator. * * @return The generator (possibly <code>null</code>). @@ -349,8 +374,26 @@ * @param generator the generator (<code>null</code> permitted). */ public void setBaseItemLabelGenerator(XYItemLabelGenerator generator) { + setBaseItemLabelGenerator(generator, true); + } + + /** + * Sets the default item label generator and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @since 1.2.0 + * + * @see #getBaseItemLabelGenerator() + */ + public void setBaseItemLabelGenerator(XYItemLabelGenerator generator, + boolean notify) { this.baseItemLabelGenerator = generator; - notifyListeners(new RendererChangeEvent(this)); + if (notify) { + notifyListeners(new RendererChangeEvent(this)); + } } // TOOL TIP GENERATOR @@ -366,8 +409,6 @@ * @return The generator (possibly <code>null</code>). */ public XYToolTipGenerator getToolTipGenerator(int series, int item) { - - // look up the generator table XYToolTipGenerator generator = (XYToolTipGenerator) this.toolTipGeneratorList.get(series); if (generator == null) { @@ -382,6 +423,8 @@ * @param series the series index (zero based). * * @return The generator (possibly <code>null</code>). + * + * @see #setSeriesToolTipGenerator(int, XYToolTipGenerator) */ public XYToolTipGenerator getSeriesToolTipGenerator(int series) { return (XYToolTipGenerator) this.toolTipGeneratorList.get(series); @@ -396,8 +439,25 @@ */ public void setSeriesToolTipGenerator(int series, XYToolTipGenerator generator) { + setSeriesToolTipGenerator(series, generator, true); + } + + /** + * Sets the tool tip generator for a series and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index (zero based). + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @since 1.2.0 + */ + public void setSeriesToolTipGenerator(int series, + XYToolTipGenerator generator, boolean notify) { this.toolTipGeneratorList.set(series, generator); - notifyListeners(new RendererChangeEvent(this)); + if (notify) { + notifyListeners(new RendererChangeEvent(this)); + } } /** @@ -420,8 +480,26 @@ * @see #getBaseToolTipGenerator() */ public void setBaseToolTipGenerator(XYToolTipGenerator generator) { + setBaseToolTipGenerator(generator, true); + } + + /** + * Sets the default tool tip generator and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @see #getBaseToolTipGenerator() + * + * @since 1.2.0 + */ + public void setBaseToolTipGenerator(XYToolTipGenerator generator, + boolean notify) { this.baseToolTipGenerator = generator; - notifyListeners(new RendererChangeEvent(this)); + if (notify) { + notifyListeners(new RendererChangeEvent(this)); + } } // URL GENERATOR @@ -445,6 +523,9 @@ notifyListeners(new RendererChangeEvent(this)); } + + // ANNOTATIONS + /** * Adds an annotation and sends a {@link RendererChangeEvent} to all * registered listeners. The annotation is added to the foreground @@ -512,6 +593,8 @@ * when no area is specified. * * @return A radius. + * + * @see #setDefaultEntityRadius(int) */ public int getDefaultEntityRadius() { return this.defaultEntityRadius; @@ -522,6 +605,8 @@ * when no area is specified. * * @param radius the radius. + * + * @see #getDefaultEntityRadius() */ public void setDefaultEntityRadius(int radius) { this.defaultEntityRadius = radius; @@ -611,6 +696,8 @@ * * @return The range (<code>null</code> if the dataset is <code>null</code> * or empty). + * + * @see #findRangeBounds(XYDataset) */ public Range findDomainBounds(XYDataset dataset) { if (dataset != null) { @@ -629,6 +716,8 @@ * * @return The range (<code>null</code> if the dataset is <code>null</code> * or empty). + * + * @see #findDomainBounds(XYDataset) */ public Range findRangeBounds(XYDataset dataset) { if (dataset != null) { @@ -778,48 +867,6 @@ } /** - * Draws a grid line against the range axis. - * - * @param g2 the graphics device. - * @param plot the plot. - * @param axis the value axis. - * @param dataArea the area for plotting data (not yet adjusted for any - * 3D effect). - * @param value the value at which the grid line should be drawn. - */ - public void drawDomainGridLine(Graphics2D g2, - XYPlot plot, - ValueAxis axis, - Rectangle2D dataArea, - double value) { - - Range range = axis.getRange(); - if (!range.contains(value)) { - return; - } - - PlotOrientation orientation = plot.getOrientation(); - double v = axis.valueToJava2D(value, dataArea, - plot.getDomainAxisEdge()); - Line2D line = null; - if (orientation == PlotOrientation.HORIZONTAL) { - line = new Line2D.Double(dataArea.getMinX(), v, - dataArea.getMaxX(), v); - } - else if (orientation == PlotOrientation.VERTICAL) { - line = new Line2D.Double(v, dataArea.getMinY(), v, - dataArea.getMaxY()); - } - - Paint paint = plot.getDomainGridlinePaint(); - Stroke stroke = plot.getDomainGridlineStroke(); - g2.setPaint(paint != null ? paint : Plot.DEFAULT_OUTLINE_PAINT); - g2.setStroke(stroke != null ? stroke : Plot.DEFAULT_OUTLINE_STROKE); - g2.draw(line); - - } - - /** * Draws a line perpendicular to the domain axis. * * @param g2 the graphics device. @@ -828,8 +875,8 @@ * @param dataArea the area for plotting data (not yet adjusted for any 3D * effect). * @param value the value at which the grid line should be drawn. - * @param paint the paint. - * @param stroke the stroke. + * @param paint the paint (<code>null</code> not permitted). + * @param stroke the stroke (<code>null</code> not permitted). * * @since 1.0.5 */ @@ -1138,7 +1185,7 @@ dataArea.getMaxX(), v); } - final Composite originalComposite = g2.getComposite(); + Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); g2.setPaint(marker.getPaint()); @@ -1196,7 +1243,7 @@ high - low); } - final Composite originalComposite = g2.getComposite(); + Composite originalComposite = g2.getComposite(); g2.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_OVER, marker.getAlpha())); Paint p = marker.getPaint(); Modified: trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java 2007-06-26 15:41:25 UTC (rev 85) +++ trunk/source/org/jfree/chart/renderer/xy/XYItemRenderer.java 2007-06-27 13:15:01 UTC (rev 86) @@ -126,28 +126,21 @@ public interface XYItemRenderer extends LegendItemSource { /** - * Initialises the renderer then returns the number of 'passes' through the - * data that the renderer will require (usually just one). This method - * will be called before the first item is rendered, giving the renderer - * an opportunity to initialise any state information it wants to maintain. - * The renderer can do nothing if it chooses. + * Returns the plot that this renderer has been assigned to. * - * @param g2 the graphics device. - * @param dataArea the area inside the axes. - * @param plot the plot. - * @param dataset the dataset. - * @param info an optional info collection object to return data back to - * the caller. - * - * @return The number of passes the renderer requires. + * @return The plot. */ - public XYItemRendererState initialise(Graphics2D g2, - Rectangle2D dataArea, - XYPlot plot, - XYDataset dataset, - PlotRenderingInfo info); + public XYPlot getPlot(); /** + * Sets the plot that this renderer is assigned to. This method will be + * called by the plot class...you do not need to call it yourself. + * + * @param plot the plot. + */ + public void setPlot(XYPlot plot); + + /** * Returns the number of passes through the data required by the renderer. * * @return The pass count. @@ -155,6 +148,51 @@ public int getPassCount(); /** + * Returns the lower and upper bounds (range) of the x-values in the + * specified dataset. + * + * @param dataset the dataset (<code>null</code> permitted). + * + * @return The range. + */ + public Range findDomainBounds(XYDataset dataset); + + /** + * Returns the lower and upper bounds (range) of the y-values in the + * specified dataset. The implementation of this method will take + * into account the presentation used by the renderers (for example, + * a renderer that "stacks" values will return a bigger range than + * a renderer that doesn't. + * + * @param dataset the dataset (<code>null</code> permitted). + * + * @return The range (or <code>null</code> if the dataset is + * <code>null</code> or empty). + */ + public Range findRangeBounds(XYDataset dataset); + + /** + * Add a renderer change listener. + * + * @param listener the listener. + * + * @see #removeChangeListener(RendererChangeListener) + */ + public void addChangeListener(RendererChangeListener listener); + + /** + * Removes a change listener. + * + * @param listener the listener. + * + * @see #addChangeListener(RendererChangeListener) + */ + public void removeChangeListener(RendererChangeListener listener); + + + //// VISIBLE ////////////////////////////////////////////////////////////// + + /** * Returns a boolean that indicates whether or not the specified item * should be drawn (this is typically used to hide an entire series). * @@ -181,6 +219,8 @@ * @param series the series index (zero-based). * * @return The flag (possibly <code>null</code>). + * + * @see #setSeriesVisible(int, Boolean) */ public Boolean getSeriesVisible(int series); @@ -190,6 +230,8 @@ * * @param series the series index (zero-based). * @param visible the flag (<code>null</code> permitted). + * + * @see #getSeriesVisible(int) */ public void setSeriesVisible(int series, Boolean visible); @@ -201,6 +243,8 @@ * @param series the series index. * @param visible the flag (<code>null</code> permitted). * @param notify notify listeners? + * + * @see #getSeriesVisible(int) */ public void setSeriesVisible(int series, Boolean visible, boolean notify); @@ -208,6 +252,8 @@ * Returns the base visibility for all series. * * @return The base visibility. + * + * @see #setBaseSeriesVisible(boolean) */ public boolean getBaseSeriesVisible(); @@ -216,6 +262,8 @@ * registered listeners. * * @param visible the flag. + * + * @see #getBaseSeriesVisible() */ public void setBaseSeriesVisible(boolean visible); @@ -225,11 +273,14 @@ * * @param visible the visibility. * @param notify notify listeners? + * + * @see #getBaseSeriesVisible() */ public void setBaseSeriesVisible(boolean visible, boolean notify); - // SERIES VISIBLE IN LEGEND (not yet respected by all renderers) + // SERIES VISIBLE IN LEGEND (not yet respected by all renderers) ////////// + /** * Returns <code>true</code> if the series should be shown in the legend, * and <code>false</code> otherwise. @@ -249,6 +300,8 @@ * @param series the series index (zero-based). * * @return The flag (possibly <code>null</code>). + * + * @see #setSeriesVisibleInLegend(int, Boolean) */ public Boolean getSeriesVisibleInLegend(int series); @@ -258,6 +311,8 @@ * * @param series the series index (zero-based). * @param visible the flag (<code>null</code> permitted). + * + * @see #getSeriesVisibleInLegend(int) */ public void setSeriesVisibleInLegend(int series, Boolean visible); @@ -269,6 +324,8 @@ * @param series the series index. * @param visible the flag (<code>null</code> permitted). * @param notify notify listeners? + * + * @see #getSeriesVisibleInLegend(int) */ public void setSeriesVisibleInLegend(int series, Boolean visible, boolean notify); @@ -277,6 +334,8 @@ * Returns the base visibility in the legend for all series. * * @return The base visibility. + * + * @see #setBaseSeriesVisibleInLegend(boolean) */ public boolean getBaseSeriesVisibleInLegend(); @@ -285,6 +344,8 @@ * {@link RendererChangeEvent} to all registered listeners. * * @param visible the flag. + * + * @see #getBaseSeriesVisibleInLegend() */ public void setBaseSeriesVisibleInLegend(boolean visible); @@ -294,11 +355,14 @@ * * @param visible the visibility. * @param notify notify listeners? + * + * @see #getBaseSeriesVisibleInLegend() */ public void setBaseSeriesVisibleInLegend(boolean visible, boolean notify); - // PAINT + //// PAINT //////////////////////////////////////////////////////////////// + /** * Returns the paint used to fill data items as they are drawn. * @@ -315,6 +379,8 @@ * @param series the series index (zero-based). * * @return The paint (possibly <code>null</code>). + * + * @see #setSeriesPaint(int, Paint) */ public Paint getSeriesPaint(int series); @@ -324,15 +390,31 @@ * * @param series the series index (zero-based). * @param paint the paint (<code>null</code> permitted). + * + * @see #getSeriesPaint(int) */ public void setSeriesPaint(int series, Paint paint); - // FIXME: add setSeriesPaint(int, Paint, boolean)? + /** + * Sets the paint for a series and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param paint the paint (<code>null</code> permitted). + * @param notify notify listeners? + * + * @see #getSeriesPaint(int) + * + * @since 1.2.0 + */ + public void setSeriesPaint(int series, Paint paint, boolean notify); /** * Returns the base paint. * * @return The base paint (never <code>null</code>). + * + * @see #setBasePaint(Paint) */ public Paint getBasePaint(); @@ -341,63 +423,119 @@ * registered listeners. * * @param paint the paint (<code>null</code> not permitted). + * + * @see #getBasePaint() */ public void setBasePaint(Paint paint); - // FIXME: add setBasePaint(int, Paint, boolean)? + /** + * Sets the default paint and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param paint the paint (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @see #getBasePaint() + * + * @since 1.2.0 + */ + public void setBasePaint(Paint paint, boolean notify); -// // FILL PAINT -// -// /** -// * Returns the paint used to fill data items as they are drawn. -// * -// * @param row the row (or series) index (zero-based). -// * @param column the column (or category) index (zero-based). -// * -// * @return The paint (never <code>null</code>). -// */ -// public Paint getItemFillPaint(int row, int column); -// -// /** -// * Returns the paint used to fill an item drawn by the renderer. -// * -// * @param series the series index (zero-based). -// * -// * @return The paint (possibly <code>null</code>). -// */ -// public Paint getSeriesFillPaint(int series); -// -// /** -// * Sets the paint used for a series and sends a {@link RendererChangeEvent} -// * to all registered listeners. -// * -// * @param series the series index (zero-based). -// * @param paint the paint (<code>null</code> permitted). -// */ -// public void setSeriesFillPaint(int series, Paint paint); -// -// // FIXME: add setSeriesFillPaint(int, Paint, boolean)? -// -// /** -// * Returns the base paint. -// * -// * @return The base paint (never <code>null</code>). -// */ -// public Paint getBaseFillPaint(); -// -// /** -// * Sets the base paint and sends a {@link RendererChangeEvent} to all -// * registered listeners. -// * -// * @param paint the paint (<code>null</code> not permitted). -// */ -// public void setBaseFillPaint(Paint paint); -// -// // FIXME: add setBaseFillPaint(int, Paint, boolean)? - // OUTLINE PAINT + //// FILL PAINT ///////////////////////////////////////////////////////// /** + * Returns the paint used to fill data items as they are drawn. + * + * @param row the row (or series) index (zero-based). + * @param column the column (or category) index (zero-based). + * + * @return The paint (never <code>null</code>). + * + * @since 1.2.0 + */ + public Paint getItemFillPaint(int row, int column); + + /** + * Returns the paint used to fill an item drawn by the renderer. + * + * @param series the series (zero-based index). + * + * @return The paint (possibly <code>null</code>). + * + * @see #setSeriesFillPaint(int, Paint) + * + * @since 1.2.0 + */ + public Paint getSeriesFillPaint(int series); + + /** + * Sets the fill paint for the specified series and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index (zero-based). + * @param paint the paint (<code>null</code> permitted). + * + * @see #getSeriesFillPaint(int) + * + * @since 1.2.0 + */ + public void setSeriesFillPaint(int series, Paint paint); + + /** + * Sets the fill paint for the specified series and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index (zero-based). + * @param paint the paint (<code>null</code> permitted). + * @param notify notify listeners? + * + * @see #getSeriesFillPaint(int) + * + * @since 1.2.0 + */ + public void setSeriesFillPaint(int series, Paint paint, boolean notify); + + /** + * Returns the base fill paint. + * + * @return The paint (never <code>null</code>). + * + * @see #setBaseFillPaint(Paint) + * + * @since 1.2.0 + */ + public Paint getBaseFillPaint(); + + /** + * Sets the default fill paint and sends a {@link RendererChangeEvent} to + * all registered listeners. + * + * @param paint the paint (<code>null</code> not permitted). + * + * @see #getBaseFillPaint() + * + * @since 1.2.0 + */ + public void setBaseFillPaint(Paint paint); + + /** + * Sets the default fill paint and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param paint the paint (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @see #getBaseFillPaint() + * + * @since 1.2.0 + */ + public void setBaseFillPaint(Paint paint, boolean notify); + + + //// OUTLINE PAINT //////////////////////////////////////////////////////// + + /** * Returns the paint used to outline data items as they are drawn. * * @param row the row (or series) index (zero-based). @@ -413,6 +551,8 @@ * @param series the series (zero-based index). * * @return The paint (possibly <code>null</code>). + * + * @see #setSeriesOutlinePaint(int, Paint) */ public Paint getSeriesOutlinePaint(int series); @@ -422,15 +562,31 @@ * * @param series the series index (zero-based). * @param paint the paint (<code>null</code> permitted). + * + * @see #getSeriesOutlinePaint(int) */ public void setSeriesOutlinePaint(int series, Paint paint); - // FIXME: add setSeriesOutlinePaint(int, Paint, boolean)? + /** + * Sets the outline paint for the specified series and, if requested, + * sends a {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param paint the paint (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @see #getSeriesOutlinePaint(int) + * + * @since 1.2.0 + */ + public void setSeriesOutlinePaint(int series, Paint paint, boolean notify); /** * Returns the base outline paint. * * @return The paint (never <code>null</code>). + * + * @see #setBaseOutlinePaint(Paint) */ public Paint getBaseOutlinePaint(); @@ -439,12 +595,26 @@ * all registered listeners. * * @param paint the paint (<code>null</code> not permitted). + * + * @see #getBaseOutlinePaint() */ public void setBaseOutlinePaint(Paint paint); - // FIXME: add setBaseOutlinePaint(Paint, boolean)? + /** + * Sets the default outline paint and sends a {@link RendererChangeEvent} + * to all registered listeners. + * + * @param paint the paint (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @see #getBaseOutlinePaint() + * + * @since 1.2.0 + */ + public void setBaseOutlinePaint(Paint paint, boolean notify); - // STROKE + + //// STROKE /////////////////////////////////////////////////////////////// /** * Returns the stroke used to draw data items. @@ -462,6 +632,8 @@ * @param series the series (zero-based index). * * @return The stroke (possibly <code>null</code>). + * + * @see #setSeriesStroke(int, Stroke) */ public Stroke getSeriesStroke(int series); @@ -471,28 +643,59 @@ * * @param series the series index (zero-based). * @param stroke the stroke (<code>null</code> permitted). + * + * @see #getSeriesStroke(int) */ public void setSeriesStroke(int series, Stroke stroke); - // FIXME: add setSeriesStroke(int, Stroke, boolean) ? + /** + * Sets the stroke for the specified series and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param stroke the stroke (<code>null</code> permitted). + * @param notify notify listeners? + * + * @see #getSeriesStroke(int) + * + * @since 1.2.0 + */ + public void setSeriesStroke(int series, Stroke stroke, boolean notify); /** * Returns the base stroke. * * @return The base stroke (never <code>null</code>). + * + * @see #setBaseStroke(Stroke) */ public Stroke getBaseStroke(); /** - * Sets the base stroke. + * Sets the base stroke and sends a {@link RendererChangeEvent} to all + * registered listeners. * * @param stroke the stroke (<code>null</code> not permitted). + * + * @see #getBaseStroke() */ public void setBaseStroke(Stroke stroke); - // FIXME: add setBaseStroke(Stroke, boolean) ? + /** + * Sets the default stroke and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param stroke the stroke (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @see #getBaseStroke() + * + * @since 1.2.0 + */ + public void setBaseStroke(Stroke stroke, boolean notify); - // OUTLINE STROKE + + //// OUTLINE STROKE /////////////////////////////////////////////////////// /** * Returns the stroke used to outline data items. The default @@ -512,6 +715,8 @@ * @param series the series (zero-based index). * * @return The stroke (possibly <code>null</code>). + * + * @see #setSeriesOutlineStroke(int, Stroke) */ public Stroke getSeriesOutlineStroke(int series); @@ -521,15 +726,32 @@ * * @param series the series index (zero-based). * @param stroke the stroke (<code>null</code> permitted). + * + * @see #getSeriesOutlineStroke(int) */ public void setSeriesOutlineStroke(int series, Stroke stroke); - // FIXME: add setSeriesOutlineStroke(int, Stroke, boolean) ? + /** + * Sets the outline stroke for the specified series and, if requested, + * sends a {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param stroke the stroke (<code>null</code> permitted). + * @param notify notify listeners? + * + * @see #getSeriesOutlineStroke(int) + * + * @since 1.2.0 + */ + public void setSeriesOutlineStroke(int series, Stroke stroke, + boolean notify); /** * Returns the base outline stroke. * * @return The stroke (never <code>null</code>). + * + * @see #setBaseOutlineStroke(Stroke) */ public Stroke getBaseOutlineStroke(); @@ -538,13 +760,27 @@ * all registered listeners. * * @param stroke the stroke (<code>null</code> not permitted). + * + * @see #getBaseOutlineStroke() */ public void setBaseOutlineStroke(Stroke stroke); - // FIXME: add setBaseOutlineStroke(Stroke, boolean) ? + /** + * Sets the default outline stroke and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param stroke the stroke (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @see #getBaseOutlineStroke() + * + * @since 1.2.0 + */ + public void setBaseOutlineStroke(Stroke stroke, boolean notify); - // SHAPE + //// SHAPE //////////////////////////////////////////////////////////////// + /** * Returns a shape used to represent a data item. * @@ -561,6 +797,8 @@ * @param series the series (zero-based index). * * @return The shape (possibly <code>null</code>). + * + * @see #setSeriesShape(int, Shape) */ public Shape getSeriesShape(int series); @@ -570,15 +808,31 @@ * * @param series the series index (zero-based). * @param shape the shape (<code>null</code> permitted). + * + * @see #getSeriesShape(int) */ public void setSeriesShape(int series, Shape shape); - // FIXME: add setSeriesShape(int, Shape, boolean) ? + /** + * Sets the shape for the specified series and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param shape the shape (<code>null</code> permitted). + * @param notify notify listeners? + * + * @see #getSeriesShape(int) + * + * @since 1.2.0 + */ + public void setSeriesShape(int series, Shape shape, boolean notify); /** * Returns the base shape. * * @return The shape (never <code>null</code>). + * + * @see #setBaseShape(Shape) */ public Shape getBaseShape(); @@ -587,14 +841,208 @@ * registered listeners. * * @param shape the shape (<code>null</code> not permitted). + * + * @see #getBaseShape() */ public void setBaseShape(Shape shape); - // FIXME: add setBaseShape(Shape, boolean) ? + /** + * Sets the default shape and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param shape the shape (<code>null</code> not permitted). + * @param notify notify listeners? + * + * @see #getBaseShape() + * + * @since 1.2.0 + */ + public void setBaseShape(Shape shape, boolean notify); - // ITEM LABELS VISIBLE + //// LEGEND ITEMS ///////////////////////////////////////////////////////// + /** + * Returns a legend item for a series from a dataset. + * + * @param datasetIndex the dataset index. + * @param series the series (zero-based index). + * + * @return The legend item (possibly <code>null</code>). + */ + public LegendItem getLegendItem(int datasetIndex, int series); + + + //// LEGEND ITEM LABEL GENERATOR ////////////////////////////////////////// + + /** + * Returns the legend item label generator. + * + * @return The legend item label generator (never <code>null</code>). + * + * @see #setLegendItemLabelGenerator(XYSeriesLabelGenerator) + */ + public XYSeriesLabelGenerator getLegendItemLabelGenerator(); + + /** + * Sets the legend item label generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> not permitted). + */ + public void setLegendItemLabelGenerator(XYSeriesLabelGenerator generator); + + /** + * Returns the legend item tool tip generator. + * + * @return The tool tip generator (possibly <code>null</code>). + * + * @see #setLegendItemToolTipGenerator(XYSeriesLabelGenerator) + * + * @since 1.2.0 + */ + public XYSeriesLabelGenerator getLegendItemToolTipGenerator(); + + /** + * Sets the legend item tool tip generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #getLegendItemToolTipGenerator() + * + * @since 1.2.0 + */ + public void setLegendItemToolTipGenerator(XYSeriesLabelGenerator generator); + + /** + * Returns the legend item URL generator. + * + * @return The URL generator (possibly <code>null</code>). + * + * @see #setLegendItemURLGenerator(XYSeriesLabelGenerator) + * + * @since 1.2.0 + */ + public XYSeriesLabelGenerator getLegendItemURLGenerator(); + + /** + * Sets the legend item URL generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #getLegendItemURLGenerator() + * + * @since 1.2.0 + */ + public void setLegendItemURLGenerator(XYSeriesLabelGenerator generator); + + + //// TOOL TIP GENERATOR /////////////////////////////////////////////////// + + /** + * Returns the tool tip generator for a data item. + * + * @param row the row index (zero based). + * @param column the column index (zero based). + * + * @return The generator (possibly <code>null</code>). + */ + public XYToolTipGenerator getToolTipGenerator(int row, int column); + + /** + * Returns the tool tip generator for a series. + * + * @param series the series index (zero based). + * + * @return The generator (possibly <code>null</code>). + * + * @see #setSeriesToolTipGenerator(int, XYToolTipGenerator) + */ + public XYToolTipGenerator getSeriesToolTipGenerator(int series); + + /** + * Sets the tool tip generator for a series and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index (zero based). + * @param generator the generator (<code>null</code> permitted). + * + * @see #getSeriesToolTipGenerator(int) + */ + public void setSeriesToolTipGenerator(int series, + XYToolTipGenerator generator); + + /** + * Sets the tool tip generator for the specified series and, if requested, + * sends a {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @since 1.2.0 + */ + public void setSeriesToolTipGenerator(int series, + XYToolTipGenerator generator, boolean notify); + + /** + * Returns the base tool tip generator. + * + * @return The generator (possibly <code>null</code>). + * + * @see #setBaseToolTipGenerator(XYToolTipGenerator) + */ + public XYToolTipGenerator getBaseToolTipGenerator(); + + /** + * Sets the base tool tip generator and sends a {@link RendererChangeEvent} + * to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #getBaseToolTipGenerator() + */ + public void setBaseToolTipGenerator(XYToolTipGenerator generator); + + /** + * Sets the default tool tip generator and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @see #getBaseToolTipGenerator() + * + * @since 1.2.0 + */ + public void setBaseToolTipGenerator(XYToolTipGenerator generator, + boolean notify); + + + //// URL GENERATOR //////////////////////////////////////////////////////// + + // FIXME: make this per-series + + /** + * Returns the URL generator for HTML image maps. + * + * @return The URL generator (possibly null). + */ + public XYURLGenerator getURLGenerator(); + + /** + * Sets the URL generator for HTML image maps. + * + * @param urlGenerator the URL generator (null permitted). + */ + public void setURLGenerator(XYURLGenerator urlGenerator); + + + //// ITEM LABELS VISIBLE ////////////////////////////////////////////////// + + /** * Returns <code>true</code> if an item label is visible, and * <code>false</code> otherwise. * @@ -615,7 +1063,6 @@ */ public boolean isSeriesItemLabelsVisible(int series); - /** * Returns the flag that controls whether or not item labels are displayed * for the specified series. @@ -624,15 +1071,21 @@ * * @return The flag (possibly <code>null</code>). * + * @see #setSeriesI... [truncated message content] |
From: <mu...@us...> - 2007-06-29 13:02:21
|
Revision: 90 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=90&view=rev Author: mungady Date: 2007-06-29 06:02:20 -0700 (Fri, 29 Jun 2007) Log Message: ----------- 2007-06-29 David Gilbert <dav...@ob...> * source/org/jfree/data/time/TimePeriodValues.java (TimePeriodValues(String)): Changed parameter to Comparable, (TimePeriodValues(String, String, String)): Changed first parameter to Comparable, * source/org/jfree/data/time/TimeSeries.java (TimeSeries(String)): Changed parameter to Comparable, (TimeSeries(String, String, String)): Changed first parameter to Comparable, (TimeSeries(String, String, String, Class)): Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/data/time/TimePeriodValues.java trunk/source/org/jfree/data/time/TimeSeries.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-29 12:56:09 UTC (rev 89) +++ trunk/ChangeLog 2007-06-29 13:02:20 UTC (rev 90) @@ -1,5 +1,17 @@ 2007-06-29 David Gilbert <dav...@ob...> + * source/org/jfree/data/time/TimePeriodValues.java + (TimePeriodValues(String)): Changed parameter to Comparable, + (TimePeriodValues(String, String, String)): Changed first parameter to + Comparable, + * source/org/jfree/data/time/TimeSeries.java + (TimeSeries(String)): Changed parameter to Comparable, + (TimeSeries(String, String, String)): Changed first parameter to + Comparable, + (TimeSeries(String, String, String, Class)): Likewise. + +2007-06-29 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (getItemURLGenerator): Renamed getURLGenerator(), (addItemEntity): Updated for renamed method, Modified: trunk/source/org/jfree/data/time/TimePeriodValues.java =================================================================== --- trunk/source/org/jfree/data/time/TimePeriodValues.java 2007-06-29 12:56:09 UTC (rev 89) +++ trunk/source/org/jfree/data/time/TimePeriodValues.java 2007-06-29 13:02:20 UTC (rev 90) @@ -44,6 +44,8 @@ * 03-Oct-2006 : Fixed NullPointerException in equals(), fire change event in * add() method, updated API docs (DG); * 21-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Changed first parameter in constructors from String to + * Comparable (DG); * */ @@ -109,7 +111,7 @@ * * @param name the name of the series (<code>null</code> not permitted). */ - public TimePeriodValues(String name) { + public TimePeriodValues(Comparable name) { this(name, DEFAULT_DOMAIN_DESCRIPTION, DEFAULT_RANGE_DESCRIPTION); } @@ -124,7 +126,7 @@ * @param domain the domain description. * @param range the range description. */ - public TimePeriodValues(String name, String domain, String range) { + public TimePeriodValues(Comparable name, String domain, String range) { super(name); this.domain = domain; this.range = range; Modified: trunk/source/org/jfree/data/time/TimeSeries.java =================================================================== --- trunk/source/org/jfree/data/time/TimeSeries.java 2007-06-29 12:56:09 UTC (rev 89) +++ trunk/source/org/jfree/data/time/TimeSeries.java 2007-06-29 13:02:20 UTC (rev 90) @@ -73,6 +73,8 @@ * 22-Mar-2007 : Simplified getDataItem(RegularTimePeriod) - see patch 1685500 * by Nick Guenther (DG); * 21-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Changed first parameter in constructors from String to + * Comparable (DG); * */ @@ -134,7 +136,7 @@ * * @param name the series name (<code>null</code> not permitted). */ - public TimeSeries(String name) { + public TimeSeries(Comparable name) { this(name, DEFAULT_DOMAIN_DESCRIPTION, DEFAULT_RANGE_DESCRIPTION, Day.class); } @@ -147,7 +149,7 @@ * @param timePeriodClass the type of time period (<code>null</code> not * permitted). */ - public TimeSeries(String name, Class timePeriodClass) { + public TimeSeries(Comparable name, Class timePeriodClass) { this(name, DEFAULT_DOMAIN_DESCRIPTION, DEFAULT_RANGE_DESCRIPTION, timePeriodClass); } @@ -165,7 +167,7 @@ * @param timePeriodClass the type of time period (<code>null</code> not * permitted). */ - public TimeSeries(String name, String domain, String range, + public TimeSeries(Comparable name, String domain, String range, Class timePeriodClass) { super(name); this.domain = domain; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-06-29 12:56:10
|
Revision: 89 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=89&view=rev Author: mungady Date: 2007-06-29 05:56:09 -0700 (Fri, 29 Jun 2007) Log Message: ----------- 2007-06-29 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java (getItemURLGenerator): Renamed getURLGenerator(), (addItemEntity): Updated for renamed method, * source/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java (drawHorizontalItem): Call addEntity() to handle entity generation, (drawVerticalItem): Likewise, * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java: Reorganised source file, * source/org/jfree/chart/renderer/category/GanttRenderer.java (drawTasks): Call addEntity() to handle entity generation, (drawTask): Likewise, * source/org/jfree/chart/renderer/category/GroupedStackedBarRenderer.java (drawItem): Likewise, * source/org/jfree/chart/renderer/category/IntervalBarRenderer.java (drawItem): Likewise, * source/org/jfree/chart/renderer/category/LayeredBarRenderer.java (drawHorizontalItem): Likewise, (drawVerticalItem): Likewise, * source/org/jfree/chart/renderer/category/LevelRenderer.java (drawItem): Likewise, * source/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java (drawItem): Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java trunk/source/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java trunk/source/org/jfree/chart/renderer/category/GanttRenderer.java trunk/source/org/jfree/chart/renderer/category/GroupedStackedBarRenderer.java trunk/source/org/jfree/chart/renderer/category/IntervalBarRenderer.java trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java trunk/source/org/jfree/chart/renderer/category/LevelRenderer.java trunk/source/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java trunk/tests/org/jfree/chart/junit/AreaChartTests.java trunk/tests/org/jfree/chart/junit/BarChart3DTests.java trunk/tests/org/jfree/chart/junit/BarChartTests.java trunk/tests/org/jfree/chart/junit/GanttChartTests.java trunk/tests/org/jfree/chart/junit/LineChart3DTests.java trunk/tests/org/jfree/chart/junit/LineChartTests.java trunk/tests/org/jfree/chart/junit/StackedAreaChartTests.java trunk/tests/org/jfree/chart/junit/StackedBarChart3DTests.java trunk/tests/org/jfree/chart/junit/StackedBarChartTests.java trunk/tests/org/jfree/chart/junit/WaterfallChartTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/ChangeLog 2007-06-29 12:56:09 UTC (rev 89) @@ -1,3 +1,28 @@ +2007-06-29 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java + (getItemURLGenerator): Renamed getURLGenerator(), + (addItemEntity): Updated for renamed method, + * source/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java + (drawHorizontalItem): Call addEntity() to handle entity generation, + (drawVerticalItem): Likewise, + * source/org/jfree/chart/renderer/category/CategoryItemRenderer.java: + Reorganised source file, + * source/org/jfree/chart/renderer/category/GanttRenderer.java + (drawTasks): Call addEntity() to handle entity generation, + (drawTask): Likewise, + * source/org/jfree/chart/renderer/category/GroupedStackedBarRenderer.java + (drawItem): Likewise, + * source/org/jfree/chart/renderer/category/IntervalBarRenderer.java + (drawItem): Likewise, + * source/org/jfree/chart/renderer/category/LayeredBarRenderer.java + (drawHorizontalItem): Likewise, + (drawVerticalItem): Likewise, + * source/org/jfree/chart/renderer/category/LevelRenderer.java + (drawItem): Likewise, + * source/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java + (drawItem): Likewise. + 2007-06-27 David Gilbert <dav...@ob...> * source/org/jfree/chart/ChartFactory.java Modified: trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -493,7 +493,7 @@ * * @return The URL generator. */ - public CategoryURLGenerator getItemURLGenerator(int row, int column) { + public CategoryURLGenerator getURLGenerator(int row, int column) { CategoryURLGenerator generator = (CategoryURLGenerator) this.urlGeneratorList.get(row); if (generator == null) { @@ -1549,7 +1549,7 @@ tip = tipster.generateToolTip(dataset, row, column); } String url = null; - CategoryURLGenerator urlster = getItemURLGenerator(row, column); + CategoryURLGenerator urlster = getURLGenerator(row, column); if (urlster != null) { url = urlster.generateURL(dataset, row, column); } Modified: trunk/source/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -66,6 +66,7 @@ * 17-May-2007 : Set datasetIndex and seriesIndex in getLegendItem() (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Simplified entity generation by calling addEntity() (DG); * */ @@ -92,10 +93,8 @@ import org.jfree.chart.LegendItem; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.CategoryItemEntity; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.RendererChangeEvent; -import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; @@ -497,21 +496,7 @@ if (state.getInfo() != null && box != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster - = getToolTipGenerator(row, column); - if (tipster != null) { - tip = tipster.generateToolTip(dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL( - dataset, row, column); - } - CategoryItemEntity entity = new CategoryItemEntity(box, tip, - url, dataset, dataset.getRowKey(row), - dataset.getColumnKey(column)); - entities.add(entity); + addItemEntity(entities, dataset, row, column, box); } } @@ -729,21 +714,7 @@ if (state.getInfo() != null && box != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster - = getToolTipGenerator(row, column); - if (tipster != null) { - tip = tipster.generateToolTip(dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL(dataset, - row, column); - } - CategoryItemEntity entity = new CategoryItemEntity(box, tip, - url, dataset, dataset.getRowKey(row), - dataset.getColumnKey(column)); - entities.add(entity); + addItemEntity(entities, dataset, row, column, box); } } Modified: trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/CategoryItemRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -151,16 +151,6 @@ public interface CategoryItemRenderer extends LegendItemSource { /** - * Returns the number of passes through the dataset required by the - * renderer. Usually this will be one, but some renderers may use - * a second or third pass to overlay items on top of things that were - * drawn in an earlier pass. - * - * @return The pass count. - */ - public int getPassCount(); - - /** * Returns the plot that the renderer has been assigned to (where * <code>null</code> indicates that the renderer is not currently assigned * to a plot). @@ -183,6 +173,27 @@ public void setPlot(CategoryPlot plot); /** + * Returns the number of passes through the dataset required by the + * renderer. Usually this will be one, but some renderers may use + * a second or third pass to overlay items on top of things that were + * drawn in an earlier pass. + * + * @return The pass count. + */ + public int getPassCount(); + + /** + * Returns the range of values the renderer requires to display all the + * items from the specified dataset. + * + * @param dataset the dataset (<code>null</code> permitted). + * + * @return The range (or <code>null</code> if the dataset is + * <code>null</code> or empty). + */ + public Range findRangeBounds(CategoryDataset dataset); + + /** * Adds a change listener. * * @param listener the listener. @@ -200,39 +211,9 @@ */ public void removeChangeListener(RendererChangeListener listener); - /** - * Returns the range of values the renderer requires to display all the - * items from the specified dataset. - * - * @param dataset the dataset (<code>null</code> permitted). - * - * @return The range (or <code>null</code> if the dataset is - * <code>null</code> or empty). - */ - public Range findRangeBounds(CategoryDataset dataset); + //// VISIBILITY /////////////////////////////////////////////////////////// /** - * Initialises the renderer. This method will be called before the first - * item is rendered, giving the renderer an opportunity to initialise any - * state information it wants to maintain. The renderer can do nothing if - * it chooses. - * - * @param g2 the graphics device. - * @param dataArea the area inside the axes. - * @param plot the plot. - * @param rendererIndex the renderer index. - * @param info collects chart rendering information for return to caller. - * - * @return A state object (maintains state information relevant to one - * chart drawing). - */ - public CategoryItemRendererState initialise(Graphics2D g2, - Rectangle2D dataArea, - CategoryPlot plot, - int rendererIndex, - PlotRenderingInfo info); - - /** * Returns a boolean that indicates whether or not the specified item * should be drawn (this is typically used to hide an entire series). * @@ -318,6 +299,7 @@ */ public void setBaseSeriesVisible(boolean visible, boolean notify); + // SERIES VISIBLE IN LEGEND (not yet respected by all renderers) /** @@ -400,7 +382,7 @@ public void setBaseSeriesVisibleInLegend(boolean visible, boolean notify); - //// PAINT ///////////////////////////////////////////////////////////////// + //// PAINT //////////////////////////////////////////////////////////////// /** * Returns the paint used to fill data items as they are drawn. @@ -475,6 +457,7 @@ * @since 1.2.0 */ public void setBasePaint(Paint paint, boolean notify); + //// FILL PAINT ///////////////////////////////////////////////////////// @@ -896,6 +879,262 @@ public void setBaseShape(Shape shape, boolean notify); + //// LEGEND ITEMS ///////////////////////////////////////////////////////// + + /** + * Returns a legend item for a series. This method can return + * <code>null</code>, in which case the series will have no entry in the + * legend. + * + * @param datasetIndex the dataset index (zero-based). + * @param series the series (zero-based index). + * + * @return The legend item (possibly <code>null</code>). + */ + public LegendItem getLegendItem(int datasetIndex, int series); + + /** + * Returns the legend item label generator. + * + * @return The label generator (never <code>null</code>). + * + * @see #setLegendItemLabelGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public CategorySeriesLabelGenerator getLegendItemLabelGenerator(); + + /** + * Sets the legend item label generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> not permitted). + * + * @see #getLegendItemLabelGenerator() + * + * @since 1.2.0 + */ + public void setLegendItemLabelGenerator( + CategorySeriesLabelGenerator generator); + + /** + * Returns the legend item tool tip generator. + * + * @return The tool tip generator (possibly <code>null</code>). + * + * @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public CategorySeriesLabelGenerator getLegendItemToolTipGenerator(); + + /** + * Sets the legend item tool tip generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public void setLegendItemToolTipGenerator( + CategorySeriesLabelGenerator generator); + + /** + * Returns the legend item URL generator. + * + * @return The URL generator (possibly <code>null</code>). + * + * @see #setLegendItemURLGenerator(CategorySeriesLabelGenerator) + * + * @since 1.2.0 + */ + public CategorySeriesLabelGenerator getLegendItemURLGenerator(); + + /** + * Sets the legend item URL generator and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #getLegendItemURLGenerator() + * + * @since 1.2.0 + */ + public void setLegendItemURLGenerator( + CategorySeriesLabelGenerator generator); + + + // TOOL TIP GENERATOR + + /** + * Returns the tool tip generator that should be used for the specified + * item. This method looks up the generator using the "three-layer" + * approach outlined in the general description of this interface. + * + * @param row the row index (zero-based). + * @param column the column index (zero-based). + * + * @return The generator (possibly <code>null</code>). + */ + public CategoryToolTipGenerator getToolTipGenerator(int row, int column); + + /** + * Returns the tool tip generator for the specified series (a "layer 1" + * generator). + * + * @param series the series index (zero-based). + * + * @return The tool tip generator (possibly <code>null</code>). + * + * @see #setSeriesToolTipGenerator(int, CategoryToolTipGenerator) + */ + public CategoryToolTipGenerator getSeriesToolTipGenerator(int series); + + /** + * Sets the tool tip generator for a series and sends a + * {@link org.jfree.chart.event.RendererChangeEvent} to all registered + * listeners. + * + * @param series the series index (zero-based). + * @param generator the generator (<code>null</code> permitted). + * + * @see #getSeriesToolTipGenerator(int) + */ + public void setSeriesToolTipGenerator(int series, + CategoryToolTipGenerator generator); + + /** + * Sets the tool tip generator for a series and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param generator the generator (<code>null</code> permitted) + * @param notify notify listeners? + * + * @since 1.2.0 + * + * @see #getSeriesToolTipGenerator(int) + */ + public void setSeriesToolTipGenerator(int series, + CategoryToolTipGenerator generator, boolean notify); + + /** + * Returns the base tool tip generator (the "layer 2" generator). + * + * @return The tool tip generator (possibly <code>null</code>). + * + * @see #setBaseToolTipGenerator(CategoryToolTipGenerator) + */ + public CategoryToolTipGenerator getBaseToolTipGenerator(); + + /** + * Sets the base tool tip generator and sends a + * {@link org.jfree.chart.event.RendererChangeEvent} to all registered + * listeners. + * + * @param generator the generator (<code>null</code> permitted). + * + * @see #getBaseToolTipGenerator() + */ + public void setBaseToolTipGenerator(CategoryToolTipGenerator generator); + + /** + * Sets the default tool tip generator and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @since 1.2.0 + * + * @see #getBaseToolTipGenerator() + */ + public void setBaseToolTipGenerator(CategoryToolTipGenerator generator, + boolean notify); + + + // ITEM URL GENERATOR + + /** + * Returns the URL generator for an item. + * + * @param series the series index (zero-based). + * @param item the item index (zero-based). + * + * @return The item URL generator. + */ + public CategoryURLGenerator getURLGenerator(int series, int item); + + /** + * Returns the URL generator for a series. + * + * @param series the series index (zero-based). + * + * @return The URL generator. + * + * @see #setSeriesURLGenerator(int, CategoryURLGenerator) + */ + public CategoryURLGenerator getSeriesURLGenerator(int series); + + /** + * Sets the URL generator for a series and sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index (zero-based). + * @param generator the generator. + * + * @see #getSeriesURLGenerator(int) + */ + public void setSeriesURLGenerator(int series, + CategoryURLGenerator generator); + + /** + * Sets the URL generator for a series and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param series the series index. + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @since 1.2.0 + */ + public void setSeriesURLGenerator(int series, + CategoryURLGenerator generator, boolean notify); + + /** + * Returns the base URL generator. + * + * @return The URL generator (possibly <code>null</code>). + * + * @see #setBaseURLGenerator(CategoryURLGenerator) + */ + public CategoryURLGenerator getBaseURLGenerator(); + + /** + * Sets the base URL generator and sends a {@link RendererChangeEvent} + * to all registered listeners. + * + * @param generator the URL generator (<code>null</code> permitted). + * + * @see #getBaseURLGenerator() + */ + public void setBaseURLGenerator(CategoryURLGenerator generator); + + /** + * Sets the default URL generator and, if requested, sends a + * {@link RendererChangeEvent} to all registered listeners. + * + * @param generator the generator (<code>null</code> permitted). + * @param notify notify listeners? + * + * @since 1.2.0 + */ + public void setBaseURLGenerator(CategoryURLGenerator generator, + boolean notify); + + // ITEM LABELS VISIBLE /** @@ -999,6 +1238,7 @@ */ public void setBaseItemLabelsVisible(boolean visible, boolean notify); + // ITEM LABEL GENERATOR /** @@ -1082,95 +1322,6 @@ boolean notify); - // TOOL TIP GENERATOR - - /** - * Returns the tool tip generator that should be used for the specified - * item. This method looks up the generator using the "three-layer" - * approach outlined in the general description of this interface. - * - * @param row the row index (zero-based). - * @param column the column index (zero-based). - * - * @return The generator (possibly <code>null</code>). - */ - public CategoryToolTipGenerator getToolTipGenerator(int row, int column); - - /** - * Returns the tool tip generator for the specified series (a "layer 1" - * generator). - * - * @param series the series index (zero-based). - * - * @return The tool tip generator (possibly <code>null</code>). - * - * @see #setSeriesToolTipGenerator(int, CategoryToolTipGenerator) - */ - public CategoryToolTipGenerator getSeriesToolTipGenerator(int series); - - /** - * Sets the tool tip generator for a series and sends a - * {@link org.jfree.chart.event.RendererChangeEvent} to all registered - * listeners. - * - * @param series the series index (zero-based). - * @param generator the generator (<code>null</code> permitted). - * - * @see #getSeriesToolTipGenerator(int) - */ - public void setSeriesToolTipGenerator(int series, - CategoryToolTipGenerator generator); - - /** - * Sets the tool tip generator for a series and, if requested, sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param series the series index. - * @param generator the generator (<code>null</code> permitted) - * @param notify notify listeners? - * - * @since 1.2.0 - * - * @see #getSeriesToolTipGenerator(int) - */ - public void setSeriesToolTipGenerator(int series, - CategoryToolTipGenerator generator, boolean notify); - - /** - * Returns the base tool tip generator (the "layer 2" generator). - * - * @return The tool tip generator (possibly <code>null</code>). - * - * @see #setBaseToolTipGenerator(CategoryToolTipGenerator) - */ - public CategoryToolTipGenerator getBaseToolTipGenerator(); - - /** - * Sets the base tool tip generator and sends a - * {@link org.jfree.chart.event.RendererChangeEvent} to all registered - * listeners. - * - * @param generator the generator (<code>null</code> permitted). - * - * @see #getBaseToolTipGenerator() - */ - public void setBaseToolTipGenerator(CategoryToolTipGenerator generator); - - /** - * Sets the default tool tip generator and, if requested, sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param generator the generator (<code>null</code> permitted). - * @param notify notify listeners? - * - * @since 1.2.0 - * - * @see #getBaseToolTipGenerator() - */ - public void setBaseToolTipGenerator(CategoryToolTipGenerator generator, - boolean notify); - - //// ITEM LABEL FONT ////////////////////////////////////////////////////// /** @@ -1585,179 +1736,55 @@ public void setBaseCreateEntities(boolean create, boolean notify); - // ITEM URL GENERATOR + //// DRAWING ////////////////////////////////////////////////////////////// /** - * Returns the URL generator for an item. + * Initialises the renderer. This method will be called before the first + * item is rendered, giving the renderer an opportunity to initialise any + * state information it wants to maintain. The renderer can do nothing if + * it chooses. * - * @param series the series index (zero-based). - * @param item the item index (zero-based). - * - * @return The item URL generator. - */ - public CategoryURLGenerator getItemURLGenerator(int series, int item); - - /** - * Returns the URL generator for a series. - * - * @param series the series index (zero-based). - * - * @return The URL generator. + * @param g2 the graphics device. + * @param dataArea the area inside the axes. + * @param plot the plot. + * @param rendererIndex the renderer index. + * @param info collects chart rendering information for return to caller. * - * @see #setSeriesURLGenerator(int, CategoryURLGenerator) + * @return A state object (maintains state information relevant to one + * chart drawing). */ - public CategoryURLGenerator getSeriesURLGenerator(int series); + public CategoryItemRendererState initialise(Graphics2D g2, + Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, + PlotRenderingInfo info); /** - * Sets the URL generator for a series and sends a - * {@link RendererChangeEvent} to all registered listeners. + * Draws a single data item. * - * @param series the series index (zero-based). - * @param generator the generator. - * - * @see #getSeriesURLGenerator(int) + * @param g2 the graphics device. + * @param state state information for one chart. + * @param dataArea the data plot area. + * @param plot the plot. + * @param domainAxis the domain axis. + * @param rangeAxis the range axis. + * @param dataset the data. + * @param row the row index (zero-based). + * @param column the column index (zero-based). + * @param pass the pass index. */ - public void setSeriesURLGenerator(int series, - CategoryURLGenerator generator); + public void drawItem(Graphics2D g2, CategoryItemRendererState state, + Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, + ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, + int pass); /** - * Sets the URL generator for a series and, if requested, sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param series the series index. - * @param generator the generator (<code>null</code> permitted). - * @param notify notify listeners? - * - * @since 1.2.0 - */ - public void setSeriesURLGenerator(int series, - CategoryURLGenerator generator, boolean notify); - - /** - * Returns the base URL generator. - * - * @return The URL generator (possibly <code>null</code>). - * - * @see #setBaseURLGenerator(CategoryURLGenerator) - */ - public CategoryURLGenerator getBaseURLGenerator(); - - /** - * Sets the base URL generator and sends a {@link RendererChangeEvent} - * to all registered listeners. - * - * @param generator the URL generator (<code>null</code> permitted). - * - * @see #getBaseURLGenerator() - */ - public void setBaseURLGenerator(CategoryURLGenerator generator); - - /** - * Sets the default URL generator and, if requested, sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param generator the generator (<code>null</code> permitted). - * @param notify notify listeners? - * - * @since 1.2.0 - */ - public void setBaseURLGenerator(CategoryURLGenerator generator, - boolean notify); - - /** - * Returns a legend item for a series. This method can return - * <code>null</code>, in which case the series will have no entry in the - * legend. - * - * @param datasetIndex the dataset index (zero-based). - * @param series the series (zero-based index). - * - * @return The legend item (possibly <code>null</code>). - */ - public LegendItem getLegendItem(int datasetIndex, int series); - - /** - * Returns the legend item label generator. - * - * @return The label generator (never <code>null</code>). - * - * @see #setLegendItemLabelGenerator(CategorySeriesLabelGenerator) - * - * @since 1.2.0 - */ - public CategorySeriesLabelGenerator getLegendItemLabelGenerator(); - - /** - * Sets the legend item label generator and sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param generator the generator (<code>null</code> not permitted). - * - * @see #getLegendItemLabelGenerator() - * - * @since 1.2.0 - */ - public void setLegendItemLabelGenerator( - CategorySeriesLabelGenerator generator); - - /** - * Returns the legend item tool tip generator. - * - * @return The tool tip generator (possibly <code>null</code>). - * - * @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator) - * - * @since 1.2.0 - */ - public CategorySeriesLabelGenerator getLegendItemToolTipGenerator(); - - /** - * Sets the legend item tool tip generator and sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param generator the generator (<code>null</code> permitted). - * - * @see #setLegendItemToolTipGenerator(CategorySeriesLabelGenerator) - * - * @since 1.2.0 - */ - public void setLegendItemToolTipGenerator( - CategorySeriesLabelGenerator generator); - - /** - * Returns the legend item URL generator. - * - * @return The URL generator (possibly <code>null</code>). - * - * @see #setLegendItemURLGenerator(CategorySeriesLabelGenerator) - * - * @since 1.2.0 - */ - public CategorySeriesLabelGenerator getLegendItemURLGenerator(); - - /** - * Sets the legend item URL generator and sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param generator the generator (<code>null</code> permitted). - * - * @see #getLegendItemURLGenerator() - * - * @since 1.2.0 - */ - public void setLegendItemURLGenerator( - CategorySeriesLabelGenerator generator); - - /** * Draws a background for the data area. * * @param g2 the graphics device. * @param plot the plot. * @param dataArea the data area. */ - public void drawBackground(Graphics2D g2, - CategoryPlot plot, - Rectangle2D dataArea); + public void drawBackground(Graphics2D g2, CategoryPlot plot, + Rectangle2D dataArea); /** * Draws an outline for the data area. @@ -1766,36 +1793,10 @@ * @param plot the plot. * @param dataArea the data area. */ - public void drawOutline(Graphics2D g2, - CategoryPlot plot, - Rectangle2D dataArea); + public void drawOutline(Graphics2D g2, CategoryPlot plot, + Rectangle2D dataArea); /** - * Draws a single data item. - * - * @param g2 the graphics device. - * @param state state information for one chart. - * @param dataArea the data plot area. - * @param plot the plot. - * @param domainAxis the domain axis. - * @param rangeAxis the range axis. - * @param dataset the data. - * @param row the row index (zero-based). - * @param column the column index (zero-based). - * @param pass the pass index. - */ - public void drawItem(Graphics2D g2, - CategoryItemRendererState state, - Rectangle2D dataArea, - CategoryPlot plot, - CategoryAxis domainAxis, - ValueAxis rangeAxis, - CategoryDataset dataset, - int row, - int column, - int pass); - - /** * Draws a grid line against the domain axis. * * @param g2 the graphics device. @@ -1807,10 +1808,8 @@ * @see #drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis, * Rectangle2D, double) */ - public void drawDomainGridline(Graphics2D g2, - CategoryPlot plot, - Rectangle2D dataArea, - double value); + public void drawDomainGridline(Graphics2D g2, CategoryPlot plot, + Rectangle2D dataArea, double value); /** * Draws a grid line against the range axis. @@ -1824,11 +1823,8 @@ * * @see #drawDomainGridline(Graphics2D, CategoryPlot, Rectangle2D, double) */ - public void drawRangeGridline(Graphics2D g2, - CategoryPlot plot, - ValueAxis axis, - Rectangle2D dataArea, - double value); + public void drawRangeGridline(Graphics2D g2, CategoryPlot plot, + ValueAxis axis, Rectangle2D dataArea, double value); /** * Draws a line (or some other marker) to indicate a particular category on @@ -1843,11 +1839,8 @@ * @see #drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, * Rectangle2D) */ - public void drawDomainMarker(Graphics2D g2, - CategoryPlot plot, - CategoryAxis axis, - CategoryMarker marker, - Rectangle2D dataArea); + public void drawDomainMarker(Graphics2D g2, CategoryPlot plot, + CategoryAxis axis, CategoryMarker marker, Rectangle2D dataArea); /** * Draws a line (or some other marker) to indicate a particular value on @@ -1862,10 +1855,7 @@ * @see #drawDomainMarker(Graphics2D, CategoryPlot, CategoryAxis, * CategoryMarker, Rectangle2D) */ - public void drawRangeMarker(Graphics2D g2, - CategoryPlot plot, - ValueAxis axis, - Marker marker, - Rectangle2D dataArea); - + public void drawRangeMarker(Graphics2D g2, CategoryPlot plot, + ValueAxis axis, Marker marker, Rectangle2D dataArea); + } Modified: trunk/source/org/jfree/chart/renderer/category/GanttRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/GanttRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/GanttRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -49,6 +49,7 @@ * 17-Jan-2006 : Set includeBaseInRange flag to false (DG); * 20-Mar-2007 : Implemented equals() and fixed serialization (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Simplified entity generation by calling addEntity() (DG); * */ @@ -66,11 +67,9 @@ import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.CategoryItemEntity; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.RendererChangeEvent; import org.jfree.chart.labels.CategoryItemLabelGenerator; -import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.util.PaintUtilities; @@ -381,20 +380,7 @@ if (state.getInfo() != null) { EntityCollection entities = state.getEntityCollection(); if (entities != null) { - String tip = null; - if (getToolTipGenerator(row, column) != null) { - tip = getToolTipGenerator(row, column).generateToolTip( - dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL( - dataset, row, column); - } - CategoryItemEntity entity = new CategoryItemEntity( - bar, tip, url, dataset, dataset.getRowKey(row), - dataset.getColumnKey(column)); - entities.add(entity); + addItemEntity(entities, dataset, row, column, bar); } } } @@ -526,27 +512,10 @@ } // collect entity and tool tip information... - if (state.getInfo() != null) { - EntityCollection entities = state.getEntityCollection(); - if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster = getToolTipGenerator(row, - column); - if (tipster != null) { - tip = tipster.generateToolTip(dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL( - dataset, row, column); - } - CategoryItemEntity entity = new CategoryItemEntity(bar, tip, - url, dataset, dataset.getRowKey(row), - dataset.getColumnKey(column)); - entities.add(entity); - } + EntityCollection entities = state.getEntityCollection(); + if (entities != null) { + addItemEntity(entities, dataset, row, column, bar); } - } /** Modified: trunk/source/org/jfree/chart/renderer/category/GroupedStackedBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/GroupedStackedBarRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/GroupedStackedBarRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -44,6 +44,7 @@ * --> CategoryItemLabelGenerator (DG); * 22-Sep-2005 : Renamed getMaxBarWidth() --> getMaximumBarWidth() (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Simplified entity generation by calling addEntity() (DG); * */ @@ -57,11 +58,9 @@ import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.CategoryItemEntity; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.RendererChangeEvent; import org.jfree.chart.labels.CategoryItemLabelGenerator; -import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.util.PublicCloneable; @@ -331,35 +330,17 @@ g2.draw(bar); } - CategoryItemLabelGenerator generator - = getItemLabelGenerator(row, column); + CategoryItemLabelGenerator generator = getItemLabelGenerator(row, + column); if (generator != null && isItemLabelVisible(row, column)) { - drawItemLabel( - g2, dataset, row, column, plot, generator, bar, - (value < 0.0) - ); + drawItemLabel(g2, dataset, row, column, plot, generator, bar, + (value < 0.0)); } // collect entity and tool tip information... - if (state.getInfo() != null) { - EntityCollection entities = state.getEntityCollection(); - if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster = getToolTipGenerator(row, - column); - if (tipster != null) { - tip = tipster.generateToolTip(dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL( - dataset, row, column); - } - CategoryItemEntity entity = new CategoryItemEntity( - bar, tip, url, dataset, dataset.getRowKey(row), - dataset.getColumnKey(column)); - entities.add(entity); - } + EntityCollection entities = state.getEntityCollection(); + if (entities != null) { + addItemEntity(entities, dataset, row, column, bar); } } Modified: trunk/source/org/jfree/chart/renderer/category/IntervalBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/IntervalBarRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/IntervalBarRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -58,6 +58,7 @@ * --> CategoryItemLabelGenerator (DG); * 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Simplified entity generation by calling addEntity() (DG); * */ @@ -71,10 +72,8 @@ import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.CategoryItemEntity; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.labels.CategoryItemLabelGenerator; -import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.util.PublicCloneable; @@ -269,25 +268,9 @@ } // collect entity and tool tip information... - if (state.getInfo() != null) { - EntityCollection entities = state.getEntityCollection(); - if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster - = getToolTipGenerator(row, column); - if (tipster != null) { - tip = tipster.generateToolTip(dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL( - dataset, row, column); - } - CategoryItemEntity entity = new CategoryItemEntity(bar, tip, - url, dataset, dataset.getRowKey(row), - dataset.getColumnKey(column)); - entities.add(entity); - } + EntityCollection entities = state.getEntityCollection(); + if (entities != null) { + addItemEntity(entities, dataset, row, column, bar); } } Modified: trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/LayeredBarRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -48,6 +48,7 @@ * width setting (thanks to Zoheb Borbora) (DG); * 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Simplified entity generation by calling addEntity() (DG); * */ @@ -62,10 +63,8 @@ import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.CategoryItemEntity; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.labels.CategoryItemLabelGenerator; -import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.util.GradientPaintTransformer; @@ -215,7 +214,7 @@ * @param plot the plot. * @param domainAxis the domain axis. * @param rangeAxis the range axis. - * @param data the data. + * @param dataset the dataset. * @param row the row index (zero-based). * @param column the column index (zero-based). */ @@ -225,12 +224,12 @@ CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, - CategoryDataset data, + CategoryDataset dataset, int row, int column) { // nothing is drawn for null values... - Number dataValue = data.getValue(row, column); + Number dataValue = dataset.getValue(row, column); if (dataValue == null) { return; } @@ -322,31 +321,16 @@ CategoryItemLabelGenerator generator = getItemLabelGenerator(row, column); if (generator != null && isItemLabelVisible(row, column)) { - drawItemLabel(g2, data, row, column, plot, generator, bar, + drawItemLabel(g2, dataset, row, column, plot, generator, bar, (transX1 > transX2)); } // collect entity and tool tip information... - if (state.getInfo() != null) { - EntityCollection entities = state.getEntityCollection(); - if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster - = getToolTipGenerator(row, column); - if (tipster != null) { - tip = tipster.generateToolTip(data, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL(data, - row, column); - } - CategoryItemEntity entity = new CategoryItemEntity(bar, tip, - url, data, data.getRowKey(row), - data.getColumnKey(column)); - entities.add(entity); - } + EntityCollection entities = state.getEntityCollection(); + if (entities != null) { + addItemEntity(entities, dataset, row, column, bar); } + } /** @@ -358,7 +342,7 @@ * @param plot the plot. * @param domainAxis the domain axis. * @param rangeAxis the range axis. - * @param data the data. + * @param dataset the dataset. * @param row the row index (zero-based). * @param column the column index (zero-based). */ @@ -368,12 +352,12 @@ CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, - CategoryDataset data, + CategoryDataset dataset, int row, int column) { // nothing is drawn for null values... - Number dataValue = data.getValue(row, column); + Number dataValue = dataset.getValue(row, column); if (dataValue == null) { return; } @@ -472,30 +456,14 @@ CategoryItemLabelGenerator generator = getItemLabelGenerator(row, column); if (generator != null && isItemLabelVisible(row, column)) { - drawItemLabel(g2, data, row, column, plot, generator, bar, + drawItemLabel(g2, dataset, row, column, plot, generator, bar, (transX1 > transX2)); } // collect entity and tool tip information... - if (state.getInfo() != null) { - EntityCollection entities = state.getEntityCollection(); - if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster - = getToolTipGenerator(row, column); - if (tipster != null) { - tip = tipster.generateToolTip(data, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL( - data, row, column); - } - CategoryItemEntity entity = new CategoryItemEntity(bar, tip, - url, data, data.getRowKey(row), - data.getColumnKey(column)); - entities.add(entity); - } + EntityCollection entities = state.getEntityCollection(); + if (entities != null) { + addItemEntity(entities, dataset, row, column, bar); } } Modified: trunk/source/org/jfree/chart/renderer/category/LevelRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/LevelRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/LevelRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -44,6 +44,7 @@ * 23-Jan-2006 : Renamed getMaxItemWidth() --> getMaximumItemWidth() (DG); * 19-Jun-2007 : Removed deprecated code (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Simplified entity generation by calling addEntity() (DG); * */ @@ -58,11 +59,9 @@ import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.CategoryItemEntity; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.RendererChangeEvent; import org.jfree.chart.labels.CategoryItemLabelGenerator; -import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.PlotRenderingInfo; @@ -331,28 +330,12 @@ } // collect entity and tool tip information... - if (state.getInfo() != null) { - EntityCollection entities = state.getEntityCollection(); - if (entities != null) { - String tip = null; - CategoryToolTipGenerator tipster = getToolTipGenerator(row, - column); - if (tipster != null) { - tip = tipster.generateToolTip(dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL(dataset, - row, column); - } - CategoryItemEntity entity = new CategoryItemEntity( - line.getBounds(), tip, url, dataset, - dataset.getRowKey(row), dataset.getColumnKey(column)); - entities.add(entity); - } - + EntityCollection entities = state.getEntityCollection(); + if (entities != null) { + addItemEntity(entities, dataset, row, column, line.getBounds()); } + } /** Modified: trunk/source/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/source/org/jfree/chart/renderer/category/StatisticalLineAndShapeRenderer.java 2007-06-29 12:56:09 UTC (rev 89) @@ -48,6 +48,7 @@ * 14-Jun-2007 : If the dataset is not a StatisticalCategoryDataset, revert * to the drawing behaviour of LineAndShapeRenderer (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 29-Jun-2007 : Simplified entity generation by calling addEntity() (DG); * */ @@ -65,10 +66,8 @@ import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.ValueAxis; -import org.jfree.chart.entity.CategoryItemEntity; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.RendererChangeEvent; -import org.jfree.chart.labels.CategoryToolTipGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.util.PaintUtilities; @@ -317,29 +316,12 @@ } // collect entity and tool tip information... - if (state.getInfo() != null) { - EntityCollection entities = state.getEntityCollection(); - if (entities != null && shape != null) { - String tip = null; - CategoryToolTipGenerator tipster = getToolTipGenerator(row, - column); - if (tipster != null) { - tip = tipster.generateToolTip(dataset, row, column); - } - String url = null; - if (getItemURLGenerator(row, column) != null) { - url = getItemURLGenerator(row, column).generateURL( - dataset, row, column); - } - CategoryItemEntity entity = new CategoryItemEntity(shape, tip, - url, dataset, dataset.getRowKey(row), - dataset.getColumnKey(column)); - entities.add(entity); - - } - + EntityCollection entities = state.getEntityCollection(); + if (entities != null) { + addItemEntity(entities, dataset, row, column, shape); } + } /** Modified: trunk/tests/org/jfree/chart/junit/AreaChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/AreaChartTests.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/tests/org/jfree/chart/junit/AreaChartTests.java 2007-06-29 12:56:09 UTC (rev 89) @@ -37,7 +37,8 @@ * Changes: * -------- * 12-Apr-2005 : Version 1 (DG); - * + * 27-Jun-2007 : Updated for method name change in CategoryItemRenderer + * interface (DG); */ package org.jfree.chart.junit; @@ -123,7 +124,7 @@ StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); renderer.setSeriesURLGenerator(0, url1); - CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); + CategoryURLGenerator url2 = renderer.getURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/BarChart3DTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/BarChart3DTests.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/tests/org/jfree/chart/junit/BarChart3DTests.java 2007-06-29 12:56:09 UTC (rev 89) @@ -40,6 +40,8 @@ * 25-Jun-2002 : Removed redundant code (DG); * 17-Oct-2002 : Fixed errors reported by Checkstyle (DG); * 14-Jul-2003 : Renamed BarChart3DTests.java (DG); + * 27-Jun-2007 : Updated for method name change in CategoryItemRenderer + * interface (DG); * */ @@ -175,7 +177,7 @@ StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); renderer.setSeriesURLGenerator(0, url1); - CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); + CategoryURLGenerator url2 = renderer.getURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/BarChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/BarChartTests.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/tests/org/jfree/chart/junit/BarChartTests.java 2007-06-29 12:56:09 UTC (rev 89) @@ -40,6 +40,8 @@ * 25-Jun-2002 : Removed redundant code (DG); * 17-Oct-2002 : Fixed errors reported by Checkstyle (DG); * 14-Jul-2003 : Renamed BarChartTests.java (DG); + * 27-Jun-2007 : Updated for method name change in CategoryItemRenderer + * interface (DG); * */ @@ -179,7 +181,7 @@ StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); renderer.setSeriesURLGenerator(0, url1); - CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); + CategoryURLGenerator url2 = renderer.getURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/GanttChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/GanttChartTests.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/tests/org/jfree/chart/junit/GanttChartTests.java 2007-06-29 12:56:09 UTC (rev 89) @@ -37,6 +37,8 @@ * Changes: * -------- * 12-Apr-2005 : Version 1 (DG); + * 27-Jun-2007 : Updated for method name change in CategoryItemRenderer + * interface (DG); * */ @@ -176,7 +178,7 @@ StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); renderer.setSeriesURLGenerator(0, url1); - CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); + CategoryURLGenerator url2 = renderer.getURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/LineChart3DTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/LineChart3DTests.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/tests/org/jfree/chart/junit/LineChart3DTests.java 2007-06-29 12:56:09 UTC (rev 89) @@ -37,6 +37,8 @@ * Changes: * -------- * 12-Apr-2005 : Version 1 (DG); + * 27-Jun-2007 : Updated for method name change in CategoryItemRenderer + * interface (DG); * */ @@ -174,7 +176,7 @@ StandardCategoryURLGenerator url1 = new StandardCategoryURLGenerator(); renderer.setSeriesURLGenerator(0, url1); - CategoryURLGenerator url2 = renderer.getItemURLGenerator(0, 0); + CategoryURLGenerator url2 = renderer.getURLGenerator(0, 0); assertTrue(url2 == url1); } Modified: trunk/tests/org/jfree/chart/junit/LineChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/LineChartTests.java 2007-06-27 15:19:13 UTC (rev 88) +++ trunk/tests/or... [truncated message content] |
From: <mu...@us...> - 2007-07-02 14:43:41
|
Revision: 94 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=94&view=rev Author: mungady Date: 2007-07-02 07:43:38 -0700 (Mon, 02 Jul 2007) Log Message: ----------- 2007-07-02 David Gilbert <dav...@ob...> * experimental/org/jfree/experimental/chart/axis/LogAxis.java (draw): Updated for change in method signature, * source/org/jfree/chart/axis/Axis.java (labelToolTip): New field, (labelURL): Likewise, (Axis(String)): Initialise new fields, (getLabelToolTip): New method, (setLabelToolTip): Likewise, (getLabelURL): Likewise, (setLabelURL): Likewise, (drawLabel): Added PlotRenderingInfo parameter and create entity if needed, (equals): Check new fields, * source/org/jfree/chart/axis/CategoryAxis.java (draw): Updated for change in method signature, * source/org/jfree/chart/axis/CategoryAxis3D.java (draw): Likewise, * source/org/jfree/chart/axis/DateAxis.java (draw): Likewise, * source/org/jfree/chart/axis/NumberAxis.java (draw): Likewise, * source/org/jfree/chart/axis/NumberAxis3D.java (draw): Likewise, * source/org/jfree/chart/axis/PeriodAxis.java (draw): Likewise, * source/org/jfree/chart/axis/SubCategoryAxis.java (draw): Likewise, * source/org/jfree/chart/entity/AxisLabelEntity.java: New file, * tests/org/jfree/chart/axis/junit/AxisTests.java (equals): Check new fields. Modified Paths: -------------- trunk/ChangeLog trunk/experimental/org/jfree/experimental/chart/axis/LogAxis.java trunk/source/org/jfree/chart/axis/Axis.java trunk/source/org/jfree/chart/axis/CategoryAxis.java trunk/source/org/jfree/chart/axis/CategoryAxis3D.java trunk/source/org/jfree/chart/axis/DateAxis.java trunk/source/org/jfree/chart/axis/NumberAxis.java trunk/source/org/jfree/chart/axis/NumberAxis3D.java trunk/source/org/jfree/chart/axis/PeriodAxis.java trunk/source/org/jfree/chart/axis/SubCategoryAxis.java trunk/tests/org/jfree/chart/axis/junit/AxisTests.java Added Paths: ----------- trunk/source/org/jfree/chart/entity/AxisLabelEntity.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/ChangeLog 2007-07-02 14:43:38 UTC (rev 94) @@ -1,3 +1,35 @@ +2007-07-02 David Gilbert <dav...@ob...> + + * experimental/org/jfree/experimental/chart/axis/LogAxis.java + (draw): Updated for change in method signature, + * source/org/jfree/chart/axis/Axis.java + (labelToolTip): New field, + (labelURL): Likewise, + (Axis(String)): Initialise new fields, + (getLabelToolTip): New method, + (setLabelToolTip): Likewise, + (getLabelURL): Likewise, + (setLabelURL): Likewise, + (drawLabel): Added PlotRenderingInfo parameter and create entity if needed, + (equals): Check new fields, + * source/org/jfree/chart/axis/CategoryAxis.java + (draw): Updated for change in method signature, + * source/org/jfree/chart/axis/CategoryAxis3D.java + (draw): Likewise, + * source/org/jfree/chart/axis/DateAxis.java + (draw): Likewise, + * source/org/jfree/chart/axis/NumberAxis.java + (draw): Likewise, + * source/org/jfree/chart/axis/NumberAxis3D.java + (draw): Likewise, + * source/org/jfree/chart/axis/PeriodAxis.java + (draw): Likewise, + * source/org/jfree/chart/axis/SubCategoryAxis.java + (draw): Likewise, + * source/org/jfree/chart/entity/AxisLabelEntity.java: New file, + * tests/org/jfree/chart/axis/junit/AxisTests.java + (equals): Check new fields. + 2007-06-29 David Gilbert <dav...@ob...> * source/org/jfree/data/time/TimePeriodValues.java Modified: trunk/experimental/org/jfree/experimental/chart/axis/LogAxis.java =================================================================== --- trunk/experimental/org/jfree/experimental/chart/axis/LogAxis.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/experimental/org/jfree/experimental/chart/axis/LogAxis.java 2007-07-02 14:43:38 UTC (rev 94) @@ -39,6 +39,7 @@ * 24-Aug-2006 : Version 1 (DG); * 22-Mar-2007 : Use defaultAutoArrange attribute (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -443,7 +444,8 @@ return state; } state = drawTickMarksAndLabels(g2, cursor, plotArea, dataArea, edge); - state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); + state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state, + plotState); return state; } Modified: trunk/source/org/jfree/chart/axis/Axis.java =================================================================== --- trunk/source/org/jfree/chart/axis/Axis.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/Axis.java 2007-07-02 14:43:38 UTC (rev 94) @@ -78,6 +78,7 @@ * ------------- JFREECHART 1.0.0 --------------------------------------------- * 22-Aug-2006 : API doc updates (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Modifications to support entities for axis labels (DG); * */ @@ -104,6 +105,8 @@ import javax.swing.event.EventListenerList; +import org.jfree.chart.entity.AxisLabelEntity; +import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.event.AxisChangeEvent; import org.jfree.chart.event.AxisChangeListener; import org.jfree.chart.plot.Plot; @@ -130,15 +133,15 @@ public static final boolean DEFAULT_AXIS_VISIBLE = true; /** The default axis label font. */ - public static final Font DEFAULT_AXIS_LABEL_FONT - = new Font("SansSerif", Font.PLAIN, 12); + public static final Font DEFAULT_AXIS_LABEL_FONT = new Font( + "SansSerif", Font.PLAIN, 12); /** The default axis label paint. */ public static final Paint DEFAULT_AXIS_LABEL_PAINT = Color.black; /** The default axis label insets. */ public static final RectangleInsets DEFAULT_AXIS_LABEL_INSETS - = new RectangleInsets(3.0, 3.0, 3.0, 3.0); + = new RectangleInsets(3.0, 3.0, 3.0, 3.0); /** The default axis line paint. */ public static final Paint DEFAULT_AXIS_LINE_PAINT = Color.gray; @@ -150,15 +153,15 @@ public static final boolean DEFAULT_TICK_LABELS_VISIBLE = true; /** The default tick label font. */ - public static final Font DEFAULT_TICK_LABEL_FONT - = new Font("SansSerif", Font.PLAIN, 10); + public static final Font DEFAULT_TICK_LABEL_FONT = new Font("SansSerif", + Font.PLAIN, 10); /** The default tick label paint. */ public static final Paint DEFAULT_TICK_LABEL_PAINT = Color.black; /** The default tick label insets. */ public static final RectangleInsets DEFAULT_TICK_LABEL_INSETS - = new RectangleInsets(2.0, 4.0, 2.0, 4.0); + = new RectangleInsets(2.0, 4.0, 2.0, 4.0); /** The default tick marks visible. */ public static final boolean DEFAULT_TICK_MARKS_VISIBLE = true; @@ -192,7 +195,21 @@ /** The label angle. */ private double labelAngle; + + /** + * The tool tip text for the label (<code>null</code> is permitted). + * + * @since 1.2.0 + */ + private String labelToolTip; + /** + * The URL for the label (<code>null</code> is permitted). + * + * @since 1.2.0. + */ + private String labelURL; + /** A flag that controls whether or not the axis line is visible. */ private boolean axisLineVisible; @@ -260,6 +277,8 @@ this.labelPaint = DEFAULT_AXIS_LABEL_PAINT; this.labelInsets = DEFAULT_AXIS_LABEL_INSETS; this.labelAngle = 0.0; + this.labelToolTip = null; + this.labelURL = null; this.axisLineVisible = true; this.axisLinePaint = DEFAULT_AXIS_LINE_PAINT; @@ -461,6 +480,62 @@ } /** + * Returns the tool tip text for the axis label. + * + * @return The tool tip text (possibly <code>null</code>). + * + * @see #setLabelToolTip(String) + * + * @since 1.2.0 + */ + public String getLabelToolTip() { + return this.labelToolTip; + } + + /** + * Sets the tool tip text for the axis label and sends a . + * {@link AxisChangeEvent} to all registered listeners. + * + * @param text the tool tip text (<code>null</code> permitted). + * + * @see #getLabelToolTip() + * + * @since 1.2.0 + */ + public void setLabelToolTip(String text) { + this.labelToolTip = text; + notifyListeners(new AxisChangeEvent(this)); + } + + /** + * Returns the URL text for the axis label. + * + * @return The URL (possibly <code>null</code>). + * + * @see #setLabelURL(String) + * + * @since 1.2.0 + */ + public String getLabelURL() { + return this.labelURL; + } + + /** + * Sets the URL for the axis label and sends an {@link AxisChangeEvent} to + * all registered listeners. + * + * @param url the URL (<code>null</code> permitted). + * + * @see #getLabelURL() + * + * @since 1.2.0 + */ + public void setLabelURL(String url) { + this.labelURL = url; + notifyListeners(new AxisChangeEvent(this)); + } + + /** * A flag that controls whether or not the axis line is drawn. * * @return A boolean. @@ -1009,15 +1084,13 @@ * @param dataArea the area inside the axes. * @param edge the location of the axis. * @param state the axis state (<code>null</code> not permitted). + * @param plotState the plot state (<code>null</code> permitted). * * @return Information about the axis. */ - protected AxisState drawLabel(String label, - Graphics2D g2, - Rectangle2D plotArea, - Rectangle2D dataArea, - RectangleEdge edge, - AxisState state) { + protected AxisState drawLabel(String label, Graphics2D g2, + Rectangle2D plotArea, Rectangle2D dataArea, RectangleEdge edge, + AxisState state, PlotRenderingInfo plotState) { // it is unlikely that 'state' will be null, but check anyway... if (state == null) { @@ -1034,54 +1107,60 @@ g2.setPaint(getLabelPaint()); FontMetrics fm = g2.getFontMetrics(); Rectangle2D labelBounds = TextUtilities.getTextBounds(label, g2, fm); - + Shape hotspot = null; + if (edge == RectangleEdge.TOP) { - AffineTransform t = AffineTransform.getRotateInstance( getLabelAngle(), labelBounds.getCenterX(), labelBounds.getCenterY()); Shape rotatedLabelBounds = t.createTransformedShape(labelBounds); labelBounds = rotatedLabelBounds.getBounds2D(); - double labelx = dataArea.getCenterX(); - double labely = state.getCursor() - insets.getBottom() - - labelBounds.getHeight() / 2.0; - TextUtilities.drawRotatedString(label, g2, (float) labelx, - (float) labely, TextAnchor.CENTER, getLabelAngle(), - TextAnchor.CENTER); + float w = (float) labelBounds.getWidth(); + float h = (float) labelBounds.getHeight(); + float labelx = (float) dataArea.getCenterX(); + float labely = (float) (state.getCursor() - insets.getBottom() + - h / 2.0); + TextUtilities.drawRotatedString(label, g2, labelx, labely, + TextAnchor.CENTER, getLabelAngle(), TextAnchor.CENTER); + hotspot = new Rectangle2D.Float(labelx - w / 2.0f, + labely - h / 2.0f, w, h); state.cursorUp(insets.getTop() + labelBounds.getHeight() + insets.getBottom()); - } else if (edge == RectangleEdge.BOTTOM) { - AffineTransform t = AffineTransform.getRotateInstance( getLabelAngle(), labelBounds.getCenterX(), labelBounds.getCenterY()); Shape rotatedLabelBounds = t.createTransformedShape(labelBounds); labelBounds = rotatedLabelBounds.getBounds2D(); - double labelx = dataArea.getCenterX(); - double labely = state.getCursor() - + insets.getTop() + labelBounds.getHeight() / 2.0; - TextUtilities.drawRotatedString(label, g2, (float) labelx, - (float) labely, TextAnchor.CENTER, getLabelAngle(), - TextAnchor.CENTER); + float w = (float) labelBounds.getWidth(); + float h = (float) labelBounds.getHeight(); + float labelx = (float) dataArea.getCenterX(); + float labely = (float) (state.getCursor() + insets.getTop() + + h / 2.0); + TextUtilities.drawRotatedString(label, g2, labelx, labely, + TextAnchor.CENTER, getLabelAngle(), TextAnchor.CENTER); + hotspot = new Rectangle2D.Float(labelx - w / 2.0f, + labely - h / 2.0f, w, h); state.cursorDown(insets.getTop() + labelBounds.getHeight() + insets.getBottom()); - } else if (edge == RectangleEdge.LEFT) { - AffineTransform t = AffineTransform.getRotateInstance( getLabelAngle() - Math.PI / 2.0, labelBounds.getCenterX(), labelBounds.getCenterY()); Shape rotatedLabelBounds = t.createTransformedShape(labelBounds); labelBounds = rotatedLabelBounds.getBounds2D(); - double labelx = state.getCursor() - - insets.getRight() - labelBounds.getWidth() / 2.0; - double labely = dataArea.getCenterY(); - TextUtilities.drawRotatedString(label, g2, (float) labelx, - (float) labely, TextAnchor.CENTER, - getLabelAngle() - Math.PI / 2.0, TextAnchor.CENTER); + float w = (float) labelBounds.getWidth(); + float h = (float) labelBounds.getHeight(); + float labelx = (float) (state.getCursor() - insets.getRight() + - w / 2.0); + float labely = (float) dataArea.getCenterY(); + TextUtilities.drawRotatedString(label, g2, labelx, labely, + TextAnchor.CENTER, getLabelAngle() - Math.PI / 2.0, + TextAnchor.CENTER); + hotspot = new Rectangle2D.Float(labelx - w / 2.0f, + labely - h / 2.0f, w, h); state.cursorLeft(insets.getLeft() + labelBounds.getWidth() + insets.getRight()); } @@ -1092,17 +1171,29 @@ labelBounds.getCenterX(), labelBounds.getCenterY()); Shape rotatedLabelBounds = t.createTransformedShape(labelBounds); labelBounds = rotatedLabelBounds.getBounds2D(); - double labelx = state.getCursor() - + insets.getLeft() + labelBounds.getWidth() / 2.0; - double labely = dataArea.getY() + dataArea.getHeight() / 2.0; - TextUtilities.drawRotatedString(label, g2, (float) labelx, - (float) labely, TextAnchor.CENTER, - getLabelAngle() + Math.PI / 2.0, TextAnchor.CENTER); + float w = (float) labelBounds.getWidth(); + float h = (float) labelBounds.getHeight(); + float labelx = (float) (state.getCursor() + + insets.getLeft() + w / 2.0); + float labely = (float) (dataArea.getY() + dataArea.getHeight() + / 2.0); + TextUtilities.drawRotatedString(label, g2, labelx, labely, + TextAnchor.CENTER, getLabelAngle() + Math.PI / 2.0, + TextAnchor.CENTER); + hotspot = new Rectangle2D.Float(labelx - w / 2.0f, + labely - h / 2.0f, w, h); state.cursorRight(insets.getLeft() + labelBounds.getWidth() + insets.getRight()); } - + if (plotState != null && hotspot != null) { + EntityCollection entities = plotState.getOwner() + .getEntityCollection(); + if (entities != null) { + entities.add(new AxisLabelEntity(this, hotspot, + this.labelToolTip, this.labelURL)); + } + } return state; } @@ -1190,6 +1281,12 @@ if (this.labelAngle != that.labelAngle) { return false; } + if (!ObjectUtilities.equal(this.labelToolTip, that.labelToolTip)) { + return false; + } + if (!ObjectUtilities.equal(this.labelURL, that.labelURL)) { + return false; + } if (this.axisLineVisible != that.axisLineVisible) { return false; } Modified: trunk/source/org/jfree/chart/axis/CategoryAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/CategoryAxis.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/CategoryAxis.java 2007-07-02 14:43:38 UTC (rev 94) @@ -85,6 +85,7 @@ * 07-Mar-2007 : Fixed bug in axis label positioning (DG); * 19-Jun-2007 : Removed deprecated code (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -824,7 +825,8 @@ AxisState state = new AxisState(cursor); state = drawCategoryLabels(g2, plotArea, dataArea, edge, state, plotState); - state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); + state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state, + plotState); return state; Modified: trunk/source/org/jfree/chart/axis/CategoryAxis3D.java =================================================================== --- trunk/source/org/jfree/chart/axis/CategoryAxis3D.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/CategoryAxis3D.java 2007-07-02 14:43:38 UTC (rev 94) @@ -50,6 +50,7 @@ * 18-Aug-2006 : Fix for bug drawing category labels, thanks to Adriaan * Joubert (1277726) (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -149,7 +150,8 @@ AxisState state = new AxisState(cursor); state = drawCategoryLabels(g2, plotArea, adjustedDataArea, edge, state, plotState); - state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); + state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state, + plotState); return state; Modified: trunk/source/org/jfree/chart/axis/DateAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/DateAxis.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/DateAxis.java 2007-07-02 14:43:38 UTC (rev 94) @@ -117,6 +117,7 @@ * 03-May-2007 : Fixed minor bugs in previousStandardDate(), with new JUnit * tests (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -1700,7 +1701,8 @@ // draw the axis label (note that 'state' is passed in *and* // returned)... - state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); + state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state, + plotState); return state; Modified: trunk/source/org/jfree/chart/axis/NumberAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/NumberAxis.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/NumberAxis.java 2007-07-02 14:43:38 UTC (rev 94) @@ -93,6 +93,7 @@ * see bug 1608371 (DG); * 22-Mar-2007 : Use new defaultAutoRange attribute (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -676,7 +677,8 @@ // } // draw the axis label... - state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); + state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state, + plotState); return state; Modified: trunk/source/org/jfree/chart/axis/NumberAxis3D.java =================================================================== --- trunk/source/org/jfree/chart/axis/NumberAxis3D.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/NumberAxis3D.java 2007-07-02 14:43:38 UTC (rev 94) @@ -66,6 +66,7 @@ * ------------- JFREECHART 1.0.x --------------------------------------------- * 18-Jan-2006 : Fixed bug 1408904 (axis assumes CategoryPlot) (DG): * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -171,7 +172,8 @@ adjustedDataArea, edge); // draw the axis label... - info = drawLabel(getLabel(), g2, plotArea, dataArea, edge, info); + info = drawLabel(getLabel(), g2, plotArea, dataArea, edge, info, + plotState); return info; Modified: trunk/source/org/jfree/chart/axis/PeriodAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/PeriodAxis.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/PeriodAxis.java 2007-07-02 14:43:38 UTC (rev 94) @@ -51,6 +51,7 @@ * subclasses (DG); * 22-Mar-2007 : Use new defaultAutoRange attribute (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -636,7 +637,7 @@ // draw the axis label (note that 'state' is passed in *and* // returned)... axisState = drawLabel(getLabel(), g2, plotArea, dataArea, edge, - axisState); + axisState, plotState); return axisState; } Modified: trunk/source/org/jfree/chart/axis/SubCategoryAxis.java =================================================================== --- trunk/source/org/jfree/chart/axis/SubCategoryAxis.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/source/org/jfree/chart/axis/SubCategoryAxis.java 2007-07-02 14:43:38 UTC (rev 94) @@ -46,6 +46,7 @@ * 30-May-2007 : Added argument check and event notification to * addSubCategory() (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Added entity support for axis labels (DG); * */ @@ -275,7 +276,8 @@ ); state = drawCategoryLabels(g2, plotArea, dataArea, edge, state, plotState); - state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state); + state = drawLabel(getLabel(), g2, plotArea, dataArea, edge, state, + plotState); return state; Added: trunk/source/org/jfree/chart/entity/AxisLabelEntity.java =================================================================== --- trunk/source/org/jfree/chart/entity/AxisLabelEntity.java (rev 0) +++ trunk/source/org/jfree/chart/entity/AxisLabelEntity.java 2007-07-02 14:43:38 UTC (rev 94) @@ -0,0 +1,81 @@ +/* =========================================================== + * JFreeChart : a free chart library for the Java(tm) platform + * =========================================================== + * + * (C) Copyright 2000-2007, 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.] + * + * -------------------- + * AxisLabelEntity.java + * -------------------- + * (C) Copyright 2007, by Object Refinery Limited and Contributors. + * + * Original Author: David Gilbert (for Object Refinery Limited); + * Contributor(s): -; + * + * $Id: PeriodAxis.java,v 1.16.2.7 2007/03/22 12:13:27 mungady Exp $ + * + * Changes + * ------- + * 02-Jul-2007 : Version 1 (DG); + * + */ + +package org.jfree.chart.entity; + +import java.awt.Shape; + +import org.jfree.chart.axis.Axis; + +/** + * A chart entity that represents the label for an axis. + * + * @since 1.2.0 + */ +public class AxisLabelEntity extends ChartEntity { + + /** The axis. */ + private Axis axis; + + /** + * Creates a new entity representing the label on an axis. + * + * @param axis the axis. + * @param hotspot the hotspot. + * @param toolTipText the tool tip text (<code>null</code> permitted). + * @param url the url (<code>null</code> permitted). + */ + public AxisLabelEntity(Axis axis, Shape hotspot, String toolTipText, + String url) { + super(hotspot, toolTipText, url); + } + + /** + * Returns the axis for this entity. + * + * @return The axis. + */ + public Axis getAxis() { + return this.axis; + } + +} Modified: trunk/tests/org/jfree/chart/axis/junit/AxisTests.java =================================================================== --- trunk/tests/org/jfree/chart/axis/junit/AxisTests.java 2007-07-02 14:20:29 UTC (rev 93) +++ trunk/tests/org/jfree/chart/axis/junit/AxisTests.java 2007-07-02 14:43:38 UTC (rev 94) @@ -92,7 +92,7 @@ a2 = (CategoryAxis) a1.clone(); } catch (CloneNotSupportedException e) { - System.err.println("Failed to clone."); + e.printStackTrace(); } assertTrue(a1 != a2); assertTrue(a1.getClass() == a2.getClass()); @@ -146,6 +146,16 @@ a2.setLabelAngle(1.23); assertTrue(a1.equals(a2)); + a1.setLabelToolTip("123"); + assertFalse(a1.equals(a2)); + a2.setLabelToolTip("123"); + assertTrue(a1.equals(a2)); + + a1.setLabelURL("ABC"); + assertFalse(a1.equals(a2)); + a2.setLabelURL("ABC"); + assertTrue(a1.equals(a2)); + // axis line visible... a1.setAxisLineVisible(false); assertFalse(a1.equals(a2)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-07-02 15:39:11
|
Revision: 97 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=97&view=rev Author: mungady Date: 2007-07-02 08:39:06 -0700 (Mon, 02 Jul 2007) Log Message: ----------- 2007-07-02 David Gilbert <dav...@ob...> * source/org/jfree/chart/editor/DefaultPlotEditor.java (updatePlotProperties): Updated for changes to LineAndShapeRenderer, * source/org/jfree/chart/renderer/category/LineAndShapeRenderer.java (linesVisible): Removed, (shapesVisible): Likewise, (shapesFilled): Likewise, (LineAndShapeRenderer(boolean, boolean)): Likewise, (getItemLineVisible): Adjust lookup for removed field, (getLinesVisible): Removed, (setLinesVisible): Likewise, (getItemShapeVisible): Adjust lookup for removed field, (getShapesVisible): Removed, (setShapesVisible): Likewise, (getItemShapeFilled): Adjust lookup for removed field, (setShapesFilled): Removed, (equals): Updated for removed fields. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java trunk/source/org/jfree/chart/renderer/category/LineAndShapeRenderer.java trunk/tests/org/jfree/chart/renderer/category/junit/LineAndShapeRendererTests.java trunk/tests/org/jfree/chart/renderer/category/junit/LineRenderer3DTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-02 15:35:51 UTC (rev 96) +++ trunk/ChangeLog 2007-07-02 15:39:06 UTC (rev 97) @@ -1,5 +1,24 @@ 2007-07-02 David Gilbert <dav...@ob...> + * source/org/jfree/chart/editor/DefaultPlotEditor.java + (updatePlotProperties): Updated for changes to LineAndShapeRenderer, + * source/org/jfree/chart/renderer/category/LineAndShapeRenderer.java + (linesVisible): Removed, + (shapesVisible): Likewise, + (shapesFilled): Likewise, + (LineAndShapeRenderer(boolean, boolean)): Likewise, + (getItemLineVisible): Adjust lookup for removed field, + (getLinesVisible): Removed, + (setLinesVisible): Likewise, + (getItemShapeVisible): Adjust lookup for removed field, + (getShapesVisible): Removed, + (setShapesVisible): Likewise, + (getItemShapeFilled): Adjust lookup for removed field, + (setShapesFilled): Removed, + (equals): Updated for removed fields. + +2007-07-02 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/xy/XYLineAndShapeRenderer.java (linesVisible): Removed, (shapesVisible): Likewise, Modified: trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java =================================================================== --- trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java 2007-07-02 15:35:51 UTC (rev 96) +++ trunk/source/org/jfree/chart/editor/DefaultPlotEditor.java 2007-07-02 15:39:06 UTC (rev 97) @@ -595,7 +595,7 @@ CategoryPlot p = (CategoryPlot) plot; CategoryItemRenderer r = p.getRenderer(); if (r instanceof LineAndShapeRenderer) { - ((LineAndShapeRenderer) r).setLinesVisible( + ((LineAndShapeRenderer) r).setBaseLinesVisible( this.drawLines.booleanValue() ); } @@ -616,7 +616,7 @@ CategoryPlot p = (CategoryPlot) plot; CategoryItemRenderer r = p.getRenderer(); if (r instanceof LineAndShapeRenderer) { - ((LineAndShapeRenderer) r).setShapesVisible( + ((LineAndShapeRenderer) r).setBaseShapesVisible( this.drawShapes.booleanValue() ); } Modified: trunk/source/org/jfree/chart/renderer/category/LineAndShapeRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/LineAndShapeRenderer.java 2007-07-02 15:35:51 UTC (rev 96) +++ trunk/source/org/jfree/chart/renderer/category/LineAndShapeRenderer.java 2007-07-02 15:39:06 UTC (rev 97) @@ -86,6 +86,7 @@ * 17-May-2007 : Set datasetIndex and seriesIndex in getLegendItem() (DG); * 18-May-2007 : Set dataset and seriesKey for LegendItem (DG); * 21-Jun-2007 : Removed JCommon dependencies (DG); + * 02-Jul-2007 : Removed override settings (DG); * */ @@ -122,9 +123,6 @@ /** For serialization. */ private static final long serialVersionUID = -197749519869226398L; - - /** A flag that controls whether or not lines are visible for ALL series. */ - private Boolean linesVisible; /** * A table of flags that control (per series) whether or not lines are @@ -139,11 +137,6 @@ private boolean baseLinesVisible; /** - * A flag that controls whether or not shapes are visible for ALL series. - */ - private Boolean shapesVisible; - - /** * A table of flags that control (per series) whether or not shapes are * visible. */ @@ -151,9 +144,6 @@ /** The default value returned by the getShapeVisible() method. */ private boolean baseShapesVisible; - - /** A flag that controls whether or not shapes are filled for ALL series. */ - private Boolean shapesFilled; /** * A table of flags that control (per series) whether or not shapes are @@ -194,13 +184,10 @@ */ public LineAndShapeRenderer(boolean lines, boolean shapes) { super(); - this.linesVisible = null; this.seriesLinesVisible = new BooleanList(); this.baseLinesVisible = lines; - this.shapesVisible = null; this.seriesShapesVisible = new BooleanList(); this.baseShapesVisible = shapes; - this.shapesFilled = null; this.seriesShapesFilled = new BooleanList(); this.baseShapesFilled = true; this.useFillPaint = false; @@ -220,10 +207,7 @@ * @return A boolean. */ public boolean getItemLineVisible(int series, int item) { - Boolean flag = this.linesVisible; - if (flag == null) { - flag = getSeriesLinesVisible(series); - } + Boolean flag = getSeriesLinesVisible(series); if (flag != null) { return flag.booleanValue(); } @@ -233,41 +217,6 @@ } /** - * Returns a flag that controls whether or not lines are drawn for ALL - * series. If this flag is <code>null</code>, then the "per series" - * settings will apply. - * - * @return A flag (possibly <code>null</code>). - */ - public Boolean getLinesVisible() { - return this.linesVisible; - } - - /** - * Sets a flag that controls whether or not lines are drawn between the - * items in ALL series, and sends a {@link RendererChangeEvent} to all - * registered listeners. You need to set this to <code>null</code> if you - * want the "per series" settings to apply. - * - * @param visible the flag (<code>null</code> permitted). - */ - public void setLinesVisible(Boolean visible) { - this.linesVisible = visible; - notifyListeners(new RendererChangeEvent(this)); - } - - /** - * Sets a flag that controls whether or not lines are drawn between the - * items in ALL series, and sends a {@link RendererChangeEvent} to all - * registered listeners. - * - * @param visible the flag. - */ - public void setLinesVisible(boolean visible) { - setLinesVisible(Boolean.valueOf(visible)); - } - - /** * Returns the flag used to control whether or not the lines for a series * are visible. * @@ -331,10 +280,7 @@ * @return A boolean. */ public boolean getItemShapeVisible(int series, int item) { - Boolean flag = this.shapesVisible; - if (flag == null) { - flag = getSeriesShapesVisible(series); - } + Boolean flag = getSeriesShapesVisible(series); if (flag != null) { return flag.booleanValue(); } @@ -344,37 +290,6 @@ } /** - * Returns the flag that controls whether the shapes are visible for the - * items in ALL series. - * - * @return The flag (possibly <code>null</code>). - */ - public Boolean getShapesVisible() { - return this.shapesVisible; - } - - /** - * Sets the 'shapes visible' for ALL series and sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param visible the flag (<code>null</code> permitted). - */ - public void setShapesVisible(Boolean visible) { - this.shapesVisible = visible; - notifyListeners(new RendererChangeEvent(this)); - } - - /** - * Sets the 'shapes visible' for ALL series and sends a - * {@link RendererChangeEvent} to all registered listeners. - * - * @param visible the flag. - */ - public void setShapesVisible(boolean visible) { - setShapesVisible(Boolean.valueOf(visible)); - } - - /** * Returns the flag used to control whether or not the shapes for a series * are visible. * @@ -487,7 +402,13 @@ * @return A boolean. */ public boolean getItemShapeFilled(int series, int item) { - return getSeriesShapesFilled(series); + Boolean flag = getSeriesShapesFilled(series); + if (flag != null) { + return flag.booleanValue(); + } + else { + return this.baseShapesFilled; + } } /** @@ -497,96 +418,61 @@ * @param series the series index (zero-based). * * @return A boolean. - */ - public boolean getSeriesShapesFilled(int series) { - - // return the overall setting, if there is one... - if (this.shapesFilled != null) { - return this.shapesFilled.booleanValue(); - } - - // otherwise look up the paint table - Boolean flag = this.seriesShapesFilled.getBoolean(series); - if (flag != null) { - return flag.booleanValue(); - } - else { - return this.baseShapesFilled; - } - - } - - /** - * Returns the flag that controls whether or not shapes are filled for - * ALL series. * - * @return A Boolean. + * @see #setSeriesShapesFilled(int, Boolean) */ - public Boolean getShapesFilled() { - return this.shapesFilled; + public Boolean getSeriesShapesFilled(int series) { + return this.seriesShapesFilled.getBoolean(series); } - - /** - * Sets the 'shapes filled' for ALL series. - * - * @param filled the flag. - */ - public void setShapesFilled(boolean filled) { - if (filled) { - setShapesFilled(Boolean.TRUE); - } - else { - setShapesFilled(Boolean.FALSE); - } - } /** - * Sets the 'shapes filled' for ALL series. - * - * @param filled the flag (<code>null</code> permitted). - */ - public void setShapesFilled(Boolean filled) { - this.shapesFilled = filled; - } - - /** - * Sets the 'shapes filled' flag for a series. + * Sets the 'shapes filled' flag for a series and sends a + * {@link RendererChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * @param filled the flag. + * + * @see #getSeriesShapesFilled(int) */ public void setSeriesShapesFilled(int series, Boolean filled) { this.seriesShapesFilled.setBoolean(series, filled); + notifyListeners(new RendererChangeEvent(this)); } /** - * Sets the 'shapes filled' flag for a series. + * Sets the 'shapes filled' flag for a series and sends a + * {@link RendererChangeEvent} to all registered listeners. * * @param series the series index (zero-based). * @param filled the flag. */ public void setSeriesShapesFilled(int series, boolean filled) { - this.seriesShapesFilled.setBoolean( - series, Boolean.valueOf(filled) - ); + this.seriesShapesFilled.setBoolean(series, Boolean.valueOf(filled)); + notifyListeners(new RendererChangeEvent(this)); } /** * Returns the base 'shape filled' attribute. * * @return The base flag. + * + * @see #setBaseShapesFilled(boolean) */ public boolean getBaseShapesFilled() { return this.baseShapesFilled; } /** - * Sets the base 'shapes filled' flag. + * Sets the base 'shapes filled' flag and sends a + * {@link RendererChangeEvent} to all registered listeners. * * @param flag the flag. + * + * @see #getBaseShapesFilled() */ public void setBaseShapesFilled(boolean flag) { this.baseShapesFilled = flag; + notifyListeners(new RendererChangeEvent(this)); } /** @@ -823,9 +709,6 @@ that.seriesLinesVisible)) { return false; } - if (!ObjectUtilities.equal(this.linesVisible, that.linesVisible)) { - return false; - } if (this.baseShapesVisible != that.baseShapesVisible) { return false; } @@ -833,12 +716,6 @@ that.seriesShapesVisible)) { return false; } - if (!ObjectUtilities.equal(this.shapesVisible, that.shapesVisible)) { - return false; - } - if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) { - return false; - } if (!ObjectUtilities.equal(this.seriesShapesFilled, that.seriesShapesFilled)) { return false; @@ -865,11 +742,11 @@ public Object clone() throws CloneNotSupportedException { LineAndShapeRenderer clone = (LineAndShapeRenderer) super.clone(); clone.seriesLinesVisible - = (BooleanList) this.seriesLinesVisible.clone(); + = (BooleanList) this.seriesLinesVisible.clone(); clone.seriesShapesVisible - = (BooleanList) this.seriesLinesVisible.clone(); + = (BooleanList) this.seriesLinesVisible.clone(); clone.seriesShapesFilled - = (BooleanList) this.seriesShapesFilled.clone(); + = (BooleanList) this.seriesShapesFilled.clone(); return clone; } Modified: trunk/tests/org/jfree/chart/renderer/category/junit/LineAndShapeRendererTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/category/junit/LineAndShapeRendererTests.java 2007-07-02 15:35:51 UTC (rev 96) +++ trunk/tests/org/jfree/chart/renderer/category/junit/LineAndShapeRendererTests.java 2007-07-02 15:39:06 UTC (rev 97) @@ -104,11 +104,6 @@ r2.setSeriesLinesVisible(1, true); assertTrue(r1.equals(r2)); - r1.setLinesVisible(false); - assertFalse(r1.equals(r2)); - r2.setLinesVisible(false); - assertTrue(r1.equals(r2)); - r1.setBaseShapesVisible(!r1.getBaseShapesVisible()); assertFalse(r1.equals(r2)); r2.setBaseShapesVisible(r1.getBaseShapesVisible()); @@ -119,16 +114,6 @@ r2.setSeriesShapesVisible(1, true); assertTrue(r1.equals(r2)); - r1.setShapesVisible(false); - assertFalse(r1.equals(r2)); - r2.setShapesVisible(false); - assertTrue(r1.equals(r2)); - - r1.setShapesFilled(false); - assertFalse(r1.equals(r2)); - r2.setShapesFilled(false); - assertTrue(r1.equals(r2)); - r1.setSeriesShapesFilled(1, true); assertFalse(r1.equals(r2)); r2.setSeriesShapesFilled(1, true); @@ -212,15 +197,6 @@ if (!r1.equals(r2)) { return false; } - - r1.setLinesVisible(false); - if (r1.equals(r2)) { - return false; - } - r2.setLinesVisible(false); - if (!r1.equals(r2)) { - return false; - } r1.setBaseShapesVisible(!r1.getBaseShapesVisible()); if (r1.equals(r2)) { @@ -239,32 +215,7 @@ if (!r1.equals(r2)) { return false; } - - r1.setShapesVisible(false); - if (r1.equals(r2)) { - return false; - } - r2.setShapesVisible(false); - if (!r1.equals(r2)) { - return false; - } - - boolean flag = true; - Boolean existing = r1.getShapesFilled(); - if (existing != null) { - flag = !existing.booleanValue(); - } - r1.setShapesFilled(flag); - if (r1.equals(r2)) { - return false; - } - r2.setShapesFilled(flag); - if (!r1.equals(r2)) { - return false; - } - r1.setShapesFilled(false); - r2.setShapesFilled(false); r1.setSeriesShapesFilled(0, false); r2.setSeriesShapesFilled(0, true); if (r1.equals(r2)) { Modified: trunk/tests/org/jfree/chart/renderer/category/junit/LineRenderer3DTests.java =================================================================== --- trunk/tests/org/jfree/chart/renderer/category/junit/LineRenderer3DTests.java 2007-07-02 15:35:51 UTC (rev 96) +++ trunk/tests/org/jfree/chart/renderer/category/junit/LineRenderer3DTests.java 2007-07-02 15:39:06 UTC (rev 97) @@ -169,15 +169,6 @@ if (!r1.equals(r2)) { return false; } - - r1.setLinesVisible(false); - if (r1.equals(r2)) { - return false; - } - r2.setLinesVisible(false); - if (!r1.equals(r2)) { - return false; - } r1.setBaseShapesVisible(!r1.getBaseShapesVisible()); if (r1.equals(r2)) { @@ -196,28 +187,7 @@ if (!r1.equals(r2)) { return false; } - - r1.setShapesVisible(false); - if (r1.equals(r2)) { - return false; - } - r2.setShapesVisible(false); - if (!r1.equals(r2)) { - return false; - } - boolean flag = true; - Boolean existing = r1.getShapesFilled(); - if (existing != null) { - flag = !existing.booleanValue(); - } - r1.setShapesFilled(flag); - boolean b5 = !r1.equals(r2); - r2.setShapesFilled(flag); - boolean b6 = r1.equals(r2); - - r1.setShapesFilled(false); - r2.setShapesFilled(false); r1.setSeriesShapesFilled(0, false); r2.setSeriesShapesFilled(0, true); boolean b7 = !r1.equals(r2); @@ -230,7 +200,7 @@ r2.setBaseShapesFilled(false); boolean b10 = (r1.equals(r2)); - return b0 && b5 && b6 && b7 && b8 && b9 && b10; + return b0 && b7 && b8 && b9 && b10; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-07-03 10:43:26
|
Revision: 99 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=99&view=rev Author: mungady Date: 2007-07-03 03:43:19 -0700 (Tue, 03 Jul 2007) Log Message: ----------- 2007-07-03 David Gilbert <dav...@ob...> * source/org/jfree/chart/plot/XYPlot.java (drawZeroDomainBaseline): No need to cast to AbstractXYItemRenderer, (setFixedDomainAxisSpace): Fire event, (setFixedRangeAxisSpace): Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/plot/XYPlot.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-02 15:44:24 UTC (rev 98) +++ trunk/ChangeLog 2007-07-03 10:43:19 UTC (rev 99) @@ -1,3 +1,10 @@ +2007-07-03 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/plot/XYPlot.java + (drawZeroDomainBaseline): No need to cast to AbstractXYItemRenderer, + (setFixedDomainAxisSpace): Fire event, + (setFixedRangeAxisSpace): Likewise. + 2007-07-02 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/StandardXYItemRenderer.java Modified: trunk/source/org/jfree/chart/plot/XYPlot.java =================================================================== --- trunk/source/org/jfree/chart/plot/XYPlot.java 2007-07-02 15:44:24 UTC (rev 98) +++ trunk/source/org/jfree/chart/plot/XYPlot.java 2007-07-03 10:43:19 UTC (rev 99) @@ -236,7 +236,6 @@ import org.jfree.chart.event.RendererChangeEvent; import org.jfree.chart.event.RendererChangeListener; import org.jfree.chart.renderer.RendererUtilities; -import org.jfree.chart.renderer.xy.AbstractXYItemRenderer; import org.jfree.chart.renderer.xy.XYItemRenderer; import org.jfree.chart.renderer.xy.XYItemRendererState; import org.jfree.chart.util.Layer; @@ -3269,15 +3268,9 @@ protected void drawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) { if (isDomainZeroBaselineVisible()) { XYItemRenderer r = getRenderer(); - // FIXME: the renderer interface doesn't have the drawDomainLine() - // method, so we have to rely on the renderer being a subclass of - // AbstractXYItemRenderer (which is lame) - if (r instanceof AbstractXYItemRenderer) { - AbstractXYItemRenderer renderer = (AbstractXYItemRenderer) r; - renderer.drawDomainLine(g2, this, getDomainAxis(), area, 0.0, - this.domainZeroBaselinePaint, - this.domainZeroBaselineStroke); - } + r.drawDomainLine(g2, this, getDomainAxis(), area, 0.0, + this.domainZeroBaselinePaint, + this.domainZeroBaselineStroke); } } @@ -4138,7 +4131,8 @@ } /** - * Sets the fixed domain axis space. + * Sets the fixed domain axis space and sends a {@link PlotChangeEvent} to + * all registered listeners. * * @param space the space (<code>null</code> permitted). * @@ -4146,7 +4140,7 @@ */ public void setFixedDomainAxisSpace(AxisSpace space) { this.fixedDomainAxisSpace = space; - // TODO: notify listeners? + notifyListeners(new PlotChangeEvent(this)); } /** @@ -4161,7 +4155,8 @@ } /** - * Sets the fixed range axis space. + * Sets the fixed range axis space and sends a {@link PlotChangeEvent} to + * all registered listeners. * * @param space the space (<code>null</code> permitted). * @@ -4169,7 +4164,7 @@ */ public void setFixedRangeAxisSpace(AxisSpace space) { this.fixedRangeAxisSpace = space; - // TODO: notify listeners? + notifyListeners(new PlotChangeEvent(this)); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ne...@us...> - 2007-07-06 08:48:06
|
Revision: 101 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=101&view=rev Author: nenry Date: 2007-07-06 01:48:01 -0700 (Fri, 06 Jul 2007) Log Message: ----------- Fixed clipping issues (those were apparent with multiple plot). Also fixed a bug in zooming with multiple plots. Modified Paths: -------------- trunk/ChangeLog trunk/swt/org/jfree/experimental/chart/swt/ChartComposite.java trunk/swt/org/jfree/experimental/swt/SWTGraphics2D.java trunk/swt/org/jfree/experimental/swt/SWTUtils.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-04 15:20:01 UTC (rev 100) +++ trunk/ChangeLog 2007-07-06 08:48:01 UTC (rev 101) @@ -1,3 +1,9 @@ +2007-07-06 Henry Proudhon <hen...@in...> + * swt/org/jfree/experimental/swt/SWTGraphics2D.java + (getClip): implemented, + * swt/org/jfree/experimental/chart/swt/ChartComposite.java + (zoom): fixed bug with multiple plots. + 2007-07-04 Henry Proudhon <hen...@in...> * swt/org/jfree/experimental/chart/swt/ChartComposite.java (addChartMouseListener): New method, Modified: trunk/swt/org/jfree/experimental/chart/swt/ChartComposite.java =================================================================== --- trunk/swt/org/jfree/experimental/chart/swt/ChartComposite.java 2007-07-04 15:20:01 UTC (rev 100) +++ trunk/swt/org/jfree/experimental/chart/swt/ChartComposite.java 2007-07-06 08:48:01 UTC (rev 101) @@ -53,6 +53,7 @@ * by Christoph Beck, bug 1726404 (HP); * 04-Jul-2007 : Added addChartMouseListener and removeChartMouseListener methods * as suggested by Christoph Beck, bug 1742002 (HP); + * 06-Jul-2007 : Fixed bug in zooming with multiple plots (HP); */ package org.jfree.experimental.chart.swt; @@ -627,6 +628,7 @@ switch (event.type) { case SWT.MouseDown: Rectangle scaledDataArea = getScreenDataArea(event.x, event.y); + if (scaledDataArea == null) return; zoomPoint = getPointInRectangle(event.x, event.y, scaledDataArea); Rectangle insets = getClientArea(); int x = (int) ((event.x - insets.x) / scaleX); @@ -643,8 +645,7 @@ } ChartEntity entity = null; - if (info != null) - { + if (info != null) { EntityCollection entities = info.getEntityCollection(); if (entities != null) { @@ -700,9 +701,10 @@ movingPoint.x - zoomPoint.x, scaledDataArea.height); } else if (vZoom) { + int ymax = Math.max(movingPoint.y, scaledDataArea.y); zoomRectangle = new Rectangle( scaledDataArea.x, zoomPoint.y, - scaledDataArea.width, event.y - zoomPoint.y); + scaledDataArea.width, ymax - zoomPoint.y); } canvas.redraw(); break; @@ -739,7 +741,9 @@ if ((hZoom && (zoomRectangle.x + zoomRectangle.width < zoomPoint.x)) || (vZoom && (zoomRectangle.y + zoomRectangle.height < zoomPoint.y))) restoreAutoBounds(); - else zoom(zoomRectangle); + else { + zoom(zoomRectangle); + } canvas.redraw(); } } @@ -1059,8 +1063,8 @@ new Point(selection.x, selection.y)); PlotRenderingInfo plotInfo = this.info.getPlotInfo(); Rectangle scaledDataArea = getScreenDataArea( - (int) (selection.x + selection.width)/2, - (int) (selection.y + selection.height)/2); + (int) (selection.x + selection.width/2), + (int) (selection.y + selection.height/2)); if ((selection.height > 0) && (selection.width > 0)) { double hLower = (selection.x - scaledDataArea.x) Modified: trunk/swt/org/jfree/experimental/swt/SWTGraphics2D.java =================================================================== --- trunk/swt/org/jfree/experimental/swt/SWTGraphics2D.java 2007-07-04 15:20:01 UTC (rev 100) +++ trunk/swt/org/jfree/experimental/swt/SWTGraphics2D.java 2007-07-06 08:48:01 UTC (rev 101) @@ -43,6 +43,7 @@ * thanks to silent for pointing this out (HP); * 23-May-2007 : removed resource leaks by adding a resource pool (CC); * 15-Jun-2007 : Fixed compile error for JDK 1.4 (DG); + * 06-Jul-2007 : implemented clipping (HP); * */ @@ -656,15 +657,6 @@ } /* (non-Javadoc) - * @see java.awt.Graphics2D#clip(java.awt.Shape) - */ - public void clip(Shape s) { - Path path = toSwtPath(s); - gc.setClipping(path); - path.dispose(); - } - - /* (non-Javadoc) * @see java.awt.Graphics2D#getFontRenderContext() */ public FontRenderContext getFontRenderContext() { @@ -752,6 +744,15 @@ } /* (non-Javadoc) + * @see java.awt.Graphics2D#clip(java.awt.Shape) + */ + public void clip(Shape s) { + Path path = toSwtPath(s); + gc.setClipping(path); + path.dispose(); + } + + /* (non-Javadoc) * @see java.awt.Graphics#getClipBounds() */ public Rectangle getClipBounds() { @@ -779,8 +780,7 @@ * @see java.awt.Graphics#getClip() */ public Shape getClip() { - // TODO Auto-generated method stub - return null; + return SWTUtils.toAwtRectangle(gc.getClipping()); } /* (non-Javadoc) Modified: trunk/swt/org/jfree/experimental/swt/SWTUtils.java =================================================================== --- trunk/swt/org/jfree/experimental/swt/SWTUtils.java 2007-07-04 15:20:01 UTC (rev 100) +++ trunk/swt/org/jfree/experimental/swt/SWTUtils.java 2007-07-06 08:48:01 UTC (rev 101) @@ -76,12 +76,12 @@ * from the provided awt Font. * <p>Generally speaking, given a font size, the returned swt font * will display differently on the screen than the awt one. - * Because the SWT toolkit use native graphical ressources whenever - * it is possible, this fact is plateform dependent. To address + * Because the SWT toolkit use native graphical resources whenever + * it is possible, this fact is platform dependent. To address * this issue, it is possible to enforce the method to return * a font with the same size (or at least as close as possible) * as the awt one. - * <p>When the object is no more used, the user must explicitely + * <p>When the object is no more used, the user must explicitly * call the dispose method on the returned font to free the * operating system resources (the garbage collector won't do it). * @@ -155,7 +155,7 @@ * <p>Generally speaking, given a font size, an swt font will * display differently on the screen than the corresponding awt * one. Because the SWT toolkit use native graphical ressources whenever - * it is possible, this fact is plateform dependent. To address + * it is possible, this fact is platform dependent. To address * this issue, it is possible to enforce the method to return * an awt font with the same height as the swt one. * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-07-06 14:53:33
|
Revision: 107 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=107&view=rev Author: mungady Date: 2007-07-06 07:53:31 -0700 (Fri, 06 Jul 2007) Log Message: ----------- 2007-07-06 David Gilbert <dav...@ob...> * source/org/jfree/chart/JFreeChart.java (setTitle): Add/remove chart as TitleChangeListener. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/JFreeChart.java trunk/tests/org/jfree/chart/junit/JFreeChartTests.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-06 14:13:40 UTC (rev 106) +++ trunk/ChangeLog 2007-07-06 14:53:31 UTC (rev 107) @@ -1,5 +1,10 @@ 2007-07-06 David Gilbert <dav...@ob...> + * source/org/jfree/chart/JFreeChart.java + (setTitle): Add/remove chart as TitleChangeListener. + +2007-07-06 David Gilbert <dav...@ob...> + * source/org/jfree/chart/entity/AxisLabelEntity.java (AxisLabelEntity): Assign axis argument, (toString): New method override. Modified: trunk/source/org/jfree/chart/JFreeChart.java =================================================================== --- trunk/source/org/jfree/chart/JFreeChart.java 2007-07-06 14:13:40 UTC (rev 106) +++ trunk/source/org/jfree/chart/JFreeChart.java 2007-07-06 14:53:31 UTC (rev 107) @@ -138,7 +138,8 @@ * method (DG); * 05-Jun-2007 : Add change listener to default legend (DG); * 20-Jun-2007 : Removed JCommon dependency (DG); - * 07-Jul-2007 : Changed default background color to white (DG); + * 07-Jul-2007 : Changed default background color to white. Fixed bug + * 1749124 (not registering as listener with TextTitle) (DG); * */ @@ -567,7 +568,13 @@ * @see #getTitle() */ public void setTitle(TextTitle title) { + if (this.title != null) { + this.title.removeChangeListener(this); + } this.title = title; + if (title != null) { + title.addChangeListener(this); + } fireChartChanged(); } Modified: trunk/tests/org/jfree/chart/junit/JFreeChartTests.java =================================================================== --- trunk/tests/org/jfree/chart/junit/JFreeChartTests.java 2007-07-06 14:13:40 UTC (rev 106) +++ trunk/tests/org/jfree/chart/junit/JFreeChartTests.java 2007-07-06 14:53:31 UTC (rev 107) @@ -543,6 +543,40 @@ assertNotNull(this.lastChartChangeEvent); } + /** + * Some checks for title changes and event notification. + */ + public void testTitleChangeEvent() { + DefaultPieDataset dataset = new DefaultPieDataset(); + JFreeChart chart = ChartFactory.createPieChart("title", dataset, true, + false, false); + chart.addChangeListener(this); + this.lastChartChangeEvent = null; + TextTitle t = chart.getTitle(); + t.setFont(new Font("Dialog", Font.BOLD, 9)); + assertNotNull(this.lastChartChangeEvent); + this.lastChartChangeEvent = null; + + // now create a new title and replace the existing title, several + // things should happen: + // (1) Adding the new title should trigger an immediate + // ChartChangeEvent; + // (2) Modifying the new title should trigger a ChartChangeEvent; + // (3) Modifying the old title should NOT trigger a ChartChangeEvent + TextTitle t2 = new TextTitle("T2"); + chart.setTitle(t2); + assertNotNull(this.lastChartChangeEvent); + this.lastChartChangeEvent = null; + + t2.setFont(new Font("Dialog", Font.BOLD, 9)); + assertNotNull(this.lastChartChangeEvent); + this.lastChartChangeEvent = null; + + t.setFont(new Font("Dialog", Font.BOLD, 9)); + assertNull(this.lastChartChangeEvent); + this.lastChartChangeEvent = null; + } + /** The last ChartChangeEvent received. */ private ChartChangeEvent lastChartChangeEvent; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-07-10 09:56:13
|
Revision: 112 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=112&view=rev Author: mungady Date: 2007-07-10 02:56:11 -0700 (Tue, 10 Jul 2007) Log Message: ----------- 2007-07-10 David Gilbert <dav...@ob...> * source/org/jfree/data/statistics/SimpleHistogramDataset.java (SimpleHistogramDataset): Check for null argument. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/data/statistics/SimpleHistogramDataset.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-10 09:53:17 UTC (rev 111) +++ trunk/ChangeLog 2007-07-10 09:56:11 UTC (rev 112) @@ -1,5 +1,10 @@ 2007-07-10 David Gilbert <dav...@ob...> + * source/org/jfree/data/statistics/SimpleHistogramDataset.java + (SimpleHistogramDataset): Check for null argument. + +2007-07-10 David Gilbert <dav...@ob...> + * source/org/jfree/chart/plot/CategoryPlot.java (getRangeAxisIndex): New method. Modified: trunk/source/org/jfree/data/statistics/SimpleHistogramDataset.java =================================================================== --- trunk/source/org/jfree/data/statistics/SimpleHistogramDataset.java 2007-07-10 09:53:17 UTC (rev 111) +++ trunk/source/org/jfree/data/statistics/SimpleHistogramDataset.java 2007-07-10 09:56:11 UTC (rev 112) @@ -39,6 +39,7 @@ * 10-Jan-2005 : Version 1 (DG); * 21-May-2007 : Added clearObservations() and removeAllBins() (SI); * 21-Jun-2007 : Removed JCommon dependencies (DG); + * 10-Jul-2007 : Added null argument check to constructor (DG); * */ @@ -85,9 +86,12 @@ /** * Creates a new histogram dataset. * - * @param key the series key. + * @param key the series key (<code>null</code> not permitted). */ public SimpleHistogramDataset(Comparable key) { + if (key == null) { + throw new IllegalArgumentException("Null 'key' argument."); + } this.key = key; this.bins = new ArrayList(); this.adjustForBinSize = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-07-10 14:53:20
|
Revision: 116 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=116&view=rev Author: mungady Date: 2007-07-10 07:53:19 -0700 (Tue, 10 Jul 2007) Log Message: ----------- 2007-07-10 David Gilbert <dav...@ob...> * source/org/jfree/chart/ChartFactory.java (createPieChart(String, PieDataset, boolean, boolean, Locale)): New method, (createPieChart(String, PieDataset, PieDataset, int, boolean, boolean, boolean, Locale, boolean, boolean)) : Likewise, (createRingChart(String, PieDataset, boolean, boolean, Locale)): Likewise, (createPieChart3D(String, PieDataset, boolean, boolean, Locale)): Likewise, * source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java (StandardPieSectionLabelGenerator(Locale)): New constructor, (StandardPieSectionLabelGenerator(String labelFormat, Locale)): Likewise, * source/org/jfree/chart/labels/StandardPieToolTipGenerator.java (StandardPieToolTipGenerator): Delegate, (StandardPieToolTipGenerator(Locale)): New constructor, (StandardPieToolTipGenerator(String)): Delegate, (StandardPieToolTipGenerator(String labelFormat, Locale)): New constructor. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/ChartFactory.java trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java trunk/source/org/jfree/chart/labels/StandardPieToolTipGenerator.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-10 14:37:03 UTC (rev 115) +++ trunk/ChangeLog 2007-07-10 14:53:19 UTC (rev 116) @@ -1,5 +1,22 @@ 2007-07-10 David Gilbert <dav...@ob...> + * source/org/jfree/chart/ChartFactory.java + (createPieChart(String, PieDataset, boolean, boolean, Locale)): New method, + (createPieChart(String, PieDataset, PieDataset, int, boolean, boolean, + boolean, Locale, boolean, boolean)) : Likewise, + (createRingChart(String, PieDataset, boolean, boolean, Locale)): Likewise, + (createPieChart3D(String, PieDataset, boolean, boolean, Locale)): Likewise, + * source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java + (StandardPieSectionLabelGenerator(Locale)): New constructor, + (StandardPieSectionLabelGenerator(String labelFormat, Locale)): Likewise, + * source/org/jfree/chart/labels/StandardPieToolTipGenerator.java + (StandardPieToolTipGenerator): Delegate, + (StandardPieToolTipGenerator(Locale)): New constructor, + (StandardPieToolTipGenerator(String)): Delegate, + (StandardPieToolTipGenerator(String labelFormat, Locale)): New constructor. + +2007-07-10 David Gilbert <dav...@ob...> + * source/org/jfree/data/statistics/SimpleHistogramDataset.java (SimpleHistogramDataset): Check for null argument. Modified: trunk/source/org/jfree/chart/ChartFactory.java =================================================================== --- trunk/source/org/jfree/chart/ChartFactory.java 2007-07-10 14:37:03 UTC (rev 115) +++ trunk/source/org/jfree/chart/ChartFactory.java 2007-07-10 14:53:19 UTC (rev 116) @@ -119,6 +119,8 @@ * 26-Jun-2007 : Updated some code for method name changes in * the CategoryItemRenderer interface (DG); * 27-Jun-2007 : Updates for method name changes in XYItemRenderer (DG); + * 10-Jul-2007 : Added new methods to create pie charts with locale for + * section label and tool tip formatting (DG); * */ @@ -130,6 +132,7 @@ import java.text.NumberFormat; import java.util.Iterator; import java.util.List; +import java.util.Locale; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.CategoryAxis3D; @@ -230,6 +233,36 @@ * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? + * @param locale the locale (<code>null</code> not permitted). + * + * @return A pie chart. + * + * @since 1.0.7 + */ + public static JFreeChart createPieChart(String title, PieDataset dataset, + boolean legend, boolean tooltips, Locale locale) { + + PiePlot plot = new PiePlot(dataset); + plot.setLabelGenerator(new StandardPieSectionLabelGenerator(locale)); + plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); + if (tooltips) { + plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale)); + } + return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, + legend); + + } + + /** + * Creates a pie chart with default settings. + * <P> + * The chart object returned by this method uses a {@link PiePlot} instance + * as the plot. + * + * @param title the chart title (<code>null</code> permitted). + * @param dataset the dataset for the chart (<code>null</code> permitted). + * @param legend a flag specifying whether or not a legend is required. + * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A pie chart. @@ -244,8 +277,7 @@ plot.setLabelGenerator(new StandardPieSectionLabelGenerator()); plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); if (tooltips) { - plot.setToolTipGenerator(new StandardPieToolTipGenerator( - StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT)); + plot.setToolTipGenerator(new StandardPieToolTipGenerator()); } if (urls) { plot.setURLGenerator(new StandardPieURLGenerator()); @@ -286,6 +318,125 @@ * displayed in green (decrease red) if true. * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? + * @param locale the locale (<code>null</code> not permitted). + * @param subTitle displays a subtitle with colour scheme if true + * @param showDifference create a new dataset that will show the % + * difference between the two datasets. + * + * @return A pie chart. + * + * @since 1.0.7 + */ + public static JFreeChart createPieChart(String title, PieDataset dataset, + PieDataset previousDataset, int percentDiffForMaxScale, + boolean greenForIncrease, boolean legend, boolean tooltips, + Locale locale, boolean subTitle, boolean showDifference) { + + PiePlot plot = new PiePlot(dataset); + plot.setLabelGenerator(new StandardPieSectionLabelGenerator(locale)); + plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); + + if (tooltips) { + plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale)); + } + + List keys = dataset.getKeys(); + DefaultPieDataset series = null; + if (showDifference) { + series = new DefaultPieDataset(); + } + + double colorPerPercent = 255.0 / percentDiffForMaxScale; + for (Iterator it = keys.iterator(); it.hasNext();) { + Comparable key = (Comparable) it.next(); + Number newValue = dataset.getValue(key); + Number oldValue = previousDataset.getValue(key); + + if (oldValue == null) { + if (greenForIncrease) { + plot.setSectionPaint(key, Color.green); + } + else { + plot.setSectionPaint(key, Color.red); + } + if (showDifference) { + series.setValue(key + " (+100%)", newValue); + } + } + else { + double percentChange = (newValue.doubleValue() + / oldValue.doubleValue() - 1.0) * 100.0; + double shade + = (Math.abs(percentChange) >= percentDiffForMaxScale ? 255 + : Math.abs(percentChange) * colorPerPercent); + if (greenForIncrease + && newValue.doubleValue() > oldValue.doubleValue() + || !greenForIncrease && newValue.doubleValue() + < oldValue.doubleValue()) { + plot.setSectionPaint(key, new Color(0, (int) shade, 0)); + } + else { + plot.setSectionPaint(key, new Color((int) shade, 0, 0)); + } + if (showDifference) { + series.setValue(key + " (" + (percentChange >= 0 ? "+" : "") + + NumberFormat.getPercentInstance().format( + percentChange / 100.0) + ")", newValue); + } + } + } + + if (showDifference) { + plot.setDataset(series); + } + + JFreeChart chart = new JFreeChart(title, + JFreeChart.DEFAULT_TITLE_FONT, plot, legend); + + if (subTitle) { + TextTitle subtitle = null; + subtitle = new TextTitle("Bright " + (greenForIncrease ? "red" + : "green") + "=change >=-" + percentDiffForMaxScale + + "%, Bright " + (!greenForIncrease ? "red" : "green") + + "=change >=+" + percentDiffForMaxScale + "%", + new Font("SansSerif", Font.PLAIN, 10)); + chart.addSubtitle(subtitle); + } + + return chart; + } + + /** + * Creates a pie chart with default settings that compares 2 datasets. + * The colour of each section will be determined by the move from the value + * for the same key in <code>previousDataset</code>. ie if value1 > value2 + * then the section will be in green (unless <code>greenForIncrease</code> + * is <code>false</code>, in which case it would be <code>red</code>). + * Each section can have a shade of red or green as the difference can be + * tailored between 0% (black) and percentDiffForMaxScale% (bright + * red/green). + * <p> + * For instance if <code>percentDiffForMaxScale</code> is 10 (10%), a + * difference of 5% will have a half shade of red/green, a difference of + * 10% or more will have a maximum shade/brightness of red/green. + * <P> + * The chart object returned by this method uses a {@link PiePlot} instance + * as the plot. + * <p> + * Written by <a href="mailto:ope...@ob...">Benoit + * Xhenseval</a>. + * + * @param title the chart title (<code>null</code> permitted). + * @param dataset the dataset for the chart (<code>null</code> permitted). + * @param previousDataset the dataset for the last run, this will be used + * to compare each key in the dataset + * @param percentDiffForMaxScale scale goes from bright red/green to black, + * percentDiffForMaxScale indicate the change + * required to reach top scale. + * @param greenForIncrease an increase since previousDataset will be + * displayed in green (decrease red) if true. + * @param legend a flag specifying whether or not a legend is required. + * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * @param subTitle displays a subtitle with colour scheme if true * @param showDifference create a new dataset that will show the % @@ -309,8 +460,7 @@ plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); if (tooltips) { - plot.setToolTipGenerator(new StandardPieToolTipGenerator( - StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT)); + plot.setToolTipGenerator(new StandardPieToolTipGenerator()); } if (urls) { plot.setURLGenerator(new StandardPieURLGenerator()); @@ -366,9 +516,8 @@ plot.setDataset(series); } - JFreeChart chart = new JFreeChart( - title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend - ); + JFreeChart chart = new JFreeChart(title, + JFreeChart.DEFAULT_TITLE_FONT, plot, legend); if (subTitle) { TextTitle subtitle = null; @@ -393,9 +542,39 @@ * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? + * @param locale the locale (<code>null</code> not permitted). + * + * @return A ring chart. + * + * @since 1.0.7 + */ + public static JFreeChart createRingChart(String title, PieDataset dataset, + boolean legend, boolean tooltips, Locale locale) { + + RingPlot plot = new RingPlot(dataset); + plot.setLabelGenerator(new StandardPieSectionLabelGenerator(locale)); + plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); + if (tooltips) { + plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale)); + } + return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, + legend); + + } + + /** + * Creates a ring chart with default settings. + * <P> + * The chart object returned by this method uses a {@link RingPlot} + * instance as the plot. + * + * @param title the chart title (<code>null</code> permitted). + * @param dataset the dataset for the chart (<code>null</code> permitted). + * @param legend a flag specifying whether or not a legend is required. + * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * - * @return A pie chart. + * @return A ring chart. */ public static JFreeChart createRingChart(String title, PieDataset dataset, @@ -407,8 +586,7 @@ plot.setLabelGenerator(new StandardPieSectionLabelGenerator()); plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); if (tooltips) { - plot.setToolTipGenerator(new StandardPieToolTipGenerator( - StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT)); + plot.setToolTipGenerator(new StandardPieToolTipGenerator()); } if (urls) { plot.setURLGenerator(new StandardPieURLGenerator()); @@ -477,6 +655,34 @@ * @param dataset the dataset for the chart (<code>null</code> permitted). * @param legend a flag specifying whether or not a legend is required. * @param tooltips configure chart to generate tool tips? + * @param locale the locale (<code>null</code> not permitted). + * + * @return A pie chart. + * + * @since 1.0.7 + */ + public static JFreeChart createPieChart3D(String title, PieDataset dataset, + boolean legend, boolean tooltips, Locale locale) { + + PiePlot3D plot = new PiePlot3D(dataset); + plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0)); + if (tooltips) { + plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale)); + } + return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, + legend); + + } + + /** + * Creates a 3D pie chart using the specified dataset. The chart object + * returned by this method uses a {@link PiePlot3D} instance as the + * plot. + * + * @param title the chart title (<code>null</code> permitted). + * @param dataset the dataset for the chart (<code>null</code> permitted). + * @param legend a flag specifying whether or not a legend is required. + * @param tooltips configure chart to generate tool tips? * @param urls configure chart to generate URLs? * * @return A pie chart. Modified: trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java =================================================================== --- trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java 2007-07-10 14:37:03 UTC (rev 115) +++ trunk/source/org/jfree/chart/labels/StandardPieSectionLabelGenerator.java 2007-07-10 14:53:19 UTC (rev 116) @@ -42,6 +42,7 @@ * 03-May-2006 : Modified DEFAULT_SECTION_LABEL_FORMAT (DG); * 10-Jan-2007 : Include attributedLabels in equals() test (DG); * 21-Jun-2007 : Removed JCommon dependencies (DG); + * 10-Jul-2007 : Added constructors with locale parameter (DG); * */ @@ -53,6 +54,7 @@ import java.io.Serializable; import java.text.AttributedString; import java.text.NumberFormat; +import java.util.Locale; import org.jfree.chart.util.ObjectList; import org.jfree.data.general.PieDataset; @@ -67,8 +69,8 @@ * <code>apple = 120 (5%)</code>. */ public class StandardPieSectionLabelGenerator - extends AbstractPieItemLabelGenerator - implements PieSectionLabelGenerator, Cloneable, Serializable { + extends AbstractPieItemLabelGenerator + implements PieSectionLabelGenerator, Cloneable, Serializable { /** For serialization. */ private static final long serialVersionUID = 3064190563760203668L; @@ -92,6 +94,17 @@ } /** + * Creates a new instance for the specified locale. + * + * @param locale the local (<code>null</code> not permitted). + * + * @since 1.0.7 + */ + public StandardPieSectionLabelGenerator(Locale locale) { + this(DEFAULT_SECTION_LABEL_FORMAT, locale); + } + + /** * Creates a new section label generator using the specified label format * string, and platform default number and percentage formatters. * @@ -103,6 +116,19 @@ } /** + * Creates a new instance for the specified locale. + * + * @param labelFormat the label format (<code>null</code> not permitted). + * @param locale the local (<code>null</code> not permitted). + * + * @since 1.0.7 + */ + public StandardPieSectionLabelGenerator(String labelFormat, Locale locale) { + this(labelFormat, NumberFormat.getNumberInstance(locale), + NumberFormat.getPercentInstance(locale)); + } + + /** * Creates an item label generator using the specified number formatters. * * @param labelFormat the label format string (<code>null</code> not @@ -113,12 +139,9 @@ * (<code>null</code> not permitted). */ public StandardPieSectionLabelGenerator(String labelFormat, - NumberFormat numberFormat, - NumberFormat percentFormat) { - + NumberFormat numberFormat, NumberFormat percentFormat) { super(labelFormat, numberFormat, percentFormat); this.attributedLabels = new ObjectList(); - } /** Modified: trunk/source/org/jfree/chart/labels/StandardPieToolTipGenerator.java =================================================================== --- trunk/source/org/jfree/chart/labels/StandardPieToolTipGenerator.java 2007-07-10 14:37:03 UTC (rev 115) +++ trunk/source/org/jfree/chart/labels/StandardPieToolTipGenerator.java 2007-07-10 14:53:19 UTC (rev 116) @@ -54,6 +54,7 @@ * 29-Jul-2005 : Removed implementation of PieSectionLabelGenerator * interface (DG); * 21-Jun-2007 : Removed JCommon dependencies (DG); + * 10-Jul-2007 : Added constructors with locale argument (DG); * */ @@ -61,6 +62,7 @@ import java.io.Serializable; import java.text.NumberFormat; +import java.util.Locale; import org.jfree.chart.util.PublicCloneable; import org.jfree.data.general.PieDataset; @@ -86,28 +88,48 @@ /** The default tooltip format. */ public static final String DEFAULT_TOOLTIP_FORMAT = "{0}: ({1}, {2})"; - /** The default section label format. */ - public static final String DEFAULT_SECTION_LABEL_FORMAT = "{0} = {1}"; - /** * Creates an item label generator using default number formatters. */ public StandardPieToolTipGenerator() { - this(DEFAULT_SECTION_LABEL_FORMAT, NumberFormat.getNumberInstance(), - NumberFormat.getPercentInstance()); + this(DEFAULT_TOOLTIP_FORMAT); } /** - * Creates an item label generator. + * Creates a pie tool tip generator for the specified locale, using the + * default format string. * - * @param labelFormat the label format. + * @param locale the locale (<code>null</code> not permitted). + * + * @since 1.0.7 */ + public StandardPieToolTipGenerator(Locale locale) { + this(DEFAULT_TOOLTIP_FORMAT, locale); + } + + /** + * Creates a pie tool tip generator for the default locale. + * + * @param labelFormat the label format (<code>null</code> not permitted). + */ public StandardPieToolTipGenerator(String labelFormat) { - this(labelFormat, NumberFormat.getNumberInstance(), - NumberFormat.getPercentInstance()); + this(labelFormat, Locale.getDefault()); } /** + * Creates a pie tool tip generator for the specified locale. + * + * @param labelFormat the label format (<code>null</code> not permitted). + * @param locale the locale (<code>null</code> not permitted). + * + * @since 1.0.7 + */ + public StandardPieToolTipGenerator(String labelFormat, Locale locale) { + this(labelFormat, NumberFormat.getNumberInstance(locale), + NumberFormat.getPercentInstance(locale)); + } + + /** * Creates an item label generator using the specified number formatters. * * @param labelFormat the label format string (<code>null</code> not This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mu...@us...> - 2007-07-11 15:20:22
|
Revision: 122 http://jfreechart.svn.sourceforge.net/jfreechart/?rev=122&view=rev Author: mungady Date: 2007-07-11 08:20:12 -0700 (Wed, 11 Jul 2007) Log Message: ----------- 2007-07-11 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/category/StatisticalBarRenderer.java (errorIndicatorStroke): Marked transient, (writeObject): Handle errorIndicatorStroke, (readObject): Likewise. Modified Paths: -------------- trunk/ChangeLog trunk/source/org/jfree/chart/renderer/category/StatisticalBarRenderer.java Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-07-11 15:18:26 UTC (rev 121) +++ trunk/ChangeLog 2007-07-11 15:20:12 UTC (rev 122) @@ -1,3 +1,10 @@ +2007-07-11 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/renderer/category/StatisticalBarRenderer.java + (errorIndicatorStroke): Marked transient, + (writeObject): Handle errorIndicatorStroke, + (readObject): Likewise. + 2007-07-10 David Gilbert <dav...@ob...> * source/org/jfree/chart/ChartFactory.java Modified: trunk/source/org/jfree/chart/renderer/category/StatisticalBarRenderer.java =================================================================== --- trunk/source/org/jfree/chart/renderer/category/StatisticalBarRenderer.java 2007-07-11 15:18:26 UTC (rev 121) +++ trunk/source/org/jfree/chart/renderer/category/StatisticalBarRenderer.java 2007-07-11 15:20:12 UTC (rev 122) @@ -53,6 +53,7 @@ * 02-Feb-2007 : Removed author tags all over JFreeChart sources (DG); * 20-Jun-2007 : Removed JCommon dependencies (DG); * 06-Jul-2007 : Added errorIndicatorStroke attribute (DG); + * 11-Jul-2007 : Fixed serialization for new errorIndicatorStroke field (DG); * */ @@ -104,7 +105,7 @@ * * @since 1.2.0 */ - private Stroke errorIndicatorStroke; + private transient Stroke errorIndicatorStroke; /** * Default constructor. @@ -532,6 +533,7 @@ private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); SerialUtilities.writePaint(this.errorIndicatorPaint, stream); + SerialUtilities.writeStroke(this.errorIndicatorStroke, stream); } /** @@ -546,6 +548,7 @@ throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.errorIndicatorPaint = SerialUtilities.readPaint(stream); + this.errorIndicatorStroke = SerialUtilities.readStroke(stream); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |