I have been playing around with JavaFX 2.0, which I assume your question is about. Not real production code, just a personal project, but I ran into the same problem that you mention above. The entire model tends to become dependent from the 2D framework, and I don't like it.
What I did that I split every single class in the model in two, the real model class, which has the capabilities to load its contents from database, knows how it alters its state etc etc... and the representation class that decides the appearance on screen. The latter would contain all the Property classes.
You'll find the same design in any MVC framework, like Swing. it's just that here there's no escape from doing it.
Regarding point 2: The constraints are stored in the Node that you add to the GridPane. Every Node (and every visible object in the scene graph descends from Node), has a HashMap called "properties".
Application developers can put arbitrary data in there if you wish, but each layout class also defines some properties that are used to control layout. So when you put a Node into a GridPane, if you want it to span multiple columns you set at "gridpane-column-span" property on the node, with the appropriate value.
Conceptually, I think of it a bit like CSS. You add a CSS class to a node, and that affects it's styling and layout based on where it is inserted into the scene graph (or document flow, for HTML). Similarly, you add a layout constraint to a node, and the layout component you insert the node into interprets those constraints when laying out it's child nodes.
I actually really like the model that JavaFX uses - any arbitrary node can contain any arbitrary layout constraint. It's up to the layout component to interpret them. That means you can create your own layout components to do custom layouts, and if necessary create your own custom layout constraints, and they will all work properly with any existing Node.
On point 3: the BorderPane is different in that there are very explicitly 5 "zones" into which you could place nodes. So I guess they gave it a "proper" API for convenience.
Best Answer
You have to use
stage
given tostart
method as your main Stage because it's created for you by JavaFX startup logic (and it can be desktop stage, jnlp one, or a plugin in the browser so you better not create it yourself). If you need another windows in your application (dialogs, warning, popup windows, etc) you can create new Stages. You can use them asnew Stage()
objects or subclass, at doesn't really matter or affect performance (IMHO).