Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rendering problem when loading a fxml with constrolsfx CustomTextField #16

Open
gluon-bot opened this issue Jul 15, 2015 · 4 comments
Open
Labels
blocker bug Something isn't working custom control Custom controls usage in Scene Builder

Comments

@gluon-bot
Copy link

Originally reported by: Denny Israel (Bitbucket: sideisra, GitHub: sideisra)


HOW TO REPRODUCE:

  • load controlsfx-8.40.9.jar into SB
  • create a fxml with a CustomTextField in a StackPane
  • Save the fxml
  • restart SB
  • load the fxml

WHAT HAPPENED:

  • Accordion on the right side shows rendering issues like in the attached screenshot
  • ervery time i click in one text field on the right it it is not rendered and shows a white box

WHAT SHULD HAPPEN:

  • correct rendering

From Saxonia Systems AG.


@gluon-bot
Copy link
Author

Original comment by Andre Krause (Bitbucket: akrause, GitHub: akrause):


I tested this with Java version 8u65 and ControlsFX version 8.40.9 and 8.40.10.

The problem doesn't rely on the CustomTextField, it seems that the ControlsFX jar breaks the SB-renderer or something else.

If i start the SB with the jar file already included, and i add for example an AnchorPane, the fields are also not rendered correctly.

On the initial size of the SB window, it does render the fields on the right side correctly. But if i resize the window to the right, the fields are getting white like on the screenshot.

So perhaps the renderer or something else is not growing with the SB content window, that causes this strange render issues. Perhaps the style properties for mouse over are missing in this moment.

@gluon-bot
Copy link
Author

Original comment by Andre Krause (Bitbucket: akrause, GitHub: akrause):


So on further research i found out that a special component is responsible for these rendering issues. In the class GlyphFont a user agent stylesheet is set with the class StyleManager.

#!java

StyleManager.getInstance().addUserAgentStylesheet(
                GlyphFont.class.getResource("glyphfont.css").toExternalForm());

According to the documentation of the StyleManager, it seems that the stylesheet from the SB, especially the hover effects, are overridden in case the ControlsFX JAR is imported.

If i comment this line out, the rendering issues don't appear.

@gluon-bot
Copy link
Author

Original comment by Joeri Sykora (Bitbucket: tiainen, GitHub: tiainen):


The reason the user agent stylesheet is added is because it is in a static initialization block. With the changes that were done in pull request #20 the GlyphFont class should no longer be loaded as it is not a valid candidate for including in the library (it doesn't extend from Node). I've tested it with the latest code from the repository and I no longer see any artifacts with the AnchorPane use case you described earlier.

Although, this still leaves the case where a valid library control would add a user agent stylesheet like GlyphFont does. In that case the same rendering artifacts will probably appear as well?

@gluon-bot
Copy link
Author

Original comment by Andre Krause (Bitbucket: akrause, GitHub: akrause):


Ah ok, good to know.

Yes, the SB not seems to be robust against such cases, it is possible that with other components the same behaviour appears, if the StyleManager is used. But maybe it is a JavaFX problem, because with the StyleManager class the stylesheet is set globally and could always cause these issues.

Maybe there should be a further investigation with a custom component that uses this StyleManager.

@gluon-bot gluon-bot added blocker bug Something isn't working labels May 9, 2018
@AlmasB AlmasB added the custom control Custom controls usage in Scene Builder label Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Something isn't working custom control Custom controls usage in Scene Builder
Projects
None yet
Development

No branches or pull requests

2 participants