Other Wish: Drawing components B4J Designer..

rbghongade

Well-Known Member
Licensed User
Longtime User
Dear Erel,
Wishing to have basic graphical objects like line, circle in the B4J designer. It will facilitate drawing complex diagrams.
Thanks and regards,
 

ThRuST

Well-Known Member
Licensed User
Longtime User
EDIT:
Since Scene builder is no longer supported you will have to use the internal designer and rely on the currently available control types. I'm not sure how you can access these specific controls you need any other way, sorry.
 
Last edited:
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Support for Scene Builder is only kept for backwards compatibility reasons.

So how to access shapes and charts types from the internal designer? You forgot to answer his question.
Will there be FXML support in the internal designer or is new JavaFX controls only aimed for native Java customers?
 
Upvote 0

keirS

Well-Known Member
Licensed User
Longtime User
It's not very difficult to use JavaObject to draw a shape on an pane


B4X:
Dim J As JavaObject
   
    Dim CentreX As Double = 60
    Dim CentreY As Double = 40
    Dim Radius As Double = 60
   
    J.InitializeNewInstance("javafx.scene.shape.Circle",Array As Object (CentreX,CentreY,Radius,fx.Colors.Red))
    MainForm.RootPane.AddNode(j,1,1,-1,-1)

The above code draws a small red circle on the RootPane.

Here is a good basic tutorial which cover some of the common fields used.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Most impressive code keirS :)
But it might be tedious work to draw complex diagrams from hardcording each line.
Maybe you can create a library so it will be easy to just init the control on the form and have values associated to the diagram, similar to that of Excel and VB script? Just an idea.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Nice find KeirS, building a library from this information would not be too difficult, just time consuming.

Although if the aim is to draw complex non interactive diagrams, I would suggest you would be better of using a Canvas. It would be quicker to render and lighter on memory usage for the app.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
So how to access shapes and charts types from the internal designer? You forgot to answer his question.
It was not a question. It is a feature request. Currently you cannot draw shapes or charts in the designer.

Will there be FXML support in the internal designer
Not related to this thread, but there are no plans to support FXML in the internal designer.

is new JavaFX controls only aimed for native Java customers?
Also not related to this thread. Exactly like the current views are supported.
 
Upvote 0
Top