X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fanimation%2FAnimationSystem.java;fp=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fproconf%2Fg3d%2Fanimation%2FAnimationSystem.java;h=0000000000000000000000000000000000000000;hb=6b6fcff5d6c326feef07ccf8401f97911778fffe;hp=c736bff4e334af65bceaeb2244f9860e5ae439b5;hpb=504c111db40d78f4913badddd126b283b5504dbb;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/proconf/g3d/animation/AnimationSystem.java b/org.simantics.g3d/src/org/simantics/proconf/g3d/animation/AnimationSystem.java deleted file mode 100644 index c736bff4..00000000 --- a/org.simantics.g3d/src/org/simantics/proconf/g3d/animation/AnimationSystem.java +++ /dev/null @@ -1,94 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007- VTT Technical Research Centre of Finland. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.proconf.g3d.animation; - -import java.util.ArrayList; -import java.util.List; - -import org.simantics.db.Graph; -import org.simantics.proconf.g3d.base.ScenegraphAdapter; - - -public class AnimationSystem { - private ScenegraphAdapter adapter; - private List animationControllers = new ArrayList(); - - private List listeners = new ArrayList(); - - private boolean pause = false; - - public AnimationSystem(ScenegraphAdapter adapter) { - if (adapter == null) - throw new IllegalArgumentException("ScenegraphAdapter must not be null"); - this.adapter = adapter; - } - - public void add(AnimationController controller) { - animationControllers.add(controller); - for (AnimationSystemListener l : listeners) - l.animationAdded(this, controller); - } - - public void addListener(AnimationSystemListener l) { - listeners.add(l); - } - - public void removeListener(AnimationSystemListener l) { - listeners.remove(l); - } - - public boolean isRunning() { - return animationControllers.size() > 0; - } - - public void pause() { - if (pause) - return; - pause = true; - for (AnimationSystemListener l : listeners) - l.animationPaused(this); - } - - public void play() { - if(!pause) - return; - pause = false; - for (AnimationSystemListener l : listeners) - l.animationPlay(this); - } - - public void stop() { - for (AnimationController c : animationControllers) - c.dispose(); - animationControllers.clear(); - for (AnimationSystemListener l : listeners) - l.animationStopped(this); - } - - public boolean isPause() { - return pause; - } - - public void run(Graph graph, double frameTime) { - if (pause) - return; - if (animationControllers.size() > 0) { - for (AnimationController c : animationControllers) - c.updateAnimation(graph, frameTime); - adapter.setChanged(true); - } - } - - public List getAnimationControllers() { - return animationControllers; - } - -}