Package net.sf.gridarta.gui.map.mapview
Class MapCursorTracker<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.map.mapview.MapCursorTracker<G,A,R>
-
public class MapCursorTracker<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.ObjectTracks theMapCursorof map and scrolls theAbstractMapRendererso that the map cursor remains visible.
-
-
Constructor Summary
Constructors Constructor Description MapCursorTracker(boolean isPickmap, int xScrollDistance, int yScrollDistance, @NotNull MapCursor<G,A,R> mapCursor, @NotNull AbstractMapRenderer<G,A,R> renderer)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseNotify()Must be called when this instance is not used anymore.@NotNull javax.swing.JScrollPanegetScrollPane()Returns theJScrollPaneof the renderer.voidsetViewPosition(@NotNull java.awt.Point viewPosition)Sets the view position.
-
-
-
Constructor Detail
-
MapCursorTracker
public MapCursorTracker(boolean isPickmap, int xScrollDistance, int yScrollDistance, @NotNull @NotNull MapCursor<G,A,R> mapCursor, @NotNull @NotNull AbstractMapRenderer<G,A,R> renderer)Creates a new instance.- Parameters:
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 update
-
-
Method Detail
-
setViewPosition
public void setViewPosition(@NotNull @NotNull java.awt.Point viewPosition)Sets the view position.- Parameters:
viewPosition- the view position to show
-
closeNotify
public void closeNotify()
Must be called when this instance is not used anymore. It un-registers all listeners.
-
getScrollPane
@NotNull public @NotNull javax.swing.JScrollPane getScrollPane()
Returns theJScrollPaneof the renderer.- Returns:
- the scroll pane
-
-