5 Replies Latest reply on Jul 6, 2011 12:48 PM by Narayan

# Java FX 1.3 and  Node Bounds

Hi to all, i have this problem
i write a simple program that i see a rectangle and a cirlce, i use drag and drop for move this 2d geometry figure.
Now i want to print the layout bound for each 2d geometry figure.
i use this code
``````....
public var myBox = javafx.scene.layout.Container{
layoutX:15
layoutY:40
}
..
// here i write the code see for rectangle and circle and i insert into myBox
.....

Button {
translateX: 15
translateY: 35
text: "info obj"
action: function() {

println("Local bounds: {myBox.boundsInLocal}");

}
}

``````
do you have idea?
best regads
A.

Edited by: De Curtis on 2-lug-2011 8.31
• ###### 1. Re: Java FX 1.3 and  Node Bounds
Hi,
About what kind of bounds are you talking about?
Do you want to accomplish to print out X,Y coordinates of that custom Node/Shape?

Read this it helped me a lot
http://weblogs.java.net/blog/2009/07/09/javafx12-understanding-bounds#chase
http://amyfowlersblog.wordpress.com/2010/04/30/javafx-1-3-taming-the-layout-beast/
• ###### 2. Re: Java FX 1.3 and  Node Bounds
thx for your answer,
i want print for each Node (the rectangle and circle) the t X,Y coordinate
example output
Rectangle x= 20 y=30
Circle centerX=50 centerY=60 radius =20

i don't know to select Node, do you have idea?
best regads
Antonio
• ###### 3. Re: Java FX 1.3 and  Node Bounds
Hi,
try to override toString method on that customNode something like this :
``````@Override
public String toString() {
return "CustomNode: { " + "rectangle: " + getXXX() + " circle: " + getXXX() + " }";
}``````
• ###### 4. Re: Java FX 1.3 and  Node Bounds
thx for your answer but don't work .....
the problem is i can't "select" the single node,
• ###### 5. Re: Java FX 1.3 and  Node Bounds
Hi De Curtis ,

What do you mean by "select" node?
Does it mean to select the node of scene via id?
or it means to select the node of Container's childrens by iterating one by one?

Thanks.
Narayan