EzVarDouble and input

19 views
Skip to first unread message

John leger

unread,
Oct 8, 2014, 6:17:31 AM10/8/14
to icy-so...@googlegroups.com

Hi,

I'm using EzVarDouble to get some informations and from the first tests, people would like two things:

   1. Use dot instead of comma when they give a value, because writing with a dot 0.5 -> 0,0 is like doing nothing after the comma.

   2. When they use little values like 0.001, EzVarDouble show 0 that is confusing.


Do you have any idea ?

Alexandre Dufour

unread,
Oct 13, 2014, 5:40:28 AM10/13/14
to icy-so...@googlegroups.com
Hi John,

I’ve finally found (and fixed!) the precision issue with EzVarDouble components backed by a spinner component. For this interested, Swing fixes the precision of their JSpinner components by default, and it took me quite some time to dive in the code and find this one. Let me know if the fix works on your side. Later on (i.e. when we have time), we plan to add support for scientific notation as well (xE-y), which would be quite useful for some ppl I know dealing with 1e-17 (quite a few zeros).

As for the dot notation, this is dependent on the system/app locale: on a French system/app you have to use a comma, and a dot on many others. We could enforce a general setting in the application, but since this locale-related issue is identical in other software (Excel is a blatant illustration), this might confuse other users.

Alexandre


--
You received this message because you are subscribed to the Google Groups "Icy imaging" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icy-software...@googlegroups.com.
To post to this group, send email to icy-so...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/icy-software/f286228d-7c2a-48cc-b821-ee06ccfcf466%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John leger

unread,
Oct 13, 2014, 4:08:01 PM10/13/14
to icy-so...@googlegroups.com
Hi,

Thanks for that !

I have a good news for you: scientific notation is already working, you just have to write like 1E-2 and it will be converted in 0,01. but 1e2 does not work (just use E instead of e).

And for the Local I will use this solution: adding "-Duser.language=en -Duser.country=US" to icy launch parameters.

Alexandre Dufour

unread,
Oct 13, 2014, 4:16:50 PM10/13/14
to icy-so...@googlegroups.com
Great news indeed! I have to admit I never tried capital 'E' and was content moaning about the 'e' not working :)

For the locale, let's see if Stephane can add this as an option in the Preferences menu. That would be useful I believe. 

Many thanks and good luck for your upcoming "big" release. Not to put any pressure, but I was at a meeting last week and ppl couldn't stop talking about it. That's some buzz effect. But no pressure ;)

Alexandre

Jonathan Leger

unread,
Oct 13, 2014, 4:46:30 PM10/13/14
to icy-so...@googlegroups.com
That's what I understood...

If never: while I was searching, I found how to set Locale.

But as it was more for Icy than me.

--
You received this message because you are subscribed to a topic in the Google Groups "Icy imaging" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/icy-software/Ed4JOfXDt1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to icy-software...@googlegroups.com.

To post to this group, send email to icy-so...@googlegroups.com.

John leger

unread,
Oct 14, 2014, 6:45:39 AM10/14/14
to icy-so...@googlegroups.com
Ahh and one last thing...

There was a strange comportment in eZplug:

For example with an EzVarDouble if I try to setEnable(False), the name is shown as disabled but I can still change the value and I think it should not be possible. If I try to get the value I will have the value I just entered.

What do you think ?

Alexandre Dufour

unread,
Oct 14, 2014, 9:26:40 AM10/14/14
to icy-so...@googlegroups.com
Strange, it seems to work on my side…

Does it invalidate just the name and not the input component?
How do you add the EzVarDouble to your interface? via the addEzComponent(..) method?

The best would be for you to send me a very short sample code of how you create the variable and call setEnabled(false)


-- 
You received this message because you are subscribed to the Google Groups "Icy imaging" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icy-software...@googlegroups.com.
To post to this group, send email to icy-so...@googlegroups.com.

John leger

unread,
Oct 14, 2014, 10:26:55 AM10/14/14
to icy-so...@googlegroups.com
Yes only the name is invalidate, the input is still good.
Just doing that is enough:

protected void initialize() {
        EzVarDouble a = new EzVarDouble("Salut");
        a.setEnabled(false);
        addEzComponent(a);
}

And I'm extending EzPlug.

I have a fresh installation since this morning and it's still the same.



Le mercredi 8 octobre 2014 12:17:31 UTC+2, John leger a écrit :

Alexandre Dufour

unread,
Oct 14, 2014, 11:11:23 AM10/14/14
to icy-so...@googlegroups.com
I believe the addEzComponent() line should appear before setEnabled(false), because the component must be registered to the GUI before you can trigger such events on it.
Let me know if that works.

-- 
You received this message because you are subscribed to the Google Groups "Icy imaging" group.
To unsubscribe from this group and stop receiving emails from it, send an email to icy-software...@googlegroups.com.
To post to this group, send email to icy-so...@googlegroups.com.

John leger

unread,
Oct 14, 2014, 11:35:48 AM10/14/14
to icy-so...@googlegroups.com
In theory it should not change if I do it before or after I think, and in our case it does not change anything: I still can change the value.

But if I create a button to disable the EzVarDouble it will work as expected.

So doing the setEnable in the Initialize() is the reason why it doesn't work for me.

Strange, I have no ideas why ...

Le mercredi 8 octobre 2014 12:17:31 UTC+2, John leger a écrit :
Reply all
Reply to author
Forward
0 new messages