public class DefaultMapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractMapView<G,A,R>
MapView
implementation.Constructor and Description |
---|
DefaultMapView(@NotNull MapControl<G,A,R> mapControl,
int number,
@NotNull PathManager pathManager,
@NotNull MapGrid mapGrid,
@NotNull MapCursor<G,A,R> mapCursor,
@NotNull AbstractMapRenderer<G,A,R> renderer,
int xScrollDistance,
int yScrollDistance)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activate this map view.
|
void |
closeNotify()
This function must be called when the view is closed.
|
@NotNull java.awt.Component |
getComponent()
Returns the component associated with this MapView that can be used as
parent for dialogs.
|
@NotNull javax.swing.JInternalFrame |
getInternalFrame()
Returns the
JInternalFrame instance for this map view. |
@NotNull MapControl<G,A,R> |
getMapControl()
Return the controller of this view.
|
@NotNull MapRenderer |
getRenderer()
Returns the
MapRenderer for this view. |
@NotNull javax.swing.JScrollPane |
getScrollPane()
Returns the
JScrollPane of this map view. |
@NotNull java.lang.String |
getWindowTitle()
Returns the title for the map window.
|
void |
setViewPosition(@NotNull java.awt.Point viewPosition)
Sets the view position.
|
centerMapView, getMapCursor, getMapGrid, getSelectedGameObject, getSelectedGameObjects, getSelectedSquares, setCursorLocation
public DefaultMapView(@NotNull @NotNull MapControl<G,A,R> mapControl, int number, @NotNull @NotNull PathManager pathManager, @NotNull @NotNull MapGrid mapGrid, @NotNull @NotNull MapCursor<G,A,R> mapCursor, @NotNull @NotNull AbstractMapRenderer<G,A,R> renderer, int xScrollDistance, int yScrollDistance)
mapControl
- the controller of this viewnumber
- each view of a map will get a numberpathManager
- the path manager for converting path namesmapGrid
- the map grid for this map viewmapCursor
- the map cursor for this map viewrenderer
- the map renderer for rendering the map modelxScrollDistance
- the x distance when scrollingyScrollDistance
- the y distance when scrollingpublic void setViewPosition(@NotNull @NotNull java.awt.Point viewPosition)
viewPosition
- the view position to showpublic void closeNotify()
MapView
closeNotify
in interface MapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
closeNotify
in class AbstractMapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
@NotNull public @NotNull java.lang.String getWindowTitle()
MapView
@NotNull public @NotNull java.awt.Component getComponent()
MapView
@NotNull public @NotNull MapControl<G,A,R> getMapControl()
MapView
public void activate()
MapView
@NotNull public @NotNull javax.swing.JInternalFrame getInternalFrame()
MapView
JInternalFrame
instance for this map view.@NotNull public @NotNull MapRenderer getRenderer()
MapView
MapRenderer
for this view.@NotNull public @NotNull javax.swing.JScrollPane getScrollPane()
MapView
JScrollPane
of this map view.