Coming together nicely - code example!

// Opacity is defined as an Expression in the Symbology Encoding Specification 
IExpressionViewer opacityViewer = new CQLExpressionViewer( composite, 
SWT.DEFAULT ); ExpressionInput opacity = new ExpressionInput(); 
opacity.setRequired(false); opacity.setBinding( Float.class ); opacity.setMin( 
0.0 ); opacity.setMax( 1.0 ); opacity.setDefault( 1.0 ); // used to suggest 
literal values opacity.setLiteralList( 0.0, 0.25, 0.5, 0.75, 0.8, 0.85, 0.90, 
0.95, 1.0 ); // used to suggest numeric attributes opacity.setSchema( 
featureType ); opacityViewer.setInput( opacity ); // Acts as a normal viewer 
with the selection being the edited Expression opacityViewer.setSelection( new 
StructuredSelection( expr ) ); opacityViewer.setExpression( expr ); // direct 
access via helper method
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to