You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(165) |
Nov
(296) |
Dec
(92) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(84) |
Feb
(20) |
Mar
(20) |
Apr
(42) |
May
(26) |
Jun
(30) |
Jul
(77) |
Aug
(151) |
Sep
(61) |
Oct
(259) |
Nov
(160) |
Dec
(76) |
2007 |
Jan
(159) |
Feb
(155) |
Mar
(183) |
Apr
(113) |
May
(110) |
Jun
(178) |
Jul
(56) |
Aug
(21) |
Sep
(50) |
Oct
(251) |
Nov
(218) |
Dec
(42) |
2008 |
Jan
(14) |
Feb
(37) |
Mar
(60) |
Apr
(77) |
May
(146) |
Jun
(256) |
Jul
(72) |
Aug
(51) |
Sep
(283) |
Oct
(22) |
Nov
(55) |
Dec
(53) |
2009 |
Jan
(56) |
Feb
(45) |
Mar
(56) |
Apr
(98) |
May
(84) |
Jun
(87) |
Jul
(32) |
Aug
(6) |
Sep
(19) |
Oct
|
Nov
(10) |
Dec
(6) |
2010 |
Jan
(2) |
Feb
(6) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(158) |
Nov
(17) |
Dec
(15) |
2012 |
Jan
(9) |
Feb
(3) |
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(22) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(259) |
Aug
(125) |
Sep
(24) |
Oct
(8) |
Nov
(132) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(26) |
Mar
(17) |
Apr
(8) |
May
|
Jun
(31) |
Jul
(126) |
Aug
(22) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(21) |
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
(19) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: David G. <mu...@us...> - 2005-11-01 11:30:36
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2851 Modified Files: Tag: STABLE_1-0-0 ChangeLog Log Message: 01-11-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/HighLowRenderer.java (openTickPaint): new field, (closeTickPaint): new field, (getOpenTickPaint): new method, (setOpenTickPaint): new method, (getCloseTickPaint): new method, (setCloseTickPaint): new method, (drawItem): use openTickPaint and closeTickPaint if non-null, (equals): implemented, (readObject): new method to support serialization, (writeObject): new method to support serialization, * source/org/jfree/chart/renderer/xy/junit/HighLowRendererTests.java (testEquals): add checks for all fields, (testCloning): updated for new fields, (testSerialization): updated for new fields. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.1.2.15 retrieving revision 1.1.2.16 diff -C2 -d -r1.1.2.15 -r1.1.2.16 *** ChangeLog 1 Nov 2005 09:38:49 -0000 1.1.2.15 --- ChangeLog 1 Nov 2005 11:30:11 -0000 1.1.2.16 *************** *** 1,4 **** --- 1,22 ---- 01-11-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/xy/HighLowRenderer.java + (openTickPaint): new field, + (closeTickPaint): new field, + (getOpenTickPaint): new method, + (setOpenTickPaint): new method, + (getCloseTickPaint): new method, + (setCloseTickPaint): new method, + (drawItem): use openTickPaint and closeTickPaint if non-null, + (equals): implemented, + (readObject): new method to support serialization, + (writeObject): new method to support serialization, + * source/org/jfree/chart/renderer/xy/junit/HighLowRendererTests.java + (testEquals): add checks for all fields, + (testCloning): updated for new fields, + (testSerialization): updated for new fields. + + 01-11-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/renderer/xy/HighLow.java: Removed unused class. |
From: David G. <mu...@us...> - 2005-11-01 11:30:36
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/renderer/xy/junit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2851/source/org/jfree/chart/renderer/xy/junit Modified Files: Tag: STABLE_1-0-0 HighLowRendererTests.java Log Message: 01-11-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/HighLowRenderer.java (openTickPaint): new field, (closeTickPaint): new field, (getOpenTickPaint): new method, (setOpenTickPaint): new method, (getCloseTickPaint): new method, (setCloseTickPaint): new method, (drawItem): use openTickPaint and closeTickPaint if non-null, (equals): implemented, (readObject): new method to support serialization, (writeObject): new method to support serialization, * source/org/jfree/chart/renderer/xy/junit/HighLowRendererTests.java (testEquals): add checks for all fields, (testCloning): updated for new fields, (testSerialization): updated for new fields. Index: HighLowRendererTests.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/renderer/xy/junit/HighLowRendererTests.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** HighLowRendererTests.java 25 Oct 2005 20:56:44 -0000 1.3.2.1 --- HighLowRendererTests.java 1 Nov 2005 11:30:11 -0000 1.3.2.2 *************** *** 39,42 **** --- 39,43 ---- * 25-Mar-2003 : Version 1 (DG); * 22-Oct-2003 : Added hashCode test (DG); + * 01-Nov-2005 : Added tests for new fields (DG); * */ *************** *** 44,47 **** --- 45,49 ---- package org.jfree.chart.renderer.xy.junit; + import java.awt.Color; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; *************** *** 87,90 **** --- 89,116 ---- HighLowRenderer r2 = new HighLowRenderer(); assertEquals(r1, r2); + + // drawOpenTicks + r1.setDrawOpenTicks(false); + assertFalse(r1.equals(r2)); + r2.setDrawOpenTicks(false); + assertTrue(r1.equals(r2)); + + // drawCloseTicks + r1.setDrawCloseTicks(false); + assertFalse(r1.equals(r2)); + r2.setDrawCloseTicks(false); + assertTrue(r1.equals(r2)); + + // openTickPaint + r1.setOpenTickPaint(Color.red); + assertFalse(r1.equals(r2)); + r2.setOpenTickPaint(Color.red); + assertTrue(r1.equals(r2)); + + // closeTickPaint + r1.setCloseTickPaint(Color.blue); + assertFalse(r1.equals(r2)); + r2.setCloseTickPaint(Color.blue); + assertTrue(r1.equals(r2)); } *************** *** 106,109 **** --- 132,136 ---- public void testCloning() { HighLowRenderer r1 = new HighLowRenderer(); + r1.setCloseTickPaint(Color.green); HighLowRenderer r2 = null; try { *************** *** 111,115 **** } catch (CloneNotSupportedException e) { ! System.err.println("Failed to clone."); } assertTrue(r1 != r2); --- 138,142 ---- } catch (CloneNotSupportedException e) { ! e.printStackTrace(); } assertTrue(r1 != r2); *************** *** 124,127 **** --- 151,155 ---- HighLowRenderer r1 = new HighLowRenderer(); + r1.setCloseTickPaint(Color.green); HighLowRenderer r2 = null; *************** *** 139,143 **** } catch (Exception e) { ! System.out.println(e.toString()); } assertEquals(r1, r2); --- 167,171 ---- } catch (Exception e) { ! e.printStackTrace(); } assertEquals(r1, r2); |
From: David G. <mu...@us...> - 2005-11-01 11:30:36
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/renderer/xy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2851/source/org/jfree/chart/renderer/xy Modified Files: Tag: STABLE_1-0-0 HighLowRenderer.java Log Message: 01-11-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/HighLowRenderer.java (openTickPaint): new field, (closeTickPaint): new field, (getOpenTickPaint): new method, (setOpenTickPaint): new method, (getCloseTickPaint): new method, (setCloseTickPaint): new method, (drawItem): use openTickPaint and closeTickPaint if non-null, (equals): implemented, (readObject): new method to support serialization, (writeObject): new method to support serialization, * source/org/jfree/chart/renderer/xy/junit/HighLowRendererTests.java (testEquals): add checks for all fields, (testCloning): updated for new fields, (testSerialization): updated for new fields. Index: HighLowRenderer.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/renderer/xy/HighLowRenderer.java,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** HighLowRenderer.java 25 Oct 2005 20:56:21 -0000 1.5.2.1 --- HighLowRenderer.java 1 Nov 2005 11:30:11 -0000 1.5.2.2 *************** *** 28,32 **** * HighLowRenderer.java * -------------------- ! * (C) Copyright 2001-2004, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); --- 28,32 ---- * HighLowRenderer.java * -------------------- ! * (C) Copyright 2001-2005, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); *************** *** 60,63 **** --- 60,64 ---- * 15-Jul-2004 : Switched getX() with getXValue() and getY() with * getYValue() (DG); + * 01-Nov-2005 : Added optional openTickPaint and closeTickPaint settings (DG); * */ *************** *** 71,74 **** --- 72,78 ---- import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; + import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; import java.io.Serializable; *************** *** 84,88 **** --- 88,94 ---- import org.jfree.data.xy.OHLCDataset; import org.jfree.data.xy.XYDataset; + import org.jfree.io.SerialUtilities; import org.jfree.ui.RectangleEdge; + import org.jfree.util.PaintUtilities; import org.jfree.util.PublicCloneable; *************** *** 106,109 **** --- 112,127 ---- /** A flag that controls whether the close ticks are drawn. */ private boolean drawCloseTicks; + + /** + * The paint used for the open ticks (if <code>null</code>, the series + * paint is used instead). + */ + private transient Paint openTickPaint; + + /** + * The paint used for the close ticks (if <code>null</code>, the series + * paint is used instead). + */ + private transient Paint closeTickPaint; /** *************** *** 157,160 **** --- 175,224 ---- /** + * Returns the paint used to draw the ticks for the open values. + * + * @return The paint used to draw the ticks for the open values (possibly + * <code>null</code>). + */ + public Paint getOpenTickPaint() { + return this.openTickPaint; + } + + /** + * Sets the paint used to draw the ticks for the open values and sends a + * {@link RendererChangeEvent} to all registered listeners. If you set + * this to <code>null</code> (the default), the series paint is used + * instead. + * + * @param paint the paint (<code>null</code> permitted). + */ + public void setOpenTickPaint(Paint paint) { + this.openTickPaint = paint; + notifyListeners(new RendererChangeEvent(this)); + } + + /** + * Returns the paint used to draw the ticks for the close values. + * + * @return The paint used to draw the ticks for the close values (possibly + * <code>null</code>). + */ + public Paint getCloseTickPaint() { + return this.closeTickPaint; + } + + /** + * Sets the paint used to draw the ticks for the close values and sends a + * {@link RendererChangeEvent} to all registered listeners. If you set + * this to <code>null</code> (the default), the series paint is used + * instead. + * + * @param paint the paint (<code>null</code> permitted). + */ + public void setCloseTickPaint(Paint paint) { + this.closeTickPaint = paint; + notifyListeners(new RendererChangeEvent(this)); + } + + /** * Draws the visual representation of a single data item. * *************** *** 196,202 **** return; // the x value is not within the axis range } ! double xx = domainAxis.valueToJava2D( ! xdouble, dataArea, plot.getDomainAxisEdge() ! ); // setup for collecting optional entity info... --- 260,265 ---- return; // the x value is not within the axis range } ! double xx = domainAxis.valueToJava2D(xdouble, dataArea, ! plot.getDomainAxisEdge()); // setup for collecting optional entity info... *************** *** 210,217 **** RectangleEdge location = plot.getRangeAxisEdge(); ! Paint p = getItemPaint(series, item); ! Stroke s = getItemStroke(series, item); ! g2.setPaint(p); ! g2.setStroke(s); if (dataset instanceof OHLCDataset) { --- 273,280 ---- RectangleEdge location = plot.getRangeAxisEdge(); ! Paint itemPaint = getItemPaint(series, item); ! Stroke itemStroke = getItemStroke(series, item); ! g2.setPaint(itemPaint); ! g2.setStroke(itemStroke); if (dataset instanceof OHLCDataset) { *************** *** 221,241 **** double yLow = hld.getLowValue(series, item); if (!Double.isNaN(yHigh) && !Double.isNaN(yLow)) { ! double yyHigh ! = rangeAxis.valueToJava2D(yHigh, dataArea, location); ! double yyLow ! = rangeAxis.valueToJava2D(yLow, dataArea, location); if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yyLow, xx, yyHigh, xx)); ! entityArea = new Rectangle2D.Double( ! Math.min(yyLow, yyHigh), xx - 1.0, ! Math.abs(yyHigh - yyLow), 2.0 ! ); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx, yyLow, xx, yyHigh)); ! entityArea = new Rectangle2D.Double( ! xx - 1.0, Math.min(yyLow, yyHigh), 2.0, ! Math.abs(yyHigh - yyLow) ! ); } } --- 284,301 ---- double yLow = hld.getLowValue(series, item); if (!Double.isNaN(yHigh) && !Double.isNaN(yLow)) { ! double yyHigh = rangeAxis.valueToJava2D(yHigh, dataArea, ! location); ! double yyLow = rangeAxis.valueToJava2D(yLow, dataArea, ! location); if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yyLow, xx, yyHigh, xx)); ! entityArea = new Rectangle2D.Double(Math.min(yyLow, yyHigh), ! xx - 1.0, Math.abs(yyHigh - yyLow), 2.0); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx, yyLow, xx, yyHigh)); ! entityArea = new Rectangle2D.Double(xx - 1.0, ! Math.min(yyLow, yyHigh), 2.0, ! Math.abs(yyHigh - yyLow)); } } *************** *** 246,263 **** } if (getDrawOpenTicks()) { ! double yOpen = hld.getOpenValue(series, item); if (!Double.isNaN(yOpen)) { ! double yyOpen = rangeAxis.valueToJava2D( ! yOpen, dataArea, location ! ); if (orientation == PlotOrientation.HORIZONTAL) { ! g2.draw( ! new Line2D.Double(yyOpen, xx + delta, yyOpen, xx) ! ); } else if (orientation == PlotOrientation.VERTICAL) { ! g2.draw( ! new Line2D.Double(xx - delta, yyOpen, xx, yyOpen) ! ); } } --- 306,326 ---- } if (getDrawOpenTicks()) { ! double yOpen = hld.getOpenValue(series, item); if (!Double.isNaN(yOpen)) { ! double yyOpen = rangeAxis.valueToJava2D(yOpen, dataArea, ! location); ! if (this.openTickPaint != null) { ! g2.setPaint(this.openTickPaint); ! } ! else { ! g2.setPaint(itemPaint); ! } if (orientation == PlotOrientation.HORIZONTAL) { ! g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, ! xx)); } else if (orientation == PlotOrientation.VERTICAL) { ! g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, ! yyOpen)); } } *************** *** 268,282 **** if (!Double.isNaN(yClose)) { double yyClose = rangeAxis.valueToJava2D( ! yClose, dataArea, location ! ); if (orientation == PlotOrientation.HORIZONTAL) { ! g2.draw( ! new Line2D.Double(yyClose, xx, yyClose, xx - delta) ! ); } else if (orientation == PlotOrientation.VERTICAL) { ! g2.draw( ! new Line2D.Double(xx, yyClose, xx + delta, yyClose) ! ); } } --- 331,348 ---- if (!Double.isNaN(yClose)) { double yyClose = rangeAxis.valueToJava2D( ! yClose, dataArea, location); ! if (this.closeTickPaint != null) { ! g2.setPaint(this.closeTickPaint); ! } ! else { ! g2.setPaint(itemPaint); ! } if (orientation == PlotOrientation.HORIZONTAL) { ! g2.draw(new Line2D.Double(yyClose, xx, yyClose, ! xx - delta)); } else if (orientation == PlotOrientation.VERTICAL) { ! g2.draw(new Line2D.Double(xx, yyClose, xx + delta, ! yyClose)); } } *************** *** 294,306 **** return; } ! double xx0 = domainAxis.valueToJava2D( ! x0.doubleValue(), dataArea, plot.getDomainAxisEdge() ! ); ! double yy0 = rangeAxis.valueToJava2D( ! y0.doubleValue(), dataArea, location ! ); ! double yy = rangeAxis.valueToJava2D( ! y.doubleValue(), dataArea, location ! ); if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yy0, xx0, yy, xx)); --- 360,369 ---- return; } ! double xx0 = domainAxis.valueToJava2D(x0.doubleValue(), ! dataArea, plot.getDomainAxisEdge()); ! double yy0 = rangeAxis.valueToJava2D(y0.doubleValue(), ! dataArea, location); ! double yy = rangeAxis.valueToJava2D(y.doubleValue(), dataArea, ! location); if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yy0, xx0, yy, xx)); *************** *** 323,329 **** url = getURLGenerator().generateURL(dataset, series, item); } ! XYItemEntity entity = new XYItemEntity( ! entityArea, dataset, series, item, tip, url ! ); entities.add(entity); } --- 386,391 ---- url = getURLGenerator().generateURL(dataset, series, item); } ! XYItemEntity entity = new XYItemEntity(entityArea, dataset, ! series, item, tip, url); entities.add(entity); } *************** *** 341,344 **** --- 403,467 ---- return super.clone(); } + + /** + * Tests this renderer for equality with an arbitrary object. + * + * @param obj the object (<code>null</code> permitted). + * + * @return A boolean. + */ + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof HighLowRenderer)) { + return false; + } + HighLowRenderer that = (HighLowRenderer) obj; + if (this.drawOpenTicks != that.drawOpenTicks) { + return false; + } + if (this.drawCloseTicks != that.drawCloseTicks) { + return false; + } + if (!PaintUtilities.equal(this.openTickPaint, that.openTickPaint)) { + return false; + } + if (!PaintUtilities.equal(this.closeTickPaint, that.closeTickPaint)) { + return false; + } + if (!super.equals(obj)) { + return false; + } + return true; + } + + /** + * Provides serialization support. + * + * @param stream the input stream. + * + * @throws IOException if there is an I/O error. + * @throws ClassNotFoundException if there is a classpath problem. + */ + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException { + stream.defaultReadObject(); + this.openTickPaint = SerialUtilities.readPaint(stream); + this.closeTickPaint = SerialUtilities.readPaint(stream); + } + + /** + * Provides serialization support. + * + * @param stream the output stream. + * + * @throws IOException if there is an I/O error. + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + SerialUtilities.writePaint(this.openTickPaint, stream); + SerialUtilities.writePaint(this.closeTickPaint, stream); + } } \ No newline at end of file |
From: David G. <mu...@us...> - 2005-11-01 09:44:56
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/renderer/xy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13042/source/org/jfree/chart/renderer/xy Removed Files: HighLow.java Log Message: 01-11-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/HighLow.java: Removed unused class. --- HighLow.java DELETED --- |
From: David G. <mu...@us...> - 2005-11-01 09:44:56
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13042 Modified Files: ChangeLog Log Message: 01-11-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/HighLow.java: Removed unused class. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ChangeLog 28 Oct 2005 14:10:31 -0000 1.36 --- ChangeLog 1 Nov 2005 09:44:44 -0000 1.37 *************** *** 1,2 **** --- 1,7 ---- + 01-11-2005 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/renderer/xy/HighLow.java: Removed unused + class. + 28-10-2005 David Gilbert <dav...@ob...> |
From: David G. <mu...@us...> - 2005-11-01 09:38:57
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12161 Modified Files: Tag: STABLE_1-0-0 ChangeLog Log Message: 01-11-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/HighLow.java: Removed unused class. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -C2 -d -r1.1.2.14 -r1.1.2.15 *** ChangeLog 27 Oct 2005 12:46:43 -0000 1.1.2.14 --- ChangeLog 1 Nov 2005 09:38:49 -0000 1.1.2.15 *************** *** 1,2 **** --- 1,7 ---- + 01-11-2005 David Gilbert <dav...@ob...> + + * source/org/jfree/chart/renderer/xy/HighLow.java: Removed unused + class. + 27-10-2005 David Gilbert <dav...@ob...> |
From: David G. <mu...@us...> - 2005-11-01 09:38:57
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/renderer/xy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12161/source/org/jfree/chart/renderer/xy Removed Files: Tag: STABLE_1-0-0 HighLow.java Log Message: 01-11-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/renderer/xy/HighLow.java: Removed unused class. --- HighLow.java DELETED --- |
From: David G. <mu...@us...> - 2005-10-28 14:10:39
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23942 Modified Files: ChangeLog Log Message: Fixed Changelog entry. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ChangeLog 28 Oct 2005 14:07:34 -0000 1.35 --- ChangeLog 28 Oct 2005 14:10:31 -0000 1.36 *************** *** 13,17 **** (setSuperscriptOffset): new method, (getSubscriptOffset): new method, ! (setSubscriptOffset): new method. 28-10-2005 David Gilbert <dav...@ob...> --- 13,18 ---- (setSuperscriptOffset): new method, (getSubscriptOffset): new method, ! (setSubscriptOffset): new method, ! (createTextLine): replace constants with new fields. 28-10-2005 David Gilbert <dav...@ob...> |
From: David G. <mu...@us...> - 2005-10-28 14:07:43
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23102 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/ACIUtilities.java (superscriptScaleFactor): new field, (subscriptScaleFactor): new field, (superscriptOffset): new field, (subscriptOffset): new field, (getSuperscriptScaleFactor): new method, (setSuperscriptScaleFactor): new method, (getSubscriptScaleFactor): new method, (setSubscriptScaleFactor): new method, (getSuperscriptOffset): new method, (setSuperscriptOffset): new method, (getSubscriptOffset): new method, (setSubscriptOffset): new method. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ChangeLog 28 Oct 2005 13:36:13 -0000 1.34 --- ChangeLog 28 Oct 2005 14:07:34 -0000 1.35 *************** *** 1,4 **** --- 1,20 ---- 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/ACIUtilities.java + (superscriptScaleFactor): new field, + (subscriptScaleFactor): new field, + (superscriptOffset): new field, + (subscriptOffset): new field, + (getSuperscriptScaleFactor): new method, + (setSuperscriptScaleFactor): new method, + (getSubscriptScaleFactor): new method, + (setSubscriptScaleFactor): new method, + (getSuperscriptOffset): new method, + (setSuperscriptOffset): new method, + (getSubscriptOffset): new method, + (setSubscriptOffset): new method. + + 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/ACIUtilities.java: reformatted. |
From: David G. <mu...@us...> - 2005-10-28 14:07:43
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23102/source/org/jfree/chart/block Modified Files: ACIUtilities.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/ACIUtilities.java (superscriptScaleFactor): new field, (subscriptScaleFactor): new field, (superscriptOffset): new field, (subscriptOffset): new field, (getSuperscriptScaleFactor): new method, (setSuperscriptScaleFactor): new method, (getSubscriptScaleFactor): new method, (setSubscriptScaleFactor): new method, (getSuperscriptOffset): new method, (setSuperscriptOffset): new method, (getSubscriptOffset): new method, (setSubscriptOffset): new method. Index: ACIUtilities.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block/ACIUtilities.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ACIUtilities.java 28 Oct 2005 13:36:13 -0000 1.3 --- ACIUtilities.java 28 Oct 2005 14:07:35 -0000 1.4 *************** *** 69,72 **** --- 69,84 ---- public class ACIUtilities { + /** The scale factor for deriving a superscript font. */ + private static double superscriptScaleFactor = 0.666; + + /** The scale factor for deriving a subscript font. */ + private static double subscriptScaleFactor = 0.666; + + /** The superscript offset. */ + private static float superscriptOffset = 0.25f; + + /** The subscript offset. */ + private static float subscriptOffset = 0.20f; + /** * Private constructor prevents object creation. *************** *** 76,79 **** --- 88,179 ---- /** + * Returns the scale factor for deriving a superscript font. + * + * @return The scale factor for deriving a superscript font. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static double getSuperscriptScaleFactor() { + return superscriptScaleFactor; + } + + /** + * Sets the scale factor for deriving a superscript font. + * + * @param scale the scale factor for deriving a superscript font. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static void setSuperscriptScaleFactor(double scale) { + superscriptScaleFactor = scale; + } + + /** + * Returns the scale factor for deriving a subscript font. + * + * @return The scale factor for deriving a subscript font. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static double getSubscriptScaleFactor() { + return subscriptScaleFactor; + } + + /** + * Sets the scale factor for deriving a subscript font. + * + * @param scale the scale factor for deriving a subscript font. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static void setSubscriptScaleFactor(double scale) { + subscriptScaleFactor = scale; + } + + /** + * Returns the superscript offset. The default value is 0.25f. + * + * @return The superscript offset. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static float getSuperscriptOffset() { + return superscriptOffset; + } + + /** + * Sets the superscript offset as a fraction of the font ascent. + * + * @param offset the offset. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static void setSuperscriptOffset(float offset) { + superscriptOffset = offset; + } + + /** + * Returns the subscript offset. The default value is 0.20f. + * + * @return The subscript offset. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static float getSubscriptOffset() { + return subscriptOffset; + } + + /** + * Sets the subscript offset as a fraction of the font ascent. + * + * @param offset the offset. + * + * @see #createTextLine(AttributedCharacterIterator, Font, Paint) + */ + public static void setSubscriptOffset(float offset) { + subscriptOffset = offset; + } + + /** * Returns the bounds for the specified text. * *************** *** 644,655 **** float offset = -(ascent * superscript.floatValue()); if (superscript.intValue() > 0) { ! font = font.deriveFont(AffineTransform.getScaleInstance(0.666, ! 0.666)); ! offset = offset * 0.25f; } else if (superscript.intValue() < 0) { ! font = font.deriveFont(AffineTransform.getScaleInstance(0.666, ! 0.666)); ! offset = offset * 0.20f; } result.addFragment(new TextFragment(sb.toString(), font, paint, --- 744,755 ---- float offset = -(ascent * superscript.floatValue()); if (superscript.intValue() > 0) { ! font = font.deriveFont(AffineTransform.getScaleInstance( ! superscriptScaleFactor, superscriptScaleFactor)); ! offset = offset * superscriptOffset; } else if (superscript.intValue() < 0) { ! font = font.deriveFont(AffineTransform.getScaleInstance( ! subscriptScaleFactor, subscriptScaleFactor)); ! offset = offset * subscriptOffset; } result.addFragment(new TextFragment(sb.toString(), font, paint, |
From: David G. <mu...@us...> - 2005-10-28 13:36:27
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16957/source/org/jfree/chart/block Modified Files: ACIUtilities.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/ACIUtilities.java: reformatted. Index: ACIUtilities.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block/ACIUtilities.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ACIUtilities.java 28 Jun 2005 09:04:59 -0000 1.2 --- ACIUtilities.java 28 Oct 2005 13:36:13 -0000 1.3 *************** *** 102,109 **** * @return The text bounds (adjusted for the text position). */ ! public static Rectangle2D drawAlignedString(AttributedCharacterIterator text, ! Graphics2D g2, ! float x, float y, ! TextAnchor anchor) { final Rectangle2D textBounds = new Rectangle2D.Double(); --- 102,108 ---- * @return The text bounds (adjusted for the text position). */ ! public static Rectangle2D drawAlignedString( ! AttributedCharacterIterator text, Graphics2D g2, float x, float y, ! TextAnchor anchor) { final Rectangle2D textBounds = new Rectangle2D.Double(); *************** *** 578,588 **** * </code>null</code> or has zero length). */ ! public static Shape calculateRotatedStringBounds(AttributedCharacterIterator text, ! final Graphics2D g2, ! final float textX, ! final float textY, ! final double angle, ! final float rotateX, ! final float rotateY) { if ((text == null) || (text.equals(""))) { --- 577,583 ---- * </code>null</code> or has zero length). */ ! public static Shape calculateRotatedStringBounds( ! AttributedCharacterIterator text, Graphics2D g2, float textX, ! float textY, double angle, float rotateX, float rotateY) { if ((text == null) || (text.equals(""))) { *************** *** 591,602 **** TextLayout tl = new TextLayout(text, g2.getFontRenderContext()); Rectangle2D bounds = tl.getBounds(); ! final AffineTransform translate = AffineTransform.getTranslateInstance( ! textX, textY ! ); ! final Shape translatedBounds = translate.createTransformedShape(bounds); ! final AffineTransform rotate = AffineTransform.getRotateInstance( ! angle, rotateX, rotateY ! ); ! final Shape result = rotate.createTransformedShape(translatedBounds); return result; --- 586,595 ---- TextLayout tl = new TextLayout(text, g2.getFontRenderContext()); Rectangle2D bounds = tl.getBounds(); ! AffineTransform translate = AffineTransform.getTranslateInstance( ! textX, textY); ! Shape translatedBounds = translate.createTransformedShape(bounds); ! AffineTransform rotate = AffineTransform.getRotateInstance(angle, ! rotateX, rotateY); ! Shape result = rotate.createTransformedShape(translatedBounds); return result; *************** *** 667,670 **** --- 660,673 ---- } + /** + * Creates a {@link TextBlock}. + * + * @param aci the source of attributed text. + * @param defaultFont the default font. + * @param defaultPaint the default paint. + * @param lineAlignment the line alignment. + * + * @return The text block. + */ public static TextBlock createTextBlock(AttributedCharacterIterator aci, Font defaultFont, Paint defaultPaint, *************** *** 690,695 **** end = aci.getIndex(); if (end > start) { ! TextLine line = createTextLine( ! new AttributedString(aci, start, end).getIterator(), defaultFont, defaultPaint); result.addLine(line); start = end + 1; --- 693,698 ---- end = aci.getIndex(); if (end > start) { ! TextLine line = createTextLine(new AttributedString(aci, start, ! end).getIterator(), defaultFont, defaultPaint); result.addLine(line); start = end + 1; |
From: David G. <mu...@us...> - 2005-10-28 13:36:21
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16957 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/ACIUtilities.java: reformatted. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ChangeLog 28 Oct 2005 12:59:55 -0000 1.33 --- ChangeLog 28 Oct 2005 13:36:13 -0000 1.34 *************** *** 1,4 **** --- 1,8 ---- 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/ACIUtilities.java: reformatted. + + 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/LabelBlock.java (LabelBlock(String, Font)): set the line alignment, |
From: David G. <mu...@us...> - 2005-10-28 13:00:08
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3810/source/org/jfree/chart/block Modified Files: LabelBlock.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/LabelBlock.java (LabelBlock(String, Font)): set the line alignment, (setFont): likewise, (arrange): reimplemented, (arrangeFF): new method, (arrangeFR): new method, (arrangeFN): new method, (arrangeRF): new method, (arrangeRR): new method, (arrangeRN): new method, (arrangeNF): new method, (arrangeNR): new method, (arrangeNN): new method. Index: LabelBlock.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block/LabelBlock.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LabelBlock.java 19 Jul 2005 14:27:01 -0000 1.11 --- LabelBlock.java 28 Oct 2005 12:59:56 -0000 1.12 *************** *** 51,60 **** --- 51,63 ---- import java.awt.Shape; import java.awt.geom.Rectangle2D; + import java.util.List; import org.jfree.chart.entity.ChartEntity; import org.jfree.chart.entity.StandardEntityCollection; + import org.jfree.data.Range; import org.jfree.text.TextBlock; import org.jfree.text.TextBlockAnchor; import org.jfree.text.TextUtilities; + import org.jfree.ui.HorizontalAlignment; import org.jfree.ui.Size2D; *************** *** 100,103 **** --- 103,107 ---- this.text = text; this.label = TextUtilities.createTextBlock(text, font, Color.black); + this.label.setLineAlignment(HorizontalAlignment.LEFT); this.font = font; this.toolTipText = null; *************** *** 121,127 **** public void setFont(Font font) { this.font = font; ! this.label = TextUtilities.createTextBlock( ! this.text, font, Color.black ! ); } --- 125,131 ---- public void setFont(Font font) { this.font = font; ! this.label = TextUtilities.createTextBlock(this.text, font, ! Color.black); ! this.label.setLineAlignment(HorizontalAlignment.LEFT); } *************** *** 163,168 **** /** ! * Arranges the contents of the block, within the given constraints, and ! * returns the block size. * * @param g2 the graphics device. --- 167,171 ---- /** ! * Arranges the contents of the block, to fit within the given constraints. * * @param g2 the graphics device. *************** *** 173,185 **** */ public ArrangeResult arrange(Graphics2D g2, RectangleConstraint constraint, ! ArrangeParams params) { g2.setFont(this.font); Size2D s = this.label.calculateDimensions(g2); ! // TODO: so far, this assumes no constraints ! return new ArrangeResult(calculateTotalWidth(s.getWidth()), ! calculateTotalHeight(s.getHeight()), null); } /** * Draws the block. * --- 176,476 ---- */ public ArrangeResult arrange(Graphics2D g2, RectangleConstraint constraint, ! ArrangeParams params) { ! ArrangeResult result; ! RectangleConstraint cc = toContentConstraint(constraint); ! LengthConstraintType w = cc.getWidthConstraintType(); ! LengthConstraintType h = cc.getHeightConstraintType(); ! if (w == LengthConstraintType.NONE) { ! if (h == LengthConstraintType.NONE) { ! result = arrangeNN(g2, params); ! } ! else if (h == LengthConstraintType.RANGE) { ! throw new RuntimeException("Not yet implemented."); ! } ! else if (h == LengthConstraintType.FIXED) { ! result = arrangeNF(g2, cc.getHeight(), params); ! } ! else { ! throw new RuntimeException("Unrecognised constraint."); ! } ! } ! else if (w == LengthConstraintType.RANGE) { ! if (h == LengthConstraintType.NONE) { ! result = arrangeRN(g2, cc.getWidthRange(), params); ! } ! else if (h == LengthConstraintType.RANGE) { ! result = arrangeRR(g2, cc.getWidthRange(), cc.getHeightRange(), ! params); ! } ! else if (h == LengthConstraintType.FIXED) { ! result = arrangeRF(g2, cc.getWidthRange(), cc.getHeight(), ! params); ! } ! else { ! throw new RuntimeException("Unrecognised constraint."); ! } ! } ! else if (w == LengthConstraintType.FIXED) { ! if (h == LengthConstraintType.NONE) { ! result = arrangeFN(g2, cc.getWidth(), params); ! } ! else if (h == LengthConstraintType.RANGE) { ! result = arrangeFR(g2, cc.getWidth(), cc.getHeightRange(), ! params); ! } ! else if (h == LengthConstraintType.FIXED) { ! result = arrangeFF(g2, cc.getWidth(), cc.getHeight(), params); ! } ! else { ! throw new RuntimeException("Unrecognised constraint."); ! } ! } ! else { ! throw new RuntimeException("Unrecognised constraints."); ! } ! ! // here we scale the content size back up to the overall block size... ! result.setSize(calculateTotalWidth(result.getWidth()), ! calculateTotalHeight(result.getHeight())); ! return result; ! ! } ! ! /** ! * Arranges the content to fit the given constraints. ! * ! * @param g2 the graphics device. ! * @param fixedWidth the fixed width. ! * @param fixedHeight the fixed height. ! * @param params the layout parameters (<code>null</code> not permitted). ! * ! * @return The layout result (including *content* size). ! */ ! protected ArrangeResult arrangeFF(Graphics2D g2, double fixedWidth, ! double fixedHeight, ArrangeParams params) { ! ! List messages = null; ! if (params.isLogEnabled()) { ! messages = new java.util.LinkedList(); ! } ! g2.setFont(this.font); Size2D s = this.label.calculateDimensions(g2); ! ! if (messages != null) { ! if (s.width > fixedWidth) { ! messages.add(new Message(this, "Text is too wide to fit.")); ! } ! if (s.height > fixedHeight) { ! messages.add(new Message(this, "Text is too tall to fit.")); ! } ! } ! ! ArrangeResult result = params.getRecyclableResult(); ! if (result != null) { ! result.setSize(fixedWidth, fixedHeight); ! result.setMessages(messages); ! } ! else { ! result = new ArrangeResult(fixedWidth, fixedHeight, messages); ! } ! return result; } /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeFR(Graphics2D g2, double fixedWidth, + Range heightRange, ArrangeParams params) { + ArrangeResult result = arrangeFN(g2, fixedWidth, params); + if (heightRange.contains(result.getHeight())) { + return result; + } + else { + return arrangeFF(g2, fixedWidth, + heightRange.constrain(result.getHeight()), params); + } + } + + /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param fixedWidth the fixed width. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeFN(Graphics2D g2, double fixedWidth, + ArrangeParams params) { + List messages = null; + if (params.isLogEnabled()) { + messages = new java.util.LinkedList(); + } + + g2.setFont(this.font); + Size2D s = this.label.calculateDimensions(g2); + + if (messages != null) { + if (s.width > fixedWidth) { + messages.add(new Message(this, "Text is too wide to fit.")); + } + } + + ArrangeResult result = params.getRecyclableResult(); + if (result != null) { + result.setSize(fixedWidth, s.getHeight()); + result.setMessages(messages); + } + else { + result = new ArrangeResult(fixedWidth, s.getHeight(), messages); + } + return result; + } + + /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeRF(Graphics2D g2, Range widthRange, + double fixedHeight, ArrangeParams params) { + ArrangeResult result = arrangeNF(g2, fixedHeight, params); + if (widthRange.contains(result.getWidth())) { + return result; + } + else { + return arrangeFF(g2, widthRange.constrain(result.getWidth()), + fixedHeight, params); + } + } + + /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeRR(Graphics2D g2, Range widthRange, + Range heightRange, ArrangeParams params) { + ArrangeResult result = arrangeNN(g2, params); + if (widthRange.contains(result.getWidth()) + && heightRange.contains(result.getHeight())) { + return result; + } + else { + return arrangeFF(g2, widthRange.constrain(result.getWidth()), + heightRange.constrain(result.getHeight()), params); + } + } + + /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeRN(Graphics2D g2, Range widthRange, + ArrangeParams params) { + ArrangeResult result = arrangeNN(g2, params); + if (widthRange.contains(result.getWidth())) { + return result; + } + else { + return arrangeFF(g2, widthRange.constrain(result.getWidth()), + result.getHeight(), params); + } + } + + /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeNF(Graphics2D g2, double fixedHeight, + ArrangeParams params) { + List messages = null; + if (params.isLogEnabled()) { + messages = new java.util.LinkedList(); + } + + g2.setFont(this.font); + Size2D s = this.label.calculateDimensions(g2); + + if (messages != null) { + if (s.height > fixedHeight) { + messages.add(new Message(this, "Text is too tall to fit.")); + } + } + + ArrangeResult result = params.getRecyclableResult(); + if (result != null) { + result.setSize(s.getWidth(), fixedHeight); + result.setMessages(messages); + } + else { + result = new ArrangeResult(s.getWidth(), fixedHeight, messages); + } + return result; + } + + /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeNR(Graphics2D g2, + Range heightRange, ArrangeParams params) { + ArrangeResult result = arrangeNN(g2, params); + if (heightRange.contains(result.getHeight())) { + return result; + } + else { + return arrangeFF(g2, result.getWidth(), + heightRange.constrain(result.getHeight()), params); + } + } + + /** + * Arranges the content to fit the given constraints. + * + * @param g2 the graphics device. + * @param params the layout parameters (<code>null</code> not permitted). + * + * @return The layout result (including *content* size). + */ + protected ArrangeResult arrangeNN(Graphics2D g2, ArrangeParams params) { + g2.setFont(this.font); + Size2D s = this.label.calculateDimensions(g2); + + ArrangeResult result = params.getRecyclableResult(); + if (result != null) { + result.setSize(s.getWidth(), s.getHeight()); + } + else { + result = new ArrangeResult(s.getWidth(), s.getHeight(), null); + } + return result; + } + + /** * Draws the block. * |
From: David G. <mu...@us...> - 2005-10-28 13:00:08
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3810 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/LabelBlock.java (LabelBlock(String, Font)): set the line alignment, (setFont): likewise, (arrange): reimplemented, (arrangeFF): new method, (arrangeFR): new method, (arrangeFN): new method, (arrangeRF): new method, (arrangeRR): new method, (arrangeRN): new method, (arrangeNF): new method, (arrangeNR): new method, (arrangeNN): new method. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ChangeLog 28 Oct 2005 12:52:47 -0000 1.32 --- ChangeLog 28 Oct 2005 12:59:55 -0000 1.33 *************** *** 1,4 **** --- 1,20 ---- 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/LabelBlock.java + (LabelBlock(String, Font)): set the line alignment, + (setFont): likewise, + (arrange): reimplemented, + (arrangeFF): new method, + (arrangeFR): new method, + (arrangeFN): new method, + (arrangeRF): new method, + (arrangeRR): new method, + (arrangeRN): new method, + (arrangeNF): new method, + (arrangeNR): new method, + (arrangeNN): new method. + + 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/ColumnArrangement.java (arrangeFN): set bounds of blocks, total height calculation updated |
From: David G. <mu...@us...> - 2005-10-28 12:52:56
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24677/source/org/jfree/chart/block Modified Files: ColumnArrangement.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/ColumnArrangement.java (arrangeFN): set bounds of blocks, total height calculation updated to reflect the number of vertical gaps, (arrangeNF): updated for new arrange() method return type. Index: ColumnArrangement.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block/ColumnArrangement.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ColumnArrangement.java 19 Jul 2005 14:27:02 -0000 1.14 --- ColumnArrangement.java 28 Oct 2005 12:52:47 -0000 1.15 *************** *** 216,220 **** Block b = (Block) blocks.get(i); ArrangeResult r = b.arrange(g2, constraint, params); ! totalHeight += b.getBounds().getHeight(); if (messages != null) { if (r.getMessages() != null) { --- 216,222 ---- Block b = (Block) blocks.get(i); ArrangeResult r = b.arrange(g2, constraint, params); ! b.setBounds(new Rectangle2D.Double(0.0, totalHeight, r.getWidth(), ! r.getHeight())); ! totalHeight += r.getHeight() + this.verticalGap; if (messages != null) { if (r.getMessages() != null) { *************** *** 223,226 **** --- 225,231 ---- } } + if (blockCount > 0) { + totalHeight = totalHeight - this.verticalGap; + } ArrangeResult result = params.getRecyclableResult(); *************** *** 265,287 **** for (int i = 0; i < blocks.size(); i++) { Block block = (Block) blocks.get(i); ! Size2D size = block.arrange(g2, params); ! if (y + size.height <= height) { itemsInColumn.add(block); block.setBounds( ! new Rectangle2D.Double(x, y, size.width, size.height) ); ! y = y + size.height + this.verticalGap; ! maxWidth = Math.max(maxWidth, size.width); } else { if (itemsInColumn.isEmpty()) { // place in this column (truncated) anyway ! block.setBounds( ! new Rectangle2D.Double( ! x, y, size.width, Math.min(size.height, height - y) ! ) ! ); y = 0.0; ! x = x + size.width + this.horizontalGap; } else { --- 270,290 ---- for (int i = 0; i < blocks.size(); i++) { Block block = (Block) blocks.get(i); ! ArrangeResult r = block.arrange(g2, RectangleConstraint.NONE, ! params); ! if (y + r.getHeight() <= height) { itemsInColumn.add(block); block.setBounds( ! new Rectangle2D.Double(x, y, r.getWidth(), r.getHeight()) ); ! y = y + r.getHeight() + this.verticalGap; ! maxWidth = Math.max(maxWidth, r.getWidth()); } else { if (itemsInColumn.isEmpty()) { // place in this column (truncated) anyway ! block.setBounds(new Rectangle2D.Double(x, y, r.getWidth(), ! Math.min(r.getHeight(), height - y))); y = 0.0; ! x = x + r.getWidth() + this.horizontalGap; } else { *************** *** 290,305 **** x = x + maxWidth + this.horizontalGap; y = 0.0; ! maxWidth = size.width; ! block.setBounds( ! new Rectangle2D.Double( ! x, y, size.width, Math.min(size.height, height) ! ) ! ); ! y = size.height + this.verticalGap; itemsInColumn.add(block); } } } ! return new ArrangeResult(new Size2D(x + maxWidth, constraint.getHeight()), null); } --- 293,305 ---- x = x + maxWidth + this.horizontalGap; y = 0.0; ! maxWidth = r.getWidth(); ! block.setBounds(new Rectangle2D.Double(x, y, r.getWidth(), ! Math.min(r.getHeight(), height))); ! y = r.getHeight() + this.verticalGap; itemsInColumn.add(block); } } } ! return new ArrangeResult(x + maxWidth, constraint.getHeight(), null); } |
From: David G. <mu...@us...> - 2005-10-28 12:52:56
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24677 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/ColumnArrangement.java (arrangeFN): set bounds of blocks, total height calculation updated to reflect the number of vertical gaps, (arrangeNF): updated for new arrange() method return type. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ChangeLog 28 Oct 2005 12:33:23 -0000 1.31 --- ChangeLog 28 Oct 2005 12:52:47 -0000 1.32 *************** *** 1,4 **** --- 1,11 ---- 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/ColumnArrangement.java + (arrangeFN): set bounds of blocks, total height calculation updated + to reflect the number of vertical gaps, + (arrangeNF): updated for new arrange() method return type. + + 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/BlockPanel.java (BlockPanel(Block, ArrangeParams)): removed commented out code, |
From: David G. <mu...@us...> - 2005-10-28 12:33:37
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26480/source/org/jfree/chart/block Modified Files: BlockPanel.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/BlockPanel.java (BlockPanel(Block, ArrangeParams)): removed commented out code, print messages to standard output for debugging, (paintComponent): reformatted for 80 columns. Index: BlockPanel.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block/BlockPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BlockPanel.java 17 Jun 2005 09:39:50 -0000 1.1 --- BlockPanel.java 28 Oct 2005 12:33:23 -0000 1.2 *************** *** 52,55 **** --- 52,57 ---- import java.io.Serializable; import java.util.HashMap; + import java.util.Iterator; + import java.util.List; import java.util.Map; *************** *** 76,88 **** this.block = block; this.arrangeParams = arrangeParams; ! // JFrame f = new JFrame(); ! // f.getContentPane().add(this); ! // f.pack(); ! BufferedImage image = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); ! ArrangeResult ar = getBlock().arrange( ! g2, RectangleConstraint.NONE, ! this.arrangeParams ! ); Size2D size = ar.getSize(); setPreferredSize(new Dimension((int) size.width, (int) size.height)); --- 78,95 ---- this.block = block; this.arrangeParams = arrangeParams; ! ! BufferedImage image = new BufferedImage(10, 10, ! BufferedImage.TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); ! ArrangeResult ar = getBlock().arrange(g2, RectangleConstraint.NONE, ! this.arrangeParams); ! List messages = ar.getMessages(); ! if (messages != null) { ! Iterator iterator = messages.iterator(); ! while (iterator.hasNext()) { ! Message m = (Message) iterator.next(); ! System.out.println(m.toString()); ! } ! } Size2D size = ar.getSize(); setPreferredSize(new Dimension((int) size.width, (int) size.height)); *************** *** 124,128 **** Graphics2D g2 = (Graphics2D) g.create(); Map hints = new HashMap(); ! hints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.addRenderingHints(hints); Insets insets = getInsets(); --- 131,136 ---- Graphics2D g2 = (Graphics2D) g.create(); Map hints = new HashMap(); ! hints.put(RenderingHints.KEY_ANTIALIASING, ! RenderingHints.VALUE_ANTIALIAS_ON); g2.addRenderingHints(hints); Insets insets = getInsets(); *************** *** 131,137 **** g2.translate(insets.left, insets.top); ! ArrangeResult ar = getBlock().arrange(g2, RectangleConstraint.NONE, this.arrangeParams); Size2D s = ar.getSize(); ! getBlock().draw(g2, new Rectangle2D.Double(0.0, 0.0, s.getWidth(), s.getHeight())); g2.setTransform(saved); --- 139,147 ---- g2.translate(insets.left, insets.top); ! ArrangeResult ar = getBlock().arrange(g2, RectangleConstraint.NONE, ! this.arrangeParams); Size2D s = ar.getSize(); ! getBlock().draw(g2, new Rectangle2D.Double(0.0, 0.0, s.getWidth(), ! s.getHeight())); g2.setTransform(saved); |
From: David G. <mu...@us...> - 2005-10-28 12:33:36
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26480 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/BlockPanel.java (BlockPanel(Block, ArrangeParams)): removed commented out code, print messages to standard output for debugging, (paintComponent): reformatted for 80 columns. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ChangeLog 28 Oct 2005 11:04:01 -0000 1.30 --- ChangeLog 28 Oct 2005 12:33:23 -0000 1.31 *************** *** 1,4 **** --- 1,11 ---- 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/BlockPanel.java + (BlockPanel(Block, ArrangeParams)): removed commented out code, + print messages to standard output for debugging, + (paintComponent): reformatted for 80 columns. + + 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/title/LegendTitle.java (arrangeFN): updated for return type of arrange() method, |
From: David G. <mu...@us...> - 2005-10-28 11:04:16
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2096 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/title/LegendTitle.java (arrangeFN): updated for return type of arrange() method, (arrangeNF): likewise, (arrangeNN): likewise, * source/org/jfree/chart/title/Title.java (arrange): removed redundant code. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ChangeLog 28 Oct 2005 10:57:21 -0000 1.29 --- ChangeLog 28 Oct 2005 11:04:01 -0000 1.30 *************** *** 1,4 **** --- 1,13 ---- 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/title/LegendTitle.java + (arrangeFN): updated for return type of arrange() method, + (arrangeNF): likewise, + (arrangeNN): likewise, + * source/org/jfree/chart/title/Title.java + (arrange): removed redundant code. + + 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/block/BlockContainer.java (arrange): fetch recyclable result after content is arranged. |
From: David G. <mu...@us...> - 2005-10-28 11:04:16
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/title In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2096/source/org/jfree/chart/title Modified Files: LegendTitle.java Title.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/title/LegendTitle.java (arrangeFN): updated for return type of arrange() method, (arrangeNF): likewise, (arrangeNN): likewise, * source/org/jfree/chart/title/Title.java (arrange): removed redundant code. Index: Title.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/title/Title.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Title.java 19 Jul 2005 14:15:07 -0000 1.13 --- Title.java 28 Oct 2005 11:04:01 -0000 1.14 *************** *** 400,406 **** // TODO: review how the result is used/created. ArrangeResult result = params.getRecyclableResult(); - if (result == null) { - result = new ArrangeResult(); - } RectangleConstraint cc = toContentConstraint(constraint); LengthConstraintType w = cc.getWidthConstraintType(); --- 400,403 ---- Index: LegendTitle.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/title/LegendTitle.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** LegendTitle.java 19 Jul 2005 14:17:00 -0000 1.24 --- LegendTitle.java 28 Oct 2005 11:04:01 -0000 1.25 *************** *** 81,85 **** import org.jfree.ui.RectangleEdge; import org.jfree.ui.RectangleInsets; - import org.jfree.ui.Size2D; import org.jfree.util.PublicCloneable; --- 81,84 ---- *************** *** 451,456 **** container = this.items; } ! Size2D naturalSize = container.arrange(g2, ! new RectangleConstraint(fixedWidth, null), null).getSize(); if (h < 0.0) { h = naturalSize.getHeight(); --- 450,455 ---- container = this.items; } ! ArrangeResult naturalSize = container.arrange(g2, ! new RectangleConstraint(fixedWidth, null), params); if (h < 0.0) { h = naturalSize.getHeight(); *************** *** 488,493 **** container = this.items; } ! Size2D naturalSize = container.arrange(g2, ! new RectangleConstraint(null, fixedHeight), null).getSize(); if (w < 0.0) { w = naturalSize.getWidth(); --- 487,492 ---- container = this.items; } ! ArrangeResult naturalSize = container.arrange(g2, ! new RectangleConstraint(null, fixedHeight), params); if (w < 0.0) { w = naturalSize.getWidth(); *************** *** 524,528 **** container = this.items; } ! Size2D naturalSize = container.arrange(g2, params); if (w < 0.0) { w = naturalSize.getWidth(); --- 523,528 ---- container = this.items; } ! ArrangeResult naturalSize = container.arrange(g2, ! RectangleConstraint.NONE, params); if (w < 0.0) { w = naturalSize.getWidth(); |
From: David G. <mu...@us...> - 2005-10-28 10:57:58
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32401 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/BlockContainer.java (arrange): fetch recyclable result after content is arranged. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ChangeLog 28 Oct 2005 10:47:47 -0000 1.28 --- ChangeLog 28 Oct 2005 10:57:21 -0000 1.29 *************** *** 1,5 **** 28-10-2005 David Gilbert <dav...@ob...> ! * source/org/jfree/chart/title/LegendGraphics.java: now implements PublicCloneable, (shape): now transient, --- 1,10 ---- 28-10-2005 David Gilbert <dav...@ob...> ! * source/org/jfree/chart/block/BlockContainer.java ! (arrange): fetch recyclable result after content is arranged. ! ! 28-10-2005 David Gilbert <dav...@ob...> ! ! * source/org/jfree/chart/title/LegendGraphic.java: now implements PublicCloneable, (shape): now transient, |
From: David G. <mu...@us...> - 2005-10-28 10:57:40
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32401/source/org/jfree/chart/block Modified Files: BlockContainer.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/block/BlockContainer.java (arrange): fetch recyclable result after content is arranged. Index: BlockContainer.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/block/BlockContainer.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** BlockContainer.java 19 Jul 2005 14:27:01 -0000 1.14 --- BlockContainer.java 28 Oct 2005 10:57:21 -0000 1.15 *************** *** 200,210 **** public ArrangeResult arrange(Graphics2D g2, RectangleConstraint constraint, ArrangeParams params) { - ArrangeResult result = null; - if (params != null) { - result = params.getRecyclableResult(); - } - if (result == null) { - result = new ArrangeResult(); - } RectangleConstraint cc = toContentConstraint(constraint); LengthConstraintType w = cc.getWidthConstraintType(); --- 200,203 ---- *************** *** 247,250 **** --- 240,247 ---- } } + ArrangeResult result = params.getRecyclableResult(); + if (result == null) { + result = new ArrangeResult(); + } result.setSize(new Size2D(calculateTotalWidth(contentSize.getWidth()), calculateTotalHeight(contentSize.getHeight()))); |
From: David G. <mu...@us...> - 2005-10-28 10:47:57
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/title In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31198/source/org/jfree/chart/title Modified Files: LegendGraphic.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/title/LegendGraphics.java: now implements PublicCloneable, (shape): now transient, (fillPaint): now transient, (outlinePaint): now transient, (line): now transient, (linePaint): now transient, (getShapeAnchor): new method, (getShapeLocation): new method, (equals): new method, (clone): new method, (writeObject): new method, (readObject): new method. Index: LegendGraphic.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/title/LegendGraphic.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** LegendGraphic.java 19 Jul 2005 14:19:38 -0000 1.12 --- LegendGraphic.java 28 Oct 2005 10:47:47 -0000 1.13 *************** *** 41,44 **** --- 41,45 ---- * 20-Apr-2005 : Added new draw() method (DG); * 13-May-2005 : Fixed to respect margin, border and padding settings (DG); + * 05-Sep-2005 : Implemented PublicCloneable (DG); * */ *************** *** 52,55 **** --- 53,59 ---- import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; + import java.io.IOException; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; import org.jfree.chart.block.AbstractContentBlock; *************** *** 58,62 **** --- 62,70 ---- import org.jfree.chart.block.LengthConstraintType; import org.jfree.chart.block.RectangleConstraint; + import org.jfree.io.SerialUtilities; import org.jfree.ui.RectangleAnchor; + import org.jfree.util.ObjectUtilities; + import org.jfree.util.PaintUtilities; + import org.jfree.util.PublicCloneable; import org.jfree.util.ShapeUtilities; *************** *** 64,68 **** * The graphical item within a legend item. */ ! public class LegendGraphic extends AbstractContentBlock { /** --- 72,77 ---- * The graphical item within a legend item. */ ! public class LegendGraphic extends AbstractContentBlock ! implements PublicCloneable { /** *************** *** 76,80 **** * of the shape should be at (0, 0). */ ! private Shape shape; /** --- 85,89 ---- * of the shape should be at (0, 0). */ ! private transient Shape shape; /** *************** *** 93,97 **** /** The fill paint for the shape. */ ! private Paint fillPaint; /** A flag that controls whether or not the shape outline is visible. */ --- 102,106 ---- /** The fill paint for the shape. */ ! private transient Paint fillPaint; /** A flag that controls whether or not the shape outline is visible. */ *************** *** 99,103 **** /** The outline paint for the shape. */ ! private Paint outlinePaint; /** The outline stroke for the shape. */ --- 108,112 ---- /** The outline paint for the shape. */ ! private transient Paint outlinePaint; /** The outline stroke for the shape. */ *************** *** 111,115 **** /** The line. */ ! private Shape line; /** The line stroke. */ --- 120,124 ---- /** The line. */ ! private transient Shape line; /** The line stroke. */ *************** *** 117,121 **** /** The line paint. */ ! private Paint linePaint; /** --- 126,130 ---- /** The line paint. */ ! private transient Paint linePaint; /** *************** *** 142,171 **** /** - * Sets the shape anchor. This defines a point on the shapes bounding - * rectangle that will be used to align the shape to a location. - * - * @param anchor the anchor (<code>null</code> not permitted). - */ - public void setShapeAnchor(RectangleAnchor anchor) { - if (anchor == null) { - throw new IllegalArgumentException("Null 'anchor' argument."); - } - this.shapeAnchor = anchor; - } - - /** - * Sets the shape location. This defines a point within the drawing - * area that will be used to align the shape to. - * - * @param location the location (<code>null</code> not permitted). - */ - public void setShapeLocation(RectangleAnchor location) { - if (location == null) { - throw new IllegalArgumentException("Null 'location' argument."); - } - this.shapeLocation = location; - } - - /** * Returns a flag that controls whether or not the shape * is visible. --- 151,154 ---- *************** *** 299,302 **** --- 282,329 ---- /** + * Returns the shape anchor. + * + * @return The shape anchor. + */ + public RectangleAnchor getShapeAnchor() { + return this.shapeAnchor; + } + + /** + * Sets the shape anchor. This defines a point on the shapes bounding + * rectangle that will be used to align the shape to a location. + * + * @param anchor the anchor (<code>null</code> not permitted). + */ + public void setShapeAnchor(RectangleAnchor anchor) { + if (anchor == null) { + throw new IllegalArgumentException("Null 'anchor' argument."); + } + this.shapeAnchor = anchor; + } + + /** + * Returns the shape location. + * + * @return The shape location. + */ + public RectangleAnchor getShapeLocation() { + return this.shapeLocation; + } + + /** + * Sets the shape location. This defines a point within the drawing + * area that will be used to align the shape to. + * + * @param location the location (<code>null</code> not permitted). + */ + public void setShapeLocation(RectangleAnchor location) { + if (location == null) { + throw new IllegalArgumentException("Null 'location' argument."); + } + this.shapeLocation = location; + } + + /** * Returns the flag that controls whether or not the line is visible. * *************** *** 536,539 **** --- 563,670 ---- return null; } + + /** + * Tests this <code>LegendGraphic</code> 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 instanceof LegendGraphic)) { + return false; + } + LegendGraphic that = (LegendGraphic) obj; + if (this.shapeVisible != that.shapeVisible) { + return false; + } + if (!ShapeUtilities.equal(this.shape, that.shape)) { + return false; + } + if (this.shapeFilled != that.shapeFilled) { + return false; + } + if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { + return false; + } + if (this.shapeOutlineVisible != that.shapeOutlineVisible) { + return false; + } + if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { + return false; + } + if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { + return false; + } + if (this.shapeAnchor != that.shapeAnchor) { + return false; + } + if (this.shapeLocation != that.shapeLocation) { + return false; + } + if (this.lineVisible != that.lineVisible) { + return false; + } + if (!ShapeUtilities.equal(this.line, that.line)) { + return false; + } + if (!PaintUtilities.equal(this.linePaint, that.linePaint)) { + return false; + } + if (!ObjectUtilities.equal(this.lineStroke, that.lineStroke)) { + return false; + } + if (!super.equals(obj)) { + return false; + } + return true; + } + + /** + * Returns a clone of this <code>LegendGraphic</code> instance. + * + * @return A clone of this <code>LegendGraphic</code> instance. + * + * @throws CloneNotSupportedException if there is a problem cloning. + */ + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + /** + * Provides serialization support. + * + * @param stream the output stream. + * + * @throws IOException if there is an I/O error. + */ + private void writeObject(ObjectOutputStream stream) throws IOException { + stream.defaultWriteObject(); + SerialUtilities.writeShape(this.shape, stream); + SerialUtilities.writePaint(this.fillPaint, stream); + SerialUtilities.writePaint(this.outlinePaint, stream); + SerialUtilities.writeShape(this.line, stream); + SerialUtilities.writePaint(this.linePaint, stream); + } + + /** + * Provides serialization support. + * + * @param stream the input stream. + * + * @throws IOException if there is an I/O error. + * @throws ClassNotFoundException if there is a classpath problem. + */ + private void readObject(ObjectInputStream stream) + throws IOException, ClassNotFoundException + { + stream.defaultReadObject(); + this.shape = SerialUtilities.readShape(stream); + this.fillPaint = SerialUtilities.readPaint(stream); + this.outlinePaint = SerialUtilities.readPaint(stream); + this.line = SerialUtilities.readShape(stream); + this.linePaint = SerialUtilities.readPaint(stream); + } } |
From: David G. <mu...@us...> - 2005-10-28 10:47:56
|
Update of /cvsroot/jfreechart/jfreechart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31198 Modified Files: ChangeLog Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/title/LegendGraphics.java: now implements PublicCloneable, (shape): now transient, (fillPaint): now transient, (outlinePaint): now transient, (line): now transient, (linePaint): now transient, (getShapeAnchor): new method, (getShapeLocation): new method, (equals): new method, (clone): new method, (writeObject): new method, (readObject): new method. Index: ChangeLog =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/ChangeLog,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ChangeLog 28 Oct 2005 10:35:26 -0000 1.27 --- ChangeLog 28 Oct 2005 10:47:47 -0000 1.28 *************** *** 1,4 **** --- 1,20 ---- 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/title/LegendGraphics.java: now implements + PublicCloneable, + (shape): now transient, + (fillPaint): now transient, + (outlinePaint): now transient, + (line): now transient, + (linePaint): now transient, + (getShapeAnchor): new method, + (getShapeLocation): new method, + (equals): new method, + (clone): new method, + (writeObject): new method, + (readObject): new method. + + 28-10-2005 David Gilbert <dav...@ob...> + * source/org/jfree/chart/title/AttributedTextTitle.java (arrangeFF): add message logging. |
From: David G. <mu...@us...> - 2005-10-28 10:35:34
|
Update of /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/title In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/source/org/jfree/chart/title Modified Files: AttributedTextTitle.java Log Message: 28-10-2005 David Gilbert <dav...@ob...> * source/org/jfree/chart/title/AttributedTextTitle.java (arrangeFF): add message logging. Index: AttributedTextTitle.java =================================================================== RCS file: /cvsroot/jfreechart/jfreechart/source/org/jfree/chart/title/AttributedTextTitle.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AttributedTextTitle.java 19 Jul 2005 14:22:07 -0000 1.3 --- AttributedTextTitle.java 28 Oct 2005 10:35:26 -0000 1.4 *************** *** 51,54 **** --- 51,56 ---- import java.text.AttributedCharacterIterator; import java.text.AttributedString; + import java.util.LinkedList; + import java.util.List; import org.jfree.chart.block.ACIUtilities; *************** *** 57,60 **** --- 59,63 ---- import org.jfree.chart.block.BlockResult; import org.jfree.chart.block.EntityBlockParams; + import org.jfree.chart.block.Message; import org.jfree.chart.entity.ChartEntity; import org.jfree.chart.entity.EntityCollection; *************** *** 321,335 **** double fixedHeight, ArrangeParams params) { this.textBlock = ACIUtilities.createTextBlock(this.content, this.defaultFont, this.defaultPaint, this.lineAlignment); ! // TODO: log a message if the text doesn't fit the fixed size ArrangeResult result = params.getRecyclableResult(); if (result != null) { result.setSize(fixedWidth, fixedHeight); } else { ! result = new ArrangeResult(fixedWidth, fixedHeight, null); } return result; --- 324,354 ---- double fixedHeight, ArrangeParams params) { + List messages = null; + if (params.isLogEnabled()) { + messages = new LinkedList(); + } this.textBlock = ACIUtilities.createTextBlock(this.content, this.defaultFont, this.defaultPaint, this.lineAlignment); ! if (messages != null) { ! // check if the text block will fit the constraints ! Size2D size = this.textBlock.calculateDimensions(g2); ! if (size.width > fixedWidth) { ! messages.add(new Message(this, "Text too wide to fit without clipping.")); ! } ! if (size.height > fixedHeight) { ! messages.add(new Message(this, "Text too tall to fit without clipping.")); ! } ! } ArrangeResult result = params.getRecyclableResult(); if (result != null) { result.setSize(fixedWidth, fixedHeight); + if (messages != null) { + result.getMessages().addAll(messages); + } } else { ! result = new ArrangeResult(fixedWidth, fixedHeight, messages); } return result; |