How to get raw pixel data into JavaFX

2015-04-29 Thread Philipp Dörfler
Hello list,

I got some very low level pixel data residing in memory with a pixel format and 
want to get that into JavaFX. I am talking about raw bytes, BGR, 24 bit per 
pixel etc..
The library providing this pixel data is OpenCV and although it allows for 
encoding the data into a standard format like .bmp or .png which then can 
be read by JavaFX, I would like to avoid this extra conversion process because 
I got some real time constraints.

As far as I understand this is what the PixelReader and PixelWriter interface 
is for. Is this correct? Where can I find additional information on how to use 
them besides the Javadoc? Would using the Canvas be easier? Can I somehow use 
the GraphicsContext of Canvas to do that?
I'd be grateful for any pointers even when it's just check out the class XZY 
in the underlying prism code: link to bitbucket.

Thanks and best regards!

Philipp Dörfler

Re: New alias for hg commit notifications?

2014-06-27 Thread Philipp Dörfler
+1
I’m also filtering them out right now.

Cheers,
Philipp

Am 27.06.2014 um 09:30 schrieb Ralf Spathelf ralf.spath...@aicas.de:

 +1
 
 I'm currently basically interested in the discussions.
 
 Regards,
 Ralf
 
 On 06/24/2014 03:34 PM, Kevin Rushforth wrote:
 It has been suggested that we create a new alias for Mercurial (hg) commit 
 notifications -- perhaps openjfx-chan...@openjdk.java.net -- rather than 
 sending all of them to the discussion alias. This will facilitate e-mail 
 filtering
 as well as allow people to opt in or out of getting these notifications 
 separately from being on the discussion alias.
 
 What do others think?
 
 -- Kevin
 
 



Re: Scene Builder 2.0 released.

2014-05-14 Thread Philipp Dörfler
Good job, this released version looks really polished and seems a lot more 
stable and feels snappier. And I love the new thinner look!

Am 14.05.2014 um 19:28 schrieb Simon Vienot simon.vie...@oracle.com:

 In case some of you missed it, we have just pushed Scene Builder 2.0 live [1] 
 yesterday.
 All details on Jasper's nice blog post [2].
 If you have 8 minutes to spare, I encourage you to have a look at this demo 
 [3] where FX8 and SB2 shine.
 
 -Simon
 
 [1] 
 http://www.oracle.com/technetwork/java/javase/downloads/sb2download-216.html
 [2] http://fxexperience.com/2014/05/announcing-scenebuilder-2-0/
 [3] https://www.youtube.com/watch?v=ij0HwRAlCmofeature=youtu.be



Re: New Scene Builder?

2014-04-15 Thread Philipp Dörfler
For the impatient: SceneBuilder is OpenSource nowadays and included in the 
OpenJFX8-rt repository  as a NetBeans project.

~ Philipp

Am 15.04.2014 um 12:32 schrieb Felix Bembrick felix.bembr...@gmail.com:

 There hasn't been a new release of Scene Builder in over 2 months (unless I
 am accessing stale links).  Is one on the horizon?
 
 Felix



Re: JavaFX 2 + with LWJGL ( OpenGL )

2014-04-06 Thread Philipp Dörfler
It is not possible to combine JavaFX and OpenGL as it is right now. This was 
discussed on this mailing list some time before as a _possible_ future 
addition, but I’d be very surprised if Oracle actually chose to implement this.

Starting with JavaFX 8 there is indeed some kind of „3D support“ but the 3D API 
allows only for the most basic operations. It is still completely scene graph 
based and you have to live with all restrictions that JavaFX imposes on you. 
Not wanting to say that the 3D API is completely useless, but I’m afraid that 
even WPF is more flexible when it comes to 3D than JavaFX is. For example: As 
far as I know you can not even change the shading model from GL_SMOOTH to 
GL_FLAT. You could work around that by setting the normals yourself though 
(Same for WPF). Also render quality is bad when you render an instance of Text 
in 3D and scale it down for example. At least it was when I tried that last 
time (few months ago).

Again, not to say that one can’t work with JavaFX’s 3D API, but it’s not raw 
OpenGL either. As far as I know the JavaFX team wants to be able to let the 
user use his own OpenGL context and let JavaFX render on top of that or add the 
possibility to ask JavaFX for the underlying context and mess with that but 
this is not even officially planned or included on any roadmap (AFAIK) so we 
can only keep our fingers crossed for that to happen. Like you I would 
absolutely LOVE to use JavaFX as a GUI on top of my OpenGL games.

Cheers
Philipp Dörfler

Am 06.04.2014 um 16:31 schrieb Exo Verse tora...@gmail.com:

 Can you please explain what True 3D means in terms of Low Level API ?
 Because with LWJGL I can use Low Level API to talk directly to my Video
 Card. As a game dev, I need every ounce of umph from the card I can get,
 and using a browser or any other kind of wrapper hasn't proven very
 efficient. I love LWJGL because of its simplicity. Anything extra I need, I
 am allowed to make on my own. Example, my own Game Engine.
 
 And that is where I am at. So if your speaking about Nodes, I am aware
 there is a hierarchy to the JavaFX2 when setting up the GUI, but that is
 the only thing I knew existed. Could you please elaborate what makes
 JavaFX8 a True 3D Low Level interface API ? Because from the presentation,
 you have to go through two layers before you have to get to the OpenGL
 layer. Where as if I can use LWJGL, I can skip a level.
 
 If I am misinformed on something, please, explain. Because I am new to
 JavaFX.
 
 Cheers,
 Torak
 
 
 On Sun, Apr 6, 2014 at 10:24 AM, Hervé Girod herve.gi...@gmail.com wrote:
 
 With Java 8 (JavaFX 8), you now have true 3D Nodes, with camera,
 texturing, etc... However it would still be very interesting to be able to
 control the low-level rendering of JavaFX, such as using LWJGL for example.
 This would allow to render JavaFx content in an external OpenGL context for
 example.
 
 Hervé
 
 Sent from my iPad
 
 On 6 avr. 2014, at 14:42, Exo Verse tora...@gmail.com wrote:
 
 Hello, I have been working with OpenGL and LWJGL for over 5 years now. I
 want to switch over to using JavaFX 2, because of its GUI abilities and
 still use LWJGL with it. But I can't seem to find a way to do this. I
 saw a
 2 hour video that described the features of JavaFX 2 and it even shown
 the
 layout..  OpenGL was there at the bottom with D3D with Prism above both
 of
 them in the hierarchy. I have searched the web and I can't find prism, I
 can't find info on how to talk to opengl and I can't find any tutorials
 anywhere. So I am posting here to see what I can find. I do NOT like
 JOGL.
 I prefer LWJGL. So far, the only thing related to 3D with regards to
 JavaFX
 is the very resource intensive Canvas3D, which I can't stand. Any ideas ?
 Is it not implemented yet and its on its way ? I'm trying to find any
 info
 I can about this. If there is nothing for LWJGL, then I can't use JavaFX.
 
 Thanks.
 
 Torak
 



Building OpenJFX on Mac OS X 10.9.2 / XCode 5.1 / XCode 4.3.3

2014-04-04 Thread Philipp Dörfler
Hi,

just out of curiousity I wanted to build OpenJFX, but although I followed the 
instructions at
https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX
I can’t get it to work.

gradle 1.8 fails when building :fxpackage:compileLauncher as follows:

:fxpackager:compileLauncher
clang: warning: no such sysroot directory: 
'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk'
/Users/phi/Documents/workspace/OpenJFX8-rt/modules/fxpackager/src/main/native/launcher/mac/main.m:26:9:
 fatal error: 'Cocoa/Cocoa.h' file not found
#import Cocoa/Cocoa.h
^
1 error generated.
:fxpackager:compileLauncher FAILED

I do not have a 10.7 SDK on my 10.9 Mac, but I do have a 10.8 and 10.9:

$ ls 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
MacOSX10.8.sdk MacOSX10.9.sdk

According to „the internet™“ I would have to find an old version of Xcode 
(apparently 4.3.3) because that’s the only way to find an old SDK.
As I’m sure that you guys have valid reasons to stick to 10.7 I think it would 
not hurt to mention this on the wiki page mentioned above stating that one 
needs XCode not newer than 4.3.3 and that old XCode versions can be downloaded 
on the Apple Developer website.
I would add it myself but as I’m not a contributor I don’t have the required 
permissions, so all I can do is to ask here for inclusion of that.

Thanks! May that be the only obstacle in building JFX8.




Re: Building OpenJFX on Mac OS X 10.9.2 / XCode 5.1 / XCode 4.3.3

2014-04-04 Thread Philipp Dörfler
Thanks so much for all these valuable suggestions :)

XCodeLegacy looks interesting, I thought of the symbolic link too but assumed 
there was a reason and good to know that you can change that behaviour in the 
build itself.
Looking forward to see that in the wiki!

Cheers and have a great weekend everyone!
~ Philipp

Am 04.04.2014 um 23:56 schrieb Stephen F Northover 
steve.x.northo...@oracle.com:

 Put this in your gradle.properties file:
 
 MACOSX_SDK_PATH = 
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 
 We need to document this on the wiki.  Will do that Monday.  Gotta go now.
 
 Steve
 
 On 2014-04-04 5:31 PM, Philipp Dörfler wrote:
 Hi,
 
 just out of curiousity I wanted to build OpenJFX, but although I followed 
 the instructions at
 https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX
 I can’t get it to work.
 
 gradle 1.8 fails when building :fxpackage:compileLauncher as follows:
 
 :fxpackager:compileLauncher
 clang: warning: no such sysroot directory: 
 '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk'
 /Users/phi/Documents/workspace/OpenJFX8-rt/modules/fxpackager/src/main/native/launcher/mac/main.m:26:9:
  fatal error: 'Cocoa/Cocoa.h' file not found
 #import Cocoa/Cocoa.h
 ^
 1 error generated.
 :fxpackager:compileLauncher FAILED
 
 I do not have a 10.7 SDK on my 10.9 Mac, but I do have a 10.8 and 10.9:
 
 $ ls 
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
 MacOSX10.8.sdk MacOSX10.9.sdk
 
 According to „the internet™“ I would have to find an old version of Xcode 
 (apparently 4.3.3) because that’s the only way to find an old SDK.
 As I’m sure that you guys have valid reasons to stick to 10.7 I think it 
 would not hurt to mention this on the wiki page mentioned above stating that 
 one needs XCode not newer than 4.3.3 and that old XCode versions can be 
 downloaded on the Apple Developer website.
 I would add it myself but as I’m not a contributor I don’t have the required 
 permissions, so all I can do is to ask here for inclusion of that.
 
 Thanks! May that be the only obstacle in building JFX8.
 
 
 



Re: FXML, Presentation Model bi-directional binding

2014-01-21 Thread Philipp Dörfler
The only thing you have to do is to write a controller and put
myTextBox.textProperty().bindBidirectional(dataModel.textProperty()); into
the initialize method. It's way less convenient than it could and should be
but at least that gets you bidirectional binding. For a working example
featuring a calculator that can add 4 bits done with bidirectional binding
properties only (+ some FXML) please have a look at
https://bitbucket.org/phdoerfler/talks/src/09f00ea55cbddc2acca94c240593f9071169706c/JavaFX%20-%20Lessons%20Learned/src/main/java/demo/calc/?at=defaultwhere
you can find both the code and the talk (in the downloads tab) of a
talk of mine where I compared FX to the presentation model of WPF. The
slides might be worth looking at because they summarize my findings in
surprising FXML binding syntax that are scattered in this mailing list
somewhere.

Hope this helps!
Am 20.01.2014 21:55 schrieb Martin Sladecek martin.slade...@oracle.com:

 Related JIRA issue: https://javafx-jira.kenai.com/browse/RT-17646

 Uni-directional binding is possible using ${path.to.property} syntax (see
 http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/
 introduction_to_fxml.html#expression_binding)

 -Martin

 On 01/20/2014 08:42 PM, Richard Bair wrote:

 Sadly, still not possible :-(. Though I still think it's a great way to
 go!

  On Jan 20, 2014, at 7:45 PM, Christian Schudt christian.sch...@gmx.de
 wrote:

 Hi together,

 I just (re-)read Richard's excellent article
 http://fxexperience.com/2011/10/fxml-why-it-rocks-and-the-next-phase/

 He talks about the next phase in FXML being the Presentation Model and
 the use of bidirectional binding in FXML.

 I really like to make use of it because I think it's the way to go and
 better than MVC pattern. (I've worked with PM pattern in Flex/MXML and it
 was really comfortable.)

 Now this article is 2.5 years old and I wonder, what's the current state
 of the next phase, i.e. bi-directional binding in FXML or at least
 uni-directional binding.

 I just tried the proposed syntax out and it doesn't work with Java 8, so
 I assume it's still not possible!?

 Thanks for answer,
 Best regard,

 Christian






Re: Scene Builder is now open source!

2013-12-03 Thread Philipp Dörfler
Yay! Seems Christmas is early this year :)

Am 03.12.2013 um 16:04 schrieb Simon Vienot simon.vie...@oracle.com:

 Hello OpenJFXers !
 
 We're very happy to announce that Scene Builder is now open source, as a part 
 of the OpenJFX project.
 The whole Scene Builder functionality is available, including the SB Kit API 
 as well as the standalone SB application.
 The only part of the product which remains closed is the native 
 packaging/installer code.
 SB code is available in rt/apps/scenebuilder/ under the terms of a BSD-style 
 license, similar to JavaFX samples.
 
 You are all welcome to contribute.
 
 Thanks,
 -Simon.
 



Re: Platform.isSupported behavior

2013-11-19 Thread Philipp Dörfler

 A thought about API for listening to state changes. What if we added an API 
 to Platform like Platform.isSupported that instead of returning a boolean 
 returned an ObservableBooleanValue? This listener would never be notified on 
 conditional features like EFFECT or SCENE3D but would be notified on those 
 conditional features that reflect input device state.

+1

Re: Use of plugins in WebView

2013-11-19 Thread Philipp Dörfler
Thanks for clarifying this.

~ philipp

Am 19.11.2013 um 19:12 schrieb Stephen F Northover 
steve.x.northo...@oracle.com:

 There is no FX API to get the underlying window handle (HWND) on the desktop 
 or in the browser.
 
 Steve
 
 On 2013-11-18 9:02 PM, Peter Zhelezniakov wrote:
 On 11/18/2013 06:20 PM, Philipp Dörfler wrote:
 And especially a HWND is what I’m looking for. So I guess anything 
 requiring a HWND is just not usable within an JFX App at all? :/
 
 I'm not a Glass expert, but I'd expect such platform-specific data to be 
 well hidden from a JavaFX developer.
 
 



Re: Chances of open sourcing SceneBuilder

2013-11-19 Thread Philipp Dörfler
This is excellent news! You guys are full of surprise :)

~ Philipp

Am 19.11.2013 um 23:41 schrieb Kevin Rushforth kevin.rushfo...@oracle.com:

 I see Joe already responded with status (my e-mail crossed his).
 
 -- Kevin
 
 
 Kevin Rushforth wrote:
 Hi Philipp,
 
 There is a JIRA filed to track the open sourcing or SceneBuilder:
 
 https://javafx-jira.kenai.com/browse/RT-34175
 
 Someone from the SceneBuilder team can comment on the status of this.
 
 -- Kevin
 
 
 Philipp Dörfler wrote:
 Hello list,
 
 I can’t but acknowledge the work put into SceneBuilder especially when 
 seeing SceneBuilder 2 who apparently underwent a serious and well done 
 design overhaul (I still want to see a dark theme ;) ). Well done!
 
 As much as I love the new design the Early Access 2.0 version feels very 
 rough and makes clear that this tool needs a lot of love. I thought about 
 contributing to OpenJFX for quite some time but would actually rather spend 
 time on improving SceneBuilder than working on juicy API internals that are 
 better left to guys that truly know what they do ;) Things like better IDE 
 integration or making the keyframe based animation API accessible in the 
 GUI already (To at least partially get to where JavaFX 1 Designer once was 
 or wanted to be) come to my mind.
 
 As far as I know there are currently no plans of open sourcing Scene 
 Builder but I wondered if there’s even a chance for it and what would be 
 required for that to happen? Seeing that the JFX team probably has a very 
 tight schedule and spent a lot of time open sourcing the core components 
 already I’m afraid that a OSS SceneBuilder would be kind of impossible. Am 
 I too pessimistic?
 
 Cheers,
 ~ Philipp



Use of plugins in WebView

2013-11-18 Thread Philipp Dörfler
How impossible would be the use of plugins such as the Adobe Acrobat Reader
or the Mac OS X embedded PDF preview in Safari for WebView? Does the
embedded WebKit engine include an implementation of that plugin API or has
that been omitted?

Also: How hard would it be to embed the respective platform's native
browser oneself? Can I obtain a handle for a JFX panel that I can then give
to WinAPI? How much would that interfere with the compositing and rendering
done by prism?
Being able to obtain a handle would (in my naive view) theoretically allow
to include another OpenGL context in an JFX app. Albeit I'm afraid that
prism wouldn't be happy about this either.


Re: Use of plugins in WebView

2013-11-18 Thread Philipp Dörfler
And especially a HWND is what I’m looking for. So I guess anything requiring a 
HWND is just not usable within an JFX App at all? :/

Am 18.11.2013 um 15:01 schrieb Peter Zhelezniakov 
peter.zheleznia...@oracle.com:

 How impossible would be the use of plugins such as the Adobe Acrobat Reader
 or the Mac OS X embedded PDF preview in Safari for WebView? Does the
 embedded WebKit engine include an implementation of that plugin API or has
 that been omitted?
 
 It has been omitted. The hardest part is to funnel all the rendering a plugin 
 does through Prism. Not sure if that is at all possible. (Some plugins may 
 just expect to be given a HWND for example)
 


Re: discussion about touch events

2013-11-11 Thread Philipp Dörfler
I see the need to be aware of the area that is covered by fingers rather
than just considering that area's center point.
I'd guess that this adds a new layer of complexity, though. For instance:
Say we have a button on some background and both the background and the
button do have an onClick listener attached. If you tap the button in a way
that the touched area's center point is outside of the buttons boundaries -
what event will be fired? Will both the background and the button receive a
click event? Or just either the background or the button exclusively? Will
there be a new event type which gets fired in case of such area-based taps?

My suggestion would therefore be to have an additional area tap event which
gives precise information about diameter and center of the tap. Besides
that there should be some kind of priority for choosing which node's
onClick will be called. Maybe the draw order / order in the scene graph / z
buffer value might be sufficient to model what would happen in the real,
physical world.
Am 11.11.2013 13:05 schrieb Assaf Yavnai assaf.yav...@oracle.com:

 The ascii sketch looked fine on my screen before I sent the mail :( I hope
 the idea is clear from the text
 (now in the reply dialog its also look good)

 Assaf
 On 11/11/2013 12:51 PM, Assaf Yavnai wrote:

 Hi Guys,

 I hope that I'm right about this, but it seems that touch events in glass
 are translated (and reported) as a single point events (x  y) without an
 area, like pointer events.
 AFAIK, the controls response for touch events same as mouse events (using
 the same pickers) and as a result a button press, for example, will only
 triggered if the x  y of the touch event is within the control area.

 This means that small controls, or even quite large controls (like
 buttons with text) will often get missed because the 'strict' node picking,
 although from a UX point of view it is strange as the user clearly pressed
 on a node (the finger was clearly above it) but nothing happens...

 With current implementation its hard to use small features in controls,
 like scrollbars in lists, and it almost impossible to implement something
 like 'screen navigator' (the series of small dots in the bottom of a smart
 phones screen which allow you to jump directly to a 'far away' screen)

 To illustrate it consider the bellow low resolution sketch, where the +
 is the actual x,y reported, the ellipse is the finger touch area and the
 rectangle is the node.
 With current implementation this type of tap will not trigger the node
 handlers

 __
   / \
  /   \
___/ __+_ \___in this scenario the 'button' will not get
 pressed
|\ /|
|___\ ___ / __ |
   \___/

 If your smart phone support it, turn on the touch debugging options in
 settings and see that each point translate to a quite large circle and what
 ever fall in it, or reasonably close to it, get picked.

 I want to start a discussion to understand if my perspective is accurate
 and to understand what can be done, if any, for the coming release or the
 next one.

 We might use recently opened RT-34136 https://javafx-jira.kenai.
 com/browse/RT-34136 for logging this, or open a new JIRA for it

 Thanks,
 Assaf





Re: Scene Builder performance regression between 1.1 and 2.0

2013-11-07 Thread Philipp Dörfler
I also noticed a performance regression (Linux x64). SceneBuilder 1.1 was
already kind of slow, but 2.0 feels even less snappy. The menus feel
particularly sluggish and I can even see parts of the GPU's memory content
right before the menu items are being drawn over it.
Am 07.11.2013 12:49 schrieb Artem Ananiev artem.anan...@oracle.com:


 On 11/7/2013 10:11 AM, Felix Bembrick wrote:

 Scene Builder 2.0 has very serious performance issues (on my machines at
 least).

 When running 1.1  2.0 side-by-side, 1.1 is very responsive and behaves
 very well.  On the contrary, 2.0 is extremely sluggish with a few seconds
 between clicking on a control and the selection handles appearing and
 trying to resize the properties pane is so slow that it is not usable.


 It may be caused by exceptions or logging output to stdout/err...

 Thanks,

 Artem

  I see this version of Scene Builder was built with JDK8 b112.

 Is anyone else experiencing this?  Have I just hit on some subtle
 performance issue with JavaFX 8 and the GPU drivers on this machine (which
 is Windows 7 64-bit BTW).?

 Felix




Re: Media is now opensource

2013-10-18 Thread Philipp Dörfler
+1

Am 18.10.2013 um 20:53 schrieb Scott Palmer swpal...@gmail.com:

 I propose the codecs be made pluggable.  The licensing issue can be left to 
 the application developer.
 
 https://javafx-jira.kenai.com/browse/RT-2684
 
 Once that is in place, support for whatever codec you wish can be added. 
 FFMPEG could be used as an example.
 I'm against adding any new codecs without first putting in a user-extensible 
 codec mechanism that does not require modifying JavaFX to support new 
 formats.  I.e. make the dog food first, then eat it.
 
 Scott
 
 On 2013-10-18, at 2:03 PM, Kirill Kirichenko kirill.kiriche...@oracle.com 
 wrote:
 
 Media is very regulated area in legal terms. Using different codecs may 
 involve using and even violating some license agreements.
 Anyway you're welcome to propose anything.
 
 
 On 18.10.2013 21:37, Robert Krüger wrote:
 Great news!
 
 Does this mean that it is now possible to add support for more
 demuxers/decoders e.g. by utilizing stuff from other projects (ffmpeg
 comes to mind)?
 
 On Fri, Oct 18, 2013 at 6:35 PM, Kirill Kirichenko
 kirill.kiriche...@oracle.com wrote:
 Hello OpenJFXers !
 We're happy to announce that Media part of JavaFX is now open source.
 Opensourcing touched all Media component except ON2 FLV demuxer and VP6
 decoder. The decoder will remain closed.
 
 You're all welcome to contribute.
 
 Thanks,
 K
 



Re: JAVAFX on ANDROID

2013-10-15 Thread Philipp Dörfler
I might be a bit late to the party but I lately discovered something that might 
be useful for backporting JavaFX 8 to Java 6:

 Retrolambda lets you run Java 8 code with lambda expressions on Java 7 or 
 lower. It does this by transforming your Java 8 compiled bytecode so that it 
 can run on a Java 7 runtime. After the transformation they are just a bunch 
 of normal .class files, without adding any runtime dependencies.

https://github.com/orfjackal/retrolambda

Hope this helps,
Philipp Dörfler