GroovyFX - Custom UI widget/component

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

GroovyFX - Custom UI widget/component

Tx. T
all,

I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.

class ThreeButtons extends BorderPanel { ... }

&& use this in my application:

start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } } 

Would someone please point me to where can I find such example?

Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!

---
Tim
Reply | Threaded
Open this post in threaded view
|

Re: GroovyFX - Custom UI widget/component

Dierk König
You can wrap your custom component inside "node" like gauge is wrapped in node in this opendolphin example: 
https://github.com/canoo/open-dolphin/blob/master/subprojects/demo-javafx/client/src/main/groovy/org/opendolphin/demo/LazyLoadingView.groovy

Dierk

sent from:mobile 

Am 30.12.2016 um 19:04 schrieb Tx. T <[hidden email]>:

all,

I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.

class ThreeButtons extends BorderPanel { ... }

&& use this in my application:

start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } } 

Would someone please point me to where can I find such example?

Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!

---
Tim
Reply | Threaded
Open this post in threaded view
|

Re: GroovyFX - Custom UI widget/component

Tx. T
Not sure I understand that demo code.  It seems involving jfxexra.

I like some easy sample :) (noob here) that build a component that includes the existing UI such as buttons, label, etc.

i.e.: panel contains 3 buttons  or any of the existing UI.

+--------------+
 | [ button 1 ] |
 | [ button 2 ] |
 | [ button 3 ] |
+--------------+

so I can instantiate multiple instances of this ThreeButtons UI.



From: Dierk König <[hidden email]>
To: [hidden email]
Sent: Friday, December 30, 2016 1:36 PM
Subject: Re: GroovyFX - Custom UI widget/component

You can wrap your custom component inside "node" like gauge is wrapped in node in this opendolphin example: 
https://github.com/canoo/open-dolphin/blob/master/subprojects/demo-javafx/client/src/main/groovy/org/opendolphin/demo/LazyLoadingView.groovy

Dierk

sent from:mobile 

Am 30.12.2016 um 19:04 schrieb Tx. T <[hidden email]>:

all,

I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.

class ThreeButtons extends BorderPanel { ... }

&& use this in my application:

start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } } 

Would someone please point me to where can I find such example?

Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!

---
Tim


Reply | Threaded
Open this post in threaded view
|

Re: GroovyFX - Custom UI widget/component

Dierk König
That is of course much simpler. Just make a method that returns a vbox with 3 buttons included. 
You may want to pass the SceneGraphBuilder into the method as a parameter. 

I can make you an example. 

Cheers
Dierk

sent from:mobile 

Am 31.12.2016 um 04:35 schrieb Tx. T <[hidden email]>:

Not sure I understand that demo code.  It seems involving jfxexra.

I like some easy sample :) (noob here) that build a component that includes the existing UI such as buttons, label, etc.

i.e.: panel contains 3 buttons  or any of the existing UI.

+--------------+
 | [ button 1 ] |
 | [ button 2 ] |
 | [ button 3 ] |
+--------------+

so I can instantiate multiple instances of this ThreeButtons UI.



From: Dierk König <[hidden email]>
To: [hidden email]
Sent: Friday, December 30, 2016 1:36 PM
Subject: Re: GroovyFX - Custom UI widget/component

You can wrap your custom component inside "node" like gauge is wrapped in node in this opendolphin example: 
https://github.com/canoo/open-dolphin/blob/master/subprojects/demo-javafx/client/src/main/groovy/org/opendolphin/demo/LazyLoadingView.groovy

Dierk

sent from:mobile 

Am 30.12.2016 um 19:04 schrieb Tx. T <[hidden email]>:

all,

I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.

class ThreeButtons extends BorderPanel { ... }

&& use this in my application:

start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } } 

Would someone please point me to where can I find such example?

Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!

---
Tim


Reply | Threaded
Open this post in threaded view
|

Re: GroovyFX - Custom UI widget/component

Tx. T
hi Dierk,

Thank you very much Dierk.  if you could make an example, that'll be GREAT. thanks so much!




From: Dierk König <[hidden email]>
To: [hidden email]
Sent: Saturday, December 31, 2016 4:18 AM
Subject: Re: GroovyFX - Custom UI widget/component

That is of course much simpler. Just make a method that returns a vbox with 3 buttons included. 
You may want to pass the SceneGraphBuilder into the method as a parameter. 

I can make you an example. 

Cheers
Dierk

sent from:mobile 

Am 31.12.2016 um 04:35 schrieb Tx. T <[hidden email]>:

Not sure I understand that demo code.  It seems involving jfxexra.

I like some easy sample :) (noob here) that build a component that includes the existing UI such as buttons, label, etc.

i.e.: panel contains 3 buttons  or any of the existing UI.

+--------------+
 | [ button 1 ] |
 | [ button 2 ] |
 | [ button 3 ] |
+--------------+

so I can instantiate multiple instances of this ThreeButtons UI.



From: Dierk König <[hidden email]>
To: [hidden email]
Sent: Friday, December 30, 2016 1:36 PM
Subject: Re: GroovyFX - Custom UI widget/component

You can wrap your custom component inside "node" like gauge is wrapped in node in this opendolphin example: 
https://github.com/canoo/open-dolphin/blob/master/subprojects/demo-javafx/client/src/main/groovy/org/opendolphin/demo/LazyLoadingView.groovy

Dierk

sent from:mobile 

Am 30.12.2016 um 19:04 schrieb Tx. T <[hidden email]>:

all,

I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.

class ThreeButtons extends BorderPanel { ... }

&& use this in my application:

start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } } 

Would someone please point me to where can I find such example?

Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!

---
Tim




Reply | Threaded
Open this post in threaded view
|

Re: GroovyFX - Custom UI widget/component

Dierk König
BTW: here is one demo from the GroovyFX examples for a custom widget:
https://github.com/groovyfx-project/groovyfx/blob/45561ffdba9ba71d1a289616aa2660e951d51ebd/src/demo/groovy/CustomFieldDemo.groovy



> Am 31.12.2016 um 14:46 schrieb Tx. T <[hidden email]>:
>
> hi Dierk,
>
> Thank you very much Dierk.  if you could make an example, that'll be GREAT. thanks so much!
>
>
>
> From: Dierk König <[hidden email]>
> To: [hidden email]
> Sent: Saturday, December 31, 2016 4:18 AM
> Subject: Re: GroovyFX - Custom UI widget/component
>
> That is of course much simpler. Just make a method that returns a vbox with 3 buttons included.
> You may want to pass the SceneGraphBuilder into the method as a parameter.
>
> I can make you an example.
>
> Cheers
> Dierk
>
> sent from:mobile
>
> Am 31.12.2016 um 04:35 schrieb Tx. T <[hidden email]>:
>
>> Not sure I understand that demo code.  It seems involving jfxexra.
>>
>> I like some easy sample :) (noob here) that build a component that includes the existing UI such as buttons, label, etc.
>>
>> i.e.: panel contains 3 buttons  or any of the existing UI.
>>
>> +--------------+
>>  | [ button 1 ] |
>>  | [ button 2 ] |
>>  | [ button 3 ] |
>> +--------------+
>>
>> so I can instantiate multiple instances of this ThreeButtons UI.
>>
>>
>> From: Dierk König <[hidden email]>
>> To: [hidden email]
>> Sent: Friday, December 30, 2016 1:36 PM
>> Subject: Re: GroovyFX - Custom UI widget/component
>>
>> You can wrap your custom component inside "node" like gauge is wrapped in node in this opendolphin example:
>> https://github.com/canoo/open-dolphin/blob/master/subprojects/demo-javafx/client/src/main/groovy/org/opendolphin/demo/LazyLoadingView.groovy
>>
>> Dierk
>>
>> sent from:mobile
>>
>> Am 30.12.2016 um 19:04 schrieb Tx. T <[hidden email]>:
>>
>>> all,
>>>
>>> I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.
>>>
>>> class ThreeButtons extends BorderPanel { ... }
>>>
>>> && use this in my application:
>>>
>>> start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } }
>>>
>>> Would someone please point me to where can I find such example?
>>>
>>> Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!
>>>
>>> ---
>>> Tim
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: GroovyFX - Custom UI widget/component

Dierk König
here is your buttons demo:
https://gist.github.com/Dierk/b8c9fc6470a42e27d12eea02b7848f9c

have a groovy New Year
Dierk

> Am 01.01.2017 um 20:37 schrieb Dierk König <[hidden email]>:
>
> BTW: here is one demo from the GroovyFX examples for a custom widget:
> https://github.com/groovyfx-project/groovyfx/blob/45561ffdba9ba71d1a289616aa2660e951d51ebd/src/demo/groovy/CustomFieldDemo.groovy
>
>
>
>> Am 31.12.2016 um 14:46 schrieb Tx. T <[hidden email]>:
>>
>> hi Dierk,
>>
>> Thank you very much Dierk.  if you could make an example, that'll be GREAT. thanks so much!
>>
>>
>>
>> From: Dierk König <[hidden email]>
>> To: [hidden email]
>> Sent: Saturday, December 31, 2016 4:18 AM
>> Subject: Re: GroovyFX - Custom UI widget/component
>>
>> That is of course much simpler. Just make a method that returns a vbox with 3 buttons included.
>> You may want to pass the SceneGraphBuilder into the method as a parameter.
>>
>> I can make you an example.
>>
>> Cheers
>> Dierk
>>
>> sent from:mobile
>>
>> Am 31.12.2016 um 04:35 schrieb Tx. T <[hidden email]>:
>>
>>> Not sure I understand that demo code.  It seems involving jfxexra.
>>>
>>> I like some easy sample :) (noob here) that build a component that includes the existing UI such as buttons, label, etc.
>>>
>>> i.e.: panel contains 3 buttons  or any of the existing UI.
>>>
>>> +--------------+
>>> | [ button 1 ] |
>>> | [ button 2 ] |
>>> | [ button 3 ] |
>>> +--------------+
>>>
>>> so I can instantiate multiple instances of this ThreeButtons UI.
>>>
>>>
>>> From: Dierk König <[hidden email]>
>>> To: [hidden email]
>>> Sent: Friday, December 30, 2016 1:36 PM
>>> Subject: Re: GroovyFX - Custom UI widget/component
>>>
>>> You can wrap your custom component inside "node" like gauge is wrapped in node in this opendolphin example:
>>> https://github.com/canoo/open-dolphin/blob/master/subprojects/demo-javafx/client/src/main/groovy/org/opendolphin/demo/LazyLoadingView.groovy
>>>
>>> Dierk
>>>
>>> sent from:mobile
>>>
>>> Am 30.12.2016 um 19:04 schrieb Tx. T <[hidden email]>:
>>>
>>>> all,
>>>>
>>>> I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.
>>>>
>>>> class ThreeButtons extends BorderPanel { ... }
>>>>
>>>> && use this in my application:
>>>>
>>>> start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } }
>>>>
>>>> Would someone please point me to where can I find such example?
>>>>
>>>> Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!
>>>>
>>>> ---
>>>> Tim
>>>
>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: GroovyFX - Custom UI widget/component

Tx. T
hi Dierk,

Thank you very much for the samples.    I tried to take your examples and worked toward a class. But I do not know to add pass in the 3 text label for each of the buttons.  Also, how do I make the class ThreeButtons a bit move groovy-way instead of Java-way:


#!/usr/bin/env groovy

import static groovyx.javafx.GroovyFX.start
import javafx.scene.layout.HBox
import javafx.scene.control.Button

start {
    registerBeanFactory "threeButtons", ThreeButtons

    stage title: 'Multiple Buttons', visible: true, {
        scene {
            vbox {
                threeButtons(1, 2, 3)
                threeButtons(4, 5, 6)
                threeButtons(7, 8, 9)
            }
        }
    }
}

class ThreeButtons extends HBox {
    public ThreeButtons() {
        getChildren().add(new Button('1'))
        getChildren().add(new Button('2'))
        getChildren().add(new Button('3'))
    }
}



From: Dierk König <[hidden email]>
To: [hidden email]
Sent: Sunday, January 1, 2017 2:04 PM
Subject: Re: GroovyFX - Custom UI widget/component

here is your buttons demo:
https://gist.github.com/Dierk/b8c9fc6470a42e27d12eea02b7848f9c

have a groovy New Year
Dierk

> Am 01.01.2017 um 20:37 schrieb Dierk König <[hidden email]>:
>
> BTW: here is one demo from the GroovyFX examples for a custom widget:
> https://github.com/groovyfx-project/groovyfx/blob/45561ffdba9ba71d1a289616aa2660e951d51ebd/src/demo/groovy/CustomFieldDemo.groovy
>
>
>
>> Am 31.12.2016 um 14:46 schrieb Tx. T <[hidden email]>:
>>
>> hi Dierk,
>>
>> Thank you very much Dierk.  if you could make an example, that'll be GREAT. thanks so much!
>>
>>
>>
>> From: Dierk König <[hidden email]>
>> To: [hidden email]
>> Sent: Saturday, December 31, 2016 4:18 AM
>> Subject: Re: GroovyFX - Custom UI widget/component
>>
>> That is of course much simpler. Just make a method that returns a vbox with 3 buttons included.
>> You may want to pass the SceneGraphBuilder into the method as a parameter.
>>
>> I can make you an example.
>>
>> Cheers
>> Dierk
>>
>> sent from:mobile
>>
>> Am 31.12.2016 um 04:35 schrieb Tx. T <[hidden email]>:
>>
>>> Not sure I understand that demo code.  It seems involving jfxexra.
>>>
>>> I like some easy sample :) (noob here) that build a component that includes the existing UI such as buttons, label, etc.
>>>
>>> i.e.: panel contains 3 buttons  or any of the existing UI.
>>>
>>> +--------------+
>>> | [ button 1 ] |
>>> | [ button 2 ] |
>>> | [ button 3 ] |
>>> +--------------+
>>>
>>> so I can instantiate multiple instances of this ThreeButtons UI.
>>>
>>>
>>> From: Dierk König <[hidden email]>
>>> To: [hidden email]
>>> Sent: Friday, December 30, 2016 1:36 PM
>>> Subject: Re: GroovyFX - Custom UI widget/component
>>>
>>> You can wrap your custom component inside "node" like gauge is wrapped in node in this opendolphin example:
>>> https://github.com/canoo/open-dolphin/blob/master/subprojects/demo-javafx/client/src/main/groovy/org/opendolphin/demo/LazyLoadingView.groovy
>>>
>>> Dierk
>>>
>>> sent from:mobile
>>>
>>> Am 30.12.2016 um 19:04 schrieb Tx. T <[hidden email]>:
>>>
>>>> all,
>>>>
>>>> I am trying to build a somewhat application specific (custom) widget (or control) that includes for example, 3 pushbuttons.
>>>>
>>>> class ThreeButtons extends BorderPanel { ... }
>>>>
>>>> && use this in my application:
>>>>
>>>> start { stage { scene { threeButtons (label1: 'one', label2: 'two', label3: 'three') } } }
>>>>
>>>> Would someone please point me to where can I find such example?
>>>>
>>>> Or do I need to write the ThreeButtons in JavaFX and register in Groovy to use it?  Thanks!
>>>>
>>>> ---
>>>> Tim
>>>
>>>
>>
>>
>