From: <j....@ge...> - 2003-06-14 18:41:54
|
hi as i use the attributeExpression and set a test color value column( Integer ) in shpfile database, then create Fill using the attributeExpression, a ClassCastException came out from RenderUtility: graphic.setColor(Color.decode( (String ) fill.getColor().getValue(feature) ) ); it might caused by the fill.getColor(0.getValue( feature ) returning an Integer Object, but the code above in theRenderUtility try to cast it intor String Object. so i change the code a little bit: call a toString() from this Object and it works. graphic.setColor(Color.decode( fill.getColor().getValue(feature).toString() ) ); is that the right place to change. furthermore, maybe the other way is i could write my own AtrributeExression Implementation for my own purpose ( 1. return an String Object when getValue(feature), 2 build a math function inside the expression to transform attribute value to Color RGB value ). is that the right way to do, and is that part of the gt2 development or just need to be done by userself. any helps, thanks jin |