/* */ package com.sun.j3d.loaders.lw3d;
/* */
/* */ import com.sun.j3d.internal.J3dUtilsI18N;
/* */ import com.sun.j3d.loaders.IncorrectFormatException;
/* */ import com.sun.j3d.loaders.ParsingErrorException;
/* */ import java.io.IOException;
/* */ import java.io.StreamTokenizer;
/* */ import javax.media.j3d.Behavior;
/* */ import javax.media.j3d.TransformGroup;
/* */
/* */ class LwsEnvelope extends TextfileParser
/* */ {
/* */ String name;
/* */ LwsEnvelopeFrame[] frames;
/* */ int numFrames;
/* */ int numChannels;
/* */ boolean loop;
/* */ float totalTime;
/* */ int totalFrames;
/* */ Behavior behaviors;
/* */
/* */ LwsEnvelope(StreamTokenizer st, int frames, float time)
/* */ {
/* 73 */ this.numFrames = 0;
/* 74 */ this.totalTime = time;
/* 75 */ this.totalFrames = frames;
/* 76 */ this.name = getName(st);
/* 77 */ getEnvelope(st);
/* */ }
/* */
/* */ void getEnvelope(StreamTokenizer st)
/* */ throws IncorrectFormatException, ParsingErrorException
/* */ {
/* 89 */ debugOutputLn(1, "getEnvelope()");
/* 90 */ this.numChannels = ((int)getNumber(st));
/* 91 */ if (this.numChannels != 1) {
/* 92 */ throw new IncorrectFormatException(J3dUtilsI18N.getString("LwsEnvelope0"));
/* */ }
/* */
/* 95 */ debugOutputLn(8, "got channels");
/* */
/* 97 */ this.numFrames = ((int)getNumber(st));
/* 98 */ this.frames = new LwsEnvelopeFrame[this.numFrames];
/* 99 */ debugOutputLn(2, "got frames" + this.numFrames);
/* */
/* 101 */ for (int i = 0; i < this.numFrames; i++) {
/* 102 */ this.frames[i] = new LwsEnvelopeFrame(st);
/* */ }
/* 104 */ debugOutput(8, "got all frames");
/* */ try
/* */ {
/* 107 */ st.nextToken();
/* 108 */ while (!isCurrentToken(st, "EndBehavior"))
/* */ {
/* 110 */ st.nextToken();
/* */ }
/* */ }
/* */ catch (IOException e) {
/* 114 */ throw new ParsingErrorException(e.getMessage());
/* */ }
/* 116 */ int repeatVal = (int)getNumber(st);
/* 117 */ if (repeatVal == 1)
/* 118 */ this.loop = false;
/* */ else
/* 120 */ this.loop = true;
/* */ }
/* */
/* */ void createJava3dBehaviors(TransformGroup target)
/* */ {
/* 129 */ this.behaviors = null;
/* */ }
/* */
/* */ Behavior getBehaviors() {
/* 133 */ return this.behaviors;
/* */ }
/* */
/* */ LwsEnvelopeFrame getFirstFrame()
/* */ {
/* 138 */ if (this.numFrames > 0) {
/* 139 */ return this.frames[0];
/* */ }
/* 141 */ return null;
/* */ }
/* */
/* */ void printVals()
/* */ {
/* 146 */ debugOutputLn(2, " name = " + this.name);
/* 147 */ debugOutputLn(2, " numChannels = " + this.numChannels);
/* 148 */ debugOutputLn(2, " numFrames = " + this.numFrames);
/* 149 */ debugOutputLn(2, " loop = " + this.loop);
/* 150 */ for (int i = 0; i < this.numFrames; i++) {
/* 151 */ debugOutputLn(2, " FRAME " + i);
/* 152 */ this.frames[i].printVals();
/* */ }
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\j3dutils.jar
* Qualified Name: com.sun.j3d.loaders.lw3d.LwsEnvelope
* JD-Core Version: 0.6.2
*/