Package net.sf.gridarta.gui.map.renderer
Interface MapRenderer
-
- All Known Implementing Classes:
AbstractFlatMapRenderer,AbstractIsoMapRenderer,AbstractMapRenderer,AbstractSimpleIsoMapRenderer,FlatMapRenderer,FlatPickmapRenderer,IsoMapRenderer,IsoPickmapRenderer,SimpleFlatMapRenderer,SimpleIsoMapRenderer
public interface MapRendererCommon interface for renderers of map control instances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddMouseListener(@NotNull java.awt.event.MouseListener l)voidaddMouseMotionListener(@NotNull java.awt.event.MouseMotionListener mouseMotionListener)Adds aMouseMotionListenerto be notified about mouse events.voidforceRepaint()Repaint the view because some view parameters may have changed.@NotNull java.awt.image.BufferedImagegetFullImage()Returns an image of the entire map view.@NotNull Size2DgetImageSize()Returns the size of an image of the entire map view in pixels.@NotNull java.awt.RectanglegetSquareBounds(@NotNull java.awt.Point p)Returns coordinates, length and width of map square.booleangetSquareLocationAt(@NotNull java.awt.Point point, @NotNull java.awt.Point retPoint)Returns the map location at the given point.voidprintFullImage(@NotNull java.io.File file)Saves an image of the entire view to a file.voidremoveMouseListener(@NotNull java.awt.event.MouseListener l)voidremoveMouseMotionListener(@NotNull java.awt.event.MouseMotionListener mouseMotionListener)Removes aMouseMotionListenerto be notified about mouse events.voidscrollRectToVisible(@NotNull java.awt.Rectangle aRect)Ensures that a rectangular area is visible.voidsetLightVisible(boolean lightVisible)If set, inverts the setting ofMapViewSettings.isLightVisible().
-
-
-
Method Detail
-
getImageSize
@NotNull @NotNull Size2D getImageSize()
Returns the size of an image of the entire map view in pixels.- Returns:
- the size
-
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 viewretPoint- 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.IOExceptionSaves 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 aMouseMotionListenerto be notified about mouse events.- Parameters:
mouseMotionListener- the listener to add
-
removeMouseMotionListener
void removeMouseMotionListener(@NotNull @NotNull java.awt.event.MouseMotionListener mouseMotionListener)Removes aMouseMotionListenerto 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 ofMapViewSettings.isLightVisible().- Parameters:
lightVisible- whether lighted map squares are inverted
-
-