Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-23 Thread Jim Graham
Naming aside - I think I came up with schema a few discussions ago and better name suggestions are always welcome... If we can get away with a list of suffixes then a new class is less important, though we have the issue that an array or list of strings is mutable. If any part of this

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Philip Race
Does that need a whole new API class to support a list of strings ? And it still not a "schema". It is simply one of a list of suffixes. -phil. On 9/22/16, 1:51 PM, Jim Graham wrote: If I am developing a skinned UI and I provide a set of 20 images for various parts of the controls and then

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Jim Graham
If I am developing a skinned UI and I provide a set of 20 images for various parts of the controls and then hand off to my graphic designer to create the DPI variants for all of the images, it is much easier for me to tell them to name all of the images with suffixes for the DPI variants and

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Philip Race
Also as I pointed out before a string specified per-variant is not a naming *scheme*. It is just a "per-file" add-on to the basename I could use Image image = toolkit.getImageUsingNamingSchemes(url, new Toolkit.MediaResolutionNamingScheme("abc", 1.5f), new

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Philip Race
> The method getImageUsingNamingSchemes(String fileName, MediaResolutionNamingScheme... > namingSchemes) works for any scheme not only for the default one. I'm sure it does. My point is that we don't need it. No one will care or use it. They just want to list their image files. The naming

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Philip Race
Why do we need a new issue ? I don't see how this fix can proceed without a lot of changes along the lines I suggested and that should (must even) be part of it. -phil. On 9/22/16, 10:41 AM, Alexandr Scherbatiy wrote: On 9/22/2016 11:30 AM, Jim Graham wrote: It gets further complicated,

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Alexandr Scherbatiy
On 9/22/2016 11:30 AM, Jim Graham wrote: It gets further complicated, though, when you consider that we probably need the dimensions of the base image for any metrics reporting anyway. Consider a 25x25 image with variants. If the user supplies a 125pct variant then they will need an image

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Alexandr Scherbatiy
On 9/22/2016 3:48 AM, Jim Graham wrote: I think this is a good point. The only gotcha would appear to be handling the ImageObserver notifications and the prepareImage() calls. The ImageObserver should get the variant's dimensions as one of the first notifications, though if they trigger an

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Alexandr Scherbatiy
On 9/21/2016 9:47 PM, Philip Race wrote: Hi, When the application is specifying the set of images from which to build the MRI you ask the app to specify a "schema" (probably not the right name given that it is per-file), and a floating point scale. I don't see why we need to ask the app to

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Jim Graham
It gets further complicated, though, when you consider that we probably need the dimensions of the base image for any metrics reporting anyway. Consider a 25x25 image with variants. If the user supplies a 125pct variant then they will need an image that is 31.25 pixels in size. Do they use a

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-21 Thread Jim Graham
I think this is a good point. The only gotcha would appear to be handling the ImageObserver notifications and the prepareImage() calls. The ImageObserver should get the variant's dimensions as one of the first notifications, though if they trigger an image load and then add an observer later,

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-21 Thread Philip Race
Hi, When the application is specifying the set of images from which to build the MRI you ask the app to specify a "schema" (probably not the right name given that it is per-file), and a floating point scale. I don't see why we need to ask the app to name the files in accordance with our schema

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-19 Thread Alexander Scherbatiy
Hello, Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8163854/webrev.01 The fix includes support for resolution variants loading by getImage() method for built-in toolkits using the following media resolution naming scheme (qualifier, scale): ("@125pct", 1.25),

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-08-24 Thread Philip Race
FWIW I think the most important image loading use case is that some generic resource loading code - perhaps JDK code - will get a URL for where the resources are and go hunting. It is never going to call this API .. so it had better be an optimisation and not a necessity -phil. On 8/24/16,

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-08-24 Thread Philip Race
Alexander, Were the existing Toolkit.getImage(String/URL) APIs not enhanced to do this for you automatically ? I suppose I thought they were but they can't be since you are using getImage(String) here. IMO that would be more important than this. And in any case I don't see why this is solved