Highlight not working as expected

3 views
Skip to first unread message

Kyle Hayes

unread,
Feb 8, 2010, 3:11:39 PM2/8/10
to GWT-FX
Perhaps due to my lack of understanding of how to use gwt-fx but I'm
trying to get a simple highlight to run properly:
Highlight effect = new Highlight(resizeDragPanel.getElement());
effect.setEndColor("#F6F6F6");
effect.setStartColor("#FFFF66");
effect.play();

The initial state of the element is a light grey, but it starts it at
dark grey and fades to my end color then back to the dark grey. The
Start color is FFFF66 which is a yellow. I'm not seeing this during
any point of the animation however.

Any help is much appreciated. Thanks!

-Kyle

Adam T

unread,
Feb 8, 2010, 3:49:58 PM2/8/10
to GWT-FX
Hi Kyle,

Doesn't look like you are doing anything wrong, you're just creating
the effect, and setting the colours, then playing it.

What browser are you using? Do you get any log messages output when
you try and execute your application - the code should be a little bit
chatty if it comes across an issue in development mode.

Cheers,

Adam

Kyle Hayes

unread,
Feb 8, 2010, 5:03:33 PM2/8/10
to GWT-FX
My hosted mode is using Safari and the only debug line I'm seeing is
new delay:2000. For some reason I can't test the compiled version of
the app in FF atm otherwise I would test there.

Adam T

unread,
Feb 20, 2010, 6:34:05 AM2/20/10
to GWT-FX
Hi Kyle,

Sorry for bit of delay, I'm really busy with some non IT stuff.

Seems to be some sort of combination of two issues - first the code
for parsing a colour in the form #RRGGBB is silently being ignored for
the setting of a start colour, and then the code to deal with starting
from transparency is overriding the start color setting.

You can create your own Highlight effect if you want by joining
together two ColorChange effects and use colour in format of
rgb(rrr,ggg,bbb) instead of #RRGGBB. For example:

String startCol = "rgb(100,100,100)";
String endCol = "rgb(255,255,100)";
Label testEl = new Label ("Some test Text");

//Setup first colour change
ChangeColor theEffect = new ChangeColor(testEl.getElement());
theEffect.setStartColor(startCol);
theEffect.setEndColor(endCol);

//Set up second colour change (the reverse)
ChangeColor theEffect2 = new ChangeColor(testEl.getElement());
theEffect2.setStartColor(endCol);
theEffect2.setEndColor(startCol);

// Set background colour of element to start colour
testEl.getElement().getStyle().setProperty("backgroundColor",
startCol);

//Play second effect after first
theEffect.chain(theEffect2);

//Play the effect
theEffect.play();

It will be some time before I get round to fixing so the above is
probably best way to go.

//Adam

Adam T

unread,
Feb 20, 2010, 10:25:31 AM2/20/10
to GWT-FX
Issue #136 created to track original issues.
//A
Reply all
Reply to author
Forward
0 new messages