Hi Eric,

Thanks for your answer and your correction (sorry for the line number, I checked it a little bit too fast).

There are two problems with the null values and the NPE:
- if some values of an attribute are null, and click the OK button, then a NPE appears, - if the layer doesn't contain any attributes and click the OK button, then a NPE appears.
Thanks to remind me with this one. I forgot it.
In the first case, you proposed three different options. What do you think about the option to add a check box or a combo box to ask users how they want to consider null values, either "ignore it" or "interpret as 0"? Therefore, users could have the choice and they could know how all values, even the null ones, are processed.
Would probably be the best choice. Not the simplest.
If I find time for a fix, I suggest to add a radiobutton group with both options instead of adding a new popup dialog.
In the second case, OJ developers don't have the possibility to disable the OK button. Sometimes it could be useful. There is also another possibility: to improve the LayerManager by adding a new getter which allows to get only the layers with at least one attribute (except the FID one). We can also imagine to have these two possibilities.
First option would be possible, but I think it would need a warning (a dialog with just a cancel button may seem strange for the user). Second option seems better. We could change LayerManager (layers with at least one "numeric" attribute would be necessary), but we can also manage it in the MultiInputDialogBox, by adding a addLayerWithNumericFieldsComboBox, or better, a addEnabledLayerComboBox(EnableCheck check) which could take any constraint on the FeatureSchema.

Michaël

I don't know what the best option is. What do you think about it?

Cheers,
Eric

2010/11/2 Michaël Michaud <michael.mich...@free.fr <mailto:michael.mich...@free.fr>>

    Hi Eric,

    Thanks for the bug report.
    It's fixed and will be available in the next NB
    (acually, the bug was in the Layer ComboBox listener, near line 235)

    As it seems that you are using statistic plugins, I submit to you
    and others a question about how to handle null values in this plugin.
    Currently, it throws NPE :-( .
    Different options are :
    - interpret null values as 0 for integers or 0.0 for double (not
    so good but easy)
    - catch the exception (or check for null/NaN values before) and
    throw a better message than NPE
    - do the statistics ignoring every feature having a null value

    Michaël

    Le 02/11/2010 19:41, Eric Grosso a écrit :
    Hi all,

    I found a very little bug to correct in the ClassifyAttributes
    Plugin:
    org.openjump.core.ui.plugin.tools.statistics.ClassifyAttributesPlugin

    If we select a layer without any attributes, the GUI dialog
    doesn't allow to select an attribute:
    it is logical. But after that, if we select another layer which
    contains some attributes, the attribute
    selection is still disabled.

    To correct this bug, the line 218:
    if(listNumAttributes.size()==0)jcb_attribute.setEnabled(false);

    should be replaced with:

    if(listNumAttributes.size()==0){
                 jcb_attribute.setEnabled(false);
    } else {
                 jcb_attribute.setEnabled(true);
    }

    Moreover, as it is allowed to click on the OK button even if
    there is no attribute to deal with.
    Indeed, it is impossible to disable this button due to the fact
    that the OKCancelPanel is not
    "gettable" from a MultiInputDialog. Therefore, an information or
    error message should be
    provided to users to ask them to choose/process a layer which
    contains at least one attribute
    (test in the run method ). If not, it provides a message error
    with a "null exception" error.

    Cheers,
    Eric


    
------------------------------------------------------------------------------
    Nokia and AT&T present the 2010 Calling All Innovators-North America contest
    Create new apps&  games for the Nokia N8 for consumers in  U.S. and Canada
    $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
    Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
    http://p.sf.net/sfu/nokia-dev2dev


    _______________________________________________
    Jump-pilot-devel mailing list
    Jump-pilot-devel@lists.sourceforge.net  
<mailto:Jump-pilot-devel@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel


    
------------------------------------------------------------------------------
    Nokia and AT&T present the 2010 Calling All Innovators-North
    America contest
    Create new apps & games for the Nokia N8 for consumers in  U.S.
    and Canada
    $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
    marketing
    Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi
    Store
    http://p.sf.net/sfu/nokia-dev2dev
    _______________________________________________
    Jump-pilot-devel mailing list
    Jump-pilot-devel@lists.sourceforge.net
    <mailto:Jump-pilot-devel@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel



------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment.   Learn More!
http://p.sf.net/sfu/hpdev2dev-nov


_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to