Hi Graham, there's not a directly way in GWT as yet.

As part of a project I'm doing, I've been building up an animation
library that is based on tweening between 2 styles that I've been able
to kept as open source.  You can find the library here:
http://code.google.com/p/gwt-fx/ and an example here:
http://gwtfx.adamtacy.com/EffectsExample.html  (for example, the logo
is animated from styles in a style sheet); maybe it meets your needs*

If you wanted to do it your own way, then two bits that caused me the
most headaches were:

a) understanding when the style sheet was available to you wrt the GWT
code - simplest solution I've found is to use a <script> tag in the
applications .gwt.xml file or in-line the style in the HTML file.
b) trying to pick up an underlying style - i.e. it was simplest to
define properties for the style I wanted to tween in both the start
and end style, rather than just in the end - i.e.  start{width: 100px;
height: 200px;} and end{width: 400px; height: 400px;}  rather than
start{width: 100px}  and end{width: 400px; height: 400px;} and assume
I could work out the start height.

Good Luck

//Adam


* the current downloadable zip file essentially requires you to put
the component you want to tween into a NEffectPanel, apply an effect
to that panel (either a built in one such as Fade, or build your own
using NMorphStyle(new Selector("Style1"), new Selector("Style2"));,
and fire the play() method, i.e.

NEffectPanel ePanel = new NEffectPanel();
ePanel.add(myWidget);
NMorphStyle effect = new NMorphStlye(new Selector("Style1"), new
Selector("Style2"));
ePanel.addEffect(effect);
effect.play();

the version in the trunk removes the need for a separate panel, so you
can just create an effect as follows:

NMorphStyle effect = NMorphStlye(myWidget.getElement(), new Selector
("Style1"), new Selector("Style2));
effect.play();

On 24 Juli, 22:41, Graham J <graham.j...@gmail.com> wrote:
> Is there a convenient way to access a stylesheet in programmatic form?
> My intention is to have an animation, and to let another developer
> specify a 'before' style and an 'after' style in the CSS rather than
> the code (just width and height at this point), and then to have the
> animation tween between them.
>
> However, I can't seem to think of an effective/not-ugly way for
> getting both those styles. Is there any way to directly access a
> stylesheet? Or can anyone suggest an alternative effective way of
> handling this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to