 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.map.mapview;
22 import java.awt.Point;
24 import java.io.IOException;
25 import java.util.Iterator;
26 import java.util.List;
28 import java.util.WeakHashMap;
40 import org.jetbrains.annotations.NotNull;
41 import org.jetbrains.annotations.Nullable;
94 public void gridVisibleChanged(
final boolean gridVisible) {
99 public void lightVisibleChanged(
final boolean lightVisible) {
104 public void smoothingChanged(
final boolean smoothing) {
109 public void tileStretchingChanged(
final boolean tileStretching) {
114 public void doubleFacesChanged(
final boolean doubleFaces) {
119 public void alphaTypeChanged(
final int alphaType) {
125 public void editTypeChanged(
final int editType) {
130 public void autojoinChanged(
final boolean autojoin) {
147 public void mapCreated(@NotNull
final MapControl<G, A, R> mapControl,
final boolean interactive) {
169 public MapViewsManager(@NotNull
final MapViewSettings mapViewSettings, @NotNull
final MapViewFactory<G, A, R> mapViewFactory, @NotNull
final MapManager<G, A, R> mapManager, @NotNull
final MapManager<G, A, R> pickmapManager, @NotNull
final PathManager pathManager) {
276 if (existingMapViews !=
null) {
277 return existingMapViews;
281 mapViews.put(mapControl, newMapViews);
294 public void newMapWithView(@Nullable
final List<G> objects, @NotNull
final A mapArchObject, @Nullable
final Point viewPosition, @Nullable
final MapFile mapFile) {
338 if (mapView ==
null) {
358 public void openMapFileWithView(@NotNull
final File file, @Nullable
final Point viewPosition, @Nullable
final Point centerSquare)
throws IOException {
360 if (viewPosition ==
null && centerSquare !=
null) {
380 mapControl.getMapModel().addActiveEditType(newType);
void repaintAllViews(@NotNull final MapControl< G, A, R > mapControl)
Repaints all MapViews of a MapControl.
final MapViewSettingsListener mapViewSettingsListener
The listener tracking alpha types changes to repaint map views after changes.
A MapManager manages all opened maps.
Base package of all Gridarta classes.
final MapManagerListener< G, A, R > mapManagerListener
The MapManagerListener attached to mapManager.
int getEditType()
Returns the currently set edit type.
final PathManager pathManager
The PathManager for converting File instance.
void addMapViewSettingsListener(@NotNull MapViewSettingsListener listener)
Register a MapViewSettingsListener.
Iterator< MapView< G, A, R > > getMapViewIterator(@NotNull final MapControl< G, A, R > mapControl)
Returns an Iterator returning all MapViews of a MapControl.
Interface for listeners listening to MapManager changes.
This class contains methods for converting relative map paths to absolute map paths and vice versa.
void removeMapViewsListener(@NotNull final MapControl< G, A, R > mapControl, @NotNull final MapViewsListener< G, A, R > listener)
Removes a MapViewsListener to be notified of events.
A list of MapViews for one MapControl instance.
void addEditType(final int newType)
Calculates a new type for all opened maps.
MapControl< G, A, R > newMap(@Nullable List< G > objects, @NotNull A mapArchObject, @Nullable MapFile mapFile, boolean interactive)
Creates a new map control without view.
void setFileControl(@NotNull final FileControl< G, A, R > fileControl)
void addMapManagerListener(@NotNull MapManagerListener< G, A, R > listener)
Adds a MapManagerListener to be notified.
MapViewsManager(@NotNull final MapViewSettings mapViewSettings, @NotNull final MapViewFactory< G, A, R > mapViewFactory, @NotNull final MapManager< G, A, R > mapManager, @NotNull final MapManager< G, A, R > pickmapManager, @NotNull final PathManager pathManager)
Creates a new instance.
Reflects a game object (object on a map).
Container for settings that affect the rendering of maps.
void closeView(@NotNull final MapView< G, A, R > mapView)
Closes a view of a MapControl.
List< MapControl< G, A, R > > getOpenedMaps()
Returns all opened maps.
void refreshAllMaps()
Refreshes all map views.
GameObjects are the objects based on Archetypes found on maps.
int getMapViews(@NotNull final MapControl< G, A, R > mapControl)
Returns the number of views of a MapControl.
void closeMapView(@NotNull final MapView< G, A, R > mapView)
Invoked when the user wants to close a map view.
MapViews< G, A, R > getMapViewsInt(@NotNull final MapControl< G, A, R > mapControl)
Returns the MapViews instance for a MapControl.
boolean confirmSaveChanges(@NotNull MapControl< G, A, R > mapControl)
Asks the user whether to save changes of a map.
final MapViewSettings mapViewSettings
The MapViewSettings instance.
void newMapWithView(@Nullable final List< G > objects, @NotNull final A mapArchObject, @Nullable final Point viewPosition, @Nullable final MapFile mapFile)
Creates a new map control and an initial map view.
Interface for MapArchObjects.
MapFile getMapFile(@NotNull final AbsoluteMapPath mapPath)
Returns a MapFile instance from an AbsoluteMapPath.
MapControl< G, A, R > openMapFile(@NotNull MapFile mapFile, boolean interactive)
Loads a map file.
final MapViewFactory< G, A, R > mapViewFactory
The MapViewFactory to use.
void centerMapView(@NotNull Point centerSquare)
Centers the map view on a map square.
The location of a map file with a map directory.
MapView< G, A, R > newMapView(@NotNull final MapControl< G, A, R > mapControl, @Nullable final Point viewPosition)
Creates a new map view.
Reading and writing of maps, handling of paths.
void release(@NotNull MapControl< G, A, R > mapControl)
Releases a MapControl instance.
void addMapViewsListener(@NotNull final MapControl< G, A, R > mapControl, @NotNull final MapViewsListener< G, A, R > listener)
Adds a MapViewsListener to be notified of events.
final Map< MapControl< G, A, R >, MapViews< G, A, R > > mapViews
All existing MapViews.
Interface for event listeners that are interested in changes on {}.
int getUseCounter()
Returns the use counter.
Currently nothing more than a marker interface for unification.
void openMapFileWithView(@NotNull final File file, @Nullable final Point viewPosition, @Nullable final Point centerSquare)
Loads a map file and creates a map view.
MapView< G, A, R > openMapFileWithView(@NotNull final MapFile mapFile, @Nullable final Point viewPosition)
Loads a map file and creates a map view.
FileControl< G, A, R > fileControl
The FileControl to use.
void setFocus(@NotNull final MapView< G, A, R > mapView)
Sets a MapView as the main view.
Stores all existing MapViews.
MapView< G, A, R > getMapViewFrame(@NotNull final MapControl< G, A, R > mapControl)
Returns the last used view of a MapControl.
final MapManager< G, A, R > mapManager
The MapManager to use.
void closeMap(@NotNull MapControl< G, A, R > mapControl)
Closes the given map, ignoring modified status.