|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.gr.kernel.GRActor
ptolemy.domains.gr.kernel.GRActor2D
ptolemy.domains.gr.lib.ViewScreen2D
public class ViewScreen2D
A sink actor that renders a two-dimensional scene into a display screen. All mouse and keyboard events within the viewscreen are handled by a ViewScreen2DListener.
Red (cxh) |
Yellow (ismael) |
Nested Class Summary | |
---|---|
class |
ViewScreen2D.ViewScreen2DListener
Listen for Layer, LayerMotion and Key events. |
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private JCanvas |
_canvas
|
private java.awt.Container |
_container
|
private BasicFigure |
_crosshairX
|
private BasicFigure |
_crosshairY
|
private ViewScreen2D.ViewScreen2DListener |
_eventHandler
|
private EventLayer |
_eventLayer
|
private javax.swing.JFrame |
_frame
|
private FigureLayer |
_layer
|
private java.awt.geom.Point2D.Double |
_origin
|
private boolean |
_originRelocatable
|
private OverlayLayer |
_overlayLayer
|
private Figure |
_selectedFigure
|
ColorAttribute |
backgroundColor
The red, green, blue, and alpha components of the background color of the viewscreen. |
Parameter |
horizontalPixels
The horizontal resolution of the display screen. |
Parameter |
lowerRightX
The x coordinate of the canvas point visible in the lower right corner of the display screen. |
Parameter |
lowerRightY
The y coordinate of the canvas point visible in the lower right corner of the display screen. |
Parameter |
rotatable
Boolean variable that determines if the user is allowed to rotate the scene. |
Parameter |
scalable
Boolean variable that determines if the user is allowed to scale the scene. |
TypedIOPort |
sceneGraphIn
The input scene graph. |
Parameter |
showAxes
Boolean variable that determines if the axes crosshairs are shown This parameter should contain a BooleanToken. |
Parameter |
translatable
Boolean variable that determines if the user is allowed to translate the scene. |
Parameter |
upperLeftX
The x coordinate of the canvas point visible in the upper left corner of the display screen. |
Parameter |
upperLeftY
The y coordinate of the canvas point visible in the upper left corner of the display screen. |
Parameter |
verticalPixels
The vertical resolution of the display screen. |
Fields inherited from class ptolemy.domains.gr.kernel.GRActor2D |
---|
_viewScreen |
Fields inherited from class ptolemy.domains.gr.kernel.GRActor |
---|
_allowAttributeChanges, _isSceneGraphInitialized |
Fields inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
ViewScreen2D(CompositeEntity container,
java.lang.String name)
Construct a ViewScreen2D in the given container with the given name. |
Method Summary | |
---|---|
protected void |
_addChild(Figure figure)
Add a figure to the figure layer and set its interactor. |
protected void |
_createViewScreen2D()
Create the view screen component. |
protected int |
_getHorizontalPixels()
Return the horizontal pixels by reading the horizontalPixels parameter. |
protected int |
_getVerticalPixels()
Return the vertical pixels by reading the verticalPixels parameter. |
protected boolean |
_isRotatable()
Return the value of the rotatable parameter. |
protected boolean |
_isScalable()
Return the value of the scalable parameter. |
protected boolean |
_isTranslatable()
Return the value of the translatable parameter. |
protected void |
_makeSceneGraphConnection()
Set up the scene graph connections of this actor. |
void |
fire()
Repaint the canvas. |
JCanvas |
getCanvas()
Return the Diva canvas used by this view screen. |
BasicFigure |
getCrosshairX()
Return the horizontal component of the crosshair which marks the origin. |
BasicFigure |
getCrosshairY()
Return the vertical component of the crosshair which marks the origin. |
java.awt.geom.Point2D.Double |
getOrigin()
Return the location of the origin of the viewscreen. |
Figure |
getSelectedFigure()
Return the figure currently selected in the viewscreen. |
void |
initialize()
Initialize the execution. |
void |
place(java.awt.Container container)
Set the container that this actor should display data in. |
void |
setSelectedFigure(Figure figure)
Update the state of this object to reflect which figure is currently selected in the viewscreen. |
void |
wrapup()
Wrap up an execution. |
Methods inherited from class ptolemy.domains.gr.kernel.GRActor2D |
---|
_setViewScreen |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Actor |
---|
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList |
Methods inherited from interface ptolemy.actor.Executable |
---|
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, preinitialize, removeInitializable |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public ColorAttribute backgroundColor
public TypedIOPort sceneGraphIn
public Parameter horizontalPixels
public Parameter rotatable
public Parameter scalable
public Parameter showAxes
public Parameter translatable
public Parameter verticalPixels
public Parameter upperLeftX
public Parameter upperLeftY
public Parameter lowerRightX
public Parameter lowerRightY
private JCanvas _canvas
private java.awt.Container _container
private BasicFigure _crosshairX
private BasicFigure _crosshairY
private ViewScreen2D.ViewScreen2DListener _eventHandler
private EventLayer _eventLayer
private javax.swing.JFrame _frame
private FigureLayer _layer
private java.awt.geom.Point2D.Double _origin
private boolean _originRelocatable
private OverlayLayer _overlayLayer
private Figure _selectedFigure
Constructor Detail |
---|
public ViewScreen2D(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of the director.name
- Name of this ViewScreen2D.
IllegalActionException
- If this actor
is not compatible with the specified container.
NameDuplicationException
- If the container not a
CompositeActor and the name collides with an entity in the container.Method Detail |
---|
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class GRActor
IllegalActionException
- If an error occurs
during the scene graph initialization.public JCanvas getCanvas()
public BasicFigure getCrosshairX()
public BasicFigure getCrosshairY()
public java.awt.geom.Point2D.Double getOrigin()
public Figure getSelectedFigure()
setSelectedFigure(Figure figure)
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class GRActor
IllegalActionException
- If the base class throws it.public void place(java.awt.Container container)
place
in interface Placeable
container
- The container in which to place the object, or
null to specify that there is no current container.public void setSelectedFigure(Figure figure)
figure
- The figure currently selected.getSelectedFigure()
public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class GRActor
IllegalActionException
- If the base class throws it.protected void _addChild(Figure figure) throws IllegalActionException
figure
- The figure that is to be added.
IllegalActionException
- Always thrown for this base class.protected void _createViewScreen2D() throws IllegalActionException
IllegalActionException
- If there is a problem reading
a parameter.protected int _getHorizontalPixels() throws IllegalActionException
IllegalActionException
- If thrown while reading the
parameter.protected int _getVerticalPixels() throws IllegalActionException
IllegalActionException
- If thrown while reading the
parameter.protected boolean _isRotatable() throws IllegalActionException
IllegalActionException
- If thrown while reading the
parameter.protected boolean _isScalable() throws IllegalActionException
IllegalActionException
- If thrown while reading the
parameter.protected boolean _isTranslatable() throws IllegalActionException
IllegalActionException
- If thrown while reading the
parameter.protected void _makeSceneGraphConnection() throws IllegalActionException
_makeSceneGraphConnection
in class GRActor
IllegalActionException
- Always thrown for this base class.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |