Re: Planning for JavaFX.next

2016-12-08 Thread Jeff Martin
Be wary of selection bias 
 when 
asking advice from us on this list. I would advocate a feature based on who 
*isn’t* using JavaFX: WebAssembly browser support.

JavaFX is great if you need to build a battleship class app - something big and 
specialized enough that devs don’t mind packaging/signing/deployment issues and 
users don’t mind downloads and security issues. It’s not as attractive for 
smaller scale apps. And most battleship class apps start as smaller apps.

With very little resources, I was able to use a JavaFX/Swing based UI kit and 
TeaVM to build apps that run on the desktop and in the browser. I would think 
Oracle would be able to nail this with moderate effort - particularly with 
WebAssembly coming out this year. Hire/buy the TeaVM guy - he’s brilliant.

The JavaFX team has done something like this before: JavaFXPackager - a feature 
so useful and needed that it became part of the whole system. I’m not sure we 
need new table features or such. If someone is going to write a spreadsheet, 
they’d be better off rolling their own super-table, etc.

http://reportmill.com/snaptea/BusyBox/

jeff

> On Dec 7, 2016, at 5:45 PM, Jonathan Giles  wrote:
> 
> Hi folks,
> 
> Development on JDK 9 is slowly starting to ramp down, and we are starting to 
> turn our attention to the goals for JavaFX in JDK 10 and beyond. We are 
> starting to compile our list of what we think is important, but we really 
> want to hear from the community about what their highest priorities are to 
> them. As always, it's important to keep in mind what JavaFX is (e.g. it isn't 
> aiming to be a high-performance game engine), but even still there are bound 
> to be a number of places where people might want to weigh in, for example:
> 
> * New layout containers (e.g. Flexbox)
> * Public APIs for UI control behaviors
> * Marlin renderer enabled by default
> * Support for CSS animations
> * CSS performance improvements
> * TableView improvements (cell spanning, row / column freezing, etc)
> * TableView performance
> * Focus traversal API
> * WebGL support in WebView
> * Improved image I/O support
> * A JavaFX equivalent of the AWT Desktop APIs
> * Multi-res image API
> * NIO-backed writable images
> 
> If there are other areas of interest that aren't listed here, please start 
> discussing them and we can work together to determine priorities. If all you 
> want to do is add a +1 for one of more of the items above, even that will be 
> very useful.
> 
> Thanks,
> -- Jonathan



Re: Can we use JavaPackager and a get full JRE?

2015-08-09 Thread Jeff Martin
You can add a post-image script to your javapackager build to manually add the 
java.exe into your application. If you search the output from the javapackager 
for “post-image” I think it will tell you what file to create and where to put 
it. Here is a post-image file that I use to move java.exe into my native app on 
Windows:

MyApp-post-image.wsf:

?xml version=1.0 ? 
package 
  job id=postImage 
script language=JScript 
  ![CDATA[ 
var oFSO = new ActiveXObject(Scripting.FileSystemObject); 
var oFolder = oFSO.getFolder(.); 
var from = C:\\Program Files\\Java\\jdk1.8.0_40\\bin\\java.exe; 
var to = oFolder.path + “\\MyApp\\runtime\\bin; 
if (!oFSO.FolderExists(to)) { 
  oFSO.CreateFolder(to); 
}
to += \\;
oFSO.CopyFile(from, to); 
  ]] 
/script 
  /job 
/package

On MacOS, I just build a native “image” as opposed to a .dmg. So it’s easy to 
add the java binary in an external script (I do some codesign stuff there as 
well, which has to happen after I modify the native package).

Jeff Martin
214.513.1636


 On Aug 8, 2015, at 6:16 PM, Scott Palmer swpal...@gmail.com wrote:
 
 I’m using the JavaFX gradle plugin to build a very simple application with 
 the new java packager and I’ve noticed a problem with the embedded JRE, at 
 least on OS X.
 
 Specifically, the ‘bin’ folder is missing from the embedded JRE, presumably 
 because the embedded launcher replaces it.
 However my application (and many others) needs to launch a new java process.  
 Part of the reason for doing so is so it can be launched with new JVM options 
 that are determined at runtime.  For example modifying the java.library.dir 
 after finding “plugins” that have native code.
 
 Now it fails when running from the app bundle (works fine from a command 
 line).  The problems is that it fails to launch a new ‘java’ process because 
 it expects to find 'bin/java' in the JRE folder.
 
 What is the solution?
 
 Since I’m using Gradle, I’m thinking I could tweak things to copy the JRE bin 
 folder into the .app/Contents/PlugIns/Java.runtime/Contents/Home/jre/ 
 folder, but really the javapackager should have an option to include the 
 “full” JRE.
 
 Or perhaps we need a new API in Java 9 to support launching a new Java 
 process?
 
 
 Regards,
 
 Scott
 
 



Re: App hang and pulse logger stops

2015-05-13 Thread Jeff Martin
I think I ran into this a bit when I had a mixed swing/javafx application. It 
was always due to inadvertently performing Swing activity while still in the 
JFX thread or visa versa. I think sometimes checking the stack frame on both 
threads would show me where it was (but sometimes not). I think I was always 
able to solve it with the right SwingUtilities.invokeLater() or 
Platform.runLater().

My apologies if you already knew all this (and for the fact that it wasn’t 
really helpful). I’ve heard mention on this list that there is a new “single 
event thread” setting for JFX 8. I’ve wondered if that would have magically 
solved this issue, and allowed one to remove the runLater() calls.

jeff


On May 13, 2015, at 9:04 AM, Pedro Duque Vieira pedro.duquevie...@gmail.com 
wrote:

 Anyone...? (see below)
 
 On Mon, May 11, 2015 at 8:03 PM, Pedro Duque Vieira 
 pedro.duquevie...@gmail.com wrote:
 
 
 Hi,
 
 
 
 Already posted this on the OTN forum but got no response.
 
 
 I have a swing/javafx app that is hanging randomly without any error
 information (exceptions thrown, etc). I run the app with the pulse logger
 flag active and when it hangs the pulse logger stops.
 
 
 
 How can I debug this? What can cause the pulse logger to stop? Is this my
 fault or some javafx bug?
 
 
 Thanks, best regards,
 --
 Pedro Duque Vieira
 
 
 
 
 -- 
 Pedro Duque Vieira



Re: Font size, dpi and text crispness (snapping to pixels)

2015-04-16 Thread Jeff Martin
I’m surprised about the font size problem - If I create a font with new 
Font(“Monaco”, 10), text shows up the same size as it does in Eclipse.

I don’t think there is a solution for the blurry problem, however, because 
there is no way to disable Antialiasing. In Swing, I was able to get crisp 
rendering identical to eclipse by checking for very specific fonts/sizes and 
disabling TEXT_ANTIALIASING.

The only solution in JavaFX may be to get a Retina monitor. This didn’t seem to 
be a terrible proposition to me last year, when it seemed like almost 
everything from phones to tablets to laptops had gone HiDPI. It’s taking 
forever for the desktop world to catch on, though. Apple is taking it’s time. 
Dell apparently has a nice 5k external, but it needs two mini display ports to 
drive it.

jeff


On Apr 16, 2015, at 9:28 AM, Damien Dudouit ddudo...@clio.ch wrote:

 Hello,
 
 I'm experimenting with Java FX on a Windows 7 machine, using Java 1.8.0_40.
 
 The *javafx.scene.text.*Font javadoc says :
 
 *The size of a Font is described as being specified in points which are a
 real world measurement of approximately 1/72 inch. *
 
 *[...] Note that the real world distances specified by the default
 coordinate system only approximate point sizes as a rule of thumb and are
 typically defaulted to screen pixels for most displays. *
 
 Java FX behaves as if the display dpi is 72 while in my case for instance
 its about 96. 96/72 = 1..
 
 So for instance if I set Font.font(Consolas, FontPosture.REGULAR, 10) as
 a font on a javafx.scene.control.TextArea, text appears a lot smaller than
 in my eclipse editor configured with the same font.
 Obviously, I get about the same visual size if I use a font size of 13 in
 Java FX while using the same font in size 10 in Eclipse.
 
 I guess I could set scaling somehow in my Java FX code. But using scaling,
 I imagine that text has little chance to display as crisp as it should.
 
 In fact, trying to compare the pixel output of Eclipse with font size 10
 and Java FX in font size 13 (or 13.333), the Java FX one is slightly blurry.
 
 What can be done in Java FX when an application needs text as clear as
 possible, for instance if the application is a text editor ?
 
 What is the correct approach in a Java FX app so that it respect the
 default font size configured at the OS level ?
 
 
 Thanks a lot in advance,
 
 Damien
 
 
 public final class MyApplication extends Application {
 
  public static void main(String[] args) {
launch(args);
  }
 
  @Override
  public void start(Stage primaryStage) {
TextArea editor = new TextArea();
 
editor.setFont(Font.font(Consolas, FontPosture.REGULAR, 10));
 
primaryStage.setScene(new Scene(editor));
primaryStage.show();
 
System.out.println(Toolkit.getDefaultToolkit().getScreenResolution());
  }
 }



Re: Font size, dpi and text crispness (snapping to pixels)

2015-04-16 Thread Jeff Martin
I should have included a smiley when I suggested a 5k Retina monitor as a 
“workaround”. :-)

Also, I should have mentioned that I was able to improve my text rendering 
significantly with:

myText.setFontSmoothingType(FontSmoothingType.LCD)

It isn’t as crisp as Eclipse, but I believe the text rendering is as good as 
Xcode, which renders text with antialiasing.

jeff


On Apr 16, 2015, at 5:24 PM, Matthieu BROUILLARD matth...@brouillard.fr wrote:

 In my company at least in the business (healthcare in hospitals) we target 
 JavaFX for (as a replacement of old app in Swing) we for sure cannot ask our 
 clients to change their computers/screen to have HiDPI... so having 5K 
 screens, yes in 2045 perhaps.
 
 
 On Thu, Apr 16, 2015 at 7:12 PM, Jeff Martin j...@reportmill.com wrote:
 I’m surprised about the font size problem - If I create a font with new 
 Font(“Monaco”, 10), text shows up the same size as it does in Eclipse.
 
 I don’t think there is a solution for the blurry problem, however, because 
 there is no way to disable Antialiasing. In Swing, I was able to get crisp 
 rendering identical to eclipse by checking for very specific fonts/sizes and 
 disabling TEXT_ANTIALIASING.
 
 The only solution in JavaFX may be to get a Retina monitor. This didn’t seem 
 to be a terrible proposition to me last year, when it seemed like almost 
 everything from phones to tablets to laptops had gone HiDPI. It’s taking 
 forever for the desktop world to catch on, though. Apple is taking it’s time. 
 Dell apparently has a nice 5k external, but it needs two mini display ports 
 to drive it.
 
 jeff
 
 
 On Apr 16, 2015, at 9:28 AM, Damien Dudouit ddudo...@clio.ch wrote:
 
  Hello,
 
  I'm experimenting with Java FX on a Windows 7 machine, using Java 1.8.0_40.
 
  The *javafx.scene.text.*Font javadoc says :
 
  *The size of a Font is described as being specified in points which are a
  real world measurement of approximately 1/72 inch. *
 
  *[...] Note that the real world distances specified by the default
  coordinate system only approximate point sizes as a rule of thumb and are
  typically defaulted to screen pixels for most displays. *
 
  Java FX behaves as if the display dpi is 72 while in my case for instance
  its about 96. 96/72 = 1..
 
  So for instance if I set Font.font(Consolas, FontPosture.REGULAR, 10) as
  a font on a javafx.scene.control.TextArea, text appears a lot smaller than
  in my eclipse editor configured with the same font.
  Obviously, I get about the same visual size if I use a font size of 13 in
  Java FX while using the same font in size 10 in Eclipse.
 
  I guess I could set scaling somehow in my Java FX code. But using scaling,
  I imagine that text has little chance to display as crisp as it should.
 
  In fact, trying to compare the pixel output of Eclipse with font size 10
  and Java FX in font size 13 (or 13.333), the Java FX one is slightly blurry.
 
  What can be done in Java FX when an application needs text as clear as
  possible, for instance if the application is a text editor ?
 
  What is the correct approach in a Java FX app so that it respect the
  default font size configured at the OS level ?
 
 
  Thanks a lot in advance,
 
  Damien
 
 
  public final class MyApplication extends Application {
 
   public static void main(String[] args) {
 launch(args);
   }
 
   @Override
   public void start(Stage primaryStage) {
 TextArea editor = new TextArea();
 
 editor.setFont(Font.font(Consolas, FontPosture.REGULAR, 10));
 
 primaryStage.setScene(new Scene(editor));
 primaryStage.show();
 
 System.out.println(Toolkit.getDefaultToolkit().getScreenResolution());
   }
  }
 
 



Re: JavaScript library for JavaFX fans?

2014-12-16 Thread Jeff Martin
You’re spot on, Mark. I need to do a little 
lightweight-in-the-browser-without-the-JVM development, and as a long-time 
Swing/JavaFX developer, I don’t want my fingers/brain to bleed too much. :-)

The JavaScript world doesn’t seem as cut-and-dried as Java, iOS, Android 
development. I’m hoping there’s a popular and capable standard for people who 
come from the Java world.

jeff


On Dec 16, 2014, at 9:07 AM, Jim Laskey (Oracle) james.las...@oracle.com 
wrote:

 He mentioned JavaFX Script language, so I assume he wants to work with FX 
 directly from Javascript.
 
 Look at https://blogs.oracle.com/nashorn/entry/jjs_fx as an example
 
 Cheers,
 
 -- Jim
 
 
 
 On Dec 16, 2014, at 10:49 AM, Mark Fortner phidia...@gmail.com wrote:
 
 Just to be clear, you're looking for a js library that has JavaFX-like 
 components, an event model, threading, graphics, animation and charting. And 
 runs in a browser. You're not looking to use fxml and js to build an 
 application, correct?
 
 On Dec 16, 2014 5:13 AM, Jim Laskey (Oracle) james.las...@oracle.com 
 wrote:
 Nashorn JavaScript works with FX very easily.
 
 On Dec 15, 2014, at 3:30 PM, Jeff Martin j...@reportmill.com wrote:
 
  I need to do some JavaScript development - any recommendations for a 
  JavaScript library that comes the closest to JavaFX?
 
  It seems like a couple years ago I even heard talk about making a 
  JavaScript version of JavaFX (maybe at JavaOne).
 
  jeff
 
 



JavaScript library for JavaFX fans?

2014-12-15 Thread Jeff Martin
I need to do some JavaScript development - any recommendations for a JavaScript 
library that comes the closest to JavaFX?

It seems like a couple years ago I even heard talk about making a JavaScript 
version of JavaFX (maybe at JavaOne).

jeff

Javapackager not calling MyApp-post-image.sh on MacOSX

2014-09-03 Thread Jeff Martin
I’m glad to see that javafxpackager is now javapackager. So my question should 
be - what is the proper forum to post a javapackger question, or who at Oracle 
could create a new dedicated forum for it?

In the meantime, does anyone have a suggestion to diagnose why my custom 
package/macosx/MyApp-post-image.sh isn’t getting called? Javapackager is 
picking up my custom icons fine, and the windows post-image.wsf is getting 
picked up fine. Just not getting called on MacOSX.

jeff

Re: Javapackager not calling MyApp-post-image.sh on MacOSX

2014-09-03 Thread Jeff Martin
Actually, for the moment I’m just generating “image”, though I tried pkg and it 
also didn’t call the post-image script.

I love all the customization tips when verbose is turned on. I was hoping it 
would say, “No post-image script found at package/macosx/SnapCode-post-image.sh 
- add one here for customization”.

jeff


On Sep 3, 2014, at 2:46 PM, Danno Ferrin danno.fer...@oracle.com wrote:

 What mac package format?  DMG or PKG?
 
 
 On Sep 3, 2014, at 12:38 PM, Jeff Martin j...@reportmill.com wrote:
 
 I’m glad to see that javafxpackager is now javapackager. So my question 
 should be - what is the proper forum to post a javapackger question, or who 
 at Oracle could create a new dedicated forum for it?
 
 In the meantime, does anyone have a suggestion to diagnose why my custom 
 package/macosx/MyApp-post-image.sh isn’t getting called? Javapackager is 
 picking up my custom icons fine, and the windows post-image.wsf is getting 
 picked up fine. Just not getting called on MacOSX.
 
 jeff
 



Re: Javapackager not calling MyApp-post-image.sh on MacOSX

2014-09-03 Thread Jeff Martin
Done: RT-38521 - Javapackager not calling post-image script on MacOSX for PKG 
and IMAGE

jeff


On Sep 3, 2014, at 4:15 PM, Danno Ferrin danno.fer...@oracle.com wrote:

 A quick code inspection shows that the post image script is only called for 
 DMG packaging.  Looks to be a PKG oversight.  Could you post a bug to 
 javafx-jira.kenai.com?
 
 On Sep 3, 2014, at 2:31 PM, Jeff Martin j...@reportmill.com wrote:
 
 Actually, for the moment I’m just generating “image”, though I tried pkg and 
 it also didn’t call the post-image script.
 
 I love all the customization tips when verbose is turned on. I was hoping it 
 would say, “No post-image script found at 
 package/macosx/SnapCode-post-image.sh - add one here for customization”.
 
 jeff
 
 
 On Sep 3, 2014, at 2:46 PM, Danno Ferrin danno.fer...@oracle.com wrote:
 
 What mac package format?  DMG or PKG?
 
 
 On Sep 3, 2014, at 12:38 PM, Jeff Martin j...@reportmill.com wrote:
 
 I’m glad to see that javafxpackager is now javapackager. So my question 
 should be - what is the proper forum to post a javapackger question, or 
 who at Oracle could create a new dedicated forum for it?
 
 In the meantime, does anyone have a suggestion to diagnose why my custom 
 package/macosx/MyApp-post-image.sh isn’t getting called? Javapackager is 
 picking up my custom icons fine, and the windows post-image.wsf is getting 
 picked up fine. Just not getting called on MacOSX.
 
 jeff
 
 
 



Re: Javapackager not calling MyApp-post-image.sh on MacOSX

2014-09-03 Thread Jeff Martin
I just tested with DMG and my script does get called. However, it seems like I 
can’t use it to add and remove JDK files without invalidating the codesign 
work. Is it possible for javapackager to build the image, call the post-image 
script, then codesign?

jeff


On Sep 3, 2014, at 4:33 PM, Jeff Martin j...@reportmill.com wrote:

 Done: RT-38521 - Javapackager not calling post-image script on MacOSX for PKG 
 and IMAGE
 
 jeff
 
 
 On Sep 3, 2014, at 4:15 PM, Danno Ferrin danno.fer...@oracle.com wrote:
 
 A quick code inspection shows that the post image script is only called for 
 DMG packaging.  Looks to be a PKG oversight.  Could you post a bug to 
 javafx-jira.kenai.com?
 
 On Sep 3, 2014, at 2:31 PM, Jeff Martin j...@reportmill.com wrote:
 
 Actually, for the moment I’m just generating “image”, though I tried pkg 
 and it also didn’t call the post-image script.
 
 I love all the customization tips when verbose is turned on. I was hoping 
 it would say, “No post-image script found at 
 package/macosx/SnapCode-post-image.sh - add one here for customization”.
 
 jeff
 
 
 On Sep 3, 2014, at 2:46 PM, Danno Ferrin danno.fer...@oracle.com wrote:
 
 What mac package format?  DMG or PKG?
 
 
 On Sep 3, 2014, at 12:38 PM, Jeff Martin j...@reportmill.com wrote:
 
 I’m glad to see that javafxpackager is now javapackager. So my question 
 should be - what is the proper forum to post a javapackger question, or 
 who at Oracle could create a new dedicated forum for it?
 
 In the meantime, does anyone have a suggestion to diagnose why my custom 
 package/macosx/MyApp-post-image.sh isn’t getting called? Javapackager is 
 picking up my custom icons fine, and the windows post-image.wsf is 
 getting picked up fine. Just not getting called on MacOSX.
 
 jeff


Re: JavaFX 8 and TextFields

2014-08-18 Thread Jeff Martin
I wonder if this is related to my rendering bug from last week, which also 
resulted in unexpected horizontal lines (boundary lines actually) when 
rendering on top of a background with an effect (assuming the textfield is 
possibly rendering something on a background with an inner shadow effect).

http://reportmill.com/examples/Renderbug/Renderbug.jpg
https://javafx-jira.kenai.com/browse/RT-38315

Mine may have been more pronounced because of the animation.

jeff


On Aug 18, 2014, at 9:29 AM, Stephen F Northover steve.x.northo...@oracle.com 
wrote:

 This seems to be the bug: https://javafx-jira.kenai.com/browse/RT-36987
 
 It's quite a mystery.  It's likely a shader problem but that's just a guess.
 
 Steve
 
 On 2014-08-18, 10:21 AM, Eric Le Ponner wrote:
 Dirk, Anothony,
 
 I’ve never observed this visual artifact on Mac OS 10.9 (.4)
 no matter it’s SB 2.0 (i.e. b20) or latest SB (with latest FX8dev code).
 
 Strange…
 
 Could it be related to the graphics pipeline ?
 What model of Mac are you using Dirk ?
 
 Eric
 
 
 
 Le 18 août 2014 à 15:34, Anthony Petrov anthony.pet...@oracle.com a écrit :
 
 Hi Dirk,
 
 This looks like a bug. Could you please verify if the latest 8u20 ea build 
 works for you? You can download it at:
 
 http://jdk8.java.net/download.html
 
 
 If it still fails, please file a new bug at
 
 https://javafx-jira.kenai.com/secure/CreateIssue!default.jspa
 
 --
 best regards,
 Anthony
 
 On 8/18/2014 5:28 PM, Dirk Dittert wrote:
 Hi,
 
 I'm wondering about the design of TextFields in JavaFX 8. Why are they
 having a horizontal line through the input area? I find that this looks
 rather peculiar...
 
 I posted some screenshots here:
 http://d.dittert.org/E4D7EB53-D198-47AC-9230-53E9A23F6767/
 
 One is from SceneBuilder 2.0-b20 on OS X 10.9. The other one is from one of
 my applications (running on 1.8.0_11) on OS X.
 
 Thanks,
 Dirk
 
 



Re: Render bug

2014-08-14 Thread Jeff Martin
Okay, here’s the jira:

Render bug animating over node with lighting effect

I also simplified the example (happens with a Rectangle background as well as 
ImageView).

jeff


On Aug 13, 2014, at 3:20 PM, Chien Yang chien.y...@oracle.com wrote:

 This looks like a bug in JavaFX when applying the lighting effect. I was able 
 to reproduce the dirty rect rendering on my system. The bug went away if I 
 commented  out the following line:
 
   iview.setEffect(lighting);
 
 Can you please file a JIRA so that we will fix it?
 
 Thanks,
 - Chien
 
 On 8/13/2014 8:33 AM, Jeff Martin wrote:
 I’m getting a rendering bug with a simple rotating path in front of an 
 ImageView (with lighting effect) on Mac OS with 8u20:
 
  http://reportmill.com/examples/Renderbug/Renderbug.jpg
 
 Looks like some sort of dirty rect problem. Am I doing something wrong or 
 should I file a bug?
 
 The code is below. If anyone has an idea for a quick work around, let me 
 know.
 
 jeff

import javafx.animation.RotateTransition;
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.stage.Stage;
import javafx.util.Duration;

public class DrawTurd extends Application {

public void start(Stage aStage)
{
// Creat background rect with lighting effect
Rectangle rect = new Rectangle(0,0,500,400); rect.setFill(Color.YELLOW);
Light.Distant light = new Light.Distant(); light.setAzimuth(60); 
light.setElevation(120);
Lighting lighting = new Lighting(); lighting.setLight(light); 
lighting.setSurfaceScale(10);
rect.setEffect(lighting);

// Create foreground path triangle with rotation transition animation
Path path = new Path();
path.getElements().add(new MoveTo(100,100)); path.getElements().add(new 
LineTo(180,180));
path.getElements().add(new LineTo(260,100)); path.getElements().add(new 
ClosePath());
path.setFill(Color.RED); path.setStroke(Color.BLACK);
RotateTransition rt = new RotateTransition(Duration.millis(3000), path);
rt.setByAngle(180); rt.setCycleCount(4); rt.setAutoReverse(true); rt.play();
   
// Create group, add nodes, set scene root, show stage
Group group = new Group(rect, path);
aStage.setScene(new Scene(group));
aStage.show();
}

}

Render bug

2014-08-13 Thread Jeff Martin
I’m getting a rendering bug with a simple rotating path in front of an 
ImageView (with lighting effect) on Mac OS with 8u20:

http://reportmill.com/examples/Renderbug/Renderbug.jpg

Looks like some sort of dirty rect problem. Am I doing something wrong or 
should I file a bug?

The code is below. If anyone has an idea for a quick work around, let me know.

jeff



import javafx.animation.RotateTransition;
import javafx.application.Application;
import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.image.*;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.stage.Stage;
import javafx.util.Duration;
import snap.web.WebURL;

/**
 * A custom class.
 */
public class DrawTurd extends Application {

public void start(Stage aStage)
{
// Creat background image - file at 
http://reportmill.com/examples/Renderbug/Wood.jpg
Image image = new Image(getClass().getResourceAsStream(Wood.jpg));
ImageView iview = new ImageView(image);

// Create foreground path triangle
Path path = new Path();
path.getElements().add(new MoveTo(100,100)); path.getElements().add(new 
LineTo(180,180));
path.getElements().add(new LineTo(260,100)); path.getElements().add(new 
ClosePath());
path.setFill(Color.RED); path.setStroke(Color.BLACK);

// Create lighting effect and add to ImageView
Light.Distant effect = new Light.Distant(); effect.setAzimuth(60); 
effect.setElevation(120);
Lighting lighting = new Lighting(); lighting.setSpecularConstant(.15);
lighting.setLight(effect); lighting.setSurfaceScale(10);
iview.setEffect(lighting);

// Create group, add nodes, set scene root, show stage
Group group = new Group(iview, path);
aStage.setScene(new Scene(group));
aStage.show();

// Add rotation transition animation
RotateTransition rt = new RotateTransition(Duration.millis(3000), path);
rt.setByAngle(180); rt.setCycleCount(4); rt.setAutoReverse(true); rt.play();
}

}



Re: Calculating the preferred size of a node before layout takes place?

2014-08-04 Thread Jeff Martin
I was thinking that certain nodes (e.g., TextField) won’t provide a valid pref 
size until the window was made visible (and the CSS had been evaluated).

A few times I’ve added code set Window Opacity to zero, do a Window show/hide, 
then reset Window Opacity to one. Then you should get valid pref sizes. I’m not 
proud of myself, but it seems to work in practice. :-)

jeff


On Aug 4, 2014, at 1:03 PM, Richard Bair richard.b...@oracle.com wrote:

 autosize() on Node may be what you want (sizes it then afterward you can read 
 values)?
 
 On Aug 4, 2014, at 10:56 AM, Mike Hearn m...@plan99.net wrote:
 
 I'd like to find the calculated height of a node in my window controllers
 initialise() method, so I can shrink the height to zero and then animate it
 to the right size later. However getHeight and getPrefHeight both return
 zero in this method, presumably because it's not been laid out yet.
 
 I tried calling layout() but that didn't help.
 
 I don't want any visual glitches caused by a node being visible and then
 immediately resized to invisibility. Is there a solution to my problem? I
 feel there must be an obvious one that I'm just overlooking somehow ...
 
 thanks!
 



Re: OT: Netbeans ported to JFX?

2014-07-10 Thread Jeff Martin
I agree that Oracle should have an in-house apps team to create a few real 
world apps. Sun's lack of this helped marginalize Java Client and kept them 
tone-def to problems with desktop development and deployment. Apple does this 
well: Keynote, Pages, Numbers, Safari, Mail, iBooks, iMovie, iPhoto, Calendar, 
Contacts, Messages, FaceTime. This eat your own dog food policy proves and 
improves the platform. Also, it looks suspicious when you push a product you 
don't use.

I also agree that porting NetBeans wouldn't be a great use of resources. I hear 
that Oracle doesn't even officially support JavaFX on mobile yet. ;-)

jeff


On Jul 10, 2014, at 3:07 AM, Tom Schindl tom.schi...@bestsolution.at wrote:

 Hi,
 
 I've thrown Eclipse at it [1] - performance is ok but certainly not
 better than pure SWT but the reason for that is maybe my custom SWT port.
 
 What you see is not a rewrite of Eclipse code itself (which is 99%
 unmodified) but an alternate SWT implementation which has the big
 draw-back that some part of the IDE (and I assume the same is true for
 some parts of Netbeans) are written with a direct mode toolkit in mind.
 
 For modulare application frameworks I currently know of:
 * e(fx)clipse - which leverages the Eclipse4 Platform
 * eFX - which leverages the Netbeans Platform
 * JacpFX - IIRC built solely above OSGi Felix
 * jrebirth
 
 IMHO doing a simple rewrite is not the right way - start with one of the
 platforms (Eclipse/Netbeans/IntelliJ) and rethink the IDE. What I mean
 is: Doing a rewrite simply for the sake of rewriting is wasted time and
 in case of rewriting Netbeans/Eclipse/IntelliJ/... it's a huge huge huge
 waste of time.
 
 Tom
 
 [1]
 http://tomsondev.bestsolution.at/2014/03/26/eclipse-on-javafx-a-short-video-and-next-steps/
 
 On 10.07.14 09:06, Robert Krüger wrote:
 On Wed, Jul 9, 2014 at 4:14 PM, Jeff Martin j...@reportmill.com wrote:
 My thought is that JavaFX is perfect for an IDE targeted to education, like 
 Greenfoot and BlueJ:
 
SnapCode: SnapCode is the first and only pure JavaFX IDE
YouTube Overview: SnapCode JavaFX Overview
 
 SnapCode has visual code editing (Snap-coding), a sprite kit, 
 graphics/sound editing, a runtime browser/player with animated transitions 
 and more. It also has most of the features you expect in a modern IDE. 
 Hopefully this is a great way to attract a new generation of developers and 
 bring JavaFX to all Java developers.
 
 What it doesn't have is very much in the way of resources. If anyone wants 
 to help, let me know. If Oracle would like to kick in an engineer or a few 
 dollars, I wouldn't turn that away either.
 
 We need something like a JavaFX Playground before Apple Swift-boat's us. 
 :-)
 
 I have to say I passionately disagree here. Of course, everyone has
 different requirements/expectations. I am currently looking at JavaFX
 as a candidate technology for commercial products in a market where
 people are used to native applications. So far, I think JavaFX, from a
 developer point of view, is great and the dedication of the dev team
 and the transparency of the dev process are outstanding but it still
 suffers from maturity problems that usually go away after a lot of
 serious applications have been thrown at it, not by another Ensemble
 or educational tool. Even big finance or medical or system management
 applications may not be a good enough test for some areas because
 their users are typically more forgiving in certain areas than e.g. a
 photographer or designer using their favourite photo organisation tool
 on a Mac but of course, every application helps and Netbeans is so
 huge that porting it would probably result in a number of new Jira
 issues making the platform better and, as I wrote, I thought with the
 Swing API no longer being developed, it would either have to die or be
 ported anyway.
 
 BTW, is there any directory of (commercial) JFX applications anyone is aware 
 of?
 
 



Re: OT: Netbeans ported to JFX?

2014-07-10 Thread Jeff Martin
That's not what Bill Gates or Steve Jobs said.

jeff


On Jul 10, 2014, at 9:32 AM, Fabrizio Giudici fabrizio.giud...@tidalwave.it 
wrote:

 On Thu, 10 Jul 2014 16:23:43 +0200, Jeff Martin j...@reportmill.com wrote:
 
 I agree that Oracle should have an in-house apps team to create a few real 
 world apps. Sun's lack of this helped marginalize Java Client and
 
 Corporates should only do what concerns their business and AFAIK Oracle's 
 business was not to create real world apps (I mean, with the exception of 
 IDEs or other apps for the management of Oracle apps). A technology owner, 
 usually, when tries to create a real world app only creates a demonstrator of 
 a real world app, which doesn't have any success.
 
 
 -- 
 Fabrizio Giudici - Java Architect @ Tidalwave s.a.s.
 We make Java work. Everywhere.
 http://tidalwave.it/fabrizio/blog - fabrizio.giud...@tidalwave.it



Re: OT: Netbeans ported to JFX?

2014-07-10 Thread Jeff Martin
I wish Oracle would try to build an ecosystem around Java Client. If Sun had 
done this, they could be Android right now. There might have been a few dollars 
in that. There might still be.

If Oracle isn't trying to build an ecosystem around Java Client, and it's just 
a hobby, I wish somebody would tell me. :-)

jeff


On Jul 10, 2014, at 9:53 AM, David Hill david.h...@oracle.com wrote:

 On 7/10/14, 10:40 AM, Jeff Martin wrote:
 That's not what Bill Gates or Steve Jobs said.
 To be fair - both of those guys are trying to build an ecosystem - not just 
 an OS, but an OS and tools and products layered on top of it. They want to 
 create an environment that you want to come to and spend $$$.
 
 Oracle's bottom line is about Big Data and the appware in the middle of it. 
 That middle ware uses several technologies for graphical display and JavaFX 
 is just one of them. Unless you are a middle ware customer, you probably have 
 not seen any of them, because unlike MS Word, or Apple ITunes, they are not 
 usually seen by the general public.
 
 It certainly would be nice to have more JavaFX applications (real apps or 
 even good demos) as it would help showcase the capabilities. Jasper has 
 whipped together some interesting demo apps over the years for JavaOne
 
 Any suggestions on good demo apps for small boards (Pi, i.MX6) ? (Existing or 
 otherwise).
 
 Dave
 
 jeff
 
 
 On Jul 10, 2014, at 9:32 AM, Fabrizio 
 Giudicifabrizio.giud...@tidalwave.it  wrote:
 
 On Thu, 10 Jul 2014 16:23:43 +0200, Jeff Martinj...@reportmill.com  wrote:
 
 I agree that Oracle should have an in-house apps team to create a few real 
 world apps. Sun's lack of this helped marginalize Java Client and
 Corporates should only do what concerns their business and AFAIK Oracle's 
 business was not to create real world apps (I mean, with the exception of 
 IDEs or other apps for the management of Oracle apps). A technology owner, 
 usually, when tries to create a real world app only creates a demonstrator 
 of a real world app, which doesn't have any success.
 
 
 -- 
 Fabrizio Giudici - Java Architect @ Tidalwave s.a.s.
 We make Java work. Everywhere.
 http://tidalwave.it/fabrizio/blog - fabrizio.giud...@tidalwave.it
 
 
 -- 
 David Hilldavid.h...@oracle.com
 Java Embedded Development
 
 A man's feet should be planted in his country, but his eyes should survey 
 the world.
 -- George Santayana (1863 - 1952)
 



Re: OT: Netbeans ported to JFX?

2014-07-09 Thread Jeff Martin
My thought is that JavaFX is perfect for an IDE targeted to education, like 
Greenfoot and BlueJ:

SnapCode: SnapCode is the first and only pure JavaFX IDE
YouTube Overview: SnapCode JavaFX Overview

SnapCode has visual code editing (Snap-coding), a sprite kit, graphics/sound 
editing, a runtime browser/player with animated transitions and more. It also 
has most of the features you expect in a modern IDE. Hopefully this is a great 
way to attract a new generation of developers and bring JavaFX to all Java 
developers.

What it doesn't have is very much in the way of resources. If anyone wants to 
help, let me know. If Oracle would like to kick in an engineer or a few 
dollars, I wouldn't turn that away either.

We need something like a JavaFX Playground before Apple Swift-boat's us. :-)

jeff


On Jul 9, 2014, at 8:29 AM, Michael Berry mj...@kent.ac.uk wrote:

 It would be nice in a utopian sense - though I'd have to question if it
 would really be worth the resources required?
 
 Personally I'd be much more in favour of further development of JavaFX
 itself...
 
 Michael
 
 
 On 9 July 2014 10:52, Tobias Bley t...@ultramixer.com wrote:
 
 very interesting question ;)
 
 Will there be a android and iOS version of Netbeans in the future ;)?
 
 
 Am 09.07.2014 um 11:40 schrieb Robert Krüger krue...@lesspain.de:
 
 Hi,
 
 it is a little off-topic but the people reading this list are most
 likely the ones who could answer this.
 
 Is a port of Netbeans to JFX planned or even ongoing? It would
 certainly be a huge project but I am asking myself, if there is a way
 around that with Swing being de-facto legacy if Netbeans isn't dropped
 as a whole. It would certainly demonstrate Oracle's commitment to JFX
 as the future for Desktop UIs and would surely help the maturity of
 JFX which IMHO needs tons of real-world apps to be thrown at it.
 
 I would not be surprised not to get an answer for all sorts of
 understandable reasons but I thought I'd give it a shot anyway.
 
 Best regards,
 
 Robert
 
 



Warning Could not resolve CSS

2014-06-27 Thread Jeff Martin
Jira and the web at large are full of references to this warning (which seems 
to just be a nuisance):

WARNING: Could not resolve '-fx-table-cell-border-color' while 
resolving lookups for '-fx-border-color' from rule '*.table-cell' in stylesheet 

jar:file:/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/ext/jfxrt.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
Jun 27, 2014 11:11:48 AM javafx.scene.CssStyleHelper calculateValue
 
 I get dozens of these at startup. If anyone has any insight into what I might 
be doing to trigger these (or how to suppress them), I would appreciate it. I 
know I need to create a test case (and file a Jira if it persists), but my 
startup is a little hard to do that with (it's on my list).

jeff

Re: Warning Could not resolve CSS

2014-06-27 Thread Jeff Martin
Thanks for the note Dave - yes, I tried it this morning on 8u20b20, still no 
joy (I also see a big dirty rect problem in my WelcomePanel animation).

You can see them both by running these commands on a Mac:

prompt curl -O http://reportmill.com/snap1/SnapCode1.jar.pack.gz
prompt unpack200 SnapCode1.jar.pack.gz SnapCode1.jar
prompt 
/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java -jar 
SnapCode1.jar

Then just create a new project and open it.

If I remove the TableView from the WelcomePanel visible scenegraph, the 
warnings disappear. I'll keep looking into it.

jeff


On Jun 27, 2014, at 12:08 PM, David Grieve david.gri...@oracle.com wrote:

 Have you tried the 8u20 EA release?
 
 This can happen if a node is having CSS applied before the root node of the 
 scene has had CSS applied. This has been largely resolved in 8u20.
 
 On 6/27/14, 12:19 PM, Jeff Martin wrote:
 Jira and the web at large are full of references to this warning (which 
 seems to just be a nuisance):
 
  WARNING: Could not resolve '-fx-table-cell-border-color' while 
 resolving lookups for '-fx-border-color' from rule '*.table-cell' in 
 stylesheet
  
 jar:file:/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/ext/jfxrt.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
  Jun 27, 2014 11:11:48 AM javafx.scene.CssStyleHelper calculateValue
I get dozens of these at startup. If anyone has any insight into what I 
 might be doing to trigger these (or how to suppress them), I would 
 appreciate it. I know I need to create a test case (and file a Jira if it 
 persists), but my startup is a little hard to do that with (it's on my list).
 
 jeff
 



Re: Warning Could not resolve CSS

2014-06-27 Thread Jeff Martin
Yes - that does suppress the warnings!

jeff


On Jun 27, 2014, at 2:38 PM, David Grieve david.gri...@oracle.com wrote:

 Yikes.
 
 It looks like the messages are coming up after the welcome panel is closed 
 (after I hit 'open'). As a work-around, what if you removed the table from 
 the scene-graph when the 'open' is pressed?
 
 I'll try to recreate the bug in a small app.
 
 On 6/27/14, 2:47 PM, Jeff Martin wrote:
 Thanks for the note Dave - yes, I tried it this morning on 8u20b20, still no 
 joy (I also see a big dirty rect problem in my WelcomePanel animation).
 
 You can see them both by running these commands on a Mac:
 
  prompt curl -O http://reportmill.com/snap1/SnapCode1.jar.pack.gz
  prompt unpack200 SnapCode1.jar.pack.gz SnapCode1.jar
  prompt 
 /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java 
 -jar SnapCode1.jar
 
 Then just create a new project and open it.
 
 If I remove the TableView from the WelcomePanel visible scenegraph, the 
 warnings disappear. I'll keep looking into it.
 
 jeff
 
 
 On Jun 27, 2014, at 12:08 PM, David Grieve david.gri...@oracle.com wrote:
 
 Have you tried the 8u20 EA release?
 
 This can happen if a node is having CSS applied before the root node of the 
 scene has had CSS applied. This has been largely resolved in 8u20.
 
 On 6/27/14, 12:19 PM, Jeff Martin wrote:
 Jira and the web at large are full of references to this warning (which 
 seems to just be a nuisance):
 
WARNING: Could not resolve '-fx-table-cell-border-color' while 
 resolving lookups for '-fx-border-color' from rule '*.table-cell' in 
 stylesheet

 jar:file:/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/ext/jfxrt.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss
Jun 27, 2014 11:11:48 AM javafx.scene.CssStyleHelper calculateValue
I get dozens of these at startup. If anyone has any insight into what I 
 might be doing to trigger these (or how to suppress them), I would 
 appreciate it. I know I need to create a test case (and file a Jira if it 
 persists), but my startup is a little hard to do that with (it's on my 
 list).
 
 jeff
 



Re: Dialogs in JavaFX

2014-06-20 Thread Jeff Martin
I agree that the four showXXX() methods are a slight complexity, but I think 
they are simpler than the alternative. They quickly communicate the implied 
Type of the DialogBox and response:

// Type Message: No response
DialogBox dbox = new DialogBox(FYI); dbox.setMessage(Just 
saying...);
dbox.showMessageDialog(focusedNode);

// Type Confirm: Boolean response
DialogBox dbox = new DialogBox(Sanity Check); 
dbox.setMessage(Really???);
boolean response = dbox.showConfirmDialog(focusedNode);

// Type Option: Integer response
DialogBox dbox = new DialogBox(Which One); dbox.setMessage(Select 
One); dbox.setOptions(myOptions);
int response = dbox.showOptionDialog(focusedNode, defaultOption);

// Type Input: String response
DialogBox dbox = new DialogBox(Tell Me); dbox.setMessage(Tell me 
what you want:);
String response = xbox.showOptionDialog(focusedNode, default);

The only alternative I see would be to explicitly set a DialogBox type and 
return a DialogBoxResponse, which could embody any of the above. That seems 
cumbersome to me. I also think it would be over-engineering to try to support 
any kind of response (say like a Color or a Font). In these cases, I think it's 
better to have your ColorChooserPane or FontChooserPane act as content:

// Type ColorChooser: Boolean response plus Color
DialogBox dbox = new DialogBox(Please Pick a Color); 
dbox.setContent(myColorChooserPane);
if(dbox.showConfirmPanel(focusedNode))
setColor(myColorChooserPane.getSelectedColor());

In fact, your ColorChooserPane could have a showColorDialog() method that would 
just be the above code.

Jeff Martin

On Jun 20, 2014, at 10:15 AM, Stephen F Northover 
steve.x.northo...@oracle.com wrote:

 This essentially matches my current thinking, however, I would have DialogBox 
 as an abstract superclass of Alert.  Further, I would not have many different 
 types of show() methods.
 
 Want to take the discussion further in the JIRA?  That way, is will track 
 everyone's thinking on the various issues.  The downside is that JIRA does 
 not provide threaded conversations and it can be hard to follow.
 
 Steve
 
 On 2014-06-20, 9:41 AM, Jeff Martin wrote:
 That is a great post. I think the big problem with dialogs in Swing was the 
 permutations problem. There were four basic types of dialogs (Message, 
 Confirm, Option, Input) with six different parameters (Title, Message, Icon, 
 Content, MessageType, Options) - so JOptionPane ended up with a sea of 
 static methods that were confusing to navigate.
 
 I don't think you could go wrong with a simple DialogBox class like this (I 
 love simple):
 
  // Constructor
  public DialogBox(String aTitle);
 
  // Options
  public String getTitle();
  public void setTitle(String aTitle);
  public String getMessage();
  public void setMessage(String aMessage);
  public MessageType getMessageType();
  public void setMessageType(MessageType aMessageType);
  public Node getContent();
  public void setContent(Node aNode);
  public Node getGraphic();
  public void setGraphic(Node aNode);
  public String[] getOptions();
  public void setOptions(String ... theOptions);
 
  // Convenience methods to set Message + MessageType
  public void setErrorMessage(String aMessage);
  public void setWarningMessage(String aMessage);
  public void setQuestionMessage(String aMessage);
 
  // Show methods
  public void showMessageDialog(T aComp);
  public boolean showConfirmDialog(T aComp);
  public int showOptionDialog(T aComp, String aDefault);
  public String showInputDialog(T aComp, String aDefault);
 
  // Programatic dismissal
  public void confirm();
  public void cancel();
 
 Then most common invocations would look something like this:
 
  // Get user confirmation
  DialogBox dbox = new DialogBox(Sanity Check);
  dbox.setWarningMessage(Are you sure you want to do this? It could kill 
 you.);
  if(!dbox.showConfirmationDialog(focusedNode)) return;
 
 Using instance methods instead of static methods gives opportunity to 
 subclass and override various methods. And notice the Content attribute - 
 for the standard case when no Content is provided, it is built 
 programmatically based on the parameters (essentially just the message and 
 either an Option combo, an input textfield or nothing).
 
 I've been using this in my JavaFX app for a while and it is working great 
 and makes porting from Swing easy. I even built it on a convenient 
 FormBuilder class that makes building a simple stack of form controls easy, 
 and can also be used for advanced DialogBoxes.
 
 Jeff Martin
 214.513.1636
 
 
 On Jun 20, 2014, at 7:05 AM, Stephen F Northover 
 steve.x.northo...@oracle.com wrote:
 
 Great post Jonathan.  The summary is that whatever direction we take, we'll 
 have

Re: VisibleBounds

2014-06-11 Thread Jeff Martin
Below is my poor man's getVisibleBounds. I'm using this so that my custom text 
pane only needs to add child nodes for lines of text that are visible - similar 
to how ListView and friends only add cell nodes for visible items. I hope I'm 
on the right track - I was surprised that my web search for getVisibleBounds() 
came up so empty. If nobody points out my idiocy, I'm going to put this in a 
blog.

jeff

/**
 * Returns the visible bounds for a node based on ancestor clips (or null if no 
clipping found).
 */
public static Bounds getVisibleBounds(Node aNode)
{
// Get parent visible bounds (if set, convert to local)
Bounds bounds = aNode.getParent()!=null? 
getVisibleBounds(aNode.getParent()) : null;
if(bounds!=null) { if(!bounds.isEmpty()) bounds = 
aNode.parentToLocal(bounds); else return bounds; }

// If node has clip, get clip local bounds (intersected with parent visible 
bounds if present)
if(aNode.getClip()!=null) { Node clip = aNode.getClip(); Bounds cb = 
clip.getBoundsInLocal();
bounds = bounds!=null? getIntersectingBounds(cb, bounds) : cb; }

// Return node visible bounds
return bounds;
}

/**
 * Returns the intersection bounds of two bounds.
 */
public static Bounds getIntersectingBounds(Bounds b1, Bounds b2)
{
if(!b1.intersects(b2)) return new BoundingBox(0,0,-1,-1);
double minx = Math.max(b1.getMinX(), b2.getMinX());
double miny = Math.max(b1.getMinY(), b2.getMinY());
double maxx = Math.min(b1.getMaxX(), b2.getMaxX());
double maxy = Math.min(b1.getMaxY(), b2.getMaxY());
return new BoundingBox(minx, miny, maxx-minx, maxy-miny);
}


On Jun 10, 2014, at 6:59 PM, Jeff Martin j...@reportmill.com wrote:

 What is the JFX equivalent of JComponent.getVisibleRect() - and is there a 
 way to get a notification when it changes?
 
 jeff



Re: VisibleBounds

2014-06-11 Thread Jeff Martin
Okay - here's the jira (and a blog):

Jira:  Node could use a getVisibleBounds() method
Blog:  Getting the Visible Bounds of a Node

jeff


On Jun 11, 2014, at 9:37 AM, Stephen F Northover steve.x.northo...@oracle.com 
wrote:

 This seems like a good enhancement request.  Please enter a JIRA for it.
 
 Steve
 
 On 2014-06-11, 10:17 AM, Jeff Martin wrote:
 Below is my poor man's getVisibleBounds. I'm using this so that my custom 
 text pane only needs to add child nodes for lines of text that are visible - 
 similar to how ListView and friends only add cell nodes for visible items. I 
 hope I'm on the right track - I was surprised that my web search for 
 getVisibleBounds() came up so empty. If nobody points out my idiocy, I'm 
 going to put this in a blog.
 
 jeff
 
 /**
  * Returns the visible bounds for a node based on ancestor clips (or null if 
 no clipping found).
  */
 public static Bounds getVisibleBounds(Node aNode)
 {
 // Get parent visible bounds (if set, convert to local)
 Bounds bounds = aNode.getParent()!=null? 
 getVisibleBounds(aNode.getParent()) : null;
 if(bounds!=null) { if(!bounds.isEmpty()) bounds = 
 aNode.parentToLocal(bounds); else return bounds; }
  // If node has clip, get clip local bounds (intersected with parent 
 visible bounds if present)
 if(aNode.getClip()!=null) { Node clip = aNode.getClip(); Bounds cb = 
 clip.getBoundsInLocal();
 bounds = bounds!=null? getIntersectingBounds(cb, bounds) : cb; }
  // Return node visible bounds
 return bounds;
 }
 
 /**
  * Returns the intersection bounds of two bounds.
  */
 public static Bounds getIntersectingBounds(Bounds b1, Bounds b2)
 {
 if(!b1.intersects(b2)) return new BoundingBox(0,0,-1,-1);
 double minx = Math.max(b1.getMinX(), b2.getMinX());
 double miny = Math.max(b1.getMinY(), b2.getMinY());
 double maxx = Math.min(b1.getMaxX(), b2.getMaxX());
 double maxy = Math.min(b1.getMaxY(), b2.getMaxY());
 return new BoundingBox(minx, miny, maxx-minx, maxy-miny);
 }
 
 
 On Jun 10, 2014, at 6:59 PM, Jeff Martin j...@reportmill.com wrote:
 
 What is the JFX equivalent of JComponent.getVisibleRect() - and is there a 
 way to get a notification when it changes?
 
 jeff
 



SnapCode is the first and only pure JavaFX IDE

2014-06-11 Thread Jeff Martin
Today we finished a two week port of the remaining Swing components of SnapCode 
to JavaFX, including the code editer, file manager, welcome panel, runtime 
browser/player and much more.

That means JavaFX now has a real IDE written in JavaFX! Check out the video 
overview:

Blog: 
http://reportmill.wordpress.com/2014/06/11/snapcode-is-the-first-and-only-pure-javafx-ide/
Video: https://www.youtube.com/watch?v=VZH3Ifd-IIs

The good-new/bad-news is I won't be submitting any more JFXPanel bugs. :-)

jeff

Re: -fx-background-radius problem

2014-06-10 Thread Jeff Martin
This is on 8u5 b13. Running with SW on Mac didn't reproduce the problem. Here 
is the jira:

Jira: -fx-background-radius not rendering on Parallels Windows

jeff


On Jun 9, 2014, at 6:18 PM, Kevin Rushforth kevin.rushfo...@oracle.com wrote:

 Since you said:
 
 On Parallels Windows it does not: 
 http://www.reportmill.com/examples/Radius/RadiusWin.jpg
  
 
 This is probably a SW rendering bug (we will fall back to SW when running in 
 Parallels). Is this with 8u20-ea or with 8u5?
 
 Please file a JIRA with a complete test program. Also, can you try it with 
 -Dprism.order=sw on Mac and see if the same bug happens?
 
 -- Kevin
 
 
 Jeff Martin wrote:
 Has anyone seen a problem with -fx-background-radius on Windows? When I run 
 Windows using Parallels (on a Mac), -fx-background-radius styles seem to get 
 ignored.
 
 Here is my sample code:
 
// Create label with background color and radius
Label label = new Label(Testing); label.setPadding(new Insets(20));
label.setStyle(-fx-background-color:cyan;-fx-background-radius:20;);
 
// Add to box, scene and stage
VBox vbox = new VBox(); vbox.setPrefSize(300,300); 
 vbox.setAlignment(Pos.CENTER);
vbox.getChildren().add(label); aStage.setScene(new Scene(vbox)); 
 aStage.show();
 
 On my Mac it renders correctly:  
 http://www.reportmill.com/examples/Radius/RadiusMac.jpg
 
 On Parallels Windows it does not: 
 http://www.reportmill.com/examples/Radius/RadiusWin.jpg
 
 Am I missing something or should I file a bug?
 
 jeff



VisibleBounds

2014-06-10 Thread Jeff Martin
What is the JFX equivalent of JComponent.getVisibleRect() - and is there a way 
to get a notification when it changes?

jeff

Re: Ugly flashing when opening a css-styled stage

2014-06-01 Thread Jeff Martin
I haven't seen this, but here's a hack you can try:

// Show stage transparent once to get proper drawing
_stage.setOpacity(0); _stage.show(); _stage.hide(); 
_stage.setOpacity(1);

I've done this before to trigger Stage to set it's width/height property (which 
I needed to position the stage property).

jeff


On Jun 1, 2014, at 3:18 AM, Robert Krüger krue...@lesspain.de wrote:

 Hi,
 
 I'm in the process of evaluating Java FX 8 for our currently
 Swing-based product (also Java 8) on OSX.
 
 My first attempt to style a stage's background resulted in an ugly
 flashing effect which I would classify as a show-stopper for
 delivering a commercial product. This looks like it is caused by the
 stage being drawn at least once before the style has been applied, and
 I am wondering what the mistake is since my code is more or less a
 straight-forward hello world:
 
 package jfxtest;
 
 import javafx.application.Application;
 import javafx.scene.Scene;
 import javafx.scene.control.Button;
 import javafx.scene.layout.StackPane;
 import javafx.stage.Stage;
 
 public class JXTest extends Application {
 
@Override
public void start(Stage primaryStage) throws Exception {
final StackPane pane = new StackPane();
final Button closeButton = new Button(Close);
closeButton.setOnAction(event - primaryStage.close());
pane.getChildren().add(closeButton);
final Scene scene = new Scene(pane, 800, 600);
scene.getStylesheets().add(dark.css);
scene.getStylesheets();
primaryStage.setScene(scene);
primaryStage.setTitle(getClass().getSimpleName());
primaryStage.show();
}
 
public static void main(String[] args) {
launch(args);
}
 }
 
 with dark.css being:
 
 .root {
  -fx-background: rgb(54, 54, 54);
 }
 
 Is this a Mac-specific problem? Is there a workaround? Which of the
 two mailing lists is the more appropriate one to post these things
 (JFX problems which look like they might be platform-specific) to?
 
 Thanks,
 
 Robert



Re: Integrating JFX Dialog/Stage in Swing application

2014-05-31 Thread Jeff Martin
You might try calling that new JFXPanel() in your application main. Maybe go 
ahead and call Platform.setImplicitExit(false) as well.

jeff


On May 31, 2014, at 9:46 AM, Robert Krüger krue...@lesspain.de wrote:

 That was quicker than I had hoped. Invoking close() on the stage
 constructed in this way results in this here:
 
 [ERROR|16:24:23] d.l.m.MediaTool Uncaught exception in thread JavaFX
 Application Thread: [JavaFX Application Thread]
 java.lang.IllegalStateException: This operation is permitted on the
 event thread only; currentThread = JavaFX Application Thread
 at com.sun.glass.ui.Application.checkEventThread(Application.java:427)
 ~[jfxrt.jar:na]
 at com.sun.glass.ui.View.isClosed(View.java:409) ~[jfxrt.jar:na]
 at 
 com.sun.glass.ui.mac.MacTouchInputSupport.notifyNextTouchEvent(MacTouchInputSupport.java:122)
 ~[jfxrt.jar:na]
 at 
 com.sun.glass.ui.mac.MacGestureSupport.notifyNextTouchEvent(MacGestureSupport.java:77)
 ~[jfxrt.jar:na]
 
 I checked in the debugger and com.sun.glass.ui.Application#eventThread
 is null. This makes me believe the environment is not properly
 initialized despite the invocation on new JFXPanel() that I have in
 the EDT before the stage is built.
 
 On Sat, May 31, 2014 at 4:15 PM, Robert Krüger krue...@lesspain.de wrote:
 Hi Jeff,
 
 thanks, yeah, that's a workaround I have also found. I am just asking
 myself (and the JFX developers on this list) why this kind of
 Integration is not supported directly.
 
 Good to know that you have used this quite a bit. So I'll try using it
 until someone brings up a nicer solution or I run into any problems
 :-).
 
 Cheers,
 
 Robert
 
 On Sat, May 31, 2014 at 3:57 PM, Jeff Martin j...@reportmill.com wrote:
 I'm sure this isn't the proper answer, but I have used this call to 
 initialize the FX toolkit on demand from various Swing contexts and it has 
 always worked for me:
 
new javafx.embed.swing.JFXPanel();
 
 Then you would need the Platform.runLater(). Usually for the whole method 
 that creates your UI and shows the Stage. In some cases, I would make the 
 first line of my method that ends up invoking the JFX dialog something like 
 this:
 
 public void doSomething()
 {
// Ensure we're on FX thread
if(!Platform.isFXApplicationThread()) {
Platform.runLater(new Runnable() { public void run() { 
 doSomething(); } return; }
 
… create FX UI and do stage.show() ...
 }
 
 I've done quite a bit of this and it works without problems (for me).
 
 jeff martin
 
 On May 31, 2014, at 7:27 AM, Robert Krüger krue...@lesspain.de wrote:
 
 Hi,
 
 I am trying something which I thought would technically be the easiest
 way of migrating parts of an existing application from Swing to JFX,
 i.e. have a Swing JMenuItem trigger the showing of a JFX stage because
 I thought this would technically even be cleaner than to have a swing
 dialog containing an JFXPanel.
 
 Doing this results in the following Exception:
 
 java.lang.IllegalStateException: Toolkit not initialized
 at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:276)
 ~[jfxrt.jar:na]
 at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:271)
 ~[jfxrt.jar:na]
 at javafx.application.Platform.runLater(Platform.java:78) ~[jfxrt.jar:na]
 at 
 de.lesspain.mediatool.menu.ToolsSubmenu$1.actionPerformed(ToolsSubmenu.java:20)
 ~[
 
 javadoc of runLater states:
 
 This method must not be called before the FX runtime has been
 initialized. For standard JavaFX applications that extend Application,
 and use either the Java launcher or one of the launch methods in the
 Application class to launch the application, the FX runtime is
 initialized by the launcher before the Application class is loaded.
 For Swing applications that use JFXPanel to display FX content, the FX
 runtime is initialized when the first JFXPanel instance is
 constructed.
 
 So this is consistent. Still I am wondering, why it should not be
 supported to just trigger opening a stage from a Swing menu? Either by
 Platform.runLater autoinitializing or offering a separate method like
 Platform.ensureInitialized().
 
 Am I missing something obvious?
 
 Thanks,
 
 Robert
 
 
 
 
 --
 Robert Krüger
 Managing Partner
 Lesspain GmbH  Co. KG
 
 www.lesspain-software.com
 
 
 
 -- 
 Robert Krüger
 Managing Partner
 Lesspain GmbH  Co. KG
 
 www.lesspain-software.com



Should TreeItem have a Text property?

2014-05-21 Thread Jeff Martin
I'm working with TreeView today and it seems like it would be convenient if 
TreeItem had a Text property in addition to it's Graphic property. This would 
seem to solve the most common need for a custom TreeCell factory.

Since most trees basically show a tree of labels, it would seem to make as much 
sense as the Graphic property.

It might have been sufficient if the default rendering used TreeItem.toString() 
instead of TreeItem.getValue().toString(), although this would miss the free 
updating you could get by resetting a TreeItem.Text property dynamically.

jeff

Re: Should TreeItem have a Text property?

2014-05-21 Thread Jeff Martin
Thanks!

Jira: TreeItem should have a Text property

jeff


On May 21, 2014, at 2:44 PM, Stephen F Northover steve.x.northo...@oracle.com 
wrote:

 This sounds reasonable to me.  Please enter a JIRA for it.
 
 Steve
 
 On 2014-05-21 2:52 PM, Jeff Martin wrote:
 I'm working with TreeView today and it seems like it would be convenient if 
 TreeItem had a Text property in addition to it's Graphic property. This 
 would seem to solve the most common need for a custom TreeCell factory.
 
 Since most trees basically show a tree of labels, it would seem to make as 
 much sense as the Graphic property.
 
 It might have been sufficient if the default rendering used 
 TreeItem.toString() instead of TreeItem.getValue().toString(), although this 
 would miss the free updating you could get by resetting a TreeItem.Text 
 property dynamically.
 
 jeff
 



Re: Should Canvas have been Image subclass instead of Node?

2014-04-23 Thread Jeff Martin
That's a nice solution - though in real world code I worry that the endDrawing 
snapshotting would be triggered more often than necessary.

I still think there is no compelling reason for Canvas to be a Node, and there 
is a significant drawback if you want to reuse the same Canvas many times in 
your scene graph.

I think it's appropriate to think of the basic Canvas functionality as a 
Procedural Image - it is used to create an Image from code instead of a file. 
Just because the most common case might be to stuff it in an ImageView, doesn't 
mean that it should be a Node for convenience. If you agree that the Image 
class shouldn't be a Node, you should feel the same way about Canvas.

I also think this would be easy to fix in a backward compatible way. A future 
release could simply add a CanvasImage class which had a GraphicsContext - 
then Canvas could remain, but simply embed a CanvasImage. Though for practical 
purposes, I think most developers would simply use CanvasImage with ImageView 
from then on.

jeff


On Apr 23, 2014, at 10:37 AM, Scott Palmer swpal...@gmail.com wrote:

 Here's a quick hack based on using snapshots to make something like a
 Canvas that you can reuse in many places within the Scene.  By
 subclassing WritableImage it comes out to being pretty close to what
 you were talking about.  As you mentioned, using snapshots isn't
 ideal, but I wonder how far from ideal this really is?  Having to
 remember to make the snapshot is just one call.
 
 public class CanvasImage extends WritableImage {
 
 private final Canvas canvas;
 private final SnapshotParameters snapshotParams;
 
 public CanvasImage(int width, int height) {
 super(width, height);
 canvas = new Canvas(width, height);
 snapshotParams = new SnapshotParameters();
 snapshotParams.setFill(Color.TRANSPARENT);
 }
 
 public GraphicsContext beginDrawing() {
 return canvas.getGraphicsContext2D();
 }
 
 public void endDrawing() {
 canvas.snapshot(snapshotParams, this);
 }
 }
 
 Cheers,
 
 Scott
 
 On Tue, Apr 22, 2014 at 7:01 PM, Scott Palmer swpal...@gmail.com wrote:
 It would be great if you could get a Graphics context for drawing into a
 WritableImage instead of having to deal with snapshots. But I suppose you
 could build something like that based on Canvas that would update an image.
 
 Scott
 
 On Apr 22, 2014 6:52 PM, Jeff Martin j...@reportmill.com wrote:
 
 Just by using it as an ImageView.Image.
 
 jeff
 
 
 On Apr 22, 2014, at 5:43 PM, John C. Turnbull ozem...@ozemail.com.au
 wrote:
 
 How would you (easily) use it in the scenegraph if it wasn't a Node?
 
 -Original Message-
 From: openjfx-dev [mailto:openjfx-dev-boun...@openjdk.java.net] On
 Behalf Of
 Jeff Martin
 Sent: Wednesday, April 23, 2014 8:16 AM
 To: openjfx-dev@openjdk.java.net Mailing
 Subject: Should Canvas have been Image subclass instead of Node?
 
 I have a case where I need to draw to a canvas and reuse it in multiple
 nodes. My non-optimal work-around is to take a snapshot and use that,
 but it
 makes me wonder if Canvas should have been an Image subclass or if
 WritableImage should get it's own getGraphicsContext() method.
 
 jeff=
 
 
 



Re: Should Canvas have been Image subclass instead of Node?

2014-04-23 Thread Jeff Martin
I understand that Canvas has to remain a node - but I think the basic problem 
could be fixed in a very backward compatible way:

 A future release could simply add a CanvasImage class which had a 
 GraphicsContext - then Canvas could remain, but simply embed a CanvasImage. 
 Though for practical purposes, I think most developers would simply use 
 CanvasImage with ImageView from then on.

jeff


On Apr 23, 2014, at 2:15 PM, Stephen F Northover steve.x.northo...@oracle.com 
wrote:

 I think a graphics context on a writable image would make more sense.  In any 
 case, Canvas is a Node and will remain one forever.
 
 Steve
 
 On 2014-04-22 6:15 PM, Jeff Martin wrote:
 I have a case where I need to draw to a canvas and reuse it in multiple 
 nodes. My non-optimal work-around is to take a snapshot and use that, but it 
 makes me wonder if Canvas should have been an Image subclass or if 
 WritableImage should get it's own getGraphicsContext() method.
 
 jeff
 



Should Canvas have been Image subclass instead of Node?

2014-04-22 Thread Jeff Martin
I have a case where I need to draw to a canvas and reuse it in multiple nodes. 
My non-optimal work-around is to take a snapshot and use that, but it makes me 
wonder if Canvas should have been an Image subclass or if WritableImage should 
get it's own getGraphicsContext() method.

jeff

Re: Should Canvas have been Image subclass instead of Node?

2014-04-22 Thread Jeff Martin
Just by using it as an ImageView.Image.

jeff


On Apr 22, 2014, at 5:43 PM, John C. Turnbull ozem...@ozemail.com.au wrote:

 How would you (easily) use it in the scenegraph if it wasn't a Node?
 
 -Original Message-
 From: openjfx-dev [mailto:openjfx-dev-boun...@openjdk.java.net] On Behalf Of
 Jeff Martin
 Sent: Wednesday, April 23, 2014 8:16 AM
 To: openjfx-dev@openjdk.java.net Mailing
 Subject: Should Canvas have been Image subclass instead of Node?
 
 I have a case where I need to draw to a canvas and reuse it in multiple
 nodes. My non-optimal work-around is to take a snapshot and use that, but it
 makes me wonder if Canvas should have been an Image subclass or if
 WritableImage should get it's own getGraphicsContext() method.
 
 jeff=
 



JavaFX Asteroids

2014-04-21 Thread Jeff Martin
Check out JavaFX Asteroids (using a thin Greenfoot emulation library in 
SnapCode):

JavaFX Asteroids with Greenfoot and SnapCode

http://reportmill.wordpress.com/2014/04/21/javafx-asteroids-with-greenfoot-and-snapcode/

I haven't done any performance work yet, but it runs well with a screen full of 
asteroids on a MacBook Pro.

jeff

Re: JFXPanel Dragboard setDragView

2014-04-21 Thread Jeff Martin
So I'm correct that calling Node.startFullDrag() should result in the 
OnMouseDragOver method getting called? I wasn't sure I had that right - and I 
really need a OnMouseDragMoved notification anyway.

My Sample code is below. If you think it should result in a bunch of 
onMouseDragOver.Handler printlns, I'll file a bug.

jeff

public void start(Stage aStage)
{
// Create Button with DragDetected.Handler to startFullDrag/startDragAndDrop
final Button button = new Button(Hello World);
button.setOnDragDetected(new EventHandler() {
public void handle(Event anEvent) {
button.startFullDrag();
Dragboard db = button.startDragAndDrop(TransferMode.ANY);
ClipboardContent cc = new ClipboardContent(); cc.putString(Hello 
World);
db.setContent(cc); anEvent.consume();
}
});

// Listen to DragSource events
button.setOnMouseDragOver(new EventHandlerMouseDragEvent() {
public void handle(MouseDragEvent e) { System.out.println(e); }
});

// Add button to pane and stage and show
Pane pane = new Pane(); pane.setPrefSize(400,400);
pane.getChildren().add(button); button.resizeRelocate(100,100,100,100);
aStage.setScene(new Scene(pane)); aStage.show();
}

On Apr 21, 2014, at 8:45 AM, Anthony Petrov anthony.pet...@oracle.com wrote:

 Hi Jeff,
 
 On 4/18/2014 6:43 PM, Jeff Martin wrote:
 I'm trying to figure out how to implement a version of 
 Dragboard.setDragView() that works with JFXPanel (which isn't currently 
 supported). Years ago I did this in Swing by creating a window that followed 
 the mouse around (at an offset, so it wouldn't take all the DragOver events).
 
 I created a Popup Window and added an ImageView, but I can't figure out how 
 to get the equivalent of DragSource events. I thought I could just call 
 source.startFullDrag() in my DragDetected method then I would get MouseDrag 
 events on my source, but that isn't happening. Is this a bug or am I doing 
 something wrong?
 
 Please file a new JIRA and provide a small test case that demonstrates the 
 problem.
 
 Also, when I get my Popup moving, I'd really like it to be exactly under the 
 mouse but have the Popup be MouseTransparent (or forward events to the 
 window underneath).
 
 You could use the TRANSPARENT style for your popup window and paint a 
 transparent hole (alpha == 0) in its center (or wherever you need it), and 
 keep the popup positioned so that the mouse pointer is located above the 
 hole. Mouse events always pass through transparent pixels. This way mouse 
 events will get delivered to a window below the popup window in the z-order, 
 while the popup window itself can float above it following the mouse cursor.
 
 --
 best regards,
 Anthony



JFXPanel Dragboard setDragView

2014-04-18 Thread Jeff Martin
I'm trying to figure out how to implement a version of Dragboard.setDragView() 
that works with JFXPanel (which isn't currently supported). Years ago I did 
this in Swing by creating a window that followed the mouse around (at an 
offset, so it wouldn't take all the DragOver events).

I created a Popup Window and added an ImageView, but I can't figure out how to 
get the equivalent of DragSource events. I thought I could just call 
source.startFullDrag() in my DragDetected method then I would get MouseDrag 
events on my source, but that isn't happening. Is this a bug or am I doing 
something wrong?

Also, when I get my Popup moving, I'd really like it to be exactly under the 
mouse but have the Popup be MouseTransparent (or forward events to the window 
underneath).

Thanks for any thoughts!

jeff

PS - Here is the jira I filed: Dragboard setDragView doesn't work with JFXPanel




Re: Fractional Metrics

2014-04-04 Thread Jeff Martin
I have a couple of solutions for this right now, but neither are optimal:

1. 
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(),getDefaultConfiguration()
.createCompatibleImage(1, 
1).createGraphics().getFontMetrics(font).stringWidth(string)
2. new 
javafx.scene.text.Text().setFont(font).setText(string).prefWidth(-1) // Some 
poetic license here

jeff


On Apr 4, 2014, at 8:41 AM, ngalarn...@abinitio.com wrote:

 I'm sorry if this is redundant, but does this mean there is no way to find 
 out the size (length  height) of a String as it will appear on the 
 screen?
 
 What about the size of a String as it will be printed?
 
 
 Neil
 
 
 
 
 From:   Phil Race philip.r...@oracle.com
 To: Jeff Martin j...@reportmill.com, openjfx-dev@openjdk.java.net 
 Mailing openjfx-dev@openjdk.java.net
 Date:   04/03/2014 10:40 PM
 Subject:Re: Fractional Metrics
 Sent by:openjfx-dev openjfx-dev-boun...@openjdk.java.net
 
 
 
 On 4/3/14 6:13 PM, Jeff Martin wrote:
 Is there a way to turn off FractionalMetrics in Canvas.fillText() or 
 Text?
 
 No. At least not via any supported API.
 
 Also, does text rendering perform kerning, and if so, can I disable 
 that?
 
 No.
 
 What I really need is to know the x position (or advance) of each 
 character in a rendered string.
 
 It would need new API. And characters != glyphs. Counting char advances 
 has been doomed for decades ...
 
 -phil.
 
 
 jeff
 
 
 
 NOTICE from Ab Initio: This email (including any attachments) may contain 
 information that is subject to confidentiality obligations or is legally 
 privileged, and sender does not waive confidentiality or privilege. If 
 received in error, please notify the sender, delete this email, and make 
 no further use, disclosure, or distribution. 



Fractional Metrics

2014-04-03 Thread Jeff Martin
Is there a way to turn off FractionalMetrics in Canvas.fillText() or Text?

Also, does text rendering perform kerning, and if so, can I disable that?

What I really need is to know the x position (or advance) of each character in 
a rendered string.

jeff

Re: Expected frame rates for a full-screen blur

2014-04-01 Thread Jeff Martin
If it's a MacBook Pro Retina, you might try it with and without retina level 
resolution. I haven't tested JavaFX 8 with retina, but JFX 7 had serious 
problems that would go away when I changed the display to non-retina.

jeff


On Apr 1, 2014, at 11:41 AM, Mike Hearn m...@plan99.net wrote:

 Actually, playing some more, it seems like the poor frame rates I'm seeing
 are not blur related, but rather affect any animation (i.e. all rendering)
 when my main window is maximized. Shrinking the window so it's smaller
 results in smooth animations of any kind. This seems to be true no matter
 how I try and simplify my scene (e.g. turning off a tiled background image).
 
 I grabbed Ensemble and tried the circle blur demo. It actually made my
 entire laptop unusable. The entire OS crawled to a halt and fps was maybe
 0.3 for everything, not just the Java app. Going back to the main menu made
 things snappy again.
 
 This is a bit disconcerting. Does anyone else see such appalling
 performance impact from the blurred circles demo on their Mac? Is this a
 driver issue, perhaps? Are there any platforms where this demo hits a good
 fps?
 
 
 
 On Tue, Apr 1, 2014 at 6:10 PM, Mike Hearn m...@plan99.net wrote:
 
 Hi there,
 
 On a MacBook Pro with OS X 10.9.2, does anyone have any estimates for
 anticipated frame rates of a full-screen animated blur? I noticed that when
 my window is not maximized, the blur is smooth and high frame-rate. When
 maximized the blur is somewhat choppy. Unfortunately I have no clue how
 much work is really involved in GPU blurring and whether I'm being
 unreasonable to expect that many pixels to be blurred per second (this is
 on a retina display).
 
 Can anyone let me know if it's worth me trying to optimise this or whether
 hardware limitations will mean that realistically I am expecting too much.
 
 thanks!
 



Re: Expected frame rates for a full-screen blur

2014-04-01 Thread Jeff Martin
I assume retina optimization was added for JFX 8 (or is on the short list). I 
think there is a Jira for it.

You can choose a non-retina resolution by going to display preferences and 
clicking the Scaled radio button and selecting something to the right of 
Best Resolution (Retina). It used to be that you could option-click the 
Scaled radio button to get a real list of choices, but now you can only get 
that with a 3rd party resolution tool (I think).

jeff


On Apr 1, 2014, at 12:49 PM, Mike Hearn m...@plan99.net wrote:

 How do I do that? And won't that make everything blurry? Retina support is 
 one reason why I chose JFX. Swing on Retina Macs is pretty much unusable, 
 it's like looking through thick plastic.
 
 
 On Tue, Apr 1, 2014 at 7:26 PM, Jeff Martin j...@reportmill.com wrote:
 If it's a MacBook Pro Retina, you might try it with and without retina level 
 resolution. I haven't tested JavaFX 8 with retina, but JFX 7 had serious 
 problems that would go away when I changed the display to non-retina.
 
 jeff
 
 
 On Apr 1, 2014, at 11:41 AM, Mike Hearn m...@plan99.net wrote:
 
  Actually, playing some more, it seems like the poor frame rates I'm seeing
  are not blur related, but rather affect any animation (i.e. all rendering)
  when my main window is maximized. Shrinking the window so it's smaller
  results in smooth animations of any kind. This seems to be true no matter
  how I try and simplify my scene (e.g. turning off a tiled background image).
 
  I grabbed Ensemble and tried the circle blur demo. It actually made my
  entire laptop unusable. The entire OS crawled to a halt and fps was maybe
  0.3 for everything, not just the Java app. Going back to the main menu made
  things snappy again.
 
  This is a bit disconcerting. Does anyone else see such appalling
  performance impact from the blurred circles demo on their Mac? Is this a
  driver issue, perhaps? Are there any platforms where this demo hits a good
  fps?
 
 
 
  On Tue, Apr 1, 2014 at 6:10 PM, Mike Hearn m...@plan99.net wrote:
 
  Hi there,
 
  On a MacBook Pro with OS X 10.9.2, does anyone have any estimates for
  anticipated frame rates of a full-screen animated blur? I noticed that when
  my window is not maximized, the blur is smooth and high frame-rate. When
  maximized the blur is somewhat choppy. Unfortunately I have no clue how
  much work is really involved in GPU blurring and whether I'm being
  unreasonable to expect that many pixels to be blurred per second (this is
  on a retina display).
 
  Can anyone let me know if it's worth me trying to optimise this or whether
  hardware limitations will mean that realistically I am expecting too much.
 
  thanks!
 
 
 



Re: Using JavaFX deploy and having signing issues...

2014-03-24 Thread Jeff Martin
I do this with my app, which works (though I don't submit it to the Mac App 
Store):

codesign -s Developer ID Application RMStudio14.app

jeff

On Mar 24, 2014, at 11:26 AM, Tony Anecito adanec...@yahoo.com wrote:

 Does anyone know how to codesign the jdk in the bundle created by JavaFX 
 deploy ant task properly?
 I tried:
 codesign -f -s 3rd Party Mac Developer Application: Cert Name  
 name.app/Contents/Plugins/jdk1.8.0.jdk
  
 I get the error: name.app/Contents/Plugins/jdk1.8.0.jdk bundle format 
 unrecognized, invalid, or unsuitable
  
 I am wondering what was done with Ensemble to get past this issue.
  
 Thanks,
 -Tony
 
 
 
 On Sunday, March 23, 2014 4:52 PM, Tony Anecito adanec...@yahoo.com wrote:
 
 Hi,
  
 I am using JavaFX deploy ant task and having issue trying to sign because of 
 jre embeded for Apple Store bundling. It is the last issue I have to fix then 
 I can finish my Apple Store submission.
  
 Apparently even the jdk for the bundle has to be signed. To do that I had to 
 redo permissions of jars and dylib files so the signing process would not 
 error.
  
 My jars for my own app jars are code signed already. I am using the Apple 
 find and codesign together so the jdk jre jars and dylib files get signed by 
 codesign.
  
 Still I get error when submitting final pkg (with its own signing 
 requirements) about invalid signature saying app not signed.
  
 I also discovered the JavaFX deploy lowercases my bundle id so it did not 
 match bundle id registered with iconnect. I fixed the pinfo file so it 
 matched.
  
 I would really like to see how this is all done with the ensemble app from 
 the JavaFX group.
  
 Regards,
 -Tony



SnapCode JavaFX Fun

2014-03-09 Thread Jeff Martin
More friday night light posting - I updated SnapCode this week with some fun 
features:

- Mouse/Keyboard sensing (isMousePressed, isKeyPressed)
- Actor pen drawing (penDown, penUp, setPenColor)
- Added Code Completion popup panel to visual code editor

Check out the interactive animations in this posting: 
http://www.reportmill.com/snap/gallery/MouseKeyboard/

jeff

Drag and Drop Doesn't work in JFXPanel on MacOSX

2014-03-05 Thread Jeff Martin
Has anyone else noticed that Drag and Drop doesn't work with JFXPanel on MacOSX 
(unless I'm doing something stupid)?

I filed a bug: https://javafx-jira.kenai.com/browse/RT-36127

There is a very simple test case in the comment.

jeff

Re: CSS Font size in points doesn't match Node.Font.Size

2014-03-04 Thread Jeff Martin
Thanks Tom! I assume the thread was this one:

Font.font() says it is point size but it looks like it are pixels

http://mail.openjdk.java.net/pipermail/openjfx-dev/2014-January/012398.html

I guess the final word is that CSS assumes 1pt==1/92in, and Nodes convert that 
to the real world on render?

And that this is basically a bug, but it can't be fixed due to legacy 
considerations?

jeff


On Mar 4, 2014, at 6:10 PM, Tom Schindl tom.schi...@bestsolution.at wrote:

 There was a thread some time ago on this List with explainations of this 
 behavior!
 
 Tom
 
 Von meinem iPhone gesendet
 
 Am 05.03.2014 um 01:03 schrieb Jeff Martin j...@reportmill.com:
 
 I can't quite wrap my head around why when I specify an -fx-font-size of 9pt 
 in CSS, it turns into a 12 pt font in my rendered node. I suppose CSS is 
 upscaling for my 96 dpi device, but it makes other measurements that depend 
 on that setting potentially wrong.
 
 Any suggestions on how I should be thinking about this (other than that this 
 is a bug :-)?
 
 jeff



SnapCode JavaFX

2014-02-21 Thread Jeff Martin
For some Friday night light posting, here is an update on an app I hope will 
become a great showcase, educational and promotional app for JavaFX and Java:

JavaFX Animation:   http://www.reportmill.com/snap/gallery/StudioIntro
Pen Graphics:   http://www.reportmill.com/snap/gallery/PenIntro

Maybe this could make take over for our stalled Tower defense app. I plan to 
integrate major new JavaFX features every week.

jeff

Dragboard setDragView in JFXPanel?

2014-02-11 Thread Jeff Martin
Is the JavaFX 8 Dragboard.setDragView() api supposed to work in JFXPanel?

I couldn't find a jira bug - if it should work, I'll file one.

jeff


Re: Dragboard setDragView in JFXPanel?

2014-02-11 Thread Jeff Martin
Okay, it's filed: https://javafx-jira.kenai.com/browse/RT-35812

I'd appreciate any additional info: Was it expected to work? Any thoughts on a 
work around?

Let me know if you want me to post my sample code in the jira.

jeff


On Feb 11, 2014, at 5:13 PM, Anthony Petrov anthony.pet...@oracle.com wrote:

 Please file a bug.
 
 --
 best regards,
 Anthony
 
 On 2/12/2014 2:59 AM, Jeff Martin wrote:
 Is the JavaFX 8 Dragboard.setDragView() api supposed to work in JFXPanel?
 
 I couldn't find a jira bug - if it should work, I'll file one.
 
 jeff
 



Re: Very poor performance of JavaFX on iPhone - 6 months later

2014-01-03 Thread Jeff Martin
I noticed the high-dpi problem on a high-end MacBook Pro Retina. Took me by 
surprise for JavaOne demos since I usually use an external monitor 
(non-retina). I ended up switching to low dpi.

jeff


On Jan 3, 2014, at 3:59 PM, Stephen F Northover steve.x.northo...@oracle.com 
wrote:

 Hi Tobias,
 
 Sorry about that.
 
 Looking at the bug, it seems to me that we have gotten to the bottom of it.  
 Some iOS devices are scrolling fine while others are slower.  The difference 
 seems to be that high dpi disables optimizations and this causes the slowness 
 on iOS.  The same optimizations are disabled on the desktop, but the desktop 
 is much faster and people don't notice.  There was some discussion about 
 performance in the simulator, but we should ignore that. Performance on the 
 device is what matters.
 
 iOS and Android are not currently supported platforms for JavaFX. We are 
 looking towards the community to step up and submit patches to take these 
 ports forward.  Johan Vos and others are helping with Android.  Are you 
 interested in working on iOS?  If so, please build on the patches in 
 https://javafx-jira.kenai.com/browse/RT-31453 and take the work forward.
 
 The first step would be to prove that we can be fast (which I think we can if 
 we run with the optimizations) then understand how to turn the optimizations 
 back on.
 
 Steve
 
 On 2014-01-03 3:28 PM, Tobias Bley wrote:
 Hi,
 
 many months ago I reported the „poor performance on iOS“ issue 
 (https://javafx-jira.kenai.com/browse/RT-31453). Now 6 months later the bug 
 is already open and no one of Oracle answers me on Jira.
 
 What’s up? How can we fix this important bug?
 
 Best,
 Tobi
 
 



JavaFX Visual Coding for Education

2013-10-29 Thread Jeff Martin
At JavaOne this year there were several great sessions on Java for education. 
Since JavaFX seems particularly suited for the task, but didn't appear in the 
sessions, I decided to take a stab at it. Here are the first results (4 weeks):

http://www.reportmill.com/javi/gallery/JaviStudio/

With JFX animation, effects and media, there are so many possibilities. Maybe 
we'll have the equivalent of our Tower Defense game soon.

jeff

Re: JFXPanel vs. real world usage

2013-10-24 Thread Jeff Martin
My experience has been okay, though I've seen the resizing lag.

The only real problem I've seen is bad performance on a retina display Mac Book 
Pro.

jeff


On Oct 24, 2013, at 1:37 PM, Tobias Bley t...@ultramixer.com wrote:

 I added a simple accordion as JFXPanel into a swing frame and the performance 
 is not good. the cpu usage goes up to 100% when moving the mouse over the 
 accordion title panes (hover effect). The resizing performance is bad too.
 
 
 Am 24.10.2013 um 20:10 schrieb rdarr...@yahoo.com:
 
 I have the same experience. We're using this and it works ok as far as 
 performance.
 -Original Message-
 From: Pedro Duque Vieira pedro.duquevie...@gmail.com
 Sender: openjfx-dev-boun...@openjdk.java.net
 Date: Thu, 24 Oct 2013 18:20:42 
 To: OpenJFX Mailing Listopenjfx-dev@openjdk.java.net
 Subject: RE: JFXPanel vs. real world usage
 
 Hi Matthias,
 
 I don't see any problems with performance and I've been using this a lot.
 
 Best regards,
 
 -- 
 Pedro Duque Vieira
 
 
 



Re: [REVIEW REQUEST] RT-33442: isSelected in TableViewSelectionModel is called too many times

2013-10-21 Thread Jeff Martin
I'm late to this discussion, and I don't see anything wrong with the 
selectRange() API, but perhaps another option worth considering would be to add 
a DisableSelectionEvents or CoalesceSelectionEvents attribute.

The only advantage to that I can think of is that it could allow bulk selection 
of non-contiguous cells which might otherwise also exhibit the slowdown.

jeff


On Oct 21, 2013, at 8:35 AM, Stephen F Northover steve.x.northo...@oracle.com 
wrote:

 Hi Johnathan,
 
 1) Is it possible to do the optimization without adding API (ugly but safe)?
 2) Another alternative (ugly) is to add the API but make it return a boolean 
 indicating whether it happened or not.
 3) It seem really weird to me that you can't convert from Column to index and 
 back again.  What about getColumns()?
 
 Steve
 
 On 2013-10-21 5:04 AM, Jonathan Giles wrote:
 The only reason why we tended to prefer TableColumn* in the API over ints is 
 that the TableColumn approach more clearly defined what columns were meant 
 to be selected (both because you could read directly back from the argument 
 list and because there was never any chance that the int positions could 
 become corrupted if the column order were to ever change in the middle of an 
 operation and the int values would no longer be valid).
 
 In general it is a relatively weak argument (but an argument nonetheless), 
 so I'm not massively concerned one way or the other, except from an API 
 consistency point of view, where the TableColumn approach definitely is more 
 consistent. I figure I'm about to call it a night here, so I'll wait and see 
 what feedback is received over night and will hopefully have the go-ahead 
 from the community to finish this changeset off and push tomorrow :-)
 -- Jonathan
 On 21/10/2013 9:53 p.m., Johan Vos wrote:
 I would prefer to have the selectRange (int, int, int, int) call. I know 
 TableColumn* is used heavily in the API, but it doesn't sound right to me 
 to use a primitive (int) for a row-selector and an Object for a 
 column-selector.
 Having a no-op on the abstract call sounds ok, everybody happy.
 
 Leaving the API as it is now is not really an option IMHO, as performance 
 indeed becomes a problem for large tables.
 
 - Johan
 
 
 2013/10/20 Jonathan Giles jonathan.gi...@oracle.com 
 mailto:jonathan.gi...@oracle.com
 
On 19/10/2013 8:24 a.m., Jonathan Giles wrote:
 On 19/10/2013 2:13 a.m., Stephen F Northover wrote:
 If it is a noop, will it not break people when the system
calls it and
 it does nothing?
 Only the abstract TableSelectionModel is a no-op, the
implementations
 (one each for TableView and TreeTableView) will both override and
 provide the implementation that I already have in the patch for
 TableView. I would rather have the implementation in the base
class but
 this is not feasible due to requirements in looking up column
indices.
I looked into providing a default implementation in
TableSelectionModel,
but the problem is is that there just isn't enough data at this
level of
the API.
 
In short, the API could take two forms:
selectRange(int minRow, int minColumn, int maxRow, int maxColumn)
selectRange(int minRow, TableColumnBase minColumn, int maxRow,
TableColumnBase maxColumn)
 
Either implementation is possible (although at present I've
implemented
the first approach, but for consistency it is probably better we
use the
second approach as all other API uses TableColumn* to represent
columns,
not ints).
 
The problem is is that neither approach gives me what I want for a
default implementation, which would take the following form:
for (int row = minRow; row = maxRow; row++) {
for (int col = minColumn; col = maxColumn; col++) {
TableColumnBase column = getColumn(col);
select(row, column);
}
}
 
With the first API option (all ints), I am lacking the getColumn(..)
method to convert column indices to TableColumn instances.
With the second API option, I have no way of converting the two
TableColumnBase instances back into ints, and then I have the same
problem as with the first API.
 
Therefore, my options as far as I can see (and I'm happy to be wrong)
are to either not introduce this API and keep the performance
poor (for
now - hopefully we'll come up with a better solution in time) or to
introduce one of the two methods above and then have a no-op
implementation clearly documented in TableSelectionModel (with
the two
existing implementations in JavaFX 8.0 both implementing a far
more high
performance approach than we have currently).
 
Thoughts?
-- Jonathan
 
 
 
 
 



Re: Swing and JavaFX thread merge

2013-08-13 Thread Jeff Martin
Same here.

jeff

On Aug 13, 2013, at 10:17 AM, Werner Lehmann lehm...@media-interactive.de 
wrote:

 Artem,
 
 we already tested with 7u40 b35 - same thing:
 
 Java Web Start 10.40.2.35
 Using JRE version 1.7.0_40-ea-b35 Java HotSpot(TM) 64-Bit Server VM
 ...
 runTest in AWT-EventQueue-2
 jfx button click in JavaFX Application Thread
 invokeLater from jfx button click in AWT-EventQueue-0
 jbutton click in AWT-EventQueue-2
 jfx button click in JavaFX Application Thread
 invokeLater from jfx button click in AWT-EventQueue-0
 jbutton click in AWT-EventQueue-2
 
 Werner
 
 On 13.08.2013 16:31, Artem Ananiev wrote:
 Jeff, Werner,
 
 thank you very much for detailed evaluation. The issues you observe may
 be related to recent changes in AWT/Swing in 7u25. If my guess is
 correct, they should be fixed in the latest 7u40 builds. I know it's not
 released yet, but early access builds are available at java.net. Could
 you run your apps with 7u40 and check if the problems are gone, please?
 
 Thanks,
 
 Artem



Re: Mailing list woes

2013-08-09 Thread Jeff Martin

 I only noticed because a couple of my posts didn't come back from the list.



I've noticed this, too. Perhaps the list is losing things to a junk filter.

jeff


On Aug 9, 2013, at 7:45 AM, Felix Bembrick felix.bembr...@gmail.com wrote:

 I am not sure who this is directed at but there seem to be some glitches in
 the mailing list software that manages this list.
 
 I notice that sometimes when I post to this list I do not always get that
 message being sent to me via the list so I was wondering if I am actually
 receiving every message that is posted to the list.  I compared notes with
 a friend of mine who also subscribes to this list and we analysed the posts
 that we had both received over the past week.
 
 To both of our surprise we discovered that I received some posts that he
 never received and vice versa.  There does not appear to be any pattern as
 to which posts make it into our inboxes and which don't.
 
 I'd say we are both receiving about 19 out of every 20 messages or slightly
 less than that.  We definitely established that neither of us has received
 *every* message sent to the list.
 
 We have also all but ruled out spam filter issues as this is my Gmail
 account and all spam goes into the Spam folder and they certainly haven't
 been ending up in there.  Similarly he has a POP3 account and actually has
 opted to receive *all* spam sent to him which he then uses an Outlook
 message rule to place it in his Junk folder.
 
 Is anyone else experiencing this?  If you are, you probably don't realise
 it. I only noticed because a couple of my posts didn't come back from the
 list.
 
 Felix



Re: Swing and JavaFX thread merge

2013-08-08 Thread Jeff Martin
It looks like this is specific to MacOSX 7u25+, if you run Java Inventor from 
the JAWS link on MacOSX (I'm using JVM 1.7.0_25 or 40-ea):

prompt javaws http://reportmill.com/javi/javi1/JavaInventor1.jnlp

Here are the steps:

1. Create New Project and Open
2. Click on large, animated New Java Starter File to bring up 
JOptionPane

Then if you move the mouse around, you should see the other buttons on the 
screen still animate or illuminate in the FX thread. Whereas on 7u20 or Windows 
or non-JAWS launch, the JavaFX effects are not triggered while the modal panel 
is up. If you dismiss the option pane with the escape key and quickly re-click 
the New Starter File button repeatedly, eventually the 
SwingUtilities.computeIntersection NPE will manifest (sooner if you are doing a 
sales demo).

Any thoughts on what would make the FX thread ignore the modal state in this 
configuration?

jeff


On Aug 8, 2013, at 6:50 AM, Artem Ananiev artem.anan...@oracle.com wrote:

 
 On 8/8/2013 1:45 AM, Jeff Martin wrote:
 I thought I was getting this automatically - when I run on my
 desktop, I can bring up a JOptionPane from a Swing thread and
 JFXPanels (correctly) block. But when I run from Java Web Start, they
 don't, and I end up with sporadic SwingUtilities.computeIntersection
 NullPointerException.
 
 Once these two JDK/JavaFX bugs are resolved, scenario with JOptionPane you 
 described will work. As I wrote, it won't work by default in JDK8, you'll 
 need to run your app with certain system property (something like 
 -Djavafx.swing.singlethreaded=true).
 
 Is there a secret setting that has a different default with JAWS?
 
 NPEs look like a bug, either in AWT/FX, or in your application. I really 
 doubt it's related to Java Web Start. Could you provide a test to reproduce 
 the exceptions, please?
 
 Thanks,
 
 Artem
 
 jeff
 
 
 On Aug 7, 2013, at 5:06 AM, Artem Ananiev artem.anan...@oracle.com wrote:
 
 Hi, Pedro Duque Vieira,
 
 this is in progress. JDK part is tracked in 8015477:
 
 http://bugs.sun.com/view_bug.do?bug_id=8015477
 
 JavaFX part is described in RT-30694:
 
 https://javafx-jira.kenai.com/browse/RT-30694
 
 Note that in JDK8/JavaFX8 single-threaded mode will not be a part of public 
 API, it will be an experimental feature.
 
 Thanks,
 
 Artem
 
 On 8/7/2013 2:43 AM, Pedro Duque Vieira wrote:
 Hi,
 
 Some time ago there was a patch submitted which for all purposes merged the
 swing and javafx thread, making it easier for developers working on a
 swing/javafx app - http://wiki.apidesign.org/wiki/JavaFX
 
 Is this available now (I was under the impression it is)? How do I use it?
 
 Thanks in advance,


Re: Swing and JavaFX thread merge

2013-08-08 Thread Jeff Martin
Addendum: it turns out that the JOptionPane is not blocking any of the UI 
(Swing included). So maybe this isn't strictly a JavaFX problem.

jeff


On Aug 8, 2013, at 8:17 AM, Jeff Martin j...@reportmill.com wrote:

 It looks like this is specific to MacOSX 7u25+, if you run Java Inventor from 
 the JAWS link on MacOSX (I'm using JVM 1.7.0_25 or 40-ea):
 
   prompt javaws http://reportmill.com/javi/javi1/JavaInventor1.jnlp
 
 Here are the steps:
 
   1. Create New Project and Open
   2. Click on large, animated New Java Starter File to bring up 
 JOptionPane
 
 Then if you move the mouse around, you should see the other buttons on the 
 screen still animate or illuminate in the FX thread. Whereas on 7u20 or 
 Windows or non-JAWS launch, the JavaFX effects are not triggered while the 
 modal panel is up. If you dismiss the option pane with the escape key and 
 quickly re-click the New Starter File button repeatedly, eventually the 
 SwingUtilities.computeIntersection NPE will manifest (sooner if you are doing 
 a sales demo).
 
 Any thoughts on what would make the FX thread ignore the modal state in this 
 configuration?
 
 jeff
 
 
 On Aug 8, 2013, at 6:50 AM, Artem Ananiev artem.anan...@oracle.com wrote:
 
 
 On 8/8/2013 1:45 AM, Jeff Martin wrote:
 I thought I was getting this automatically - when I run on my
 desktop, I can bring up a JOptionPane from a Swing thread and
 JFXPanels (correctly) block. But when I run from Java Web Start, they
 don't, and I end up with sporadic SwingUtilities.computeIntersection
 NullPointerException.
 
 Once these two JDK/JavaFX bugs are resolved, scenario with JOptionPane you 
 described will work. As I wrote, it won't work by default in JDK8, you'll 
 need to run your app with certain system property (something like 
 -Djavafx.swing.singlethreaded=true).
 
 Is there a secret setting that has a different default with JAWS?
 
 NPEs look like a bug, either in AWT/FX, or in your application. I really 
 doubt it's related to Java Web Start. Could you provide a test to reproduce 
 the exceptions, please?
 
 Thanks,
 
 Artem
 
 jeff
 
 
 On Aug 7, 2013, at 5:06 AM, Artem Ananiev artem.anan...@oracle.com wrote:
 
 Hi, Pedro Duque Vieira,
 
 this is in progress. JDK part is tracked in 8015477:
 
 http://bugs.sun.com/view_bug.do?bug_id=8015477
 
 JavaFX part is described in RT-30694:
 
 https://javafx-jira.kenai.com/browse/RT-30694
 
 Note that in JDK8/JavaFX8 single-threaded mode will not be a part of 
 public API, it will be an experimental feature.
 
 Thanks,
 
 Artem
 
 On 8/7/2013 2:43 AM, Pedro Duque Vieira wrote:
 Hi,
 
 Some time ago there was a patch submitted which for all purposes merged 
 the
 swing and javafx thread, making it easier for developers working on a
 swing/javafx app - http://wiki.apidesign.org/wiki/JavaFX
 
 Is this available now (I was under the impression it is)? How do I use it?
 
 Thanks in advance,



Re: Swing and JavaFX thread merge

2013-08-08 Thread Jeff Martin
So I found a workaround, though I don't understand the why of the problem or 
workaround.

What I found was that on MacOSX 7u25+, my app mainSwing() (executed via 
invokeLater() from main()) was being called on AWT-EventQueue-2 from the JAWS 
startup thread (javawsApplicationMain) instead of AWT-EventQueue-0. So I added 
code to force JavaFX init, switch over to the FX thread, and switch back to 
Swing, which is then AWT-EventQueue-0:

if(Thread.currentThread().getName().equals(AWT-EventQueue-2)) {
new JFXPanel();
Platform.runLater(new Runnable() { public void run() {
SwingUtilities.invokeLater(new Runnable() { public void 
run() {
mainSwing(args); }}); }});
return;
}

And now my JOptionPane correctly blocks events outside of the dialog!

jeff


On Aug 8, 2013, at 9:56 AM, Jeff Martin j...@reportmill.com wrote:

 Addendum: it turns out that the JOptionPane is not blocking any of the UI 
 (Swing included). So maybe this isn't strictly a JavaFX problem.
 
 jeff
 
 
 On Aug 8, 2013, at 8:17 AM, Jeff Martin j...@reportmill.com wrote:
 
 It looks like this is specific to MacOSX 7u25+, if you run Java Inventor 
 from the JAWS link on MacOSX (I'm using JVM 1.7.0_25 or 40-ea):
 
  prompt javaws http://reportmill.com/javi/javi1/JavaInventor1.jnlp
 
 Here are the steps:
 
  1. Create New Project and Open
  2. Click on large, animated New Java Starter File to bring up 
 JOptionPane
 
 Then if you move the mouse around, you should see the other buttons on the 
 screen still animate or illuminate in the FX thread. Whereas on 7u20 or 
 Windows or non-JAWS launch, the JavaFX effects are not triggered while the 
 modal panel is up. If you dismiss the option pane with the escape key and 
 quickly re-click the New Starter File button repeatedly, eventually the 
 SwingUtilities.computeIntersection NPE will manifest (sooner if you are 
 doing a sales demo).
 
 Any thoughts on what would make the FX thread ignore the modal state in this 
 configuration?
 
 jeff
 
 
 On Aug 8, 2013, at 6:50 AM, Artem Ananiev artem.anan...@oracle.com wrote:
 
 
 On 8/8/2013 1:45 AM, Jeff Martin wrote:
 I thought I was getting this automatically - when I run on my
 desktop, I can bring up a JOptionPane from a Swing thread and
 JFXPanels (correctly) block. But when I run from Java Web Start, they
 don't, and I end up with sporadic SwingUtilities.computeIntersection
 NullPointerException.
 
 Once these two JDK/JavaFX bugs are resolved, scenario with JOptionPane you 
 described will work. As I wrote, it won't work by default in JDK8, you'll 
 need to run your app with certain system property (something like 
 -Djavafx.swing.singlethreaded=true).
 
 Is there a secret setting that has a different default with JAWS?
 
 NPEs look like a bug, either in AWT/FX, or in your application. I really 
 doubt it's related to Java Web Start. Could you provide a test to reproduce 
 the exceptions, please?
 
 Thanks,
 
 Artem
 
 jeff
 
 
 On Aug 7, 2013, at 5:06 AM, Artem Ananiev artem.anan...@oracle.com wrote:
 
 Hi, Pedro Duque Vieira,
 
 this is in progress. JDK part is tracked in 8015477:
 
 http://bugs.sun.com/view_bug.do?bug_id=8015477
 
 JavaFX part is described in RT-30694:
 
 https://javafx-jira.kenai.com/browse/RT-30694
 
 Note that in JDK8/JavaFX8 single-threaded mode will not be a part of 
 public API, it will be an experimental feature.
 
 Thanks,
 
 Artem
 
 On 8/7/2013 2:43 AM, Pedro Duque Vieira wrote:
 Hi,
 
 Some time ago there was a patch submitted which for all purposes merged 
 the
 swing and javafx thread, making it easier for developers working on a
 swing/javafx app - http://wiki.apidesign.org/wiki/JavaFX
 
 Is this available now (I was under the impression it is)? How do I use 
 it?
 
 Thanks in advance,
 



Re: Swing and JavaFX thread merge

2013-08-07 Thread Jeff Martin
I thought I was getting this automatically - when I run on my desktop, I can 
bring up a JOptionPane from a Swing thread and JFXPanels (correctly) block. But 
when I run from Java Web Start, they don't, and I end up with sporadic 
SwingUtilities.computeIntersection NullPointerException.

Is there a secret setting that has a different default with JAWS?

jeff


On Aug 7, 2013, at 5:06 AM, Artem Ananiev artem.anan...@oracle.com wrote:

 Hi, Pedro Duque Vieira,
 
 this is in progress. JDK part is tracked in 8015477:
 
 http://bugs.sun.com/view_bug.do?bug_id=8015477
 
 JavaFX part is described in RT-30694:
 
 https://javafx-jira.kenai.com/browse/RT-30694
 
 Note that in JDK8/JavaFX8 single-threaded mode will not be a part of public 
 API, it will be an experimental feature.
 
 Thanks,
 
 Artem
 
 On 8/7/2013 2:43 AM, Pedro Duque Vieira wrote:
 Hi,
 
 Some time ago there was a patch submitted which for all purposes merged the
 swing and javafx thread, making it easier for developers working on a
 swing/javafx app - http://wiki.apidesign.org/wiki/JavaFX
 
 Is this available now (I was under the impression it is)? How do I use it?
 
 Thanks in advance,