Re: [9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-23 Thread Kevin Rushforth
PlatformImpl isn't API. It's an internal method in a non-public, 
non-documented class. I don't want to pick a less desirable name just 
because there is an internal method with the same name that works 
differently in 9.


-- Kevin


Ali Ebrahimi wrote:

Hi,
I know concerns here, but I think PlatformImpl.startup() and 
Platform.startup() should have same behavior from caller's POW.
So I think if we can not have default behavior(duplicate calls) for 
public API so please change method name.
My suggestions: Platform.safeStartup() or Platform.startPlatform 
or Platform.start


On Sun, Nov 22, 2015 at 11:35 PM, Jonathan Giles 
> wrote:


I don't believe there is any inconsistency here. We are preserving
the existing semantics in PlatformImpl.startup to not prevent
duplicate calls by default, whilst we are reversing the semantics
for the public API in Platform, where we do prevent duplicate
calls. The end result is that we have one public API
(Platform.startup) with one set of semantics (prevent duplicate
values).

-- Jonathan




On 21/11/15 11:57 PM, Ali Ebrahimi wrote:

Hi,
I think there is an inconsistency between :

PlatformImpl.java
 public static void startup(final Runnable r) {
+startup(r, false);  //* here default value false
+ }

and

Platform.java
+public static void startup(Runnable runnable) {
+PlatformImpl.startup(runnable, true);  // here default 
value true
+}
 


On Sat, Nov 21, 2015 at 3:28 AM, Kevin Rushforth
>
wrote:

Jonathan and all,

Please review the following new API proposal to add the
ability to explicitly start the FX runtime.

https://bugs.openjdk.java.net/browse/JDK-8090585
http://cr.openjdk.java.net/~kcr/8090585/webrev.00/


-- Kevin




-- 


Best Regards,
Ali Ebrahimi





--

Best Regards,
Ali Ebrahimi


Re: [9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-23 Thread Kevin Rushforth
This is intentional to preserve compatibility for existing internal code 
(testing tools and deployment code) to avoid regressions. I will file a 
follow-on issue to find and eliminate this difference, since it does 
seem like an unnecessary inconsistency. Thanks for pointing this out.


-- Kevin


Ali Ebrahimi wrote:

Hi,
I think there is an inconsistency between :

PlatformImpl.java
 public static void startup(final Runnable r) {
+startup(r, false);  //* here default value false
+ }

and

Platform.java
+public static void startup(Runnable runnable) {
+PlatformImpl.startup(runnable, true);  // here default value 
true
+}
 

On Sat, Nov 21, 2015 at 3:28 AM, Kevin Rushforth 
> wrote:


Jonathan and all,

Please review the following new API proposal to add the ability to
explicitly start the FX runtime.

https://bugs.openjdk.java.net/browse/JDK-8090585
http://cr.openjdk.java.net/~kcr/8090585/webrev.00/


-- Kevin




--

Best Regards,
Ali Ebrahimi


Re: [9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-23 Thread Kevin Rushforth
Yes, you can just use "new Stage()" to create a stage for such an 
application to use. As for registering it as primary, we hadn't thought 
to provide such an API. I don't think it is needed, since the ability to 
embed the primary stage in an applet in a browser (which is not possible 
unless you run it as an Application via the plugin), is really the only 
thing that distinguishes a primary stage from any other Stage.


As for launching multiple Applications, you still won't be able to do 
that by actually calling Application.launch more than once, but if you 
"roll your own" launcher you can accomplish the same thing. You can 
construct multiple Application objects, calling the init() and start() 
method of each.


One thing to be aware of is that just like the JFXPanel case, you will 
probably want to call Platform.setImplicitExit(false) in this case. 
Otherwise, when the last Stage is closed, the JavaFX runtime will exit.


-- Kevin

Benjamin Gudehus wrote:

Wow, this patch will simplify the architecture of JavaFX testing
libraries/frameworks.

From my perspective it is important to have a method to start the FX
runtime and thread.

I guess one would just use `new Stage()` to create the primary Stage? Or do
we need to register the primary Stage somewhere?

This is a great.

As a sidenote: Another use-case for testing is to be able to call the
Application launch procedure multiple times (probably for different
Application classes) without starting the FX runtime. TestFX currently uses
custom code similar to the code in `LauncherImpl` to archive this.

--Benjamin



On Sun, Nov 22, 2015 at 9:26 PM, Ali Ebrahimi 
wrote:

  

Hi,
I know concerns here, but I think PlatformImpl.startup() and
Platform.startup() should have same behavior from caller's POW.
So I think if we can not have default behavior(duplicate calls) for public
API so please change method name.
My suggestions: Platform.safeStartup() or Platform.startPlatform or
Platform.start

On Sun, Nov 22, 2015 at 11:35 PM, Jonathan Giles <
jonathan.gi...@oracle.com>
wrote:



I don't believe there is any inconsistency here. We are preserving the
existing semantics in PlatformImpl.startup to not prevent duplicate calls
by default, whilst we are reversing the semantics for the public API in
Platform, where we do prevent duplicate calls. The end result is that we
have one public API (Platform.startup) with one set of semantics (prevent
duplicate values).

-- Jonathan


On 21/11/15 11:57 PM, Ali Ebrahimi wrote:

Hi,
I think there is an inconsistency between :

PlatformImpl.java

 public static void startup(final Runnable r) {
+startup(r, false);  //* here default value false

+ }

and

Platform.java

+public static void startup(Runnable runnable) {
+PlatformImpl.startup(runnable, true);  // here default
  

value true


+}



On Sat, Nov 21, 2015 at 3:28 AM, Kevin Rushforth <
kevin.rushfo...@oracle.com> wrote:

  

Jonathan and all,

Please review the following new API proposal to add the ability to
explicitly start the FX runtime.

https://bugs.openjdk.java.net/browse/JDK-8090585
http://cr.openjdk.java.net/~kcr/8090585/webrev.00/

-- Kevin




--

Best Regards,
Ali Ebrahimi



  

--

Best Regards,
Ali Ebrahimi




Re: [9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-22 Thread Benjamin Gudehus
Wow, this patch will simplify the architecture of JavaFX testing
libraries/frameworks.

>From my perspective it is important to have a method to start the FX
runtime and thread.

I guess one would just use `new Stage()` to create the primary Stage? Or do
we need to register the primary Stage somewhere?

This is a great.

As a sidenote: Another use-case for testing is to be able to call the
Application launch procedure multiple times (probably for different
Application classes) without starting the FX runtime. TestFX currently uses
custom code similar to the code in `LauncherImpl` to archive this.

--Benjamin



On Sun, Nov 22, 2015 at 9:26 PM, Ali Ebrahimi 
wrote:

> Hi,
> I know concerns here, but I think PlatformImpl.startup() and
> Platform.startup() should have same behavior from caller's POW.
> So I think if we can not have default behavior(duplicate calls) for public
> API so please change method name.
> My suggestions: Platform.safeStartup() or Platform.startPlatform or
> Platform.start
>
> On Sun, Nov 22, 2015 at 11:35 PM, Jonathan Giles <
> jonathan.gi...@oracle.com>
> wrote:
>
> > I don't believe there is any inconsistency here. We are preserving the
> > existing semantics in PlatformImpl.startup to not prevent duplicate calls
> > by default, whilst we are reversing the semantics for the public API in
> > Platform, where we do prevent duplicate calls. The end result is that we
> > have one public API (Platform.startup) with one set of semantics (prevent
> > duplicate values).
> >
> > -- Jonathan
> >
> >
> > On 21/11/15 11:57 PM, Ali Ebrahimi wrote:
> >
> > Hi,
> > I think there is an inconsistency between :
> >
> > PlatformImpl.java
> >
> >  public static void startup(final Runnable r) {
> > +startup(r, false);  //* here default value false
> >
> > + }
> >
> > and
> >
> > Platform.java
> >
> > +public static void startup(Runnable runnable) {
> > +PlatformImpl.startup(runnable, true);  // here default
> value true
> >
> > +}
> >
> >
> >
> > On Sat, Nov 21, 2015 at 3:28 AM, Kevin Rushforth <
> > kevin.rushfo...@oracle.com> wrote:
> >
> >> Jonathan and all,
> >>
> >> Please review the following new API proposal to add the ability to
> >> explicitly start the FX runtime.
> >>
> >> https://bugs.openjdk.java.net/browse/JDK-8090585
> >> http://cr.openjdk.java.net/~kcr/8090585/webrev.00/
> >>
> >> -- Kevin
> >>
> >>
> >
> >
> > --
> >
> > Best Regards,
> > Ali Ebrahimi
> >
> >
> >
>
>
> --
>
> Best Regards,
> Ali Ebrahimi
>


Re: [9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-22 Thread Jonathan Giles
I don't believe there is any inconsistency here. We are preserving the 
existing semantics in PlatformImpl.startup to not prevent duplicate 
calls by default, whilst we are reversing the semantics for the public 
API in Platform, where we do prevent duplicate calls. The end result is 
that we have one public API (Platform.startup) with one set of semantics 
(prevent duplicate values).


-- Jonathan

On 21/11/15 11:57 PM, Ali Ebrahimi wrote:

Hi,
I think there is an inconsistency between :

PlatformImpl.java
  public static void startup(final Runnable r) {
+startup(r, false);  //* here default value false
+ }

and

Platform.java
+public static void startup(Runnable runnable) {
+PlatformImpl.startup(runnable, true);  // heredefault value 
true
+}

On Sat, Nov 21, 2015 at 3:28 AM, Kevin Rushforth 
> wrote:


Jonathan and all,

Please review the following new API proposal to add the ability to
explicitly start the FX runtime.

https://bugs.openjdk.java.net/browse/JDK-8090585
http://cr.openjdk.java.net/~kcr/8090585/webrev.00/


-- Kevin




--

Best Regards,
Ali Ebrahimi




Re: [9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-22 Thread Ali Ebrahimi
Hi,
I know concerns here, but I think PlatformImpl.startup() and
Platform.startup() should have same behavior from caller's POW.
So I think if we can not have default behavior(duplicate calls) for public
API so please change method name.
My suggestions: Platform.safeStartup() or Platform.startPlatform or
Platform.start

On Sun, Nov 22, 2015 at 11:35 PM, Jonathan Giles 
wrote:

> I don't believe there is any inconsistency here. We are preserving the
> existing semantics in PlatformImpl.startup to not prevent duplicate calls
> by default, whilst we are reversing the semantics for the public API in
> Platform, where we do prevent duplicate calls. The end result is that we
> have one public API (Platform.startup) with one set of semantics (prevent
> duplicate values).
>
> -- Jonathan
>
>
> On 21/11/15 11:57 PM, Ali Ebrahimi wrote:
>
> Hi,
> I think there is an inconsistency between :
>
> PlatformImpl.java
>
>  public static void startup(final Runnable r) {
> +startup(r, false);  //* here default value false
>
> + }
>
> and
>
> Platform.java
>
> +public static void startup(Runnable runnable) {
> +PlatformImpl.startup(runnable, true);  // here default value 
> true
>
> +}
>
>
>
> On Sat, Nov 21, 2015 at 3:28 AM, Kevin Rushforth <
> kevin.rushfo...@oracle.com> wrote:
>
>> Jonathan and all,
>>
>> Please review the following new API proposal to add the ability to
>> explicitly start the FX runtime.
>>
>> https://bugs.openjdk.java.net/browse/JDK-8090585
>> http://cr.openjdk.java.net/~kcr/8090585/webrev.00/
>>
>> -- Kevin
>>
>>
>
>
> --
>
> Best Regards,
> Ali Ebrahimi
>
>
>


-- 

Best Regards,
Ali Ebrahimi


Re: [9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-21 Thread Ali Ebrahimi
Hi,
I think there is an inconsistency between :

PlatformImpl.java

 public static void startup(final Runnable r) {
+startup(r, false);  //* here default value false

+ }

and

Platform.java

+public static void startup(Runnable runnable) {
+PlatformImpl.startup(runnable, true);  // here
default value true

+}



On Sat, Nov 21, 2015 at 3:28 AM, Kevin Rushforth  wrote:

> Jonathan and all,
>
> Please review the following new API proposal to add the ability to
> explicitly start the FX runtime.
>
> https://bugs.openjdk.java.net/browse/JDK-8090585
> http://cr.openjdk.java.net/~kcr/8090585/webrev.00/
>
> -- Kevin
>
>


-- 

Best Regards,
Ali Ebrahimi


[9] API review request: 8090585: Provide an official API to start the JavaFX platform

2015-11-20 Thread Kevin Rushforth

Jonathan and all,

Please review the following new API proposal to add the ability to 
explicitly start the FX runtime.


https://bugs.openjdk.java.net/browse/JDK-8090585
http://cr.openjdk.java.net/~kcr/8090585/webrev.00/

-- Kevin