scenebuilder icon indicating copy to clipboard operation
scenebuilder copied to clipboard

Scene Builder's CSS Analyzer not working on Windows

Open gluon-bot opened this issue 7 years ago • 24 comments

Originally reported by: Anonymous


I have a problem with Scene Builder's CSS Analyzer but only on Windows.

I have 2 environments (Windows 7 and Ubuntu 16.04) and here is what I have done in both:

  • I have created a new FXML file

  • I have added a anchor pane and set a styleSheet

  • In this anchor pane I have added a Label. I also set the styleSheet here (although this is probably not necessary).

The Label does show the style contained in the styleSheet (I have changed the Font Size and color and I do see the change on the Label) so the styleSheet is "working".

I then opened Scene Builder's CSS Analyzer and select the Label.

On Ubuntu, in the column "styleSheets", I do see what I have set in my styleSheet file. That's fine.

On Windows7, the column "styleSheets" is empty. Only the column "Defaults" is filled and the information looks incorrect: It says the the Font is "System 11.773585319519043px" which is not correct because I have set a Font Size of 26px. Is that a bug of CSS Analyzer?

This is very annoying because it prevents from seeing which CSS rule will be applied.

Thanks for your advices.


  • Bitbucket: https://bitbucket.org/gluon-oss/scenebuilder/issue/170

gluon-bot avatar Feb 02 '18 08:02 gluon-bot

Same issue on all Windows 10 machines I've tested with.

In the example bellow the css sets -fx-text-fill: green. To enhance the issue, text fill is then set to red in Scene Builder. The green property value is not shown in the CSS Analyzer.

scenebuilder_cssanlz

JavaFX Scene Builder 11.0.0 Windows 10, amd64, 10.0

depascalis avatar Dec 11 '19 17:12 depascalis

Doesn't work on MacOS either

dwhitla avatar Mar 30 '22 09:03 dwhitla

Still not working on windows 10 :

Product Version JavaFX Scene Builder 18.0.0

Build Information Version 18.0.0 Date: 2022-03-31 20:20:30 JavaFX Version: 18 Java Version: 17, OpenJDK Runtime Environment

JavaFX 18

Java 18, OpenJDK Runtime Environment

Java Library Path(s):

Missing or invalid Java Library Path(s): runtime\bin runtime\lib

Operating System Windows 10, amd64, 10.0

RobinDenaux avatar Jun 07 '22 07:06 RobinDenaux

Hi @AlmasB, how about giving this issue a higher priority so that we probably can solve it with Scene Builder 20? The CSS Analyzer is core functionality and this should work. I did not review yet how it works in detail but it is something I'll dive into. If you agree, you can assign this one to me.

Oliver-Loeffler avatar Oct 01 '22 15:10 Oliver-Loeffler

I've added this to 20, though we still seem to have trailing issues for 18 and 19 that need to be looked at.

AlmasB avatar Oct 01 '22 17:10 AlmasB

Do we have kind of a roadmap which things to resolve first and which things later? Same like #353

Oliver-Loeffler avatar Oct 01 '22 20:10 Oliver-Loeffler

This doesn't work on Linux either. This issue has been reported a few times recently. This issue should be given some priority...

credmond avatar Oct 18 '23 14:10 credmond

I can confirm the behaviour works as expected on 8.5.0 , so it was introduced since. E.g., I can see Stylesheet or Inline Styles in that version.

The bug is also present in SceneBuilder-18.0.0-SNAPSHOT.msi, which seems to be the last downloadable version of SB. Therefore whatever change broke it, was before 18.

I don't know why Gluon links all GitHub releases to this page: https://gluonhq.com/products/scene-builder ... but only provides the latest when you actually land on it (or 8.5.0). People often have reasons for reverting.

@Oliver-Loeffler @AlmasB @johanvos this is a pretty bad bug, I think it should be fixed with priority.

credmond avatar Oct 19 '23 01:10 credmond

Update: after hacking the download URLs, I was able to download SB 15. The bug is also present there also.

Works in 8.5:

image

Doesn't work with 15:

image

Note: I have found at least 6 other separate bug reports about this spanning a couple of years, to it's definitely a desired fix!

credmond avatar Oct 19 '23 11:10 credmond

@credmond Thanks for your research in this topic. I'll look into this and get in touch with @AlmasB. Would be great if we find a way to revert this into how it was supposed to work.

Oliver-Loeffler avatar Oct 19 '23 21:10 Oliver-Loeffler

I think there was a big "Java 9" readiness commit which changes a few of these classes used in this panel, I'd bet it was introduced then somehow...

https://github.com/gluonhq/scenebuilder/pull/198/files

credmond avatar Oct 19 '23 21:10 credmond

It feels like so. I'll dig into this. Its really a huge commit - it touches almost everything.

Oliver-Loeffler avatar Oct 20 '23 16:10 Oliver-Loeffler

It feels like so. I'll dig into this. Its really a huge commit - it touches almost everything.

Yeah :) I think SceneBuilder is a great tool that has lacked some love recently, fixing this (which might fix other associated bugs) would boost the JavaFX ecosystem overall...

credmond avatar Oct 21 '23 11:10 credmond

Hi all -- any progress on this?

credmond avatar Feb 11 '24 03:02 credmond

Hi @credmond, unfortunately not yet. I'll still try to see the difference. Actually I have never seen this thing working.

Oliver-Loeffler avatar Mar 27 '24 19:03 Oliver-Loeffler

Very cool, I've got Scene Builder 8.5.0 running. With your input I'm now playing with git bisect. May be this helps to identify the relevant change. But first I've to try the CSS inspector.

Oliver-Loeffler avatar Mar 27 '24 19:03 Oliver-Loeffler

Well, highest chance candidate is a combination of 011b36870b61f41ee5c7ab6e0c433d940f794028 and 4f07490d2b098f0c5721ce71b038f344715f3c26.

This one is still working: 7eda5ceda0a90b9137fb6f18b919deb490211dea

This is a test candidate (merge conflict resolution) 8b9b73a89a20a03c59ce85c01065ce23e2aee714

This one is also a candidate: 4f07490d2b098f0c5721ce71b038f344715f3c26

bad 01cccf0 good f61d405

Oliver-Loeffler avatar Mar 27 '24 20:03 Oliver-Loeffler

To get the debugger in Eclipse running, I had to add following VM parameters:

--module-path "javafx-sdk-22\lib"
--add-modules javafx.controls
--add-modules javafx.base
--add-modules javafx.graphics
--add-modules javafx.fxml
--add-modules javafx.media
--add-exports javafx.media/com.sun.media.jfxmedia.events=ALL-UNNAMED
--add-exports javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.prism=ALL-UNNAMED 
--add-exports javafx.graphics/com.sun.glass.ui=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.glass.utils=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.geom.transform=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.sg.prism=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.font=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.util=ALL-UNNAMED
--add-exports javafx.base/com.sun.javafx.logging=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.scene.input=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.text=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.scene.text=ALL-UNNAMED
--add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED
--add-opens javafx.fxml/javafx.fxml=ALL-UNNAMED

When started without exports, the CssPanel will fail to load.

Oliver-Loeffler avatar Mar 27 '24 21:03 Oliver-Loeffler

I am excited... :)

credmond avatar Mar 27 '24 23:03 credmond

Hi! I have trid in Scene Builder 21 latest yet, still there is a issue in it!

I always have to switch to old Scene Builder 8.5, beacause it have nice feature which one is still missing in new version!

ctoabidmaqbool1 avatar May 05 '24 15:05 ctoabidmaqbool1

Hi, we aware of this issue and I am investigating the problem. I cannot promise but hope to be able to fix this before the next release.

Oliver-Loeffler avatar May 05 '24 21:05 Oliver-Loeffler