001: /*
002: * $RCSfile: TextureTransform.java,v $
003: *
004: * @(#)TextureTransform.java 1.16 98/11/05 20:35:26
005: *
006: * Copyright (c) 1996-1998 Sun Microsystems, Inc. All Rights Reserved.
007: *
008: * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
009: * modify and redistribute this software in source and binary code form,
010: * provided that i) this copyright notice and license appear on all copies of
011: * the software; and ii) Licensee does not utilize the software in a manner
012: * which is disparaging to Sun.
013: *
014: * This software is provided "AS IS," without a warranty of any kind. ALL
015: * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
016: * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
017: * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
018: * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
019: * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
020: * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
021: * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
022: * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
023: * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
024: * POSSIBILITY OF SUCH DAMAGES.
025: *
026: * This software is not designed or intended for use in on-line control of
027: * aircraft, air traffic, aircraft navigation or aircraft communications; or in
028: * the design, construction, operation or maintenance of any nuclear
029: * facility. Licensee represents and warrants that it will not use or
030: * redistribute the Software for such purposes.
031: *
032: * $Revision: 1.2 $
033: * $Date: 2005/02/03 23:07:03 $
034: * $State: Exp $
035: */
036: /*
037: * @Author: Rick Goldberg
038: * @Author: Doug Gehringer
039: *
040: */
041: package org.jdesktop.j3d.loaders.vrml97.impl;
042:
043: /** Description of the Class */
044: public class TextureTransform extends Node {
045:
046: // exposedField
047: SFVec2f center;
048: SFFloat rotation;
049: SFVec2f scale;
050: SFVec2f translation;
051:
052: Appearance owner;
053:
054: /**
055: *Constructor for the TextureTransform object
056: *
057: *@param loader Description of the Parameter
058: */
059: public TextureTransform(Loader loader) {
060: super (loader);
061: center = new SFVec2f(0.0f, 0.0f);
062: rotation = new SFFloat(0.0f);
063: scale = new SFVec2f(1.0f, 1.0f);
064: translation = new SFVec2f(0.0f, 0.0f);
065: initFields();
066: }
067:
068: /**
069: *Constructor for the TextureTransform object
070: *
071: *@param loader Description of the Parameter
072: *@param center Description of the Parameter
073: *@param rotation Description of the Parameter
074: *@param scale Description of the Parameter
075: *@param translation Description of the Parameter
076: */
077: public TextureTransform(Loader loader, SFVec2f center,
078: SFFloat rotation, SFVec2f scale, SFVec2f translation) {
079: super (loader);
080: this .center = center;
081: this .rotation = rotation;
082: this .scale = scale;
083: this .translation = translation;
084: initFields();
085: }
086:
087: /**
088: * Description of the Method
089: *
090: *@param eventInName Description of the Parameter
091: *@param time Description of the Parameter
092: */
093: public void notifyMethod(String eventInName, double time) {
094: owner.updateTextureTransform();
095: }
096:
097: /**
098: * Gets the type attribute of the TextureTransform object
099: *
100: *@return The type value
101: */
102: public String getType() {
103: return "TextureTransform";
104: }
105:
106: /**
107: * Description of the Method
108: *
109: *@return Description of the Return Value
110: */
111: public Object clone() {
112: TextureTransform c = new TextureTransform(loader,
113: (SFVec2f) center.clone(), (SFFloat) rotation.clone(),
114: (SFVec2f) scale.clone(), (SFVec2f) translation.clone());
115:
116: return c;
117: }
118:
119: /** Description of the Method */
120: void initFields() {
121: center.init(this , FieldSpec, Field.EXPOSED_FIELD, "center");
122: rotation.init(this , FieldSpec, Field.EXPOSED_FIELD, "rotation");
123: scale.init(this , FieldSpec, Field.EXPOSED_FIELD, "scale");
124: translation.init(this , FieldSpec, Field.EXPOSED_FIELD,
125: "translation");
126: }
127:
128: }
|