RFR: 8251555: Remove unused focusedWindow field in glass Window to avoid leak

2020-08-22 Thread Kevin Rushforth
This is a follow-up to 
[JDK-8241840](https://bugs.openjdk.java.net/browse/JDK-8241840) that removes an 
unused static
`focusedWindow` field and its associated getter and setter from the 
platform-independent glass Window class. This is
entirely unused by any of the glass platforms. The Monocle platform keeps track 
of the `focusedWindow` attribute itself.

The existing `test.javafx.stage.FocusedWindowNativeTest` automated test, which 
was added as part of
[JDK-8241840](https://bugs.openjdk.java.net/browse/JDK-8241840), was failing 
fairly consistently on one of our test
machines before this fix, and now passes.

-

Commit messages:
 - Remove unused focusedWindow field in glass Window to avoid leak

Changes: https://git.openjdk.java.net/jfx/pull/286/files
 Webrev: https://webrevs.openjdk.java.net/jfx/286/webrev.00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8251555
  Stats: 15 lines in 1 file changed: 0 ins; 15 del; 0 mod
  Patch: https://git.openjdk.java.net/jfx/pull/286.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/286/head:pull/286

PR: https://git.openjdk.java.net/jfx/pull/286


Re: Blurry render of SwingNode

2020-08-22 Thread Kevin Rushforth
Actually, someone already did file a bug report a couple days ago (I see 
it in our internal incident tracker). Once it is transferred to the JDK 
project, I'll add the standalone test program from this email thread to 
the bug report, which should help in narrowing it down.


Thanks.

-- Kevin


On 8/22/2020 11:40 AM, Michael Paus wrote:

Hi,
this is not a bug reporting list. Please file your bug report here
https://bugs.java.com/bugdatabase/ instead.
Best regards
Michael

Am 22.08.20 um 19:57 schrieb Thangalin:

Ahoy list,

Running OpenJDK 14.0.1 on Windows 7, adding a SwingNode to a SplitPane
causes the contents of the SwingNode to appear blurry. There's a full
write-up with screen-shots at:
https://stackoverflow.com/q/63444771/59087

Here's an SSCCE that demonstrates the problem:

import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.scene.Scene;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

import javax.swing.*;
import java.awt.*;

import static javafx.application.Platform.runLater;
import static javax.swing.SwingUtilities.invokeLater;

public class FlyingSourceTest extends Application {
   public static void main( String[] args ) {
 Application.launch( args );
   }

   @Override
   public void start( Stage stage ) {
 invokeLater( () -> {
   stage.setTitle( "SSCCE" );

   final var size = 120f;
   final var font = new javafx.scene.text.Font( "Arial", size );
   final var bgStyle = "-fx-background-color: white";

   // FX label, StackPane
   final var fxLabelTop = new javafx.scene.text.Text( "FX/FX" );
   fxLabelTop.setFont( font );
   final var fxStackPaneTop = new StackPane( fxLabelTop );

   // FX label, StackPane
   final var fxLabelSplit = new javafx.scene.text.Text( "FX 
LABEL" );

   fxLabelSplit.setFont( font );
   final var fxLabelPane = new StackPane();
   fxLabelPane.getChildren().addAll( fxLabelSplit );
   fxLabelPane.setStyle( bgStyle );

   // Swing label, StackPane
   final var swingLabel = new JLabel( "SW LABEL" );
   swingLabel.setBackground( Color.WHITE );
   swingLabel.setOpaque( true );
   swingLabel.setFont( swingLabel.getFont().deriveFont( 
Font.PLAIN, size ) );

   final var swingLabelNode = new SwingNode();
   swingLabelNode.setContent( swingLabel );
   final var swingLabelPane = new StackPane( swingLabelNode );
   swingLabelPane.setStyle( bgStyle );

   final var fxSplitPane = new SplitPane(
   fxLabelPane, swingLabelPane );
   fxSplitPane.setPrefSize( 1280, 300 );

   final var root = new VBox();
   root.getChildren().addAll( fxStackPaneTop, fxSplitPane );
   root.setStyle( bgStyle );

   runLater( () -> {
 final var scene = new Scene( root );
 stage.setScene( scene );
 stage.show();
   } );
 } );
   }
}

Closely compare the "L" from "SW LABEL" to the "L" from "FX LABEL".
You'll see that the "SW LABEL" ell has what looks like stronger
antialiasing applied.

Changing the Graphics2D rendering hints on the JLabel has no effect.
Changing the JLabel's AffineTransform to shift by 0.5px worsens the
blurriness. Moving the SwingNode out of the SplitPane renders crisply,
as expected. The font colours and background do not affect the
outcome, but are there to make consistent output, which makes
comparing easier.

This problem affects neither X11 (Linux) nor OSX, only Windows.

Been trying to fix this for several days without success.

Any ideas why embedding a SwingNode within a SplitPane causes a blurry
effect? And how can the problem be resolved?

Thank you!







Re: Blurry render of SwingNode

2020-08-22 Thread Michael Paus

Hi,
this is not a bug reporting list. Please file your bug report here
https://bugs.java.com/bugdatabase/ instead.
Best regards
Michael

Am 22.08.20 um 19:57 schrieb Thangalin:

Ahoy list,

Running OpenJDK 14.0.1 on Windows 7, adding a SwingNode to a SplitPane
causes the contents of the SwingNode to appear blurry. There's a full
write-up with screen-shots at:
https://stackoverflow.com/q/63444771/59087

Here's an SSCCE that demonstrates the problem:

import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.scene.Scene;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

import javax.swing.*;
import java.awt.*;

import static javafx.application.Platform.runLater;
import static javax.swing.SwingUtilities.invokeLater;

public class FlyingSourceTest extends Application {
   public static void main( String[] args ) {
 Application.launch( args );
   }

   @Override
   public void start( Stage stage ) {
 invokeLater( () -> {
   stage.setTitle( "SSCCE" );

   final var size = 120f;
   final var font = new javafx.scene.text.Font( "Arial", size );
   final var bgStyle = "-fx-background-color: white";

   // FX label, StackPane
   final var fxLabelTop = new javafx.scene.text.Text( "FX/FX" );
   fxLabelTop.setFont( font );
   final var fxStackPaneTop = new StackPane( fxLabelTop );

   // FX label, StackPane
   final var fxLabelSplit = new javafx.scene.text.Text( "FX LABEL" );
   fxLabelSplit.setFont( font );
   final var fxLabelPane = new StackPane();
   fxLabelPane.getChildren().addAll( fxLabelSplit );
   fxLabelPane.setStyle( bgStyle );

   // Swing label, StackPane
   final var swingLabel = new JLabel( "SW LABEL" );
   swingLabel.setBackground( Color.WHITE );
   swingLabel.setOpaque( true );
   swingLabel.setFont( swingLabel.getFont().deriveFont( Font.PLAIN, size ) 
);
   final var swingLabelNode = new SwingNode();
   swingLabelNode.setContent( swingLabel );
   final var swingLabelPane = new StackPane( swingLabelNode );
   swingLabelPane.setStyle( bgStyle );

   final var fxSplitPane = new SplitPane(
   fxLabelPane, swingLabelPane );
   fxSplitPane.setPrefSize( 1280, 300 );

   final var root = new VBox();
   root.getChildren().addAll( fxStackPaneTop, fxSplitPane );
   root.setStyle( bgStyle );

   runLater( () -> {
 final var scene = new Scene( root );
 stage.setScene( scene );
 stage.show();
   } );
 } );
   }
}

Closely compare the "L" from "SW LABEL" to the "L" from "FX LABEL".
You'll see that the "SW LABEL" ell has what looks like stronger
antialiasing applied.

Changing the Graphics2D rendering hints on the JLabel has no effect.
Changing the JLabel's AffineTransform to shift by 0.5px worsens the
blurriness. Moving the SwingNode out of the SplitPane renders crisply,
as expected. The font colours and background do not affect the
outcome, but are there to make consistent output, which makes
comparing easier.

This problem affects neither X11 (Linux) nor OSX, only Windows.

Been trying to fix this for several days without success.

Any ideas why embedding a SwingNode within a SplitPane causes a blurry
effect? And how can the problem be resolved?

Thank you!





Blurry render of SwingNode

2020-08-22 Thread Thangalin
Ahoy list,

Running OpenJDK 14.0.1 on Windows 7, adding a SwingNode to a SplitPane
causes the contents of the SwingNode to appear blurry. There's a full
write-up with screen-shots at:
https://stackoverflow.com/q/63444771/59087

Here's an SSCCE that demonstrates the problem:

import javafx.application.Application;
import javafx.embed.swing.SwingNode;
import javafx.scene.Scene;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

import javax.swing.*;
import java.awt.*;

import static javafx.application.Platform.runLater;
import static javax.swing.SwingUtilities.invokeLater;

public class FlyingSourceTest extends Application {
  public static void main( String[] args ) {
Application.launch( args );
  }

  @Override
  public void start( Stage stage ) {
invokeLater( () -> {
  stage.setTitle( "SSCCE" );

  final var size = 120f;
  final var font = new javafx.scene.text.Font( "Arial", size );
  final var bgStyle = "-fx-background-color: white";

  // FX label, StackPane
  final var fxLabelTop = new javafx.scene.text.Text( "FX/FX" );
  fxLabelTop.setFont( font );
  final var fxStackPaneTop = new StackPane( fxLabelTop );

  // FX label, StackPane
  final var fxLabelSplit = new javafx.scene.text.Text( "FX LABEL" );
  fxLabelSplit.setFont( font );
  final var fxLabelPane = new StackPane();
  fxLabelPane.getChildren().addAll( fxLabelSplit );
  fxLabelPane.setStyle( bgStyle );

  // Swing label, StackPane
  final var swingLabel = new JLabel( "SW LABEL" );
  swingLabel.setBackground( Color.WHITE );
  swingLabel.setOpaque( true );
  swingLabel.setFont( swingLabel.getFont().deriveFont( Font.PLAIN, size ) );
  final var swingLabelNode = new SwingNode();
  swingLabelNode.setContent( swingLabel );
  final var swingLabelPane = new StackPane( swingLabelNode );
  swingLabelPane.setStyle( bgStyle );

  final var fxSplitPane = new SplitPane(
  fxLabelPane, swingLabelPane );
  fxSplitPane.setPrefSize( 1280, 300 );

  final var root = new VBox();
  root.getChildren().addAll( fxStackPaneTop, fxSplitPane );
  root.setStyle( bgStyle );

  runLater( () -> {
final var scene = new Scene( root );
stage.setScene( scene );
stage.show();
  } );
} );
  }
}

Closely compare the "L" from "SW LABEL" to the "L" from "FX LABEL".
You'll see that the "SW LABEL" ell has what looks like stronger
antialiasing applied.

Changing the Graphics2D rendering hints on the JLabel has no effect.
Changing the JLabel's AffineTransform to shift by 0.5px worsens the
blurriness. Moving the SwingNode out of the SplitPane renders crisply,
as expected. The font colours and background do not affect the
outcome, but are there to make consistent output, which makes
comparing easier.

This problem affects neither X11 (Linux) nor OSX, only Windows.

Been trying to fix this for several days without success.

Any ideas why embedding a SwingNode within a SplitPane causes a blurry
effect? And how can the problem be resolved?

Thank you!


Re: JPackage and JavaFX

2020-08-22 Thread Davide Perini

Just for reference,
I was using maven to bundle JavaFX, using OpenJDK I had that error,
using AdoptOpenJDK solved the problem.

Regards,
Davide


Il 20/08/2020 17.07, Kevin Rushforth ha scritto:

That should be "This list is *not* the right place..."

On 8/20/2020 8:06 AM, Kevin Rushforth wrote:
This list is be the right place to discuss the javapackager tool 
(regardless of whether or not it is a fork of the old 
java(fx)packager tool that used to be part of openjfx).


-- Kevin


On 8/20/2020 7:12 AM, Bardot Jérôme wrote:

i personaly try to use javapackager
https://github.com/fvarrui/JavaPackager

for me this tool need to be hightlight and it need feedback

On 20/08/2020 02:52, Davide Perini wrote:

Hi all,
is there someone able to use JPackage with JavaFX under ubuntu with 
JDK14?


When I try to use jpackage on ubuntu I get this error:

jpackage -n TestFX -i target --main-jar 
tmyjar-jar-with-dependencies.jar
-d output --module-path 
/home/sblantipodi/dev/jdk/javafx-sdk-14.0.2.1/lib

WARNING: Using incubator modules: jdk.incubator.jpackage

java.lang.module.FindException: Hash of jdk.management.jfr
(a405f735790e653ae6ad1ef35615c78a555389cc5076c74c52f3790a13351666)
differs to expected hash
(06d891a3ae65eb002ec7c3adeac782a67e5c76c5f1569cbb4e9bdace4e220f23)
recorded in java.base

Any idea?

Thanks