Interface MapRenderer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addMouseListener​(@NotNull java.awt.event.MouseListener l)  
      void addMouseMotionListener​(@NotNull java.awt.event.MouseMotionListener mouseMotionListener)
      Adds a MouseMotionListener to be notified about mouse events.
      void forceRepaint()
      Repaint the view because some view parameters may have changed.
      @NotNull java.awt.image.BufferedImage getFullImage()
      Returns an image of the entire map view.
      @NotNull java.awt.Rectangle getSquareBounds​(@NotNull java.awt.Point p)
      Returns coordinates, length and width of map square.
      boolean getSquareLocationAt​(@NotNull java.awt.Point point, @NotNull java.awt.Point retPoint)
      Returns the map location at the given point.
      void printFullImage​(@NotNull java.io.File file)
      Saves an image of the entire view to a file.
      void removeMouseListener​(@NotNull java.awt.event.MouseListener l)  
      void removeMouseMotionListener​(@NotNull java.awt.event.MouseMotionListener mouseMotionListener)
      Removes a MouseMotionListener to be notified about mouse events.
      void scrollRectToVisible​(@NotNull java.awt.Rectangle aRect)
      Ensures that a rectangular area is visible.
      void setLightVisible​(boolean lightVisible)
      If set, inverts the setting of MapViewSettings.isLightVisible().
    • Method Detail

      • getFullImage

        @NotNull
        @NotNull java.awt.image.BufferedImage getFullImage()
        Returns an image of the entire map view.
        Returns:
        an image of the entire map view
      • getSquareLocationAt

        boolean getSquareLocationAt​(@NotNull
                                    @NotNull java.awt.Point point,
                                    @NotNull
                                    @NotNull java.awt.Point retPoint)
        Returns the map location at the given point.
        Parameters:
        point - the coordinates in the renderer view
        retPoint - this point will be returned
        Returns:
        whether the location is within the map bounds
      • forceRepaint

        void forceRepaint()
        Repaint the view because some view parameters may have changed.
      • printFullImage

        void printFullImage​(@NotNull
                            @NotNull java.io.File file)
                     throws java.io.IOException
        Saves an image of the entire view to a file.
        Parameters:
        file - file to write image file to
        Throws:
        java.io.IOException - in case of I/O problems
      • addMouseMotionListener

        void addMouseMotionListener​(@NotNull
                                    @NotNull java.awt.event.MouseMotionListener mouseMotionListener)
        Adds a MouseMotionListener to be notified about mouse events.
        Parameters:
        mouseMotionListener - the listener to add
      • removeMouseMotionListener

        void removeMouseMotionListener​(@NotNull
                                       @NotNull java.awt.event.MouseMotionListener mouseMotionListener)
        Removes a MouseMotionListener to be notified about mouse events.
        Parameters:
        mouseMotionListener - the listener to remove
      • addMouseListener

        void addMouseListener​(@NotNull
                              @NotNull java.awt.event.MouseListener l)
      • removeMouseListener

        void removeMouseListener​(@NotNull
                                 @NotNull java.awt.event.MouseListener l)
      • getSquareBounds

        @NotNull
        @NotNull java.awt.Rectangle getSquareBounds​(@NotNull
                                                    @NotNull java.awt.Point p)
        Returns coordinates, length and width of map square.
        Parameters:
        p - the map coordinates
        Returns:
        the boundary rectangle of square
      • scrollRectToVisible

        void scrollRectToVisible​(@NotNull
                                 @NotNull java.awt.Rectangle aRect)
        Ensures that a rectangular area is visible.
        Parameters:
        aRect - the area
      • setLightVisible

        void setLightVisible​(boolean lightVisible)
        If set, inverts the setting of MapViewSettings.isLightVisible().
        Parameters:
        lightVisible - whether lighted map squares are inverted