Package net.sf.gridarta.model.mapmanager
Interface FileControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
- All Known Implementing Classes:
DefaultFileControl
public interface FileControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancloseAllMaps()Invoked when the user wants to close all maps.booleanconfirmSaveChanges(@NotNull MapControl<G,A,R> mapControl)Asks the user whether to save changes of a map.voidopenFile(boolean mapFile)The user wants to edit a file.voidreportLoadError(@Nullable java.io.File file, @NotNull java.lang.String message)voidreportOutOfMapBoundsDeleted(@NotNull java.io.File file, int outOfMapBoundsDeleted, @NotNull java.lang.StringBuilder outOfMapBoundsObjects)voidreportOutOfMemory(@NotNull java.io.File file)voidreportSaveError(@NotNull java.io.File mapFile, @NotNull java.lang.String message)Reports an error while saving a map file to the user.voidreportSaveError(@NotNull MapControl<G,A,R> mapControl, @NotNull java.lang.String message)Reports an error while saving a map file to the user.voidreportTeleportCharacterError(@NotNull java.lang.String mapPath, @NotNull java.lang.String message)Reports an error while teleporting a character to the current map.booleansave(@NotNull MapControl<G,A,R> mapControl)Save one map.voidsaveAllMaps()Saves all maps.booleansaveAs(@NotNull MapControl<G,A,R> mapControl)Asks the user for a filename, then saves the map.
-
-
-
Method Detail
-
openFile
void openFile(boolean mapFile)
The user wants to edit a file.- Parameters:
mapFile-truefor map files,falsefor script files
-
save
boolean save(@NotNull @NotNull MapControl<G,A,R> mapControl)Save one map.- Parameters:
mapControl- the map- Returns:
falseif saving failed,trueotherwise
-
saveAllMaps
void saveAllMaps()
Saves all maps.
-
closeAllMaps
boolean closeAllMaps()
Invoked when the user wants to close all maps.- Returns:
trueif all maps closed,falseif user cancelled.
-
saveAs
boolean saveAs(@NotNull @NotNull MapControl<G,A,R> mapControl)Asks the user for a filename, then saves the map.- Parameters:
mapControl- the map- Returns:
falseif the user cancelled the save or if saving failed,trueotherwise
-
confirmSaveChanges
boolean confirmSaveChanges(@NotNull @NotNull MapControl<G,A,R> mapControl)Asks the user whether to save changes of a map. Returnstrue(and does not ask the user) if the map is unmodified.- Parameters:
mapControl- the map- Returns:
- whether closing the map is allowed
-
reportSaveError
void reportSaveError(@NotNull @NotNull MapControl<G,A,R> mapControl, @NotNull @NotNull java.lang.String message)Reports an error while saving a map file to the user.- Parameters:
mapControl- the map control that failed savingmessage- the error message
-
reportSaveError
void reportSaveError(@NotNull @NotNull java.io.File mapFile, @NotNull @NotNull java.lang.String message)Reports an error while saving a map file to the user.- Parameters:
mapFile- the map file that failed savingmessage- the error message
-
reportLoadError
void reportLoadError(@Nullable @Nullable java.io.File file, @NotNull @NotNull java.lang.String message)
-
reportOutOfMapBoundsDeleted
void reportOutOfMapBoundsDeleted(@NotNull @NotNull java.io.File file, int outOfMapBoundsDeleted, @NotNull @NotNull java.lang.StringBuilder outOfMapBoundsObjects)
-
reportOutOfMemory
void reportOutOfMemory(@NotNull @NotNull java.io.File file)
-
reportTeleportCharacterError
void reportTeleportCharacterError(@NotNull @NotNull java.lang.String mapPath, @NotNull @NotNull java.lang.String message)Reports an error while teleporting a character to the current map.- Parameters:
mapPath- the map path to teleport tomessage- the error message
-
-