Re: Ways to cancel SwingWorker running task

2011-07-12 Thread neugens.limasoftw...@gmail.com
I fear you may have an architectural problem here.

You probably just need to wrap the library you are using into a more high level 
one that can deal with interruption.

Thread.stop is a bad idea in general, beside, it will not help if the library 
itself for some reason tries to be "uninterruptible".

Please, refer to this very good page for more information:

http://download.oracle.com/javase/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html

The article that Roman posted is also one of my favourite on the subject.

Cheers,
Mario 
-- 
Sent from HTC Desire...

pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

http://www.icedrobot.org

Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/


- Reply message -
Da: "ximalaya" 
Data: mer, lug 13, 2011 01:49
Oggetto:  Ways to cancel SwingWorker running task
A: "Paulo Levi" 
Cc: 


Hi Paulo,
Thanks! Agree with you.
While sometimes we need to use 3rd party libraries which are out of our 
control...


Thanks,
Xmly
At 2011-07-13 07:36:22,"Paulo Levi"  wrote:

Every task can be interruptible... if you check regularly. Even inputstreams 
can be interruptible if you have a wrapper bufferinputstream that checks for 
the interrupt status.




Re: [OpenJDK 2D-Dev] hg: jdk8/2d/jdk: 51 new changesets

2011-08-19 Thread neugens.limasoftw...@gmail.com
Very good, thanks!

Mario
-- 
Sent from HTC Desire...

pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

http://www.icedrobot.org

Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/


- Reply message -
Da: "Pavel Porvatov" 
Data: ven, ago 19, 2011 13:04
Oggetto:   [OpenJDK 2D-Dev] hg: jdk8/2d/jdk: 51 new 
changesets
A: "Artem Ananiev" 
Cc: "Mario Torre" , , 
"2d-dev" <[email protected]>, , 



Hi all,
>
> On 8/18/2011 10:45 PM, Mario Torre wrote:
>> 2011/8/18:
>>> Changeset: 34fdcdb70d20
>>> Author:rupashka
>>> Date:  2011-07-28 18:13 +0400
>>> URL:   http://hg.openjdk.java.net/jdk8/2d/jdk/rev/34fdcdb70d20
>>>
>>> 6995769: occasion NPE thrown from SwingUtilities.computeIntersection()
>>> Reviewed-by: alexp
>>>
>>> ! src/share/classes/javax/swing/RepaintManager.java
>>
>> I resend, as my phone messed up the message:
>>
>> I though we discussed on the list this changeset and agreed it was not
>> a correct fix, or do I miss something?
>
> The fix is already integrated and cannot be reverted. This 
> notification on the 2d-dev alias is caused by a synchronization 
> between AWT/Swing, JDK8 master and Java2D workspaces.
>
> The only way to revisit the fix is to file a new bug and commit 
> another changeset using this new bug ID, that's the process - as Pavel 
> said, it's in his TODO list for JDK8.
I've filed CR 7081010 (The fix of CR 6995769 should be revisited). After 
some time it will be visible at bugs.sun.com and anybody will be able to 
trace it...

Regards, Pavel


Re: Is the following code supposed to leak?

2011-08-24 Thread neugens.limasoftw...@gmail.com
The vm doesn't terminate.

One VM to rule them all: the instances are separated via the appcontext, but 
there is just one server vm running.

Cheers,
Mario
-- 
Sent from HTC Desire...

pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

http://www.icedrobot.org

Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/


- Reply message -
Da: "Pavel Porvatov" 
Data: mer, ago 24, 2011 12:57
Oggetto:  Is the following code supposed to leak?
A: "Clemens Eisserer" 
Cc: 


Hi Clemens,
> Hi Pavel,
>
> In common case you shouldn't remove listeners of course. But in
> your case you must remove listeners because of editor is shared
> between all JTextComponents (see javadoc of the
> JTextComponent#getActions method and BasicTextUI#getEditorKit
> implementation). So you added listeners not to a JTextComponent
> instance, but to the shared editor.
>
>
> Thanks a lot for clarification, I wasn't sure this behaviour is 
> intended :/
> Seems I have to adopt the jfc-demo Notepad to not leak memory when 
> running on caciocavallo-web ;)
I took a look at the Notepad demo and didn't find any problems. It adds 
listeners only when the demo starts and there is no need to remove 
listeners, because the demo closes via System.exit(0). Could you please 
explain how did you get memory leak in the demo?

Regards, Pavel


Re: Is the following code supposed to leak?

2011-08-25 Thread neugens.limasoftw...@gmail.com
I don't see any reason why this is a problem, I believe in this case specific 
case is swing leaking.

Mario
-- 
Sent from HTC Desire...

pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

http://www.icedrobot.org

Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/


- Reply message -
Da: "Clemens Eisserer" 
Data: gio, ago 25, 2011 21:20
Oggetto:  Is the following code supposed to leak?
A: 

Hi Pavel,

So if your SecurityManager denies app closing, then the application should
> be alive. It looks that your implementation contradicts javadoc contracts.
>

The app stays running for as long as the client's browser window is open -
and is terminated when the assicioated HttpSession times out.
This is when we dispose the AppContexts, which closes this one app
"instance".



>  Besides, I find it a bit weird that addXZYListener() secretly registers
>> listener to some sort of internal global object. That sounds very leaky.
>> Is it documented that such listeners must always be carefully removed?
>> Or am I missing something?
>>
> As I said normally listeners shouldn't be removed manually, until this
> listeners are added to static instances (or delegates). The
> JTextComponent#getActions method invoked on non-static object, but it uses
> inside static editor kit. So listener removing depends on implementation and
> programmers should take such nuances into account.
>

I think what Roman ment is wether this is documented somewhere - I couldn't
find out why the code leaked until I had a look at Swing's source.
I find the current API quite unintuitive - I register a listener to a
JTextArea's editor, which sends me events just for this one JTextArea, and
jet its added to some global state. From what I have seen the editors are
mostly a bunch of state-less code, except for the Actions defined.

Any compatibility-issues in mind re-working that area, making the actions
part of the JComponent's state?

Thanks, Clemens


Re: Focus on image icons are not visible in javaws cache with high contrast mode

2011-09-05 Thread neugens.limasoftw...@gmail.com
Hi!

The patch looks good to me, although I don't have the context at hand now to 
check about the control text colour, for this reason I think it would be better 
to send patch requests with a webrew next time.

What I wonder is what happens when one selects a different colours for the 
control text in windows (if this is possible) then this would be reflected as 
focus colour, which I don't know if it's what windows original laf does.

Btw, It seems to me that this bug could be reproducible also without caching an 
app in the first place.

Cheers,
Mario
-- 
Sent from HTC Desire...

pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

http://www.icedrobot.org

Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/


- Reply message -
Da: "Sean Chou" 
Data: lun, set 5, 2011 09:03
Oggetto:  Focus on image icons are not visible in javaws cache with 
high contrast mode
A: 

Hi all,
   The WindowsLookAndFeel uses hard coded focus color(black) which makes the
focus
not visible within High Contrast Mode on windows.

The problem can be reproduced as follows:
1. Run one javaws application.
2. Go to "Control panel -->Accessibility options --> the Display tab" .
3. Select "Use high Contrast". Click on "Settings" button and ensure that
"High contrast black(extra language)" in the color scheme.
4. Make sure that you have one jnlp imported in java cache viewer.(The 1st
step did.)
5. Run the following command to invoke java cache viewer
>>javaws -viewer
6. Select "Applications" in show combo box.
7. Select the any application present in java cache viewer.
8. Now, using Tab key to go to icons present in java cache viewer.(i.e Run
icon, Show icon etc..)

Observed result:
Focus will not be visible on focused image icons.
Expected result:
Focus should be visible on focused image icons.


The solution is Changing the hard coded focus color to proper loaded color
in WindowsLookAndFeel.java .
The attachment is a patch for it.

Any comment please ?

-- 
Best Regards,
Sean Chou






Re: A proposal for a behavior change about mnemonic key

2011-10-08 Thread neugens.limasoftw...@gmail.com
I believe that native look and feel should mandate the different  keybindings, 
the cross platform look and feel should behave in a specified way, that doesn't 
need to be necessarily the same as the underlying platform, although this 
should be user configurable in a property though (perhaps saved in the 
preferences), because it's indeed an area if great confusion for the users.

Mario

- Reply message -
Da: "Pavel Porvatov" 
Data: sab, ott 8, 2011 04:35
Oggetto:  A proposal for a behavior change about mnemonic key
A: 
Cc: "[email protected]" 


Hi Sean,
> Hi Pavel,
>
>Your observation is right, but I can't agree with the conclusion. 
> Windows and
> GTK behave differently about how to close an opened menu. Under GTK, press
> "alt" can not close an opened menu, so, the "esc" is used to close it; 
> while
> windows performs more friendly, when mnemonic key is pressed again, 
> the first
> opened menu is closed automatically. This is totally about how to 
> close an
> opened menu, and it doesn't change the fact that menus with same mnemonic
> key are iterated.
>
>On the other side, swing implementation doesn't follow GTK's 
> behavior about
> how to close the menu at all. Open the swingset2 and you can find its 
> behavior
> is the same with windows. Press "alt+f" and then press "alt+l" will 
> open the
> "look and feel" menu instead of GTK's "alt+f", "esc", and "alt+l".
>
>So, I think GTK's behavior about "use esc to close an opened menu" 
> is not
> user friendly and we can ignore it, while GTK's "iterate over menus 
> with same
> mnemonic key" is better than current java implementation and we can add
> this feature. And if a user wants to use GTK's key sequence "alt+f", 
> "esc",
> "alt+l", it is also functional.
>
>So I think this enhancement will help keep the behavior same with 
> both these
> platforms, how do you think?
Sounds reasonable and I don't object now to the decision. Does anybody 
have ideas (e.g. objections) about the new functionality?

I glanced at your patch and have the following comments:
1. Could you please file CR about the problem
2. A test is needed (I think it's possible to write an automatic one)
3. Could you please correct the new code to obey our code standards 
(aligning, spacing, mandatory braces in if/else conditions and others)

If possible send patch as a webrev, please.

Thanks, Pavel

>
> 2011/9/21 Pavel Porvatov  >
>
> Hi Sean,
>
> I found out that Windows and GTK works in different ways (I used
> your apps):
>
> 1. When Alt+i is pressed several times:
> In Windows focus moves between items
> In Ubuntu focus stays at the initially selected item
>
> 2. When sequence Alt+i and Escape pressed several times
> In Windows the first menu item is selected
> In Ubuntu after every sequence the next item is selected
>
> In such case we should use different strategies for different
> platforms...
>
>
> Regards, Pavel
>
>> Hi Pavel,
>>
>> I just tested linux gtk platform.  With gtk2+, ubuntu linux
>> with kernel 2.6.38, xfce, x86_32.
>> I set four menus with mnemonic "i". Press "alt+i" will travel
>> through four menus. The difference
>> is that each menu must be closed with "esc" before "alt+i" opens
>> the next one.
>>
>> So press "alt+i" opens "File", and press "esc" to close it;
>> then press "alt+i" opens "Edit", and press "esc" to close it;
>> ... for next menu with mnemonic "i"
>>
>> I attached the test application and its ui file. If it is
>> blocked, please use
>> this link:
>> 
>> https://docs.google.com/leaf?id=0B8kRxsymP7imOGU1NjhiM2ItMGQ5Ni00NWNhLWJmMDQtZjZiZmQzN2U4ZGUw&hl=en_US
>> 
>> 
>>
>> Ubuntu x86_32 should work.
>>
>>
>> So, I think both windows and linux gtk have supported traversal
>> of same mnemonic keyed
>> items already.
>>
>>
>> 2011/9/14 Pavel Porvatov > >
>>
>> Hi Sean,
>>> Hi Pavel,
>>>
>>> Let's see if this time works. The attachement just
>>> contains the exe file written by C#, the application is very
>>> simple, I just drag a menu to the default WinForm in VS2003.
>>> Please change the extension from exe1 to exe after unzip
>>> as gmail doesn't allow exe file to be sent.
>> Yes, I see. And what about other platforms/lafs? Your patch
>> affects behavior of all lafs. So we must be sure, that such
>> behavior is correct for every supported platform...
>>
>> Regards, Pavel
>>
>>>
>>> 2011/9/13 Pavel Porvatov >> >
>>>
>>> Hi Sean,
>>>
>>> I think the attached sample was removed because I didn't
>>> get any attachments...
>>>
>

Re: Add Look&Feel support for AIX platform

2011-11-28 Thread neugens.limasoftw...@gmail.com
The change looks good to me as well.

Cheers,
Mario

Inviato da HTC

- Reply message -
Da: "Deven" 
Data: mar, nov 29, 2011 02:55
Oggetto:  Add Look&Feel support for AIX platform
A: "Neil Richards" 
Cc: "Java Core Libs" , 
, 


On 10/20/2011 11:10 PM, Neil Richards wrote:
> On Tue, 2011-10-18 at 15:53 +0800, Sean Chou wrote:
>> Hi all,
>>
>>
>>  This is a simple patch to add LookAndFeel support for AIX platform
>> to help bring
>> up GUI application.
>>
>>
>>  This is part of the series of AIX patches.
>> -- 
>> Best Regards,
>> Sean Chou
>>
>>
> For ease of review, I've uploaded this suggested fix as a webrev [1].
>
> The change looks good to me.
>
> Regards, Neil
>
> [1] http://cr.openjdk.java.net/~ngmr/ojdk-167/webrev.00/index.html
Hello, any more comments on this topic?