[geotk] Error in "Display swing widgets" StylePanel dialog ?

johann sorel johann.sorel at geomatys.com
Wed Dec 12 00:49:49 PST 2012


Hello trond,

I fixed this problem about two weeks ago
commit : 
http://hg.geotoolkit.org/geotoolkit-pending/changeset/5eab43f5c87fa17a8a223fa0a11e38b43f26e099

maybe I didn't solve the right one.
Could you post the stack trace ?

johann

On 10/12/2012 13:59, Westgård Trond wrote:
>
> Hi Johann,
>
> I am now back in office and I have tried to retest the latest version 
> (snapshot) of geotoolkit-pending.
>
> 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".
>
> The code fragment where I have the breakpoint is shown below:
>
> Best Regards
>
> Trond
>
> /**
>
> * Property panel
>
> *
>
>  * @author Johann Sorel
>
> * @module pending
>
> */
>
> public class JPropertyDialog extends JDialog{
>
>     private JButton apply = new 
> JButton(MessageBundle.getString("property_apply"));
>
> private JButton revert = new 
> JButton(MessageBundle.getString("property_revert"));
>
> private JButton close = new 
> JButton(MessageBundle.getString("property_close"));
>
>     private JTabbedPane tabs = new JTabbedPane();
>
>     private PropertyPane activePanel = null;
>
>     private ArrayList<PropertyPane> panels = new 
> ArrayList<PropertyPane>();
>
>     /** Creates a new instance of ASDialog */
>
> private JPropertyDialog(final boolean modal,final boolean app, final 
> boolean rev, final boolean clo) {
>
> super();
>
> setModal(modal);
>
> setTitle(MessageBundle.getString("property_properties"));
>
>         JToolBar bas = new JToolBar();
>
> bas.setFloatable(false);
>
> bas.setLayout(new FlowLayout(FlowLayout.RIGHT));
>
>         if(app)bas.add(apply);
>
> if(rev)bas.add(revert);
>
> if(clo)bas.add(close);
>
>         apply.setIcon(IconBundle.getIcon("16_apply"));
>
> revert.setIcon(IconBundle.getIcon("16_reload"));
>
> close.setIcon(IconBundle.getIcon("16_close"));
>
>         tabs.addChangeListener(new ChangeListener() {
>
> @Override
>
> public void stateChanged(ChangeEvent e) {
>
> activePanel = (PropertyPane)tabs.getSelectedComponent();
>
> }
>
> });
>
>         apply.addActionListener(new ActionListener() {
>
> @Override
>
> public void actionPerformed(ActionEvent e) { // HERE THE activePanel 
> is null ???????????????
>
> if(activePanel != null){
>
>                    activePanel.apply();
>
> }
>
> }
>
> });
>
> *From:*geotoolkit-bounces at lists.osgeo.org 
> [mailto:geotoolkit-bounces at lists.osgeo.org] *On Behalf Of *johann sorel
> *Sent:* 26. november 2012 14:12
> *To:* geotoolkit at lists.osgeo.org
> *Subject:* Re: [geotk] Error in "Display swing widgets" StylePanel 
> dialog ?
>
> Hello Trond,
>
> I will have a look at it, I don't think it will be long.
>
> johann
>
>
> On 26/11/2012 12:40, Westgård Trond wrote:
>
>     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.
>
>     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.
>
>     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.
>
>     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.
>
>     Any hints would be appreciated !!
>
>     Best Regards
>
>     Trond
>
>     Trond Westgård
>
>     Senior Engineer
>
>     Institute of Marine Research
>
>     Bergen, Norway
>
>     trondwe at imr.no <mailto:trondwe at imr.no>
>
>
>
>
>     _______________________________________________
>
>     Geotoolkit mailing list
>
>     Geotoolkit at lists.osgeo.org  <mailto:Geotoolkit at lists.osgeo.org>
>
>     http://lists.osgeo.org/mailman/listinfo/geotoolkit
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20121212/2d1cd64e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 13895 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20121212/2d1cd64e/attachment-0002.jpe>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 55602 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20121212/2d1cd64e/attachment-0003.jpe>


More information about the Geotoolkit mailing list