Re: Mention of the CSS properties in JavaDocs

2022-02-15 Thread Anirvan Sarkar
JavaFX 2 provided a custom doclet [1] but this was not required since
JavaFX 8 (JDK 8).
If a custom doclet is introduced again, we need to modify build scripts /
IDE settings, etc. which is not required since JDK 12 [2].
So I suppose going back to a custom doclet again will not be a preferable
solution.

[1] : https://docs.oracle.com/javafx/2/doclet/jfxpub-doclet.htm
[2] : https://bugs.openjdk.java.net/browse/JDK-8208532

On Mon, 14 Feb 2022 at 02:34, Scott Palmer  wrote:

> Would it be a custom doclet that was part of the OpenJFX project and
> require no changes to the javadoc tool?
>
> Scott
>
> > On Feb 12, 2022, at 9:52 AM, Kevin Rushforth 
> wrote:
> >
> > While something like this could be handy, I doubt that adding this much
> knowledge of JavaFX into the javadoc tool would gain any traction.
> >
> > -- Kevin
> >
> >
> > On 2/9/2022 7:11 AM, Nir Lisker wrote:
> >> Hi,
> >>
> >> When reviewing the docs changes to TabPane, I saw that some properties
> >> mention the CSS that is related to them. I was wondering if we could
> >> standardize it through something like a @css tag that is given the css
> >> string constant, or read automatically through the CssMetaData.
> >>
> >> As an example:
> >>
> >> /**
> >>  * Specifies the maximum width of a tab.
> >>  * ...
> >>  * @css -fx-tab-max-width
> >>  * @defaultValue 10
> >>  */
> >>
> >> If the javadoc tool has access to these during its runtime, it can read
> the
> >> string by looking in the getCssMetaData() override of the property and
> then
> >> read the first argument of the CssMetaData constructor.
> >>
> >> Thoughts?
> >
>
>

-- 
Anirvan


Re: JDK-8154847 : Windows content is blank when using StageStyle.UNIFIED

2020-08-17 Thread Anirvan Sarkar
Hi,

I can see in the implementation that
Platform.isSupported(ConditionalFeature.UNIFIED_WINDOW) is always false on
Linux [1].
So it seems that the issue does not occur in Linux because
StageStyle.UNIFIED is not supported there and so as per the specification
[2] the StageStyle is downgraded to StageStyle.DECORATED.

The workaround of using SW pipeline does not resolve the issue for me when
the below option is selected and accent color is changed.

Settings (Win + I) -> Personalization -> Colors -> Show accent
color on the following surfaces -> Title bars and window borders

I was expecting the background color of the window content to be the same
as the title bar color / accent color but it is not.
Since this issue is in the SW pipeline I don't think the issue is due to a
graphics driver bug, or maybe this is a different bug.

I have attached my observations in the JBS issue.

[1] :
https://github.com/openjdk/jfx/blob/2aed5ad3e57cd8aa9875965d17eeb76e09dae13c/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java#L474

[2] :
https://openjfx.io/javadoc/14/javafx.graphics/javafx/stage/StageStyle.html#UNIFIED


On Sat, 8 Aug 2020 at 05:25, Kevin Rushforth 
wrote:

> Thanks for the additional information. I added it to the bug report.
>
> It is interesting to note that it doesn't happen on Linux when running
> on the same HW, although it isn't surprising. This is likely a graphics
> driver bug, as opposed to a fundamental HW issue, so it isn't surprising
> that the results would be different on Linux.
>
> -- Kevin
>
>
> On 8/7/2020 1:09 PM, Hannes H. wrote:
> > Good evening,
> >
> > Weeks ago I reported a duplicate to JDK-8154847 because I did not realize
> > that this has been reported years ago.
> >
> > As far as I understand most of the contributors to this ticket believe
> that
> > the problem is related to specific video cards. Since I can reproduce
> this
> > issue on my developer notebook on Windows 10, I decided to install Linux
> > (not on a VM but actually on the hardware) to check if I can reproduce
> > the issue there as well.
> >
> > First tests show that this issue cannot be reproduced on Linux Mint while
> > it can on the very same hardware when using Windows 10.
> >
> > I am not sure if this information helps anyone. I decided to send it to
> > this mailing list since I find it very cumbersome to create - another -
> > duplicate of an issue just to add information.
> >
> > If you have any further questions or I can be of assistance with
> > reproducing the issue please let me know.
> >
> > Kind regards,
> > Hannes
>
>

-- 
Anirvan


Re: Support "trust all" SSL context in OpenJFX 14

2020-04-08 Thread Anirvan Sarkar
Maybe it doesn't work due to JDK-8239595. It seems that HttpClient
implementation does not use the default SSL context for its configuration
[1].

There is an RFR mail to fix this [2][3].

[1] : https://bugs.openjdk.java.net/browse/JDK-8239595
[2] : https://mail.openjdk.java.net/pipermail/net-dev/2020-March/013705.html
[3] : https://mail.openjdk.java.net/pipermail/net-dev/2020-April/013785.html

On Tue, 7 Apr 2020 at 22:33, Lior Yaffe  wrote:

> I'm not sure why but it doesn't work.
>
> The only workaround I found is:
> System.setProperty("com.sun.webkit.useHTTP2Loader", "false"); // Workaround
> to support test certificate with OpenJFX 14 Webview
>
> Then use the old code which works in OpenJFX 13 and earlier.
>
> HttpsURLConnection.setDefaultSSLSocketFactory(TrustAllSSLProvider.getSslSocketFactory());
>
> HttpsURLConnection.setDefaultHostnameVerifier(TrustAllSSLProvider.getHostNameVerifier());
>
> On Tue, Apr 7, 2020 at 2:28 PM Michał Zegan 
> wrote:
>
> > What about global SSLContext.setDefault()? maybe it doesn't apply of
> > course.
> >
> > W dniu 07.04.2020 o 13:14, Lior Yaffe pisze:
> > > Some background information on why we are facing the issue.
> > > The internal implementation of WebView changed in OpenJFX 14 to use
> > > HttpClient instead of Http(s)URLConnection. Therefore, it is no longer
> > > possible to use the following methods to set a custom SSL context
> before
> > > instantiation of a HttpsURLConnection object:
> > >
> > > HttpsURLConnection#setDefaultSSLSocketFactory
> > > HttpsURLConnection#setDefaultHostnameVerifier
> > >
> > > The only way to set a custom SSLContext to a HttpClient is to use the
> > > method HttpClientBuilder#sslContext unfortunately this method is not
> > > accessible for the Webview code.
> > >
> > > Since there is no static method on the HttpClient to set a custom
> > > SSLContext, we hereby request to introduce a public method on WebView
> (or
> > > WebEngine) for the purpose of passing a custom SSL context.
> > >
> > > <
> >
> http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_content=webmail
> > >
> > > Virus-free.
> > > www.avg.com
> > > <
> >
> http://www.avg.com/email-signature?utm_medium=email_source=link_campaign=sig-email_content=webmail
> > >
> > > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> > >
> >
>


-- 
Anirvan


Re: JDK-8210361: Add images to docs for public API classes of controls

2018-09-12 Thread Anirvan Sarkar
Hi Nir,

Thanks for this RFE.

Now other UI toolkits like GTK and QT have a separate gallery of
controls[1][2].

I was considering to add something similar in JavaFX but I never got around
to start working on it, mostly due to all the screenshots which is needed
to be taken beforehand !

Since you will now take images of all the controls, you can consider to add
a gallery in this RFE itself.

But if you don't want then someone else (me) can volunteer to do this once
this RFE is merged.

Let me know what you decide :-)

[1] : https://developer.gnome.org/gtk4/stable/ch03.html
[2] : http://doc.qt.io/archives/qt-4.8/gallery.html


On Thu 13 Sep, 2018, 12:07 AM Kevin Rushforth, 
wrote:

> Agreed. For simple controls like checkbox, button, etc., it makes sense
> to use an undecorated Stage. It's less busy and puts the emphasis on the
> control being illustrated.
>
> -- Kevin
>
>
> On 9/12/2018 7:57 AM, Pedro Duque Vieira wrote:
> > Yes I agree with you. Controls on which their window decorations are a
> part
> > of them, should show up with them. If those decorations change depending
> on
> > the platform their running, I would put a note saying that.
> >
> > The vast majority of controls don't belong to that category.
> >
> > Cheers,
> >
> > On Wed, Sep 12, 2018 at 3:51 PM Nir Lisker  wrote:
> >
> >> That's sensible, though for Alert and the like I think they should stay
> as
> >> it's effectively part of the control.
> >>
> >> On Wed, Sep 12, 2018 at 4:19 PM Pedro Duque Vieira <
> >> pedro.duquevie...@gmail.com> wrote:
> >>
> >>> I would remove the window decorations. That's platform dependent,
> windows,
> >>> linux, mac have different aesthetics for this. They also don't add any
> >>> value to the representation of the control.
> >>>
> >>> That's what I usually do.
> >>>
> >>> Cheers,
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> Pedro Duque Vieira - https://www.pixelduke.com
> >>>
>
>


Re: Matrox Graphics Cards Problems

2018-05-18 Thread Anirvan Sarkar
Hi Matthew,

OpenGL pipeline on Windows is not a supported configuration and so it is
not present in JavaFX for Windows[1][2].
You would have to build JavaFX yourself to include this pipeline and "use
it at your own risk". It may or may not work.
Also it looks like the card should support OpenGL 2.1 or later[3].

[1]:
http://hg.openjdk.java.net/openjfx/jfx-dev/rt/file/071b040b8736/build.gradle#l478
[2]:
http://mail.openjdk.java.net/pipermail/openjfx-dev/2014-July/014936.html
[3]:
http://hg.openjdk.java.net/openjfx/jfx-dev/rt/file/071b040b8736/modules/javafx.graphics/src/main/native-prism-es2/windows/WinGLFactory.c#l252


On 18 May 2018 at 04:32, Matthew Elliot <matthew.james.ell...@gmail.com>
wrote:

> Hey, thanks for the second link, exactly what I needed just not the best
> news.
>
> I see all Matrox cards are disabled which is a bit tricky for us when many
> of our customers are have 4+ monitors and some have chosen those cards.
>
> I then managed to find this - https://bugs.openjdk.java.
> net/browse/JDK-8103350
> I assume this means there will never be support of these cards or is there
> a work around? I.e. I see they support OpenGL so could I install OpenGL on
> a windows machine and try that pipeline?
> Is this exclusion of all Matrox cards still valid?
>
> Thanks in advance,
> Matt
>
> Sent from my phone.
>
> On 17/05/2018, at 5:15 PM, Anirvan Sarkar <powers.anir...@gmail.com>
> wrote:
>
> Hi Matthew,
>
> Please see the below file for blaclisted hardware on D3D.
>
> http://hg.openjdk.java.net/openjfx/jfx-dev/rt/file/
> 9e0e0e65e642/modules/javafx.graphics/src/main/native-
> prism-d3d/D3DBadHardware.h
>
> Regards,
> Anirvan
>
>
> On Thu, 17 May 2018 at 11:04 PM, Matthew Elliot <
> matthew.james.ell...@gmail.com> wrote:
>
>> Hi all,
>>
>> we have some customers in the wild who use Matrox 9148LP (9100 series)
>> graphics cards because they drive more than 2 monitors and JavaFX always
>> reports an error initializing HW pipeline and forcing gpu results in
>> system
>> instability.
>>
>> I checked the bug reports but couldn't see anything about JavaFX and
>> Matrox
>> cards.
>>
>> Questions
>> Is anyone aware of an existing issue?
>> Is there a way to get more details on why JavaFx fails to enable the D3D
>> pipeline?
>> Is there a list of known problematic graphics cards or a black list of
>> graphics cards where JavaFX falls back?
>>
>> Thanks in advance,
>> Matt
>>
> --
> Sent from Gmail Mobile
>
>


-- 
Anirvan


Re: Matrox Graphics Cards Problems

2018-05-17 Thread Anirvan Sarkar
Hi Matthew,

Please see the below file for blaclisted hardware on D3D.

http://hg.openjdk.java.net/openjfx/jfx-dev/rt/file/9e0e0e65e642/modules/javafx.graphics/src/main/native-prism-d3d/D3DBadHardware.h

Regards,
Anirvan


On Thu, 17 May 2018 at 11:04 PM, Matthew Elliot <
matthew.james.ell...@gmail.com> wrote:

> Hi all,
>
> we have some customers in the wild who use Matrox 9148LP (9100 series)
> graphics cards because they drive more than 2 monitors and JavaFX always
> reports an error initializing HW pipeline and forcing gpu results in system
> instability.
>
> I checked the bug reports but couldn't see anything about JavaFX and Matrox
> cards.
>
> Questions
> Is anyone aware of an existing issue?
> Is there a way to get more details on why JavaFx fails to enable the D3D
> pipeline?
> Is there a list of known problematic graphics cards or a black list of
> graphics cards where JavaFX falls back?
>
> Thanks in advance,
> Matt
>
-- 
Sent from Gmail Mobile


Re: Javadoc tool version used to build JavaFX documentation

2016-03-02 Thread Anirvan Sarkar
I messed up before. I hadn't cleaned up my Javadoc directory before
building the documentation with jdk1.8.0_40.

The alignment issue exists with jdk1.8.0_40. After some searching in JBS I
found the javadoc bug JDK-8072461 [1].

According to the bug report the issue has been fixed in atleast jdk1.8.0_60.

Created JBS enhancement issue [2] to update javadoc tool version to
1.8.0_60 for generating JavaFX documentation

[1] : https://bugs.openjdk.java.net/browse/JDK-8072461
[2] : https://bugs.openjdk.java.net/browse/JDK-8151038


On 2 March 2016 at 17:56, Anirvan Sarkar <powers.anir...@gmail.com> wrote:

> Hi,
>
> Is the Javadoc tool used to build JavaFX documentation not from the JDK
> used to build JavaFX ?
>
> If you view the javafx.event.Event 'Uses' webpage [1] source, you will see
> the comment:
>
> 
>
> So it looks like the documentation is built using jdk1.8.0 while JavaFX
> itself is built using jdk1.8.0_40 [2].
>
> The alignment in the concerned webpage is messed up. (Description column
> is all the way to the right and its width is very small).
>
> When I built the documentation locally using jdk1.8.0_40 the webpage is
> displayed properly.
>
> Seems like there was some Javadoc bug in 1.8.0 which was resolved in some
> subsequent releases.
>
>
> [1] :
> https://docs.oracle.com/javase/8/javafx/api/javafx/event/class-use/Event.html
> [2] : https://bugs.openjdk.java.net/browse/JDK-8097930
>
> --
> Anirvan
>



-- 
Anirvan


Javadoc tool version used to build JavaFX documentation

2016-03-02 Thread Anirvan Sarkar
Hi,

Is the Javadoc tool used to build JavaFX documentation not from the JDK
used to build JavaFX ?

If you view the javafx.event.Event 'Uses' webpage [1] source, you will see
the comment:



So it looks like the documentation is built using jdk1.8.0 while JavaFX
itself is built using jdk1.8.0_40 [2].

The alignment in the concerned webpage is messed up. (Description column is
all the way to the right and its width is very small).

When I built the documentation locally using jdk1.8.0_40 the webpage is
displayed properly.

Seems like there was some Javadoc bug in 1.8.0 which was resolved in some
subsequent releases.


[1] :
https://docs.oracle.com/javase/8/javafx/api/javafx/event/class-use/Event.html
[2] : https://bugs.openjdk.java.net/browse/JDK-8097930

-- 
Anirvan


Re: JEP 283: Enable GTK 3 on Linux

2016-02-21 Thread Anirvan Sarkar
Hi Kevin, Phil,

Thanks for the clarification.

On 19 February 2016 at 23:40, Phil Race <philip.r...@oracle.com> wrote:

> We had not forgotten that the other JEP was there (as a draft)
> but the new JEP started with a pure FX focus on allowing FX to use either
> GTK2 or GTK3 depending on what you needed.
> It was extended (feature creep) whilst being drafted to include doing the
> same for
> AWT/Swing but the focus was still on interoperability. Making the Swing
> L fully GTK3 based is the later stretch goal whereas the original JEP
> is much more focused on that and also not at all on FX.
> It would be good for Mario to take a look at the new JEP and identify
> any areas in which it falls short of the previous JEP, which would be
> one reason to leave the "old" JEP open for now. Another is that it
> is unclear how much of JEP 283 we will actually be able to deliver for
> JDK 9 and it is written in a way which is intended to allow for that.
> In which case the previous JEP may yet be needed to complete that work,
> so we don't know yet it if it will be completely subsumed by that work.
>
> -phil.
>
>
> On 02/19/2016 07:43 AM, Kevin Rushforth wrote:
>
>> Current plan is to track all of the work for both JavaFX and Swing with
>> this JEP.
>>
>> -- Kevin
>>
>>
>> Anirvan Sarkar wrote:
>>
>>> Hi,
>>>
>>> One of the sub-task of this JEP is to 'Rework Swing GTK LnF to support
>>> GTK-3'.
>>> This seems something in common with another submitted JEP [1]: 'Modernize
>>> the GTK3 Look and Feel implementation'.
>>>
>>> So will these two JEP complement each other or will the other one be now
>>> redundant ?
>>>
>>>
>>> [1] https://bugs.openjdk.java.net/browse/JDK-8065658
>>>
>>> On 19 February 2016 at 07:11, <mark.reinh...@oracle.com> wrote:
>>>
>>> New JEP Candidate: http://openjdk.java.net/jeps/283
>>>>
>>>> - Mark
>>>>
>>>>
>>>
>>>
>>>
>


-- 
Anirvan


Re: JEP 283: Enable GTK 3 on Linux

2016-02-19 Thread Anirvan Sarkar
Hi,

One of the sub-task of this JEP is to 'Rework Swing GTK LnF to support
GTK-3'.
This seems something in common with another submitted JEP [1]:  'Modernize
the GTK3 Look and Feel implementation'.

So will these two JEP complement each other or will the other one be now
redundant ?


[1] https://bugs.openjdk.java.net/browse/JDK-8065658

On 19 February 2016 at 07:11,  wrote:

> New JEP Candidate: http://openjdk.java.net/jeps/283
>
> - Mark
>



-- 
Anirvan


Re: JFX as an OSGi service?

2016-02-19 Thread Anirvan Sarkar
Hi Stephen,

FYI, there is another way of initializing JavaFX runtime. Just use:

new JFXPanel();

It is documented[1] that FX runtime is initialized when the first JFXPanel
instance is constructed.

Also JavaFX 9 will provide an official API to start the FX platform [2] [3].


[1]
https://docs.oracle.com/javase/8/javafx/api/javafx/application/Platform.html#runLater-java.lang.Runnable-
[2] https://bugs.openjdk.java.net/browse/JDK-8090585
[3]
http://download.java.net/jdk9/jfxdocs/javafx/application/Platform.html#startup-java.lang.Runnable-


On 18 February 2016 at 20:08, Stephen Winnall  wrote:

> As I understand it, there are two ways of activating JavaFX:
>
> 1) sub-class javafx.application.Application or
> 2) call javafx.application.Application.launch()
>



-- 
Anirvan


Re: JavaFX JIRA issues moving to JBS

2015-04-16 Thread Anirvan Sarkar
On 15 April 2015 at 03:50, Kevin Rushforth kevin.rushfo...@oracle.com
wrote:

 ...
 The issues currently in the RT project in JavaFX JIRA will be folded into
 the JDK project in JBS.


What about the Scene Builder issues (DTL project in JavaFX JIRA)? Would
they also be migrated to JBS?

-- 
Anirvan


Re: OpenJFX mirror at BitBucket?

2015-03-17 Thread Anirvan Sarkar
Looks like the page
https://wiki.openjdk.java.net/display/OpenJFX/Developer+Work+Flow is
outdated.

It links to the BitBucket repo and mentions that one of the ways to provide
a patch is to create a pull request on BitBucket.

On 18 March 2015 at 05:51, Jonathan Giles jonathan.gi...@oracle.com wrote:

 Correct.
 -- Jonathan

 On 18 March 2015 13:19:21 GMT+13:00, Tomas Mikula tomas.mik...@gmail.com
 wrote:
 But we still need this one-way mirror, from which users can fork,
 right? My assumption is that bitbucket will not keep track of how much
 you diverged from the OpenJDK repo you initially cloned. It will,
 however, tell you how much you diverged from a bitbucket repo that you
 forked.
 
 On Tue, Mar 17, 2015 at 8:09 PM, Jonathan Giles
 jonathan.gi...@oracle.com wrote:
  BitBucket supports generation of patches from pull requests. My
 suggestion
  was that community members who wanted to use BitBucket to collaborate
 and /
  or easily keep their work current with the repo could do so, and when
 they
  create their pull request, they can have bitbucket generate the patch
 file
  for submission 'the old fashioned way'.
 
  -- Jonathan
 
  On 18/03/2015 1:03 p.m., Tomas Mikula wrote:
 
  Legal issues could be resolved by requiring a signed OCA before each
  pull request is merged. But anyway, if OpenJDK project does not
 accept
  pull requests, who is going to create the patches? If patches are
  painful for individual developers, they are going to be super
 painful
  for the person who is supposed to get the accepted PRs back to
  OpenJDK.
 
  OTOH, one-way mirrors should be easy enough to maintain by anyone
 who
  has access to a server where they can set up a cron task to
  periodically pull from OpenJDK repos and push to bitbucket repos.
  Whoever forks the mirror and makes changes would still have to
 submit
  patches directly to OpenJDK.
 
  Tomas
 
  On Tue, Mar 17, 2015 at 6:22 PM, Jonathan Giles
  jonathan.gi...@oracle.com wrote:
 
  There is no issue with members of the community using BitBucket to
  develop
  their patches. I just don't think it is a wise use of our limited
 time to
  maintain a mirror. This seems something that interested community
 members
  can do if they want. The main issue is as Kevin mentioned - someone
 has
  to
  submit the patch officially, and that someone has to have signed an
 OCA
  stating that they are owners of the code and IP being submitted. It
 would
  pay to very carefully track who has contributed code to a certain
 patch
  file, as all contributors will need to have signed an OCA.
 
  -- Jonathan
 
 
  On 18/03/2015 11:12 a.m., Florian Brunner wrote:
 
  Wouldn't it be possible for the OpenJFX team to officially
 maintain a
  mirror at
  BitBucket themselves and use the same criteria for accepting a
  pull-request as
  for accepting a patch-file? Then you're sure that you can
 synchronize it
  with
  the main repositories without any legal or quality issues.
 
  The contributors could link their forks and pull-requests in JIRA
 for
  documentation purposes.
 
  It would really be great if we could move on with this.
 
  -Florian
 
  Am Dienstag, 17. März 2015, 15.02:01 schrieb Kevin Rushforth:
 
  Right. If you wanted to revive the unofficial OpenJFX bitbucket
 mirror
  for your own experiments, that is certainly something you could
 do
  (subject to the GPLv2 + CLASSPATH license terms).
 
  For those patches to then be incorporated into the openjfx repos
 on
  hg.openjdk.java.net they need to go through the existing openjdk
  mechanism (which requires a signed OCA) as patches / webrevs,
 just like
  any other openjdk project. We cannot take patches directly from a
  BitBucket repo.
 
  -- Kevin
 
  Jonathan Giles wrote:
 
  There was a mirror, but it was unofficial and one-way (OpenJDK
 -
  BitBucket). I believe (although my memory may be failing me)
 that it
  was operated by Danno, so he might have more to say.
 
  In regards to fork / pull-request vs patch-file, I have no
 arguments
  there. Of course, OpenJFX is part of the OpenJDK, and therefore
 makes
  use of the OpenJDK infrastructure. My main point is that any
 movement
  regarding infrastructure is guided by an over-arching
 infrastructure
  team, in conjunction with the OpenJDK masters. OpenJFX can't
 work
  independent of this.
 
  -- Jonathan
 
  On 18/03/2015 10:50 a.m., Florian Brunner wrote:
 
  Hi,
 
  AFAIK there is/ was a mirror of OpenJFX at BitBucket.
 
  I think the URL was https://bitbucket.org/openjfxmirrors, but
 it's
  not valid
  anymore.
 
  Is there still a mirror of OpenJFX at BitBucket?
 
  A fork/pull-request workflow is state-of-the-art nowadays in
 software
  development and way better than a patch-file based workflow
 IMHO.
 
  It would be great to have such a fork/pull-request workflow
 also for
  OpenJFX!
 
  -Florian
 
 
 




-- 
Anirvan


Re: Permutation of scene graph children

2014-12-01 Thread Anirvan Sarkar
Hi,

java.util.List doesn't support a swap operation but there is
Collections.swap(List,
int, int)
https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#swap-java.util.List-int-int-for
that.

Also there exists a JIRA RT-39128
https://javafx-jira.kenai.com/browse/RT-39128 for getting swap support on
ObservableList.

Regards,
Anirvan

On 1 December 2014 at 23:35, Werner Lehmann lehm...@media-interactive.de
wrote:

 Hi,

 occasionally I need to move a child in its children list and would like to
 avoid a remove/add operation. For example, this could be useful to change
 z-order in a StackPane, or change vertical order on a VBox, or when
 synchronizing item order in a model with corresponding node order in a skin.

 java.util.List does not support a move or swap operation. I had hoped a
 sort operation with a clever comparator might do the trick, triggering a
 permutation listchange event. However, any attempt in this direction bombs,
 complaining about duplicate children added. On the other hand there is
 rudimentary support for this in Node.toFront and flags exist on Parent:
 childrenTriggerPermutation, childSetModified.

 Any thoughts about getting swap support on ObservableList and/or
 permutation support on Parent.children?

 Werner




-- 
Anirvan


JavaFX 8 Demos and Samples

2014-10-24 Thread Anirvan Sarkar
Can someone provide the link to JavaFX 8 Demos and Samples page?

I found  JavaFX 2.2.71 Demos and Samples from JDK 7 downloads
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
page.
But I couldn't  find one at JDK 8 downloads
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
 page.

Also searching for JavaFX Samples on the net led me to this page:
http://www.oracle.com/technetwork/java/javafx/samples/index.html which says
that JavaFX Samples Section has moved to
http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-2158687.html
.

But on this page there is link to try Ensemble 2 and not Ensemble 8.

So from where can we try Ensemble 8?

Regards,
Anirvan


Re: JavaFX 8 Demos and Samples

2014-10-24 Thread Anirvan Sarkar
Hi Vadim,

I must have missed that while I was glancing through the JDK demos.

Also I will recommend that the pages at
http://www.oracle.com/technetwork/java/javafx/samples/index.html and
http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-2158687.html
be
updated to link to JDK 8 demos since they are the first links to come when
you search Google for JavaFX Samples.

Thanks,
Anirvan.

On 24 October 2014 16:57, Vadim Pakhnushev vadim.pakhnus...@oracle.com
wrote:

 Hi Anirvan,

 Since JavaFX is bundled with the JDK, JavaFX samples are bundled with the
 JDK demos and samples downloadable from the JDK 8 downloads page.
 Specifically, Ensemble8 is in the demo/javafx_samples directory of the
 demos bundle.

 Thanks,
 Vadim

 On 24.10.2014 14:27, Anirvan Sarkar wrote:

 Can someone provide the link to JavaFX 8 Demos and Samples page?

 I found  JavaFX 2.2.71 Demos and Samples from JDK 7 downloads
 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-
 1880260.html
 page.
 But I couldn't  find one at JDK 8 downloads
 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-
 2133151.html
   page.

 Also searching for JavaFX Samples on the net led me to this page:
 http://www.oracle.com/technetwork/java/javafx/samples/index.html which
 says
 that JavaFX Samples Section has moved to
 http://www.oracle.com/technetwork/java/javase/overview/javafx-samples-
 2158687.html
 .

 But on this page there is link to try Ensemble 2 and not Ensemble 8.

 So from where can we try Ensemble 8?

 Regards,
 Anirvan





-- 
Anirvan


WritableImage is of lower quality and larger in size than BufferedImage?

2014-08-16 Thread Anirvan Sarkar
I first created a BufferedImage using the Graphics2D API and then a similar
WritableImage using GraphicsContext and Canvas.snapshot(null, null) method.
The WritableImage is of lower quality and larger in size than BufferedImage.

Is this a JavaFX bug or I am missing some RenderingHints for
GraphicsContext?

The test programs which I used:


BufferedImageExample.java

import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class BufferedImageExample {

public static void main(String[] args) throws IOException {

int width = 160;
int height = 60;

BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
g.setFont(new Font(SansSerif, Font.BOLD, 36));

Graphics2D graphics = (Graphics2D) g;
graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
  RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
graphics.drawString(JavaFX, 15, 45);

//save this image
ImageIO.write(image, png, new File(BufferedImageExample.png));
}
}



WritableImageExample.java

import java.io.File;
import java.io.IOException;

import javafx.application.Application;
import javafx.embed.swing.SwingFXUtils;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.WritableImage;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

import javax.imageio.ImageIO;

public class WritableImageExample extends Application {

@Override
public void start(final Stage primaryStage) throws IOException {

int width = 160;
int height = 60;

Canvas canvas = new Canvas(width, height);
GraphicsContext gc = canvas.getGraphicsContext2D();

gc.setFill(Color.BLACK);
gc.fillRect(0, 0, width, height);
gc.setFill(Color.WHITE);
gc.setFont(Font.font(SansSerif, FontWeight.BOLD, 36));
gc.fillText(JavaFX, 15, 45);

WritableImage image = canvas.snapshot(null, null);

//save this image
ImageIO.write(SwingFXUtils.fromFXImage(image, null), png, new
File(WritableImageExample.png));

System.exit(0);
}
}


-- 
Anirvan