Package net.sf.gridarta.gui.map.mapview
Interface MapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
- All Known Implementing Classes:
AbstractMapView,DefaultMapView
public interface MapView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>A map view consists of a map grid and a map cursor, and is attached to a map control.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivate()Activate this map view.voidcenterMapView(@NotNull java.awt.Point centerSquare)Centers the map view on a map square.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 MapCursor<G,A,R>getMapCursor()Returns theMapCursorof this view.@NotNull MapGridgetMapGrid()Returns theMapGridof this view.@NotNull MapRenderergetRenderer()Returns theMapRendererfor this view.@NotNull javax.swing.JScrollPanegetScrollPane()Returns theJScrollPaneof this map view.GgetSelectedGameObject()Return one selected game object.@NotNull java.util.List<G>getSelectedGameObjects()Return all selected game objects.@NotNull java.util.List<MapSquare<G,A,R>>getSelectedSquares()Returns the selected squares.@NotNull java.lang.StringgetWindowTitle()Returns the title for the map window.voidsetCursorLocation(@NotNull java.awt.Point point)Sets the cursor location.voidsetViewPosition(@NotNull java.awt.Point viewPosition)Sets the view position.
-
-
-
Method Detail
-
setViewPosition
void setViewPosition(@NotNull @NotNull java.awt.Point viewPosition)Sets the view position.- Parameters:
viewPosition- the view position to show
-
closeNotify
void closeNotify()
This function must be called when the view is closed.
-
getSelectedGameObject
@Nullable G getSelectedGameObject()
Return one selected game object. If more than one game object is selected, return a random one. If nothing is selected, return a random game object from the entire map.- Returns:
- one random selected game object, or
nullif no game object is selected
-
getSelectedGameObjects
@NotNull @NotNull java.util.List<G> getSelectedGameObjects()
Return all selected game objects. If nothing is selected, return all game objects from the entire map.- Returns:
- the selected game objects
-
getWindowTitle
@NotNull @NotNull java.lang.String getWindowTitle()
Returns the title for the map window.- Returns:
- the title
-
getComponent
@NotNull @NotNull java.awt.Component getComponent()
Returns the component associated with this MapView that can be used as parent for dialogs.- Returns:
- the component as parent for dialogs
-
getMapControl
@NotNull @NotNull MapControl<G,A,R> getMapControl()
Return the controller of this view.- Returns:
- the controller of this view
-
activate
void activate()
Activate this map view.
-
getInternalFrame
@NotNull @NotNull javax.swing.JInternalFrame getInternalFrame()
Returns theJInternalFrameinstance for this map view.- Returns:
- the internal frame
-
getSelectedSquares
@NotNull @NotNull java.util.List<MapSquare<G,A,R>> getSelectedSquares()
Returns the selected squares.- Returns:
- the selected squares; the list may be modified by the caller
-
getMapGrid
@NotNull @NotNull MapGrid getMapGrid()
Returns theMapGridof this view.- Returns:
- the map grid of this view
-
getMapCursor
@NotNull @NotNull MapCursor<G,A,R> getMapCursor()
Returns theMapCursorof this view.- Returns:
- the map cursor of this view
-
getRenderer
@NotNull @NotNull MapRenderer getRenderer()
Returns theMapRendererfor this view.- Returns:
- the map renderer
-
getScrollPane
@NotNull @NotNull javax.swing.JScrollPane getScrollPane()
Returns theJScrollPaneof this map view.- Returns:
- the scroll pane
-
setCursorLocation
void setCursorLocation(@NotNull @NotNull java.awt.Point point)Sets the cursor location. If the map location is not within map bounds the cursor is set to the nearest valid location.- Parameters:
point- the new location will be modified to the actually set cursor location
-
centerMapView
void centerMapView(@NotNull @NotNull java.awt.Point centerSquare)Centers the map view on a map square.- Parameters:
centerSquare- the map square
-
-