public class MapCursorTracker<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
MapCursor
of map and scrolls the AbstractMapRenderer
so that the map cursor remains visible.Constructor and Description |
---|
MapCursorTracker(boolean isPickmap,
int xScrollDistance,
int yScrollDistance,
@NotNull MapCursor<G,A,R> mapCursor,
@NotNull AbstractMapRenderer<G,A,R> renderer)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
closeNotify()
Must be called when this instance is not used anymore.
|
@NotNull javax.swing.JScrollPane |
getScrollPane()
Returns the
JScrollPane of the renderer. |
void |
setViewPosition(@NotNull java.awt.Point viewPosition)
Sets the view position.
|
public MapCursorTracker(boolean isPickmap, int xScrollDistance, int yScrollDistance, @NotNull @NotNull MapCursor<G,A,R> mapCursor, @NotNull @NotNull AbstractMapRenderer<G,A,R> renderer)
isPickmap
- whether the map model belongs to a pickmapxScrollDistance
- the x distance when scrollingyScrollDistance
- the y distance when scrollingmapCursor
- the map cursor to trackrenderer
- the map renderer to updatepublic void setViewPosition(@NotNull @NotNull java.awt.Point viewPosition)
viewPosition
- the view position to showpublic void closeNotify()
@NotNull public @NotNull javax.swing.JScrollPane getScrollPane()
JScrollPane
of the renderer.