set size values for an controll in .fxgraph [message #1299022] |
Wed, 16 April 2014 13:30  |
Eclipse User |
|
|
|
Hello,
I am trying to build a Simple Java Program and haven't been programming since school.
Therefor I am just starting to learn JavaFX and I'm not really sure how to set the size of a TabPane within FxGraph or in general how to add a property value.
I have found one example where it was done like this (like what I was expecting after reading the "FXGraph sort introduction" wiki page)
In my code it doesen't work
TabPane {
setMinWidth: 300,
//static height: 300,
//PrefHeigh: 300.0,
//setMinHeight: 200.0,
heigh: 300.0,
tabs :
[...
it throws me "Property "..." does not exist or is read-only" errors
i've been trying it whith in other ways to as you can see
So can anyone tell me to apply some size to that control? (It is the root control of that scene)
because for example adding a text to a Label is working and i start to get confused.
Furthermore i'm wondering what the "call" modifier is doing in general and why/when has he to been used? And isn't there also a "static" which is doing some magic?
e.g. in call GridPane#columnIndex: 0
Is there a better/more detailed introduction for FXGraph some where on the Net than the Short introduction from the e(fx)clipse wiki page?
gretings, Florian
|
|
|
Re: set size values for an controll in .fxgraph [message #1299918 is a reply to message #1299022] |
Thu, 17 April 2014 03:41   |
Eclipse User |
|
|
|
Hi,
On 16.04.14 21:06, Florian Kühne wrote:
> Hello,
> I am trying to build a Simple Java Program and haven't been programming
> since school.
> Therefor I am just starting to learn JavaFX and I'm not really sure how
> to set the size of a TabPane within FxGraph or in general how to add a
> property value.
>
> I have found one example where it was done like this width: 275(like
> what I was expecting after reading the "FXGraph sort introduction" wiki
> page)
>
>
> In my code it doesen't work
> TabPane {
> setMinWidth: 300,
> //static height: 300,
> //PrefHeigh: 300.0,
> //setMinHeight: 200.0,
> heigh: 300.0,
> tabs : [...
You control the default width/height with prefHeight/Width. In FXGraph
you always use the value without set/get and then the property starts
with a lower-case!
>
> it throws me "Property "..." does not exist or is read-only" errors
>
the content assist (CTRL+Space) should show you all possible values!
> i've been trying it whith in other ways to as you can see
> So can anyone tell me to apply some size to that control? (It is the
> root control of that scene)
>
> because for example adding a text to a Label is working and i start to
> get confused.
>
>
> Furthermore i'm wondering what the "call" modifier is doing in general
> and why/when has he to been used? And isn't there also a "static" which
> is doing some magic?
> e.g. in call GridPane#columnIndex: 0
>
call & static serve the same purpose. They are used on the
parent-container where static as you assumed is doing some magic so
those two things are identical.
GridPane {
children : [ TabPane {
static columnIndex: 0
} ]
}
GridPane {
children : [ TabPane {
call GridPane#columnIndex: 0
} ]
}
They produce the same result in FXML
<GridPane>
<children>
<TabPane GridPane.columnIndex="0" />
</children>
</GridPane>
or Java
GridPane p = new GridPane();
TabPane tb = new TabPane();
GridPane.setColumnIndex(tb,0);
p.getChildren().add(tb);
We should deprecate call and only advertise static. The magic in static
is that it figures out the containers static properties - or put the
other way call is more explicit that static. ContentAssist will also
provide you the available properties.
> Is there a better/more detailed introduction for FXGraph some where on
> the Net than the Short introduction from the e(fx)clipse wiki page?
>
We have a lot of examples in our git repo [1] which you can take a look
at and because FXGraph is another way to represent informations captured
in FXML it might make sense to read the FXML-Docu [2].
Do better understand the static/call stuff you might want to make
yourself familiar with JavaFX layouts [3]
Tom
[1]http://git.eclipse.org/c/efxclipse/org.eclipse.efxclipse.git/tree/testcases/org.eclipse.fx.testcases.fxgraph
[2]http://docs.oracle.com/javafx/2/api/javafx/fxml/doc-files/introduction_to_fxml.html
[3]http://docs.oracle.com/javafx/2/layout/jfxpub-layout.htm
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02883 seconds