Class ViewControlsLayer

    • Field Detail

      • IMAGE_HEADING_LEFT

        protected static final java.lang.String IMAGE_HEADING_LEFT
        See Also:
        Constant Field Values
      • IMAGE_HEADING_RIGHT

        protected static final java.lang.String IMAGE_HEADING_RIGHT
        See Also:
        Constant Field Values
      • IMAGE_PITCH_DOWN

        protected static final java.lang.String IMAGE_PITCH_DOWN
        See Also:
        Constant Field Values
      • IMAGE_FOV_NARROW

        protected static final java.lang.String IMAGE_FOV_NARROW
        See Also:
        Constant Field Values
      • position

        protected java.lang.String position
      • layout

        protected java.lang.String layout
      • locationCenter

        protected Vec4 locationCenter
      • locationOffset

        protected Vec4 locationOffset
      • scale

        protected double scale
      • borderWidth

        protected int borderWidth
      • buttonSize

        protected int buttonSize
      • panSize

        protected int panSize
      • initialized

        protected boolean initialized
      • referenceViewport

        protected java.awt.Rectangle referenceViewport
      • showPanControls

        protected boolean showPanControls
      • showLookControls

        protected boolean showLookControls
      • showZoomControls

        protected boolean showZoomControls
      • showHeadingControls

        protected boolean showHeadingControls
      • showPitchControls

        protected boolean showPitchControls
      • showFovControls

        protected boolean showFovControls
      • showVeControls

        protected boolean showVeControls
    • Constructor Detail

      • ViewControlsLayer

        public ViewControlsLayer()
    • Method Detail

      • getBorderWidth

        public int getBorderWidth()
      • setBorderWidth

        public void setBorderWidth​(int borderWidth)
        Sets the view controls offset from the viewport border.
        Parameters:
        borderWidth - the number of pixels to offset the view controls from the borders indicated by setPosition(String).
      • getScale

        public double getScale()
        Get the controls display scale.
        Specified by:
        getScale in interface Layer
        Overrides:
        getScale in class AbstractLayer
        Returns:
        the controls display scale.
      • setScale

        public void setScale​(double scale)
        Set the controls display scale.
        Parameters:
        scale - the controls display scale.
      • getButtonSize

        protected int getButtonSize()
      • setButtonSize

        protected void setButtonSize​(int buttonSize)
      • getPanSize

        protected int getPanSize()
      • setPanSize

        protected void setPanSize​(int panSize)
      • getPosition

        public java.lang.String getPosition()
        Returns the current relative view controls position.
        Returns:
        the current view controls position.
      • setPosition

        public void setPosition​(java.lang.String position)
        Sets the relative viewport location to display the view controls. Can be one of AVKey.NORTHEAST, AVKey.NORTHWEST, AVKey.SOUTHEAST, or AVKey.SOUTHWEST (the default). These indicate the corner of the viewport to place view controls.
        Parameters:
        position - the desired view controls position, in screen coordinates.
      • getLayout

        public java.lang.String getLayout()
        Returns the current layout. Can be one of AVKey.HORIZONTAL or AVKey.VERTICAL.
        Returns:
        the current layout.
      • setLayout

        public void setLayout​(java.lang.String layout)
        Sets the desired layout. Can be one of AVKey.HORIZONTAL or AVKey.VERTICAL.
        Parameters:
        layout - the desired layout.
      • setOpacity

        public void setOpacity​(double opacity)
        Layer opacity is not applied to layers of this type. Opacity is controlled by the alpha values of the operation images.
        Specified by:
        setOpacity in interface Layer
        Overrides:
        setOpacity in class RenderableLayer
        Parameters:
        opacity - the current opacity value, which is ignored by this layer.
      • getOpacity

        public double getOpacity()
        Returns the layer's opacity value, which is ignored by this layer. Opacity is controlled by the alpha values of the operation images.
        Specified by:
        getOpacity in interface Layer
        Overrides:
        getOpacity in class RenderableLayer
        Returns:
        The layer opacity, a value between 0 and 1.
      • getLocationCenter

        public Vec4 getLocationCenter()
        Returns the current layer image location.
        Returns:
        the current location center. May be null.
      • setLocationCenter

        public void setLocationCenter​(Vec4 locationCenter)
        Specifies the screen location of the layer, relative to the image's center. May be null. If this value is non-null, it overrides the position specified by setPosition(String). The location is specified in pixels. The origin is the window's lower left corner. Positive X values are to the right of the origin, positive Y values are upwards from the origin. The final image location will be affected by the currently specified location offset if a non-null location offset has been specified (see setLocationOffset(gov.nasa.worldwind.geom.Vec4) )}.
        Parameters:
        locationCenter - the location center. May be null.
        See Also:
        setPosition(String), setLocationOffset(gov.nasa.worldwind.geom.Vec4)
      • getLocationOffset

        public Vec4 getLocationOffset()
        Returns the current location offset. See #setLocationOffset for a description of the offset and its values.
        Returns:
        the location offset. Will be null if no offset has been specified.
      • setLocationOffset

        public void setLocationOffset​(Vec4 locationOffset)
        Specifies a placement offset from the layer position on the screen.
        Parameters:
        locationOffset - the number of pixels to shift the layer image from its specified screen position. A positive X value shifts the image to the right. A positive Y value shifts the image up. If null, no offset is applied. The default offset is null.
        See Also:
        setLocationCenter(gov.nasa.worldwind.geom.Vec4), setPosition(String)
      • isShowPanControls

        public boolean isShowPanControls()
      • setShowPanControls

        public void setShowPanControls​(boolean state)
      • isShowLookControls

        public boolean isShowLookControls()
      • setShowLookControls

        public void setShowLookControls​(boolean state)
      • isShowHeadingControls

        public boolean isShowHeadingControls()
      • setShowHeadingControls

        public void setShowHeadingControls​(boolean state)
      • isShowZoomControls

        public boolean isShowZoomControls()
      • setShowZoomControls

        public void setShowZoomControls​(boolean state)
      • isShowPitchControls

        public boolean isShowPitchControls()
      • setShowPitchControls

        public void setShowPitchControls​(boolean state)
      • isShowFovControls

        public boolean isShowFovControls()
      • setShowFovControls

        public void setShowFovControls​(boolean state)
      • setShowVeControls

        public void setShowVeControls​(boolean state)
      • isShowVeControls

        public boolean isShowVeControls()
      • getHighlightedObject

        public java.lang.Object getHighlightedObject()
        Indicates the currently highlighted control, if any.
        Returns:
        the currently highlighted control, or null if no control is highlighted.
      • highlight

        public void highlight​(java.lang.Object control)
        Specifies the control to highlight. Any currently highlighted control is un-highlighted.
        Parameters:
        control - the control to highlight.
      • isInitialized

        protected boolean isInitialized()
      • initialize

        protected void initialize​(DrawContext dc)
      • updatePositions

        protected void updatePositions​(DrawContext dc)
      • computeLocation

        protected java.awt.Point computeLocation​(java.awt.Rectangle viewport,
                                                 java.awt.Rectangle controls)
        Compute the screen location of the controls overall rectangle bottom right corner according to either the location center if not null, or the screen position.
        Parameters:
        viewport - the current viewport rectangle.
        controls - the overall controls rectangle
        Returns:
        the screen location of the bottom left corner - south west corner.
      • clearControls

        protected void clearControls()