Skip to main content

Binding ShadowFilter attribute doesn´t work

3 replies [Last post]
Joined: 2007-12-07

I´m trying to bind distance attribute in ShadowFilter object but it doesn´t work. When I bind another attribute like Rect:x works fine, but binding ShadowFilter attributes dont change values dynamically.

<br />
import javafx.ui.*;<br />
import javafx.ui.canvas.*;<br />
import javafx.ui.filter.*;</p>
<p>class classone extends CompositeNode {</p>
<p>class anotherclass {<br />
    attribute height: Number;<br />
<p>attribute anotherclass.height = 0;</p>
<p>function classone.composeNode() =<br />
Group {<br />
    var mydistance:anotherclass = new anotherclass()    </p>
<p>    onMouseClicked: operation(e)<br />
    {<br />
        mydistance.height++;<br />
<p>    content:<br />
        [Rect {<br />
            cursor: HAND<br />
            selectable: true<br />
            x: 10<br />
            y: 10<br />
            width: 100<br />
            height: 50<br />
            fill: Color {<br />
            	blue: 0.8<br />
                green: 0.8<br />
                red: 0.8<br />
            }<br />
        },<br />
        Text {<br />
            content: "hello"<br />
            x: 25<br />
            y: 20<br />
            filter:<br />
                [ShadowFilter {distance: bind mydistance.height, x: 5, y: -5, ShadowColor: black}]<br />
        }<br />
        ]<br />
<p>Canvas {<br />
    content:<br />
    [classone]<br />
}<br />

Any idea will be appreciated.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-12-07

Ok, I will find another form to make down and up button effect when users click it.

Thanks for your response.

Joined: 2007-07-12

I think that you could do it using two rectangles and their color and opacity attributes.

Joined: 2007-07-12

It seems that triggers are missed for the ShadowFilter class attributes:

So it should be a bug in JavaFX Script API.