Interface Canvas


  • public interface Canvas
    Defines a common abstraction for implementations that manage the display. Canvas can be extended for cartesian display or any kind. A Canvas with an XY (Cartesian) display field should support the following properties:

    • pixelWidth
    • pixelHeight
    • center
    • width
    • scale
    • envelope
    Since:
    GeoAPI 2.2
    • Method Detail

      • getState

        CanvasState getState()
        Returns a copy of the current state of this Canvas. The object returned will implement CanvasState or one of its subinterfaces, depending on the type of canvas.
        Returns:
        a snapshot of current canvas state.
      • isVisible

        boolean isVisible​(DirectPosition coordinate)
        Returns true if the given coordinate is visible on this Canvas.
        Parameters:
        coordinate - The coordinate to test for visibility.
        Returns:
        true if the given coordinate is visible on this canvas.
      • getController

        CanvasController getController()
        Returns the controller that allows the programmer to modify the Canvas's properties.
        Returns:
        the controller for this canvas.
      • setRenderingHint

        void setRenderingHint​(RenderingHints.Key hintKey,
                              Object hint)
        Sets a rendering hint for implementation or platform specific rendering information.
        Parameters:
        hintKey - The key of the hint.
        hint - The rendering hint.
      • getRenderingHint

        Object getRenderingHint​(RenderingHints.Key hintKey)
        Returns the rendering hint associated with the hint name.
        Parameters:
        hintKey - The key of the hint.
        Returns:
        the rendering hint.
      • addCanvasListener

        void addCanvasListener​(CanvasListener listener)
        Adds the given listener that will be notified when the state of this Canvas has changed.
        Parameters:
        listener - The listener to add.
      • removeCanvasListener

        void removeCanvasListener​(CanvasListener listener)
        Removes the given listener.
        Parameters:
        listener - The listener to remove.