<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=NO-BOK link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Hi Johann,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I am now back in office and I have tried to retest the latest version (snapshot) of geotoolkit-pending.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>I get the same error as before, the cartography will not take effect and the variable “activepanel” is null when I press the “Apply-button”.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The code fragment where I have the breakpoint is shown below:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Best Regards<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Trond<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>/**<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> * Property panel<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> * <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> * @author Johann Sorel<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> * @module pending<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'> */<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>public class JPropertyDialog extends JDialog{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    private JButton apply = new JButton(MessageBundle.getString("property_apply"));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    private JButton revert = new JButton(MessageBundle.getString("property_revert"));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    private JButton close = new JButton(MessageBundle.getString("property_close"));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    private JTabbedPane tabs = new JTabbedPane();    <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    private PropertyPane activePanel = null;    <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    private ArrayList<PropertyPane> panels = new ArrayList<PropertyPane>();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    /** Creates a new instance of ASDialog */<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>    private JPropertyDialog(final boolean modal,final boolean app, final boolean rev, final boolean clo) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        super();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        setModal(modal);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        setTitle(MessageBundle.getString("property_properties"));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        JToolBar bas = new JToolBar();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        bas.setFloatable(false);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        bas.setLayout(new FlowLayout(FlowLayout.RIGHT));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        if(app)bas.add(apply);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        if(rev)bas.add(revert);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        if(clo)bas.add(close);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        apply.setIcon(IconBundle.getIcon("16_apply"));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        revert.setIcon(IconBundle.getIcon("16_reload"));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        close.setIcon(IconBundle.getIcon("16_close"));<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        tabs.addChangeListener(new ChangeListener() {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>            @Override<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>            public void stateChanged(ChangeEvent e) {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                activePanel = (PropertyPane)tabs.getSelectedComponent();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>            }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        });<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        apply.addActionListener(new ActionListener() {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>            @Override<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>            public void actionPerformed(ActionEvent e) { // HERE THE activePanel is null ???????????????<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                if(activePanel != null){<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                    activePanel.apply();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>                }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>            }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>        });<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> geotoolkit-bounces@lists.osgeo.org [mailto:geotoolkit-bounces@lists.osgeo.org] <b>On Behalf Of </b>johann sorel<br><b>Sent:</b> 26. november 2012 14:12<br><b>To:</b> geotoolkit@lists.osgeo.org<br><b>Subject:</b> Re: [geotk] Error in "Display swing widgets" StylePanel dialog ?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hello Trond,<br><br>I will have a look at it, I don't think it will be long.<br><br>johann<br><br><br>On 26/11/2012 12:40, Westgård Trond wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span lang=EN-US>In our application “MapHandler” that heavily relies on the geotoolkit “Display swing widgets”-module we get an error that did not occur in earlier versions of geotoolkit.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>It could be caused by error in our own code since we have done some rewriting, but I have a suspicion to the JPropertyDialog class.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>In our example we want to change the colors of the polygons in a FeatureMapLayer. We opens the JSimpleStylePanel dialog and change the color (to red in this case) – see below.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>The problem comes when the “Apply”-button is pressed. The action is trigged but the variable activePanel is null. The peculiar thing is that at first the activePanel is set to a correct value and then to null and of course when activePanel is not referening a JSimpleStylePanel then the “apply” method in that class is not performed and then nothing happens in the MapLayer.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Any hints would be appreciated !!</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Best Regards</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Trond</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p><p class=MsoNormal><img width=370 height=264 id="Picture_x0020_1" src="cid:image001.jpg@01CDD6DE.9F841650"><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><img width=789 height=484 id="Picture_x0020_2" src="cid:image002.jpg@01CDD6DE.9F841650"><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Trond Westgård</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Senior Engineer</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-US>Institute of Marine Research</span><o:p></o:p></p><p class=MsoNormal>Bergen, Norway<o:p></o:p></p><p class=MsoNormal><a href="mailto:trondwe@imr.no">trondwe@imr.no</a><o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><br><o:p></o:p></span></p><pre>_______________________________________________<o:p></o:p></pre><pre>Geotoolkit mailing list<o:p></o:p></pre><pre><a href="mailto:Geotoolkit@lists.osgeo.org">Geotoolkit@lists.osgeo.org</a><o:p></o:p></pre><pre><a href="http://lists.osgeo.org/mailman/listinfo/geotoolkit">http://lists.osgeo.org/mailman/listinfo/geotoolkit</a><o:p></o:p></pre></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p></div></body></html>