[Schmitzm-commits] r230 - in trunk/src/schmitzm: geotools/io jfree jfree/chart/style jfree/feature/style
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sat Jul 18 21:26:44 CEST 2009
Author: mojays
Date: 2009-07-18 21:26:43 +0200 (Sat, 18 Jul 2009)
New Revision: 230
Modified:
trunk/src/schmitzm/geotools/io/GeoImportUtil.java
trunk/src/schmitzm/jfree/JFreeChartUtil.java
trunk/src/schmitzm/jfree/chart/style/ChartStyle.java
trunk/src/schmitzm/jfree/chart/style/ChartStyleUtil.java
trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
trunk/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java
trunk/src/schmitzm/jfree/feature/style/FeatureChartStyleXMLFactory.java
Log:
GeoImportUtil.DEFAULT_CRS reset to public (used in Xulu, SDSS, ...). I will convert to setter method later.
ChartType to own class file.
ChartType icon path relatively to main package (containing JFreeChartUtil)
Modified: trunk/src/schmitzm/geotools/io/GeoImportUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/io/GeoImportUtil.java 2009-07-18 11:28:34 UTC (rev 229)
+++ trunk/src/schmitzm/geotools/io/GeoImportUtil.java 2009-07-18 19:26:43 UTC (rev 230)
@@ -105,7 +105,7 @@
* Anwendungen koennen diese Variable gefahrlos ueberschreiben, um ein fuer
* die Anwendung adaequates Standard-CRS zu verwenden.
*/
- private static CoordinateReferenceSystem DEFAULT_CRS = DefaultGeographicCRS.WGS84;
+ public static CoordinateReferenceSystem DEFAULT_CRS = DefaultGeographicCRS.WGS84;
/**
* Diese Methode extrahiert saemtliche Features aus einem ShapeFile-Projekt
Modified: trunk/src/schmitzm/jfree/JFreeChartUtil.java
===================================================================
--- trunk/src/schmitzm/jfree/JFreeChartUtil.java 2009-07-18 11:28:34 UTC (rev 229)
+++ trunk/src/schmitzm/jfree/JFreeChartUtil.java 2009-07-18 19:26:43 UTC (rev 230)
@@ -65,7 +65,7 @@
import schmitzm.jfree.chart.style.BasicChartStyle;
import schmitzm.jfree.chart.style.ChartStyle;
import schmitzm.jfree.chart.style.ChartStyleXMLFactory;
-import schmitzm.jfree.chart.style.ChartStyle.ChartType;
+import schmitzm.jfree.chart.style.ChartType;
import schmitzm.jfree.feature.Feature2SeriesDatasetMapping;
import schmitzm.jfree.feature.FeatureDatasetMetaData;
import schmitzm.jfree.feature.FeatureDatasetSelectionModel;
Modified: trunk/src/schmitzm/jfree/chart/style/ChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/ChartStyle.java 2009-07-18 11:28:34 UTC (rev 229)
+++ trunk/src/schmitzm/jfree/chart/style/ChartStyle.java 2009-07-18 19:26:43 UTC (rev 230)
@@ -12,18 +12,13 @@
package schmitzm.jfree.chart.style;
import java.awt.Paint;
-import java.awt.image.BufferedImage;
-import java.net.URL;
-import javax.swing.ImageIcon;
import org.apache.log4j.Logger;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.general.Dataset;
-import schmitzm.jfree.JFreeChartUtil;
-import schmitzm.lang.ResourceProvider;
/**
* This interface is a general super class for a design style of a {@link JFreeChart}.
@@ -35,88 +30,8 @@
* @version 1.0
*/
public interface ChartStyle {
-
- final static Logger LOGGER = Logger.getLogger(ChartStyle.class);
- /**
- * Enum representing the style type of a chart (bar, line, area)
- */
- public enum ChartType {
- /** Represents all bar chart styles */
- BAR,
- /** Represents all line chart styles */
- LINE,
- /** Represents all area chart styles */
- AREA,
- /** Represents all point chart styles */
- POINT,
- /** Represents all pie chart styles */
- PIE,
- /** Represents all gantt chart styles */
- GANTT,
- /** Represents all timeseries chart styles */
- TIMESERIES,
- /** Represents all spider chart styles */
- SPIDER,
- /** Represents all scatter chart styles */
- SCATTER;
-
- /**
- * Returns an image of 300x200 pixels that shows a hypothetical
- * chart of the given type. Never returns <code>null</code>, but rather
- * a default image. The images are not cached, so if ut's called often,
- * cache it yourself.
- */
- public ImageIcon getIcon() {
- final String fileName = getClass().getSimpleName() + "_"
- + toString();
-
- final String imageResPath = "../../resource/images/" + fileName
- + ".png";
-
- // LOGGER.debug("Looking for image " + imageResPath);
- final URL imageUrl = ChartStyle.class.getResource(imageResPath);
-
- if (imageUrl == null) {
- // Create a default icon
- final BufferedImage bufferedImage = new BufferedImage(300, 200,
- BufferedImage.TYPE_INT_RGB);
- bufferedImage.getGraphics().drawString("no preview available",
- 20, 110); // i8n
- return new ImageIcon(bufferedImage);
-
- }
- return new ImageIcon(imageUrl);
- }
-
- /**
- * Returns a description of this kind of chart. Can be used for
- * tool-tips. May return <code>null</code> if no localized String found.
- */
- public String getDescription() {
- final String resource = JFreeChartUtil.R(getClass().getSimpleName()
- + "_" + toString() + ".Desc");
- if (resource == null
- || resource
- .equals(ResourceProvider.MISSING_RESOURCE_STRING))
- return null;
- return resource;
- }
-
- /**
- * Returns a localized title of this kind of chart. If no localized
- * string found, return the Enum.toString()
- */
- public String getTitle() {
- final String resource = JFreeChartUtil.R(getClass().getSimpleName()
- + "_" + toString() + ".Title");
- if (resource == null
- || resource
- .equals(ResourceProvider.MISSING_RESOURCE_STRING))
- return toString();
- return resource;
- }
- };
-
+ final static Logger LOGGER = Logger.getLogger(ChartStyle.class);
+
/** Constant for the domain axis (X). */
public static final int DOMAIN_AXIS = 0;
/** Constant for the domain axis (X). Synonym for {@link #DOMAIN_AXIS}.*/
Modified: trunk/src/schmitzm/jfree/chart/style/ChartStyleUtil.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/ChartStyleUtil.java 2009-07-18 11:28:34 UTC (rev 229)
+++ trunk/src/schmitzm/jfree/chart/style/ChartStyleUtil.java 2009-07-18 19:26:43 UTC (rev 230)
@@ -20,7 +20,6 @@
import org.jdom.input.SAXBuilder;
import schmitzm.io.IOUtil;
-import schmitzm.jfree.chart.style.ChartStyle.ChartType;
/**
* This class contains static utility methods related to chart styling.
Modified: trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2009-07-18 11:28:34 UTC (rev 229)
+++ trunk/src/schmitzm/jfree/chart/style/ChartStyleXMLFactory.java 2009-07-18 19:26:43 UTC (rev 230)
@@ -21,7 +21,6 @@
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.ui.RectangleInsets;
-import schmitzm.jfree.chart.style.ChartStyle.ChartType;
import schmitzm.xml.XMLUtil;
/**
@@ -52,7 +51,7 @@
// Determine the chart type from XML
String typeStr = XMLUtil.getAttribute(element, "type");
- ChartStyle.ChartType chartType = ChartStyleUtil.getChartType(typeStr);
+ ChartType chartType = ChartStyleUtil.getChartType(typeStr);
// create default style for given type
E chartStyle = createDefaultChartStyle(id, chartType);
Modified: trunk/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java 2009-07-18 11:28:34 UTC (rev 229)
+++ trunk/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java 2009-07-18 19:26:43 UTC (rev 230)
@@ -18,6 +18,7 @@
import schmitzm.jfree.JFreeChartUtil;
import schmitzm.jfree.chart.style.BasicChartStyle;
+import schmitzm.jfree.chart.style.ChartType;
/**
* This class extends the {@link BasicChartStyle} with the properties
Modified: trunk/src/schmitzm/jfree/feature/style/FeatureChartStyleXMLFactory.java
===================================================================
--- trunk/src/schmitzm/jfree/feature/style/FeatureChartStyleXMLFactory.java 2009-07-18 11:28:34 UTC (rev 229)
+++ trunk/src/schmitzm/jfree/feature/style/FeatureChartStyleXMLFactory.java 2009-07-18 19:26:43 UTC (rev 230)
@@ -18,7 +18,7 @@
import schmitzm.jfree.chart.style.ChartStyle;
import schmitzm.jfree.chart.style.ChartStyleXMLFactory;
-import schmitzm.jfree.chart.style.ChartStyle.ChartType;
+import schmitzm.jfree.chart.style.ChartType;
import schmitzm.lang.LangUtil;
import schmitzm.xml.XMLUtil;
More information about the Schmitzm-commits
mailing list