B4J Library [Beta]JFXExtended: Shapes, Effects, Borders And Gradient Fills

JFXExtended.png


JFXExtend allows you to apply shapes, effects, borders and gradient fills to Nodes.


The library does not use CSS. It wraps the underlying packages used by JavaFX to implement the CSS . Mixing the two together can cause conflicts. An example of this is if you add a border to a button using this library and there is a border defined in the inline style for the button then the border will only temporarily replace the border defined in the inline style. This means if the button is redrawn the original border in the inline style will be used and the border you added will be lost. You will need to remove the original border from the inline style. The example code shows you how to remove entries from the inline style.

Quite late in the process of coding this library I came to the conclusion that the approach I used is wrong. It would have been better and more flexible to write a collection of helper classes in B4J to build up the CSS required to do the same thing this library does.

At this point I would usually post the library documentation. I can't though because it exceeds the 50,000 character limit for messages...

So please refer to the html file in the library folder of the zip.

The demo requires the ApacheStringUtils library.
 

Attachments

  • JFXExtended.zip
    55.5 KB · Views: 335
Last edited:

amaxco

Member
Licensed User
Longtime User
@Informatix and @keirS

I, too, invite @Erel to be part of this discussion.

Also, I suggest adding a title, something like "Initiatives", in each forum where we all participate/collaborate for producing a product, library, wrapper ... etc, for the benefit of the entire community. It is like a "B4Xhub" project. If applicable we can take it to a higher level aiming at organizing a A "B4X Anywhere school" .... Sounds highly imaginative but not difficult to achieve if we unite our resources, we want our kids get engaged too.

B4X has amazingly attracted so many and specially those who were born and worked in the classic world of programming and found it difficult to jump on the new world wagon.... For them, B4X is the lifebuoy!
 

amaxco

Member
Licensed User
Longtime User
Download the ApacheStrUtils library again. I have updated this and it should now work.

Thanks @keirS

All is fixed and working fine.

Just some odd idea occurred to me, is it possible to use these shapes separately? Is it is explained in the B4X beginner's guide shapes can only be used if contained in a canvas. In my opinion, placing many convases at different positions only for the purpose of displaying shapes such as circle, line or rectangles is not that hand this way.
 

keirS

Well-Known Member
Licensed User
Longtime User
Thanks @keirS

All is fixed and working fine.

Just some odd idea occurred to me, is it possible to use these shapes separately? Is it is explained in the B4X beginner's guide shapes can only be used if contained in a canvas. In my opinion, placing many convases at different positions only for the purpose of displaying shapes such as circle, line or rectangles is not that hand this way.

Yes this is possible. Just use AddNode to add them. They are just another type of Node.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I wonder if @Erel would be willing to the post the BADoclet code
You don't need the BADoclet tool for this. It will be easier to create a tool that reads the XML and generates HTML. It will also work with all B4X products. The BADoclet is only used by B4A and B4J.

In fact I'm using such a tool to produce the online documentation:
https://www.b4x.com/b4j/documentation.html

I cannot share this tool as it is a modified version of the IDE.
 
Top