Class ViewScreen2D

    • Field Detail

      • backgroundColor

        public ColorAttribute backgroundColor
        The red, green, blue, and alpha components of the background color of the viewscreen. This parameter must contain an array of double values. The default value is {1.0, 1.0, 1.0, 1.0}, corresponding to opaque white.
      • sceneGraphIn

        public TypedIOPort sceneGraphIn
        The input scene graph.
      • horizontalPixels

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

        public Parameter rotatable
        Boolean variable that determines if the user is allowed to rotate the scene. This parameter should contain a BooleanToken. The default value of this parameter is BooleanToken true.
      • scalable

        public Parameter scalable
        Boolean variable that determines if the user is allowed to scale the scene. This parameter should contain a BooleanToken. The default value of this parameter is BooleanToken false.
      • showAxes

        public Parameter showAxes
        Boolean variable that determines if the axes crosshairs are shown This parameter should contain a BooleanToken. The default value of this parameter is BooleanToken true.
      • translatable

        public Parameter translatable
        Boolean variable that determines if the user is allowed to translate the scene. This parameter should contain a BooleanToken. The default value of this parameter is BooleanToken false.
      • verticalPixels

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

        public Parameter upperLeftX
        The x coordinate of the canvas point visible in the upper left corner of the display screen.
      • upperLeftY

        public Parameter upperLeftY
        The y coordinate of the canvas point visible in the upper left corner of the display screen.
      • lowerRightX

        public Parameter lowerRightX
        The x coordinate of the canvas point visible in the lower right corner of the display screen.
      • lowerRightY

        public Parameter lowerRightY
        The y coordinate of the canvas point visible in the lower right corner of the display screen.
    • Constructor Detail

      • ViewScreen2D

        public ViewScreen2D​(CompositeEntity container,
                            java.lang.String name)
                     throws IllegalActionException,
                            NameDuplicationException
        Construct a ViewScreen2D 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 ViewScreen2D.
        Throws:
        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

      • getCanvas

        public JCanvas getCanvas()
        Return the Diva canvas used by this view screen.
        Returns:
        The Diva canvas.
      • getCrosshairX

        public BasicFigure getCrosshairX()
        Return the horizontal component of the crosshair which marks the origin.
        Returns:
        The horizontal component of the crosshair which marks the origin.
      • getCrosshairY

        public BasicFigure getCrosshairY()
        Return the vertical component of the crosshair which marks the origin.
        Returns:
        The vertical component of the crosshair which marks the origin.
      • getOrigin

        public java.awt.geom.Point2D.Double getOrigin()
        Return the location of the origin of the viewscreen.
        Returns:
        The origin of the viewscreen.
      • getSelectedFigure

        public Figure getSelectedFigure()
        Return the figure currently selected in the viewscreen.
        Returns:
        The figure currently selected in the viewscreen.
        See Also:
        setSelectedFigure(Figure figure)
      • 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 Placeable
        Parameters:
        container - The container in which to place the object, or null to specify that there is no current container.
      • setSelectedFigure

        public void setSelectedFigure​(Figure figure)
        Update the state of this object to reflect which figure is currently selected in the viewscreen.
        Parameters:
        figure - The figure currently selected.
        See Also:
        getSelectedFigure()
      • _addChild

        protected void _addChild​(Figure figure)
                          throws IllegalActionException
        Add a figure to the figure layer and set its interactor.
        Parameters:
        figure - The figure that is to be added.
        Throws:
        IllegalActionException - Always thrown for this base class.
      • _createViewScreen2D

        protected void _createViewScreen2D()
                                    throws IllegalActionException
        Create the view screen component. If place() was called with a container, then use the container. Otherwise, create a new frame and use that.
        Throws:
        IllegalActionException - If there is a problem reading a parameter.
      • _getHorizontalPixels

        protected int _getHorizontalPixels()
                                    throws IllegalActionException
        Return the horizontal pixels by reading the horizontalPixels parameter.
        Returns:
        the horizontal pixels.
        Throws:
        IllegalActionException - If thrown while reading the parameter.
      • _getVerticalPixels

        protected int _getVerticalPixels()
                                  throws IllegalActionException
        Return the vertical pixels by reading the verticalPixels parameter.
        Returns:
        the vertical pixels.
        Throws:
        IllegalActionException - If thrown while reading the parameter.
      • _isRotatable

        protected boolean _isRotatable()
                                throws IllegalActionException
        Return the value of the rotatable parameter.
        Returns:
        The value of the rotatable parameter.
        Throws:
        IllegalActionException - If thrown while reading the parameter.
      • _isScalable

        protected boolean _isScalable()
                               throws IllegalActionException
        Return the value of the scalable parameter.
        Returns:
        The value of the scalable parameter.
        Throws:
        IllegalActionException - If thrown while reading the parameter.
      • _isTranslatable

        protected boolean _isTranslatable()
                                   throws IllegalActionException
        Return the value of the translatable parameter.
        Returns:
        The value of the tranlatable parameter.
        Throws:
        IllegalActionException - If thrown while reading the parameter.