ImageView should have shorthand creation function

Richard Bair richard.bair at oracle.com
Thu Dec 8 10:34:32 PST 2011


I agree, I like the constructor. I think something special will have to be done to make it usable from FXML though (but that's because "url" isn't a property on ImageView and thus it will have to be special in the ImageViewBuilder for FXML to use it). I agree it needs to match the semantics of new Image(url).

Richard

On Dec 8, 2011, at 3:53 AM, Lubomir Nerad wrote:

> Hi Daniel,
> 
> thanks for your vote. Currently the plan is to have the same interpretation of the url parameter as in "new Image(url)". But there is http://javafx-jira.kenai.com/browse/RT-18291 which will address the relative URL issue.
> 
> Lubo
> 
> On 8.12.2011 10:41, Daniel Zwolenski wrote:
>> Option 1 is better for FXML (although we can just use builders). Gets my vote anyway.
>> 
>> Will the URL be relative to the classpath? I.e will the implementation be equivalent to Image.getClass().getResource and will this be ok in deployed apps I think there have been issues with this on other areas (I think multiple classloaders are used in deploy mode).
>> 
>> 
>> On 08/12/2011, at 8:12 PM, Lubomir Nerad<lubomir.nerad at oracle.com>  wrote:
>> 
>>> Hi,
>>> 
>>> I am looking at http://javafx-jira.kenai.com/browse/RT-6554. It requests to add a possibility to create image view and its image from url in one step. What I think should be discussed is whether to add this as a new constructor to the ImageView class or as a static factory method.
>>> 
>>> So the options are:
>>> 
>>> 1) public ImageView(String url) { ... }
>>> 2) public static ImageView image(String url) { ... }  (or another name)
>>> 
>>> Unless we expect that we will need more possibilities for image specification (more shorthand creation methods) in the future, I am leaning towards option 1.
>>> 
>>> What do you think?
>>> 
>>> Thanks,
>>> Lubo
>>> 



More information about the openjfx-dev mailing list