[Schmitzm-commits] r993 - in trunk: src/schmitzm/geotools/gui src/schmitzm/jfree/chart/style src_junit/schmitzm/geotools/gui
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Sep 8 11:49:05 CEST 2010
Author: alfonx
Date: 2010-09-08 11:49:03 +0200 (Wed, 08 Sep 2010)
New Revision: 993
Modified:
trunk/src/schmitzm/geotools/gui/XMapPane.java
trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java
trunk/src_junit/schmitzm/geotools/gui/XMapPaneTest.java
Log:
Further fixing of a zoom-bug reported by Annica and Dominique. Added a test for it.
Modified: trunk/src/schmitzm/geotools/gui/XMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/XMapPane.java 2010-08-26 20:50:20 UTC (rev 992)
+++ trunk/src/schmitzm/geotools/gui/XMapPane.java 2010-09-08 09:49:03 UTC (rev 993)
@@ -2054,11 +2054,9 @@
* Set the maximum allowed zoom scale. This is the smaller number value of
* the two. If <code>null</code> is passed, Double.MINVALUE are used which
* mean there is no restriction.
- *
- * @author <a href="mailto:skpublic at wikisquare.de">Stefan Alfons Tzeggai</a>
*/
public void setMaxZoomScale(final Double maxZoomScale) {
- this.maxZoomScale = maxZoomScale == null ? 1 : maxZoomScale;
+ this.maxZoomScale = maxZoomScale == null ? Double.MIN_VALUE : maxZoomScale;
}
// /** Stored the time used for the last real rendering in ms. **/
Modified: trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2010-08-26 20:50:20 UTC (rev 992)
+++ trunk/src/schmitzm/jfree/chart/style/AbstractChartStyle.java 2010-09-08 09:49:03 UTC (rev 993)
@@ -46,15 +46,8 @@
import org.apache.log4j.Category;
import org.jfree.chart.JFreeChart;
-import org.jfree.chart.LegendItem;
-import org.jfree.chart.LegendItemCollection;
-import org.jfree.chart.LegendItemSource;
import org.jfree.chart.axis.Axis;
import org.jfree.chart.axis.NumberAxis;
-import org.jfree.chart.block.BlockBorder;
-import org.jfree.chart.block.BlockContainer;
-import org.jfree.chart.block.BorderArrangement;
-import org.jfree.chart.block.EmptyBlock;
import org.jfree.chart.labels.CategoryToolTipGenerator;
import org.jfree.chart.labels.PieSectionLabelGenerator;
import org.jfree.chart.labels.StandardCategoryToolTipGenerator;
@@ -68,8 +61,6 @@
import org.jfree.chart.renderer.AbstractRenderer;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
import org.jfree.chart.renderer.xy.XYItemRenderer;
-import org.jfree.chart.title.CompositeTitle;
-import org.jfree.chart.title.LegendTitle;
import org.jfree.chart.title.TextTitle;
import org.jfree.chart.urls.CategoryURLGenerator;
import org.jfree.chart.urls.PieURLGenerator;
@@ -77,11 +68,8 @@
import org.jfree.chart.urls.StandardPieURLGenerator;
import org.jfree.chart.urls.StandardXYURLGenerator;
import org.jfree.chart.urls.XYURLGenerator;
-import org.jfree.ui.RectangleEdge;
-import org.jfree.ui.RectangleInsets;
import schmitzm.jfree.JFreeChartUtil;
-import schmitzm.jfree.chart.FilteredLegendItemSource;
import schmitzm.jfree.chart.StyledToolTipGenerator;
import schmitzm.lang.LangUtil;
import skrueger.geotools.CopyableUtil;
Modified: trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java 2010-08-26 20:50:20 UTC (rev 992)
+++ trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java 2010-09-08 09:49:03 UTC (rev 993)
@@ -41,9 +41,6 @@
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
-import org.jfree.chart.LegendItem;
-import org.jfree.chart.LegendItemCollection;
-import org.jfree.chart.LegendItemSource;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.Plot;
import org.jfree.chart.plot.PlotOrientation;
Modified: trunk/src_junit/schmitzm/geotools/gui/XMapPaneTest.java
===================================================================
--- trunk/src_junit/schmitzm/geotools/gui/XMapPaneTest.java 2010-08-26 20:50:20 UTC (rev 992)
+++ trunk/src_junit/schmitzm/geotools/gui/XMapPaneTest.java 2010-09-08 09:49:03 UTC (rev 993)
@@ -24,5 +24,19 @@
assertTrue(corrected.getHeight() > 0.);
}
+
+ @Test
+ public void testBestAllowedMapArea2() {
+
+ XMapPane xMapPane = new XMapPane();
+
+ xMapPane.setMaxZoomScale(null);
+
+ assertTrue(xMapPane.getMaxZoomScale() != 1.);
+ assertTrue(xMapPane.getMaxZoomScale() < 1.);
+ assertTrue(xMapPane.getMaxZoomScale() == Double.MIN_VALUE);
+
+ }
+
}
More information about the Schmitzm-commits
mailing list