Package net.sf.gridarta.gui.map.mapview
Class DefaultMapView<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.AbstractMapView<G,A,R>
-
- net.sf.gridarta.gui.map.mapview.DefaultMapView<G,A,R>
-
- All Implemented Interfaces:
MapView<G,A,R>
public class DefaultMapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractMapView<G,A,R>
DefaultMapViewimplementation.
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activate this map view.voidcloseNotify()This function must be called when the view is closed.@NotNull java.awt.ComponentgetComponent()Returns the component associated with this MapView that can be used as parent for dialogs.@NotNull javax.swing.JInternalFramegetInternalFrame()Returns theJInternalFrameinstance for this map view.@NotNull MapControl<G,A,R>getMapControl()Return the controller of this view.@NotNull MapRenderergetRenderer()Returns theMapRendererfor this view.@NotNull javax.swing.JScrollPanegetScrollPane()Returns theJScrollPaneof this map view.@NotNull java.lang.StringgetWindowTitle()Returns the title for the map window.voidsetViewPosition(@NotNull java.awt.Point viewPosition)Sets the view position.-
Methods inherited from class net.sf.gridarta.gui.map.mapview.AbstractMapView
centerMapView, getMapCursor, getMapGrid, getSelectedGameObject, getSelectedGameObjects, getSelectedSquares, setCursorLocation
-
-
-
-
Constructor Detail
-
DefaultMapView
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)Creates a new instance.- Parameters:
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 scrolling
-
-
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()
Description copied from interface:MapViewThis function must be called when the view is closed.- Specified by:
closeNotifyin interfaceMapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Overrides:
closeNotifyin classAbstractMapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
getWindowTitle
@NotNull public @NotNull java.lang.String getWindowTitle()
Description copied from interface:MapViewReturns the title for the map window.- Returns:
- the title
-
getComponent
@NotNull public @NotNull java.awt.Component getComponent()
Description copied from interface:MapViewReturns the component associated with this MapView that can be used as parent for dialogs.- Returns:
- the component as parent for dialogs
-
getMapControl
@NotNull public @NotNull MapControl<G,A,R> getMapControl()
Description copied from interface:MapViewReturn the controller of this view.- Returns:
- the controller of this view
-
activate
public void activate()
Description copied from interface:MapViewActivate this map view.
-
getInternalFrame
@NotNull public @NotNull javax.swing.JInternalFrame getInternalFrame()
Description copied from interface:MapViewReturns theJInternalFrameinstance for this map view.- Returns:
- the internal frame
-
getRenderer
@NotNull public @NotNull MapRenderer getRenderer()
Description copied from interface:MapViewReturns theMapRendererfor this view.- Returns:
- the map renderer
-
getScrollPane
@NotNull public @NotNull javax.swing.JScrollPane getScrollPane()
Description copied from interface:MapViewReturns theJScrollPaneof this map view.- Returns:
- the scroll pane
-
-