org.wings.animation.SAnimation Maven / Gradle / Ivy
The newest version!
package org.wings.animation;
import java.io.IOException;
import java.io.Serializable;
import org.wings.Renderable;
import org.wings.SComponent;
import org.wings.SConstants;
import org.wings.io.Device;
import org.wings.plaf.AnimationCG;
import org.wings.resource.ResourceNotFoundException;
import org.wings.session.SessionManager;
public class SAnimation extends SComponent implements SConstants, Renderable, Serializable{
/**
* The code generation delegate, which is responsible for
* the visual representation of an animation.
*/
protected transient AnimationCG cg;
public SAnimation() {
}
protected void setCG(AnimationCG newCG) {
cg = newCG;
}
/**
* Return the look and feel delegate.
*
* @return the componet's cg
*/
@Override
public AnimationCG getCG() {
return cg;
}
/**
* Notification from the CGFactory that the L&F
* has changed.
*
* @see SComponent#updateCG
*/
@Override
public void updateCG() {
cg = (AnimationCG) SessionManager.getSession().getCGManager().getCG(this);
}
@Override
public void write(Device d) throws IOException, ResourceNotFoundException {
cg.write(d, this);
}
}