wicketstuff-animator

Introduction

wicketstuff-animator integrates animator.js into wicket.

Documentation

most of the api provided by the javascript class is already implemented, including:

attention: do not mix up the targets of the animation and the component the animator is attached to. the targets describe who gets animated. attaching the animator to a component is just the means to get the animation started (or whatever action is used).

fwiw, i encourage you to visit the original page of animator.js to understand how it works. after that, it shouldn't be that difficult to comprehend the java version of it.

Example 

let's have a look at how you can use the animator to turn the color of a label (it's actually a div) from red to blue on the first click, and back to red on the second click, and again to blue on another click, ...

MyPage.html:

... <div wicket:id="label">my label</div> ...





MyPage.java
... // somewhere in the constructor
Label label = new Label("label");
add(label);
Animator animator = new Animator().addCssStyleSubject(new MarkupIdModel(label),  "red", "blue");
animator.attachTo(label, "onclick", Action.toggle());
...





What can we see here:

  1. create a new Animator object.
  2. add CssStyleSubject to the animator. this changes target (here 'label', wrapped in a MarkupIdModel which simply extracts the MarkupId, hence the name...) from css-class 'red' to css-class 'blue'.
  3. attach the animator to the click event of the label (this actually generates an AttributeAppender-behavior).
  4. don't forget to define the styles 'red' and 'blue' somewhere

Maintainers 

Gerolf Seitz 

Sourcecode

https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicketstuff-animator/

License

wicketstuff-animator is provided under the terms of the Apache License, Version 2.0 

animator.js is released under the terms of the BSD License 


Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced
- Activity

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

or Sign Up  

Other Features

Add Content