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,
java.awt.Point viewPosition,
int xScrollDistance,
int yScrollDistance,
MapCursor<G,A,R> mapCursor,
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.
|
javax.swing.JScrollPane |
getScrollPane()
Returns the
JScrollPane of the renderer. |
public MapCursorTracker(boolean isPickmap, @Nullable java.awt.Point viewPosition, int xScrollDistance, int yScrollDistance, @NotNull MapCursor<G,A,R> mapCursor, @NotNull AbstractMapRenderer<G,A,R> renderer)
isPickmap
- whether the map model belongs to a pickmapviewPosition
- the initial view position to show; null=show top left
cornerxScrollDistance
- the x distance when scrollingyScrollDistance
- the y distance when scrollingmapCursor
- the map cursor to trackrenderer
- the map renderer to update