File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes javafx 2, layoutx / layouty values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "javafx 2, layoutx / layouty values" Watch "javafx 2, layoutx / layouty values" New topic
Author

javafx 2, layoutx / layouty values

Roger Wegner
Greenhorn

Joined: Nov 13, 2008
Posts: 3
I have a problem to find out the correct layoutx / layouty values for shapes. Please have a look at this example:

If I run this program the line seems to be positioned as expected starting at 10, 10. However the layoutx and layouty values are 0, 0.

Can anybody give me an explanation for this behaviour and / or tell me how to find out the actual position?

Thank you,
Roger
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3064
    
  33

I see that your are using Line from a different package. You should be using: javafx.scene.shape.Line


Mohamed Sanaulla | My Blog
Roger Wegner
Greenhorn

Joined: Nov 13, 2008
Posts: 3
Mohamed Sanaulla wrote:I see that your are using Line from a different package. You should be using: javafx.scene.shape.Line


You are right, I messed this up (copy / paste) when I created the sample. However, the behaviour is exactly the same with javafx.scene.shape.Line.
I corrected the sample.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3064
    
  33

You are setting the startX and startY and not exactly the layoutX and layoutY which are properties of the node. So layoutX and layoutY are 0.0.
Roger Wegner
Greenhorn

Joined: Nov 13, 2008
Posts: 3
Mohamed Sanaulla wrote:You are setting the startX and startY and not exactly the layoutX and layoutY which are properties of the node. So layoutX and layoutY are 0.0.


I see, is there any mapping from layoutXY to startXY and vice versa? Where can I read and learn about the relation between them?
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3064
    
  33

Roger Wegner wrote:
Mohamed Sanaulla wrote:You are setting the startX and startY and not exactly the layoutX and layoutY which are properties of the node. So layoutX and layoutY are 0.0.


I see, is there any mapping from layoutXY to startXY and vice versa? Where can I read and learn about the relation between them?


You can use the API documentation http://download.oracle.com/javafx/2.0/api/index.html
Alternatively you can try setting the layoutX and layoutY of the line.
startX and startY are the properties specific to the Line, but as you can see in the API layoutX and layoutY are the properties of Node and are inherited by all the components.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javafx 2, layoutx / layouty values
 
Similar Threads
How to embed JavaFX 2.0 application with jsp (to deploy it on server)
The import javafx cannot be resolved
JSlider issue
need help with exception
facing problem while creating a Road/Pathway using Java3D