Re: Possible regressionn, popupmenus not appearing to work correctly with cntl-click

2013-10-31 Thread Leonid Romanov
I see.. While it might pose an inconvenience in some scenarios on OS X, I don't 
think it's an issue, since Apple JDK 6 behaves the same way, so I'm going to 
close the bug.

On 29.10.2013, at 15:14, Paul Taylor  wrote:

> On 28/10/2013 12:29, Leonid Romanov wrote:
>> Hello,
>> I've filed a bug:
>> https://bugs.openjdk.java.net/browse/JDK-8027374
>> 
> Hi, Ive think Ive found the issue for me , I created this test case and it 
> works correctly as you say
> 
> import javax.swing.*;
> 
> public class TableTest
> {
> public static void main(String[] args) throws Exception
> {
> JPopupMenu popup = new JPopupMenu("Popup");
> popup.add(new JMenuItem("Copy"));
> JTable test = new JTable(5,5);
> test.setComponentPopupMenu(popup);
> test.setRowSelectionAllowed(true);
> test.setColumnSelectionAllowed(true);
> 
> UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
> JFrame frame = new JFrame();
> frame.add(test);
> frame.pack();
> frame.setVisible(true);
> }
> }
> 
> But if you comment out the line
> 
> test.setComponentPopupMenu(popup);
> 
> so that there is no popup menu then it doesn't work, CntlClick will change 
> the selection.
> 
> Whether this is a bug, or correct behaviour Im not sure  ?
> 
> But the reason why this is causing an issue for me in my current code is that 
> Im not using setComponentPopupMenu()instead I'm adding a mouse handler  to 
> the table that then decides whether or not to show a popup menu so I guess 
> the logic for Jtable must not detect that it has a popup menu in this case. 
> I've checked and the method was not added to JTable until Java 1.5 and my 
> code was started before then so hopefully I can just update my code to  use 
> the method and the problem will go away for me.
> 
> Paul
> 
> 



Re: Possible regressionn, popupmenus not appearing to work correctly with cntl-click

2013-10-31 Thread Paul Taylor

On 31/10/2013 11:11, Leonid Romanov wrote:
I see.. While it might pose an inconvenience in some scenarios on OS 
X, I don't think it's an issue, since Apple JDK 6 behaves the same 
way, so I'm going to close the bug.


Okay no problem, I now have it working for me since using 
setComponentPopup(). The only thing I would say is that is if Cntl-Click 
is meant to work the same as Right-Click on OSX in all situations it 
does seem there is a minor issue that it breaks my old code but this is 
no longer a problem for me.


On 29.10.2013, at 15:14, Paul Taylor > wrote:



On 28/10/2013 12:29, Leonid Romanov wrote:

Hello,
I've filed a bug:
https://bugs.openjdk.java.net/browse/JDK-8027374

Hi, Ive think Ive found the issue for me , I created this test case 
and it works correctly as you say


import javax.swing.*;

public class TableTest
{
public static void main(String[] args) throws Exception
{
JPopupMenu popup = new JPopupMenu("Popup");
popup.add(new JMenuItem("Copy"));
JTable test = new JTable(5,5);
test.setComponentPopupMenu(popup);
test.setRowSelectionAllowed(true);
test.setColumnSelectionAllowed(true);
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
JFrame frame = new JFrame();
frame.add(test);
frame.pack();
frame.setVisible(true);
}
}

But if you comment out the line

test.setComponentPopupMenu(popup);

so that there is no popup menu then it doesn't work, CntlClick will 
change the selection.


Whether this is a bug, or correct behaviour Im not sure  ?

But the reason why this is causing an issue for me in my current code 
is that Im not using setComponentPopupMenu()instead I'm adding a 
mouse handler to the table that then decides whether or not to show a 
popup menu so I guess the logic for Jtable must not detect that it 
has a popup menu in this case. I've checked and the method was not 
added to JTable until Java 1.5 and my code was started before then so 
hopefully I can just update my code to  use the method and the 
problem will go away for me.


Paul








Default heap memory size allocated with Java 7 on OSX

2013-10-31 Thread Paul Taylor
How does Java 7 decide on the max value of heap memory allocated (-Xmx) 
if not specified on an OSX bundle, I've read the manual page and it gave 
no indication. It seems to be allocated more than the default on Java 6 
and I wonder if it varies with the memory available on the machine, that 
would be very useful to me because my application is memory bound, but I 
cannot set the default too high because then the application would fail 
to run at all on lower specification machines.


Paul


Re: Possible regressionn, popupmenus not appearing to work correctly with cntl-click

2013-10-31 Thread Robert Krüger
On Thu, Oct 31, 2013 at 12:11 PM, Leonid Romanov
 wrote:
> I see.. While it might pose an inconvenience in some scenarios on OS X, I 
> don't think it's an issue, since Apple JDK 6 behaves the same way, so I'm 
> going to close the bug.

yes, I have run into this as well already with Apple's JDK 6 and have
yet to see an explanation why it is not a bug there already. In some
situations one will have to reorganize code in a hackish way, e.g.
when the menu is based on the current selection, when using
setComponentPopup() one would have to remove/add menu items in an
overridden setVisible method or something like that.


Re: Where Can I Find the Javadocs for Apple Extensions?

2013-10-31 Thread Sergey Bylokhov

Hi, Will.
You can find your bug here:
https://bugs.openjdk.java.net/browse/JI-9007897

On 31.10.2013 0:37, Will Herrmann wrote:

I filed a bug using the link you provided and received an e-mail back saying that it was accepted 
as bug #9007897. However, when I try to search for it in the bug database, I am told "This bug 
is not available. More information is available here." Clicking on the word "here" 
brings me to a blank page. So I'm not sure what I did wrong or if there are internal server 
problems with the bug database.

-Will Herrmann

On Oct 30, 2013, at 10:20 AM, Sergey Bylokhov wrote:


Hi, Will.
I suggest to file a bug for this at http://bugreport.sun.com/bugreport

As a workaround you can generate javadoc ourself from the source code:
http://hg.openjdk.java.net/jdk8/awt/jdk/file/db2838f25a85/src/macosx/classes/com/apple/eawt

On 30.10.2013 0:41, Will Herrmann wrote:

A while back, I'd asked if Java 7 and onwards would continue to include the 
Apple Extensions (e.g. com.apple.eawt). I was told that they would indeed 
remain, but I don't think I ever got an answer about where I can find the 
Javadocs for them. They used to be hosted on Apple's website (at 
http://bit.ly/1939ShE), but it now results in a Page Not Found error. The 
OpenJDK site doesn't seem to have them and they're not in the standard Java 7 
Javadocs either. Where can I find these Javadocs?
  Thanks in Advance,
-Will Herrmann


--
Best regards, Sergey.




--
Best regards, Sergey.



Re: Where Can I Find the Javadocs for Apple Extensions?

2013-10-31 Thread Will Herrmann
I had filed the bug report on bugs.sun.com, but I see that it's now on 
bugs.openjdk.com, so that may have been part of my confusion. Thanks for 
providing me with the info and for fixing my bug report.

-Will Herrmann

On Oct 31, 2013, at 8:18 AM, Sergey Bylokhov wrote:

> Hi, Will.
> You can find your bug here:
> https://bugs.openjdk.java.net/browse/JI-9007897
> 
> On 31.10.2013 0:37, Will Herrmann wrote:
>> I filed a bug using the link you provided and received an e-mail back saying 
>> that it was accepted as bug #9007897. However, when I try to search for it 
>> in the bug database, I am told "This bug is not available. More information 
>> is available here." Clicking on the word "here" brings me to a blank page. 
>> So I'm not sure what I did wrong or if there are internal server problems 
>> with the bug database.
>> 
>> -Will Herrmann
>> 
>> On Oct 30, 2013, at 10:20 AM, Sergey Bylokhov wrote:
>> 
>>> Hi, Will.
>>> I suggest to file a bug for this at http://bugreport.sun.com/bugreport
>>> 
>>> As a workaround you can generate javadoc ourself from the source code:
>>> http://hg.openjdk.java.net/jdk8/awt/jdk/file/db2838f25a85/src/macosx/classes/com/apple/eawt
>>> 
>>> On 30.10.2013 0:41, Will Herrmann wrote:
 A while back, I'd asked if Java 7 and onwards would continue to include 
 the Apple Extensions (e.g. com.apple.eawt). I was told that they would 
 indeed remain, but I don't think I ever got an answer about where I can 
 find the Javadocs for them. They used to be hosted on Apple's website (at 
 http://bit.ly/1939ShE), but it now results in a Page Not Found error. The 
 OpenJDK site doesn't seem to have them and they're not in the standard 
 Java 7 Javadocs either. Where can I find these Javadocs?
  Thanks in Advance,
 -Will Herrmann
>>> 
>>> -- 
>>> Best regards, Sergey.
>>> 
> 
> 
> -- 
> Best regards, Sergey.
> 



Re: [8] Review request for 8011059 [macosx] Make JDK demos look perfect on retina displays

2013-10-31 Thread Alexander Scherbatiy


 Could you review the updated fix:
   http://cr.openjdk.java.net/~alexsch/8011059/webrev.04/

   The reflection is used to skip the Image.getScaledInstance() method 
call if it is not overridden by a user.


On 10/29/2013 11:08 PM, Sergey Bylokhov wrote:

Hi, Alexander.
The fix looks fine to me in general. But there is at least one issue. 
I build you fix and test it:

 - Consuming of cpu increased by 500 times Java2Demo on images tab.
 - FPS is dropped from 220(jdk8)/35(jdk7u40) to 15 in guimark2. Note 
that jdk6 has the same FPS(15) on my system.


   The main problem is that the Image.SCALE_DEFAULT hint is used to 
retrieve a scaled image from Image.getScaledInstance() method.
   It always uses the ReplicateScaleFilter for images which 
getScaledInstance() method has not been overridden.
   The ReplicateScaleFilter creates a lot of arrays and consumes the 
CPU during the image parsing.


   The better fix would be to introduce the new Image.SCALE_CUSTOM hint 
which could be used to get a scaled image and does not use filters by 
default.

   But it should be a separated bug with a new CCC request.

  Thanks,
  Alexandr.



On 29.10.2013 20:45, Alexander Scherbatiy wrote:


  Could you review the updated fix:
http://cr.openjdk.java.net/~alexsch/8011059/webrev.03

On 10/28/2013 2:33 PM, Artem Ananiev wrote:

Hi, Alexander,

a few comments:

1. SunGraphics2D.java:3076 - should isHiDPIImage() be used here?
 The isHiDPIImage() method is used to check that the 
drawHiDPIImage should be called like:

if (isHiDPIImage(img)) {
return drawHiDPIImage(...);
}

2. I'm not sure that the proposed getScaledImageName() 
implementation in ScalableToolkitImage works perfectly for URLs like 
this:


  http://www.exampmle.com/dir/image

In this case it will try to find 2x image here:

  http://www.exam...@2x.com/dir/image

which doesn't look correct.

   Fixed. Only path part of a URL is converted to path2x.

3. RenderingHints spec references Retina or non-Retina displays, 
which should be removed.

   Fixed.

- devScale is used instead of transform parsing in the 
drawHiDPIImage() method just to not have performance regression more 
than 2 times on HiDPI displays
- LWCToolkit.ScalableToolkitImage is made public for the fix 
8024926 [macosx] AquaIcon HiDPI support.


Thanks,
Alexandr.



Thanks,

Artem

On 10/25/2013 5:18 PM, Alexander Scherbatiy wrote:


   Could you review the updated fix:
http://cr.openjdk.java.net/~alexsch/8011059/webrev.02/

   - Scaled image width and height are transformed according to the
AffineTransform type.
   - ToolkitImage subclass is used to hold @2x image instance.

  Thanks,
  Alexandr.

On 10/23/2013 7:24 PM, Alexander Scherbatiy wrote:


  Could you review the updated fix:
http://cr.openjdk.java.net/~alexsch/8011059/webrev.01/

  The JCK failures has been resolved:
- Some tests tries to draw an image with Integer.MAX_VALUE width
or height. Passing large values to image.getScaledImage(width, 
height,

hints).
   leads that an Image filter is not able to create necessary
arrays.  The fix uses the original image if width or height are equal
to Integer.MAX_VALUE.
- Using Image.SCALE_DEFAULT hint for the getScaledImage(width,
height, hints) method to get the high resolution image interferes 
with

   JCK tests that expect that the scaled image by certain
algorithm is returned. This is fixed by invoking the
super.getScaledImage(width, height, hints)
   method in ToolkitImage in case if a high resolution image is
not set.

Thanks,
Alexandr.



On 10/22/2013 1:31 PM, Alexander Scherbatiy wrote:


Hello,

Could you review the fix:

  bug: https://bugs.openjdk.java.net/browse/JDK-8011059
  webrev: http://cr.openjdk.java.net/~alexsch/8011059/webrev.00

  The IMAGE_SCALING rendering hint is added to the RenderingHints 
class.

  Enabling the image scaling rendering hint forces the SunGraphics2D
to use getScaledInstance(width, height, hints) method
  from Image class with SCALE_DEFAULT hint.

  By default the image scaling rendering hint is enabled on HiDPI
display and disabled for standard displays.

  User can override the getScaledInstance(width, height, hints)
method and return necessary high resolution image
  according to the given image width and height.

  For example:
  -
final Image highResolutionImage =
new BufferedImage(2 * WIDTH, 2 * HEIGHT,
BufferedImage.TYPE_INT_RGB);
Image image = new BufferedImage(WIDTH, HEIGHT,
BufferedImage.TYPE_INT_RGB) {

@Override
public Image getScaledInstance(int width, int height, 
int

hints) {
if ((hints & Image.SCALE_DEFAULT) != 0) {
return (width <= WIDTH && height <= HEIGHT)
? this : highResolutionImage;
}
return super.getScaledInstance(width, height, 
hints);

}
};
  ---

How do I make my Java 7 OSX App draggable on toolbar only ?

2013-10-31 Thread Paul Taylor
Things were working okay with Java 6 ( and some custom libs) but now by 
default a Java 7 application is only movable on Mac if you click near 
the top of the window (like on Windows), however if I set


toolbar.getRootPane().putClientProperty("apple.awt.draggableWindowBackground") 



I can then move the window by dragging on the toolbar. Unfortunately 
because this property is applied to the rootpane, and then is just one 
rootpane for the frame that the whole applications is a part of the 
window moves where-ever I drag on it, I only want to be able to drag on 
it in the toolbar.


The main part of my application is a JTable and I really don't want the 
window to be moved when I dragclick here because it causes lots of 
problems such as I can now no longer reorder by table columns by 
dragging the table headers because that just moves the whole window. How 
can I limit movement to either:


1. Only the JToolbar
2. Everywhere except the Jtable

whichever is easiest.

thanks Paul


Re: Java 7 Application built on OSX 10.9 crashing on startup on 10.7.5

2013-10-31 Thread Mike Swingler
Is this the full crash log? Are there no thread stacks?

Regards,
Mike Swingler
Apple Inc.


Re: Java 7 Application built on OSX 10.9 crashing on startup on 10.7.5

2013-10-31 Thread Paul Taylor

On 31/10/2013 18:38, Mike Swingler wrote:

Is this the full crash log? Are there no thread stacks?

Regards,
Mike Swingler
Apple Inc.

Thats all that comes up with the Crash reporter, Ive now tried another 
application that definitently was working on OSX 10.7 with an earlier 
version of Java 7 but now crashes in the same way, you can download 
both, they have both been released because they do work on 10.8 and 10.9


http://www.jthink.net/jaikoz/jsp/manualdownload/jaikoz-osx.dmg?val=125
http://www.jthink.net/songkong/downloads/songkong-osx.dmg?val=15

Paul


Re: Java 7 Application built on OSX 10.9 crashing on startup on 10.7.5

2013-10-31 Thread Michael Hall
On Oct 30, 2013, at 4:38 PM, Paul Taylor wrote:

> /Applications/Jaikoz.app/Contents/MacOS/Jaikoz

I'm assuming this is the appbundler JavaAppLauncher. Which branch? java.net 
project or infinitekind? Which OS version was it built on?

Michael Hall

trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz

HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe

AppConverter convert Apple jvm to openjdk apps 
http://www195.pair.com/mik3hall/index.html#appconverter







Re: Java 7 Application built on OSX 10.9 crashing on startup on 10.7.5

2013-10-31 Thread Paul Taylor

On 31/10/2013 21:49, Michael Hall wrote:

On Oct 30, 2013, at 4:38 PM, Paul Taylor wrote:


/Applications/Jaikoz.app/Contents/MacOS/Jaikoz

I'm assuming this is the appbundler JavaAppLauncher. Which branch? java.net 
project or infinitekind? Which OS version was it built on?

Ah, I think you have it.

It was the latest version of infinitekind on mavericks, and now I 
remember change something in the appbundler build file because it 
couldn't find some 10.7 files, is it possible these files on 10.9


Paul

Michael Hall

trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz

HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe

AppConverter convert Apple jvm to openjdk apps 
http://www195.pair.com/mik3hall/index.html#appconverter










Re: Java 7 Application built on OSX 10.9 crashing on startup on 10.7.5

2013-10-31 Thread Michael Hall
On Oct 31, 2013, at 7:10 PM, Paul Taylor wrote:

> On 31/10/2013 21:49, Michael Hall wrote:
>> On Oct 30, 2013, at 4:38 PM, Paul Taylor wrote:
>> 
>>> /Applications/Jaikoz.app/Contents/MacOS/Jaikoz
>> I'm assuming this is the appbundler JavaAppLauncher. Which branch? java.net 
>> project or infinitekind? Which OS version was it built on?
> Ah, I think you have it.
> 
> It was the latest version of infinitekind on mavericks, and now I remember 
> change something in the appbundler build file because it couldn't find some 
> 10.7 files, is it possible these files on 10.9

is it possible these files are not on 10.9? I would think some incompatibility 
is possible.
You could maybe try building the native executable on 10.7 instead of 10.9. If 
it works, you have one executable that works for all. Otherwise you might have 
to resolve the incompatibility.
For infinitekind, or both JavaAppLauncher projects, figuring out what the 
incompatibility is might be appreciated anyhow.

Michael Hall

trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz

HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe

AppConverter convert Apple jvm to openjdk apps 
http://www195.pair.com/mik3hall/index.html#appconverter