camera3d
Class VcLight

java.lang.Object
  extended bycamera3d.VcObject
      extended bycamera3d.VcLight
All Implemented Interfaces:
RotatableObject, ScalableObject, TranslatableObject
Direct Known Subclasses:
VcAmbientLight, VcDirectLight, VcPointLight

public abstract class VcLight
extends VcObject

Abstract superclass to all lights that can be added to the scene graph. This class encapsulates a javax.media.j3d.Light and provides some functionality for editing it.

Version:
1.0
Author:
Fábio Roberto de Miranda

Field Summary
 
Fields inherited from class camera3d.VcObject
transformationMode
 
Constructor Summary
VcLight()
          Creates new light.
 
Method Summary
 float getBlue()
          Returns blue component of this light's color.
 javax.vecmath.Color3f getColor()
          Returns current color of this light.
 float getGreen()
          Returns green component of this light's color.
 javax.swing.Icon getIcon()
          Returns the Icon associated with lights.
static int getInstanceCounter()
          Returns the number of objects instatiated so far.
abstract  javax.media.j3d.Light getJ3DLight()
          Returns the Java 3D light encapsulated by this VcLight.
 float getRed()
          Returns red component of this light's color.
 boolean isEnabled()
          Returns a flag indicating current light's state (on/off).
abstract  void setColor(float red, float green, float blue)
          Sets color of this light.
abstract  void setEnable(boolean b)
          Sets state (on/off) of this light.
 void setIcon(javax.swing.Icon lightIcon)
          Sets the Icon associated with lights.
abstract  void setJ3DLight(javax.media.j3d.Light light)
          Sets the Java 3D light encapsulated by this VcLight.
 
Methods inherited from class camera3d.VcObject
addChangeListener, addNode, addVcChild, detach, getBoundingBox, getBoundingBoxInVWorld, getBranchGroup, getChildrenList, getInfo, getLabel, getLocalToVworld, getParentRotScaleTG, getParentTransTG, getTooltipText, getTransforms, getTranslation, getXAngleDeg, getXAngleRad, getXScale, getXTranslation, getYAngleDeg, getYAngleRad, getYScale, getYTranslation, getZAngleDeg, getZAngleRad, getZScale, getZTranslation, hideBoundingBox, isInvalidData, isLive, isSelected, printTransform, removeAllChangeListeners, removeAllNodes, removeBoundingBox, removeChangeListener, removeNode, removeVcChild, removeVcChild, rotateAbsolute, rotateEuler, rotateEulerLocal, rotateEulerLocalX, rotateEulerLocalY, rotateEulerLocalZ, rotateEulerX, rotateEulerY, rotateEulerZ, rotateLocal, scaleRelative, scaleX, scaleXRelative, scaleY, scaleYRelative, scaleZ, scaleZRelative, select, setAbsoluteScale, setGlobalAxisVisible, setLabel, setLocalAxisVisible, setOngoingTransformation, setOngoingTransformationMode, setRelativeScale, setTooltipText, setTransform, setTransformsToIdentity, showBoundingBox, translate, translate, translateLocal, underOngoingTransformation, unselect, updateData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VcLight

public VcLight()
Creates new light.

Method Detail

getInstanceCounter

public static int getInstanceCounter()
Returns the number of objects instatiated so far.


setColor

public abstract void setColor(float red,
                              float green,
                              float blue)
Sets color of this light.

Parameters:
red - red component of color.
green - green component of color.
blue - blue component of color.

setEnable

public abstract void setEnable(boolean b)
Sets state (on/off) of this light.

Parameters:
b - If true, turns light on. If false, turns light off.

getColor

public javax.vecmath.Color3f getColor()
Returns current color of this light.


getRed

public float getRed()
Returns red component of this light's color.


getGreen

public float getGreen()
Returns green component of this light's color.


getBlue

public float getBlue()
Returns blue component of this light's color.


isEnabled

public boolean isEnabled()
Returns a flag indicating current light's state (on/off).

Returns:
true if light is on, false if light is off.

getIcon

public javax.swing.Icon getIcon()
Returns the Icon associated with lights.

Specified by:
getIcon in class VcObject

setIcon

public void setIcon(javax.swing.Icon lightIcon)
Sets the Icon associated with lights.

Specified by:
setIcon in class VcObject

getJ3DLight

public abstract javax.media.j3d.Light getJ3DLight()
Returns the Java 3D light encapsulated by this VcLight.


setJ3DLight

public abstract void setJ3DLight(javax.media.j3d.Light light)
Sets the Java 3D light encapsulated by this VcLight.



Copyright © 2001-2003 F.R. Miranda, C.S. Santos, J.E. Kogler Jr.. All Rights Reserved.