Gridarta Editor
MapView.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.gui.map.mapview;
21 
22 import java.awt.Component;
23 import java.awt.Point;
24 import java.util.List;
25 import javax.swing.JInternalFrame;
26 import javax.swing.JScrollPane;
35 import org.jetbrains.annotations.NotNull;
36 import org.jetbrains.annotations.Nullable;
37 
43 public interface MapView<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> {
44 
49  void setViewPosition(@NotNull Point viewPosition);
50 
54  void closeNotify();
55 
63  @Nullable
65 
71  @NotNull
72  List<G> getSelectedGameObjects();
73 
78  @NotNull
79  String getWindowTitle();
80 
86  @NotNull
87  Component getComponent();
88 
93  @NotNull
95 
99  void activate();
100 
105  @NotNull
106  JInternalFrame getInternalFrame();
107 
112  @NotNull
113  List<MapSquare<G, A, R>> getSelectedSquares();
114 
119  @NotNull
121 
126  @NotNull
128 
133  @NotNull
135 
140  @NotNull
141  JScrollPane getScrollPane();
142 
149  void setCursorLocation(@NotNull Point point);
150 
155  void centerMapView(@NotNull Point centerSquare);
156 
157 }
net.sf.gridarta.gui.map.mapview.MapView.setCursorLocation
void setCursorLocation(@NotNull Point point)
Sets the cursor location.
net.sf.gridarta.gui.map.mapview.MapView.getSelectedGameObjects
List< G > getSelectedGameObjects()
Return all selected game objects.
net.sf.gridarta.gui.map.mapview.MapView.getMapGrid
MapGrid getMapGrid()
Returns the MapGrid of this view.
net.sf.gridarta.gui.map.mapview.MapView.getMapControl
MapControl< G, A, R > getMapControl()
Return the controller of this view.
net.sf.gridarta
Base package of all Gridarta classes.
net.sf.gridarta.model.mapmodel.MapSquare
A single Map Square.
Definition: MapSquare.java:45
net.sf.gridarta.gui.map.mapview.MapView.getComponent
Component getComponent()
Returns the component associated with this MapView that can be used as parent for dialogs.
net.sf
net.sf.gridarta.model.mapmodel
Definition: AboveFloorInsertionMode.java:20
net.sf.gridarta.gui.map.renderer
Definition: AbstractIsoMapRenderer.java:20
net.sf.gridarta.gui.map.mapview.MapView.getSelectedGameObject
G getSelectedGameObject()
Return one selected game object.
net.sf.gridarta.model.archetype
Definition: AbstractArchetype.java:20
net.sf.gridarta.model.gameobject.GameObject
Reflects a game object (object on a map).
Definition: GameObject.java:36
net.sf.gridarta.model.mapcontrol
Definition: DefaultMapControl.java:20
net.sf.gridarta.gui.map.mapview.MapView.getRenderer
MapRenderer getRenderer()
Returns the MapRenderer for this view.
net.sf.gridarta.gui
Graphical User Interface of Gridarta.
net.sf.gridarta.gui.map.mapview.MapView.setViewPosition
void setViewPosition(@NotNull Point viewPosition)
Sets the view position.
net.sf.gridarta.gui.map.mapview.MapView.getMapCursor
MapCursor< G, A, R > getMapCursor()
Returns the MapCursor of this view.
net.sf.gridarta.gui.map.mapview.MapView.closeNotify
void closeNotify()
This function must be called when the view is closed.
net.sf.gridarta.gui.map.mapview.MapView.activate
void activate()
Activate this map view.
net.sf.gridarta.model.gameobject
GameObjects are the objects based on Archetypes found on maps.
Definition: AbstractGameObject.java:20
net
net.sf.gridarta.gui.map.mapview.MapView.getWindowTitle
String getWindowTitle()
Returns the title for the map window.
net.sf.gridarta.model.maparchobject.MapArchObject
Interface for MapArchObjects.
Definition: MapArchObject.java:40
net.sf.gridarta.gui.map.mapview.MapView
A map view consists of a map grid and a map cursor, and is attached to a map control.
Definition: MapView.java:43
net.sf.gridarta.model.mapcursor.MapCursor
MapCursor provides methods to move and drag on map.
Definition: MapCursor.java:58
net.sf.gridarta.gui.map.mapview.MapView.getScrollPane
JScrollPane getScrollPane()
Returns the JScrollPane of this map view.
net.sf.gridarta.gui.map.mapview.MapView.centerMapView
void centerMapView(@NotNull Point centerSquare)
Centers the map view on a map square.
net.sf.gridarta.model.mapgrid.MapGrid
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
Definition: MapGrid.java:46
net.sf.gridarta.model.mapgrid
Definition: MapGrid.java:20
net.sf.gridarta.model
net.sf.gridarta.model.archetype.Archetype
Reflects an Archetype.
Definition: Archetype.java:41
net.sf.gridarta.gui.map.mapview.MapView.getInternalFrame
JInternalFrame getInternalFrame()
Returns the JInternalFrame instance for this map view.
net.sf.gridarta.gui.map
Base classes for rendering maps.
Definition: AbstractPerMapDialogManager.java:20
net.sf.gridarta.model.mapcontrol.MapControl
Currently nothing more than a marker interface for unification.
Definition: MapControl.java:35
net.sf.gridarta.model.maparchobject
Definition: AbstractMapArchObject.java:20
net.sf.gridarta.gui.map.mapview.MapView.getSelectedSquares
List< MapSquare< G, A, R > > getSelectedSquares()
Returns the selected squares.
net.sf.gridarta.gui.map.renderer.MapRenderer
Common interface for renderers of map control instances.
Definition: MapRenderer.java:36
net.sf.gridarta.model.mapcursor
Definition: MapCursor.java:20