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