[Schmitzm-commits] r667 - branches/2.0-RC2/src/schmitzm/jfree/feature/style
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Feb 3 19:16:14 CET 2010
Author: mojays
Date: 2010-02-03 19:16:13 +0100 (Wed, 03 Feb 2010)
New Revision: 667
Modified:
branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java
branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartStyle.java
branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureScatterChartStyle.java
Log:
FeatureChartStyle.filterNoDataValue(..) return type parameterized.
Modified: branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java 2010-02-03 18:05:50 UTC (rev 666)
+++ branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureBasicChartStyle.java 2010-02-03 18:16:13 UTC (rev 667)
@@ -269,7 +269,7 @@
* @param value an attribute value
* @return {@code null} if the given value is one of the "No data" values
*/
- public Object filterNoDataValue(int idx, Object value) {
+ public <T> T filterNoDataValue(int idx, T value) {
return dummyFeatureChartStyle.filterNoDataValue(idx, value);
}
Modified: branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartStyle.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartStyle.java 2010-02-03 18:05:50 UTC (rev 666)
+++ branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartStyle.java 2010-02-03 18:16:13 UTC (rev 667)
@@ -192,7 +192,7 @@
* @param value an attribute value
* @return {@code null} if the given value is one of the "No data" values
*/
- public Object filterNoDataValue(int idx, Object value);
+ public <T> T filterNoDataValue(int idx, T value);
/**
* This class defines a dummy implementation of {@link FeatureChartStyle} just
@@ -266,7 +266,9 @@
private void updateAttributeCount() {
// attribute names define the number of attributes, also
// if there are "more" normalize constraints specified
- maxAttrIdx = LangUtil.max( attrNames.keySet() );
+ maxAttrIdx = LangUtil.max( attrNames.keySet(),
+ normalizeAttr.keySet(),
+ noDataValues.keySet() );
if ( maxAttrCount > 0 && maxAttrIdx >= maxAttrCount )
throw new IllegalArgumentException("Only "+maxAttrCount+" attributes can be specified for "+LangUtil.getSimpleClassName(this));
@@ -280,6 +282,17 @@
*/
@Override
public void removeAttribute(int idx) {
+ this.attrNames.remove(idx);
+ this.normalizeAttr.remove(idx);
+ Set<Object> noDataValues = this.noDataValues.remove(idx);
+ if ( noDataValues != null )
+ noDataValues.clear();
+
+ // restructure -> move
+// int oldCount =
+// for (int i=idx+1; i)
+
+
throw new UnsupportedOperationException("FeatureChartStyle.removeAttribute(..) not yet implemented!");
}
@@ -449,6 +462,7 @@
*/
public void setNoDataValues(int idx, Set<Object> noDataValues) {
this.noDataValues.put(idx, noDataValues);
+ updateAttributeCount();
}
/**
@@ -507,7 +521,7 @@
* @param value an attribute value
* @return {@code null} if the given value is one of the "No data" values
*/
- public Object filterNoDataValue(int idx, Object value) {
+ public <T> T filterNoDataValue(int idx, T value) {
if ( isNoDataValue(idx, value) )
return null;
return value;
Modified: branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureScatterChartStyle.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureScatterChartStyle.java 2010-02-03 18:05:50 UTC (rev 666)
+++ branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureScatterChartStyle.java 2010-02-03 18:16:13 UTC (rev 667)
@@ -284,7 +284,7 @@
* @param value an attribute value
* @return {@code null} if the given value is one of the "No data" values
*/
- public Object filterNoDataValue(int idx, Object value) {
+ public <T> T filterNoDataValue(int idx, T value) {
return dummyFeatureChartStyle.filterNoDataValue(idx, value);
}
More information about the Schmitzm-commits
mailing list