B4J Question How to Remove warnings when shape is resized

jmon

Well-Known Member
Licensed User
Longtime User
Hello,

I bumped into a problem that not many may have encountered yet. When I add a shape (any shape, like circle, polygon, rectangle...) to an anchorPane and set the anchors to that anchorPane, I get those warnings:
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]

I am not trying to resize the control, I just set the right anchor. The issue it that I have 100s of shapes added in anchorpanes and anchored, so I end up having hundreds of lines written in my StdOut (I monitor the stdout and write to file).

I have attached an example that demonstrates the issue, but here is what it does:
B4X:
For i = 1 To 10
    Dim c As JavaObject
    c.InitializeNewInstance("javafx.scene.shape.Circle", Null)
    c.RunMethod("setRadius", Array(20.0))
    ap.AddNode(c, 0, Rnd(0, ap.Height), -1, -1)
    ap.SetRightAnchor(c, Rnd(2, 25))
Next
and I get that:
Program started.
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]
Child is not resizable: Circle[centerX=0.0, centerY=0.0, radius=20.0, fill=0x000000ff]

I was wondering if there was a method like the one to disable CSS warnings for shapes?

Thanks,

Jmon.
 

Attachments

  • ShapeWarnings_Example.zip
    1.3 KB · Views: 166

Daestrum

Expert
Licensed User
Longtime User
Saw a note on Oracles Anchorpane class.
The application sets anchor constraints on each child to configure the anchors on one or more sides. If a child is anchored on opposite sides (and is resizable), the anchorpane will resize it to maintain both offsets, otherwise the anchorpane will resize it to its preferred size. If in the former case (anchored on opposite sides) and the child is not resizable, then only the top/left anchor will be honored. AnchorPane provides a static method for setting each anchor constraint.
 
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
Thanks for your answer.
AnchorPane provides a static method for setting each anchor constraint.
That's what I am doing in this case, I just set the right anchor and it works in the example, just the issue is the message in the stdout.
 
Upvote 0
Top