Hi I´m new in that mailing list. 
I hope somebody can help me with that problem.

I want use the ColorThemingStyle class to
show different kinds of landuse in a map.
It seems to work but the wrong symbolization 
is shown in the legend.

Greetings Holger

private void TestColorTheming(TaskMonitor monitor, PlugInContext context)
        throws Exception {
                
                LayerManager LayManager = context.getLayerManager();
                LayManager.setFiringEvents(false);
        
                Layer layFB = LayManager.getLayer(strLayFB);
                
                
                LayManager.setFiringEvents(false);
                ColorThemingStyle cts = new ColorThemingStyle();
                                
                cts.setAttributeName(strFieldBodnenNutz);

                BasicStyle bs1 = new BasicStyle(Color.blue);
                bs1.setLineColor(Color.black);
                bs1.setLineWidth(1);
                bs1.setEnabled(true);
                                
                BasicStyle bs2 = new BasicStyle(Color.GREEN);
                bs2.setLineColor(Color.black);
                bs2.setLineWidth(1);
                bs2.setEnabled(true);
                        
                BasicStyle bs3 = new BasicStyle(Color.red);
                bs3.setLineColor(Color.black);
                bs3.setLineWidth(1);
                bs3.setEnabled(true);
                        
                HashMap styleMap = new  HashMap();
                styleMap.put("A", bs1);
                styleMap.put("G", bs2);
                styleMap.put("K", bs3);
                                
                layFB.getStyle((BasicStyle.class)).setEnabled(false);
                cts.setAttributeValueToBasicStyleMap(styleMap); 
                cts.setEnabled(true);
                layFB.addStyle(cts);
                layFB.getStyle((ColorThemingStyle.class)).setEnabled(true);
                
                
                LayManager.setFiringEvents(true);
                layFB.fireLayerChanged(LayerEventType.APPEARANCE_CHANGED );
        }
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

Holger Rossol
Landwirtschaftskammer NRW
Referat 22 - Anwendungsentwicklung
Nevinghoff 40
48147 Münster
 
eMail: [EMAIL PROTECTED]
Telefon: 0251/2376-926
Telefax: 0251/2376-818


_______________________________________________
jump-users mailing list
[email protected]
http://lists.refractions.net/mailman/listinfo/jump-users

Reply via email to