/*
 *  @(#)NodeComponentState.java 1.4 01/06/26 14:16:28
 *
 * Copyright (c) 2000-2001 Sun Microsystems, Inc. All Rights Reserved.
 */
package com.sun.j3d.demos.utils.scenegraph.io.state.javax.media.j3d;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import com.sun.j3d.demos.utils.scenegraph.io.retained.Controller;
import com.sun.j3d.demos.utils.scenegraph.io.retained.SymbolTableData;
import javax.media.j3d.NodeComponent;
import javax.media.j3d.SceneGraphObject;

public abstract class NodeComponentState extends SceneGraphObjectState {
    
    public NodeComponentState( SymbolTableData symbol, Controller control ) {
        super(symbol, control);
    }
    
    public void readObject( DataInput in ) throws IOException {
        super.readObject( in );
        /*
         read dublicateOnNodeTree flag !
         added by Andreas Jerke, andreas@heretogo.com
         */
        ((NodeComponent)this.node).setDuplicateOnCloneTree(in.readBoolean());
    }
    
    public void writeObject( DataOutput out ) throws IOException {  
        super.writeObject(out);
        /*
         write dublicateOnNodeTree flag !
         added by Andreas Jerke, andreas@heretogo.com
         */
        out.writeBoolean(((NodeComponent)this.node).getDuplicateOnCloneTree());
    }
    
    /**
     * Called when this component reference count is incremented.
     * Allows this component to update the reference count of any components
     * that it references.
     */
    public void addSubReference() {
    }
}