|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.behavior.AbstractBehavior
org.wicketstuff.minis.reflection.ReflectionBehavior
public class ReflectionBehavior
Behavior for adding reflections to an image. Uses reflection.js (v1.6), licensed under a MIT license.
Add this behavior to your image to generate a reflection. You can change the height and opacity of the reflection using the provided setters.
Ultimately the markup you attach this behavior to must be an image, but it
need not be a Wicket Image component, a markup container will
suffice, provided the tag is an img-tag.
You can also use this class to generate add and remove reflection scriptlets
for use in Ajax request targets or any other place you want. All you need to
do is ensure the reflection.js is added to the head of the document. You can
use the REFLECTION_JS resource reference for that.
The reflection.js library and more documentation can be found here http://cow.neondragon.net/stuff/reflection/
| Nested Class Summary | |
|---|---|
static class |
ReflectionBehavior.Javascript
Container for javascript calls this behavior enables |
| Field Summary | |
|---|---|
static org.apache.wicket.ResourceReference |
REFLECTION_JS
The resource reference to the reflection.js file. |
| Constructor Summary | |
|---|---|
ReflectionBehavior()
Default constructor, creates a reflection using the default settings from reflection.js. |
|
ReflectionBehavior(java.lang.Integer height,
java.lang.Integer opacity)
Constructor |
|
| Method Summary | |
|---|---|
void |
bind(org.apache.wicket.Component component)
Binds the component to this behavior. |
void |
renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
Adds the reflection.js javascript to the page. |
void |
setReflectionHeight(java.lang.Integer height)
Sets the reflection height. |
void |
setReflectionOpacity(java.lang.Integer opacity)
Sets the opacity of the reflection. |
| Methods inherited from class org.apache.wicket.behavior.AbstractBehavior |
|---|
afterRender, beforeRender, cleanup, detach, detachModel, exception, getStatelessHint, isEnabled, isTemporary, onComponentTag, onException, onRendered, rendered |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.wicket.ResourceReference REFLECTION_JS
| Constructor Detail |
|---|
public ReflectionBehavior()
public ReflectionBehavior(java.lang.Integer height,
java.lang.Integer opacity)
height - see setReflectionHeight(Integer)opacity - see setReflectionOpacity(Integer)| Method Detail |
|---|
public void bind(org.apache.wicket.Component component)
bind in interface org.apache.wicket.behavior.IBehaviorbind in class org.apache.wicket.behavior.AbstractBehaviorIBehavior.bind(Component)public void setReflectionHeight(java.lang.Integer height)
height - the height of the reflection as a percentage of the original
image, valid values range from 0 to 100.public void setReflectionOpacity(java.lang.Integer opacity)
opacity - the opacity. Valid values range from 0 to 100.public void renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
renderHead in interface org.apache.wicket.markup.html.IHeaderContributorrenderHead in class org.apache.wicket.behavior.AbstractBehaviorAbstractBehavior.renderHead(org.apache.wicket.markup.html.IHeaderResponse)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||