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: 331
Last edited:

amaxco

Member
Licensed User
Longtime User
Hi everybody,

Many thanks on behalf of beginners and "VB6 immigrants" to all who contribute with such added values.

As a proposal, I wish that all added value works be documented in a "LibraryName_InfoSheet.txt" Standard Template file with basic and ordered content/spec entries. As such, this is an invitation to those who are skillful in documentation to design the template. For example, a "Use Case Scenario" could be one of the entries whereby a potential user may on the spot decide if it is the product that addresses his problem.

This will help all to read the documentation first which will save time and clarify important points in advance.

@keirS
Thank you for sharing your works

@Erel
An implicit "Thank you for your creation" goes from me with every post.

Regards,
 

Informatix

Expert
Licensed User
Longtime User
Hi everybody,

Many thanks on behalf of beginners and "VB6 immigrants" to all who contribute with such added values.

As a proposal, I wish that all added value works be documented in a "LibraryName_InfoSheet.txt" Standard Template file with basic and ordered content/spec entries. As such, this is an invitation to those who are skillful in documentation to design the template. For example, a "Use Case Scenario" could be one of the entries whereby a potential user may on the spot decide if it is the product that addresses his problem.

This will help all to read the documentation first which will save time and clarify important points in advance.

@keirS
Thank you for sharing your works

@Erel
An implicit "Thank you for your creation" goes from me with every post.

Regards,
Be glad that you find a documentation and an example with a library. It's not always the case. ;)
 

amaxco

Member
Licensed User
Longtime User
Hi Informatix,

Sure I am. Before submitting my proposal I started with thankfulness and appreciation.

"It's not always the case" that is I am pointing to. My intention is to help each other in the best way we can.

Regards,
 

amaxco

Member
Licensed User
Longtime User
When I ran example app and press "Transform" it generated the following errors

Waiting for debugger to connect...
Program started.
java.lang.NoClassDefFoundError: org/apache/commons/lang3/CharSequenceUtils
at org.apache.commons.lang3.StringUtils.contains(StringUtils.java:1826)
at uk.co.hadaly.stringapache.ApacheStringUtils.ContainsSeq(ApacheStringUtils.java:73)
at b4j.example.main._removebordercss(main.java:348)
at b4j.example.main._border1(main.java:295)
at b4j.example.main._button1_mouseclicked(main.java:479)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:613)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.objects.NodeWrapper$1.handle(NodeWrapper.java:90)
at anywheresoftware.b4j.objects.NodeWrapper$1.handle(NodeWrapper.java:1)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3470)
at javafx.scene.Scene$ClickGenerator.access$8100(Scene.java:3398)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3766)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(GlassViewEventHandler.java:388)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
at com.sun.glass.ui.View.notifyMouse(View.java:937)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.CharSequenceUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 51 more
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/commons/lang3/CharSequenceUtils
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:93)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.objects.NodeWrapper$1.handle(NodeWrapper.java:90)
at anywheresoftware.b4j.objects.NodeWrapper$1.handle(NodeWrapper.java:1)
at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
at javafx.event.Event.fireEvent(Event.java:198)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3470)
at javafx.scene.Scene$ClickGenerator.access$8100(Scene.java:3398)
at javafx.scene.Scene$MouseHandler.process(Scene.java:3766)
at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:352)
at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:275)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$355(GlassViewEventHandler.java:388)
at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:387)
at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
at com.sun.glass.ui.View.notifyMouse(View.java:937)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$149(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/CharSequenceUtils
at org.apache.commons.lang3.StringUtils.contains(StringUtils.java:1826)
at uk.co.hadaly.stringapache.ApacheStringUtils.ContainsSeq(ApacheStringUtils.java:73)
at b4j.example.main._removebordercss(main.java:348)
at b4j.example.main._border1(main.java:295)
at b4j.example.main._button1_mouseclicked(main.java:479)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:613)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:228)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
... 34 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.CharSequenceUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 51 more
 

Informatix

Expert
Licensed User
Longtime User
Hi Informatix,

Sure I am. Before submitting my proposal I started with thankfulness and appreciation.

"It's not always the case" that is I am pointing to. My intention is to help each other in the best way we can.

Regards,
Suggestions for a normalized documentation or an index of all libraries seem to have no future here as long as contributions are posted in a forum as ordinary messages. If you force each developer to post his/her work via a form asking for a summary, a screenshot, an example, the target platform (B4A, B4J, ...), a few key words, etc., we have a chance to see some organization in this mess. But for now, it's a mess and I agree that you have to guess what may be the usefulness of some contributions (this does not concern this library) and how to use them when there's no documentation or example.
 

keirS

Well-Known Member
Licensed User
Longtime User
When I ran example app and press "Transform" it generated the following errors

Waiting for debugger to connect...
Program started.
java.lang.NoClassDefFoundError: org/apache/commons/lang3/CharSequenceUtils
at org.apache.commons.lang3.StringUtils.contains(StringUtils.java:1826)

That's strange. One of the jar files for the string utils library appears to be missing loads of classes. Download the jar file and copy it to your additional libraries folder.
 

Attachments

  • commons-lang3-3.5.jar
    145.3 KB · Views: 248

keirS

Well-Known Member
Licensed User
Longtime User
Suggestions for a normalized documentation or an index of all libraries seem to have no future here as long as contributions are posted in a forum as ordinary messages. If you force each developer to post his/her work via a form asking for a summary, a screenshot, an example, the target platform (B4A, B4J, ...), a few key words, etc., we have a chance to see some organization in this mess. But for now, it's a mess and I agree that you have to guess what may be the usefulness of some contributions (this does not concern this library) and how to use them when there's no documentation or example.

Perhaps a sticky on this section of the forum would help advising people what to include when posting a library with a link to @warwound 's library and module reference generator would be a helpful start .
 

amaxco

Member
Licensed User
Longtime User
That's strange. One of the jar files for the string utils library appears to be missing loads of classes. Download the jar file and copy it to your additional libraries folder.

I copied the file as you mentioned but still the error exists.
 

amaxco

Member
Licensed User
Longtime User
Suggestions for a normalized documentation or an index of all libraries seem to have no future here as long as contributions are posted in a forum as ordinary messages. If you force each developer to post his/her work via a form asking for a summary, a screenshot, an example, the target platform (B4A, B4J, ...), a few key words, etc., we have a chance to see some organization in this mess. But for now, it's a mess and I agree that you have to guess what may be the usefulness of some contributions (this does not concern this library) and how to use them when there's no documentation or example.

If you describe it as "mess" then we expect from experts like you a neat plan for documentation thereof. The points you mentioned are among what we really look for.
 

Informatix

Expert
Licensed User
Longtime User

keirS

Well-Known Member
Licensed User
Longtime User
Ah ok, it's the one I use. I never paid attention to what's written at the top of the page.
There are several bugs in this conversion script. A long time ago, I wrote to the author to ask for the code, but never got an answer.

Yes I have noticed that. I wonder if @Erel would be willing to the post the BADoclet code. That could form the basis to generate HTML output as well as the XML.
 
Top