/* ========================
* JSynoptic : a free Synoptic editor
* ========================
*
* Project Info: http://jsynoptic.sourceforge.net/index.html
*
* This program is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* (C) Copyright 2001-2008, by :
* Corporate:
* EADS Astrium
* Individual:
* Claude Cazenave
*
* $Id: AnimatorGroup.java,v 1.1 2008/11/14 17:03:14 cazenave Exp $
*
* Changes
* -------
* 12 nov. 2008 : Initial public release
*
*/
package jsynoptic.plugins.java3d;
import javax.media.j3d.Group;
import javax.media.j3d.Node;
import javax.media.j3d.RestrictedAccessException;
import com.sun.j3d.utils.scenegraph.io.SceneGraphStateProvider;
import com.sun.j3d.utils.scenegraph.io.retained.Controller;
import com.sun.j3d.utils.scenegraph.io.retained.SymbolTableData;
import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState;
import com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.SceneGraphObjectState;
/**
* A group dedicated to management of Animator nodes
*
*/
public class AnimatorGroup extends Group implements SceneGraphStateProvider {
public AnimatorGroup(){
}
@Override
public void addChild(Node child) {
if(!(child instanceof Animator)){
throw new RestrictedAccessException("Animator node is expected");
}
super.addChild(child);
}
@Override
public Node cloneNode(boolean forceDuplicate) {
throw new RestrictedAccessException("Can not clone animators");
}
@Override
public Class<? extends SceneGraphObjectState> getStateClass() {
return State.class;
}
public static class State extends GroupState {
public State(SymbolTableData symbol, Controller control) {
super(symbol, control);
}
}
}