001: /*
002: * $Header: /cvs/j3dfly/J3dEditor/src/org/jdesktop/j3dedit/scenegraph/SGAppearance.java,v 1.1 2005/04/20 22:20:39 paulby Exp $
003: *
004: * Sun Public License Notice
005: *
006: * The contents of this file are subject to the Sun Public License Version
007: * 1.0 (the "License"). You may not use this file except in compliance with
008: * the License. A copy of the License is available at http://www.sun.com/
009: *
010: * The Original Code is the Java 3D(tm) Scene Graph Editor.
011: * The Initial Developer of the Original Code is Paul Byrne.
012: * Portions created by Paul Byrne are Copyright (C) 2002.
013: * All Rights Reserved.
014: *
015: * Contributor(s): Paul Byrne.
016: *
017: **/
018: package org.jdesktop.j3dedit.scenegraph;
019:
020: /**
021: *
022: * @author Paul Byrne
023: */
024: public class SGAppearance extends SGNodeComponent {
025:
026: private SGTexture sgTexture = null;
027:
028: /** Holds value of property textureAttributes. */
029: private SGTextureAttributes sgTextureAttributes = null;
030:
031: /** Holds value of property sgPointAttributes. */
032: private SGPointAttributes sgPointAttributes;
033:
034: /** Holds value of property sgTransparencyAttributes. */
035: private SGTransparencyAttributes sgTransparencyAttributes;
036:
037: /** Holds value of property sgPolygonAttributes. */
038: private SGPolygonAttributes sgPolygonAttributes;
039:
040: /** Holds value of property sgMaterial. */
041: private SGMaterial sgMaterial;
042:
043: /** Creates a new instance of SGAppearance */
044: public SGAppearance(javax.media.j3d.NodeComponent nc,
045: org.jdesktop.j3dedit.J3dEditContext editContext) {
046: super (nc, editContext);
047: }
048:
049: /**
050: * Set the SGTexture component referenced by this appearance
051: */
052: public void setSGTexture(SGTexture sgTexture) {
053: if (this .sgTexture != null)
054: this .sgTexture.removeReferencedBy(this );
055:
056: this .sgTexture = sgTexture;
057: if (sgTexture != null)
058: sgTexture.addReferencedBy(this );
059: }
060:
061: /**
062: * Get the SGTexture component referenced by this appearance
063: */
064: public SGTexture getSGTexture() {
065: return sgTexture;
066: }
067:
068: /** Getter for property textureAttributes.
069: * @return Value of property textureAttributes.
070: */
071: public SGTextureAttributes getSGTextureAttributes() {
072: return this .sgTextureAttributes;
073: }
074:
075: /** Setter for property textureAttributes.
076: * @param textureAttributes New value of property textureAttributes.
077: */
078: public void setSGTextureAttributes(
079: SGTextureAttributes textureAttributes) {
080: if (this .sgTextureAttributes != null)
081: this .sgTextureAttributes.removeReferencedBy(this );
082:
083: this .sgTextureAttributes = sgTextureAttributes;
084: if (sgTextureAttributes != null)
085: sgTextureAttributes.addReferencedBy(this );
086: }
087:
088: /** Getter for property sgPointAttributes.
089: * @return Value of property sgPointAttributes.
090: */
091: public SGPointAttributes getSGPointAttributes() {
092: return this .sgPointAttributes;
093: }
094:
095: /** Setter for property sgPointAttributes.
096: * @param sgPointAttributes New value of property sgPointAttributes.
097: */
098: public void setSGPointAttributes(SGPointAttributes sgPointAttributes) {
099: if (this .sgPointAttributes != null)
100: this .sgPointAttributes.removeReferencedBy(this );
101:
102: this .sgPointAttributes = sgPointAttributes;
103: if (sgPointAttributes != null)
104: sgPointAttributes.addReferencedBy(this );
105: }
106:
107: /** Getter for property sgTransparencyAttributes.
108: * @return Value of property sgTransparencyAttributes.
109: */
110: public SGTransparencyAttributes getSGTransparencyAttributes() {
111: return this .sgTransparencyAttributes;
112: }
113:
114: /** Setter for property sgTransparencyAttributes.
115: * @param sgTransparencyAttributes New value of property sgTransparencyAttributes.
116: */
117: public void setSGTransparencyAttributes(
118: SGTransparencyAttributes sgTransparencyAttributes) {
119: if (this .sgTransparencyAttributes != null)
120: this .sgTransparencyAttributes.removeReferencedBy(this );
121:
122: this .sgTransparencyAttributes = sgTransparencyAttributes;
123: if (sgTransparencyAttributes != null)
124: sgTransparencyAttributes.addReferencedBy(this );
125: }
126:
127: /** Getter for property sgPolygonAttributes.
128: * @return Value of property sgPolygonAttributes.
129: */
130: public SGPolygonAttributes getSGPolygonAttributes() {
131: return this .sgPolygonAttributes;
132: }
133:
134: /** Setter for property sgPolygonAttributes.
135: * @param sgPolygonAttributes New value of property sgPolygonAttributes.
136: */
137: public void setSGPolygonAttributes(
138: SGPolygonAttributes sgPolygonAttributes) {
139: if (this .sgPolygonAttributes != null)
140: this .sgPolygonAttributes.removeReferencedBy(this );
141:
142: this .sgPolygonAttributes = sgPolygonAttributes;
143: if (sgPolygonAttributes != null)
144: sgPolygonAttributes.addReferencedBy(this );
145: }
146:
147: /** Getter for property sgMaterial.
148: * @return Value of property sgMaterial.
149: */
150: public SGMaterial getSGMaterial() {
151: return this .sgMaterial;
152: }
153:
154: /** Setter for property sgMaterial.
155: * @param sgMaterial New value of property sgMaterial.
156: */
157: public void setSGMaterial(SGMaterial sgMaterial) {
158: if (this.sgMaterial != null)
159: this.sgMaterial.removeReferencedBy(this);
160:
161: this.sgMaterial = sgMaterial;
162: if (sgMaterial != null)
163: sgMaterial.addReferencedBy(this);
164: }
165:
166: }
|