VisualSim.simulators.gr.lib
Class ViewScreen

java.lang.Object
  extended byVisualSim.kernel.util.NamedObj
      extended byVisualSim.kernel.Entity
          extended byVisualSim.kernel.ComponentEntity
              extended byVisualSim.actor.AtomicActor
                  extended byVisualSim.actor.TypedAtomicActor
                      extended byVisualSim.simulators.gr.kernel.GRActor
                          extended byVisualSim.simulators.gr.lib.ViewScreen
All Implemented Interfaces:
Actor, java.lang.Cloneable, VisualSim.kernel.util.Debuggable, VisualSim.kernel.util.DebugListener, VisualSim.actor.Executable, VisualSim.kernel.util.ModelErrorHandler, VisualSim.kernel.util.Nameable, VisualSim.actor.gui.Placeable, java.io.Serializable, TypedActor

public class ViewScreen
extends GRActor
implements VisualSim.actor.gui.Placeable

A sink actor that renders the GR geometry into a display screen

Since:
VisualSim 1.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class VisualSim.kernel.util.NamedObj
VisualSim.kernel.util.NamedObj.MoMLInfo
 
Field Summary
 Parameter backgroundColor
          The background color, given as a 3-element array representing rgb color
 Parameter horizontalResolution
          The horizontal resolution of the display screen This parameter should contain a IntToken.
 Parameter iterationSynchronized
           
 Parameter rotatable
          Boolean variable that determines whether the user is allowed to rotate the model This parameter should contain a BooleanToken The default value of this parameter is BooleanToken true
 Parameter scalable
          Boolean variable that determines whether the user is allowed to scale the model This parameter should contain a BooleanToken The default value of this parameter is BooleanToken false
 TypedIOPort sceneGraphIn
          The input scene graph.
 Parameter showAxes
          Boolean variable that determines whether or not axes are shown.
 Parameter translatable
          Boolean variable that determines whether the user is allowed to translate the model This parameter should contain a BooleanToken The default value of this parameter is BooleanToken false
 Parameter verticalResolution
          The vertical resolution of the display screen This parameter should contain a IntToken.
 
Fields inherited from class VisualSim.actor.AtomicActor
Block_Documentation
 
Fields inherited from class VisualSim.kernel.util.NamedObj
ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface VisualSim.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
ViewScreen(CompositeEntity container, java.lang.String name)
          Construct a ViewScreen in the given container with the given name.
 
Method Summary
 void addChild(javax.media.j3d.Node node)
          Add the node argument as a child to the encapsulated Java3D node in this actor.
 void fire()
          Fire this actor.
 javax.media.j3d.BranchGroup getBranchGroup()
          Return the root Java 3D rendering group used by this view screen.
 javax.media.j3d.Canvas3D getCanvas()
          Return the Java 3D canvas used by this view screen.
 void initialize()
          Initialize the execution.
 void place(java.awt.Container container)
          Set the container that this actor should display data in.
 void wrapup()
          Wrapup an execution
 
Methods inherited from class VisualSim.actor.TypedAtomicActor
attributeTypeChanged, newPort, typeConstraintList
 
Methods inherited from class VisualSim.actor.AtomicActor
clone, connectionsChanged, getDirector, getExecutiveDirector, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, setContainer, stop, stopFire, terminate
 
Methods inherited from class VisualSim.kernel.ComponentEntity
getContainer, isAtomic, isOpaque, setName
 
Methods inherited from class VisualSim.kernel.Entity
connectedPortList, getAttribute, getPort, linkedRelationList, portList, removeAllPorts, uniqueName, validateSettables
 
Methods inherited from class VisualSim.kernel.util.NamedObj
addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, clone, deepContains, depthInHierarchy, description, description, event, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getFullName, getModelErrorHandler, getMoMLInfo, getName, getName, handleModelError, message, removeChangeListener, removeDebugListener, requestChange, setDeferMoMLDefinitionTo, setModelErrorHandler, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface VisualSim.actor.Actor
getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface VisualSim.actor.Executable
iterate, postfire, prefire, preinitialize, stop, stopFire, terminate
 

Field Detail

backgroundColor

public Parameter backgroundColor
The background color, given as a 3-element array representing rgb color


horizontalResolution

public Parameter horizontalResolution
The horizontal resolution of the display screen This parameter should contain a IntToken. The default value of this parameter is the IntToken 400


iterationSynchronized

public Parameter iterationSynchronized

rotatable

public Parameter rotatable
Boolean variable that determines whether the user is allowed to rotate the model This parameter should contain a BooleanToken The default value of this parameter is BooleanToken true


scalable

public Parameter scalable
Boolean variable that determines whether the user is allowed to scale the model This parameter should contain a BooleanToken The default value of this parameter is BooleanToken false


sceneGraphIn

public TypedIOPort sceneGraphIn
The input scene graph.


showAxes

public Parameter showAxes
Boolean variable that determines whether or not axes are shown. This parameter should contain a BooleanToken The default value of this parameter is BooleanToken false


translatable

public Parameter translatable
Boolean variable that determines whether the user is allowed to translate the model This parameter should contain a BooleanToken The default value of this parameter is BooleanToken false


verticalResolution

public Parameter verticalResolution
The vertical resolution of the display screen This parameter should contain a IntToken. The default value of this parameter is IntToken 400

Constructor Detail

ViewScreen

public ViewScreen(CompositeEntity container,
                  java.lang.String name)
           throws VisualSim.kernel.util.IllegalActionException,
                  VisualSim.kernel.util.NameDuplicationException
Construct a ViewScreen in the given container with the given name. If the container argument is null, a NullPointerException will be thrown. If the name argument is null, then the name is set to the empty string. Increment the version number of the workspace.

Parameters:
container - Container of the director.
name - Name of this ViewScreen.
Throws:
VisualSim.kernel.util.IllegalActionException - If this actor is not compatible with the specified container.
VisualSim.kernel.util.NameDuplicationException - If the container not a CompositeActor and the name collides with an entity in the container.
Method Detail

addChild

public void addChild(javax.media.j3d.Node node)
Add the node argument as a child to the encapsulated Java3D node in this actor.


fire

public void fire()
          throws VisualSim.kernel.util.IllegalActionException
Fire this actor.

Specified by:
fire in interface VisualSim.actor.Executable
Overrides:
fire in class GRActor
Throws:
VisualSim.kernel.util.IllegalActionException - If an error occurs during the scene graph initialization.

getBranchGroup

public javax.media.j3d.BranchGroup getBranchGroup()
Return the root Java 3D rendering group used by this view screen.


getCanvas

public javax.media.j3d.Canvas3D getCanvas()
Return the Java 3D canvas used by this view screen.


initialize

public void initialize()
                throws VisualSim.kernel.util.IllegalActionException
Initialize the execution. Create the ViewScreen frame if it hasn't been set using the place() method.

Specified by:
initialize in interface VisualSim.actor.Executable
Overrides:
initialize in class GRActor
Throws:
VisualSim.kernel.util.IllegalActionException - If the base class throws it.

place

public void place(java.awt.Container container)
Set the container that this actor should display data in. If place is not called, then the actor will create its own frame for display.

Specified by:
place in interface VisualSim.actor.gui.Placeable
Parameters:
container - The container in which to place the object, or null to specify that there is no current container.

wrapup

public void wrapup()
            throws VisualSim.kernel.util.IllegalActionException
Wrapup an execution

Specified by:
wrapup in interface VisualSim.actor.Executable
Overrides:
wrapup in class GRActor
Throws:
VisualSim.kernel.util.IllegalActionException - If the base class throws it.