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
      boolean closeAllMaps()
      Invoked when the user wants to close all maps.
      boolean confirmSaveChanges​(@NotNull MapControl<G,​A,​R> mapControl)
      Asks the user whether to save changes of a map.
      void openFile​(boolean mapFile)
      The user wants to edit a file.
      void reportLoadError​(@Nullable java.io.File file, @NotNull java.lang.String message)  
      void reportOutOfMapBoundsDeleted​(@NotNull java.io.File file, int outOfMapBoundsDeleted, @NotNull java.lang.StringBuilder outOfMapBoundsObjects)  
      void reportOutOfMemory​(@NotNull java.io.File file)  
      void reportSaveError​(@NotNull java.io.File mapFile, @NotNull java.lang.String message)
      Reports an error while saving a map file to the user.
      void reportSaveError​(@NotNull MapControl<G,​A,​R> mapControl, @NotNull java.lang.String message)
      Reports an error while saving a map file to the user.
      void reportTeleportCharacterError​(@NotNull java.lang.String mapPath, @NotNull java.lang.String message)
      Reports an error while teleporting a character to the current map.
      boolean save​(@NotNull MapControl<G,​A,​R> mapControl)
      Save one map.
      void saveAllMaps()
      Saves all maps.
      boolean saveAs​(@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 - true for map files, false for script files
      • save

        boolean save​(@NotNull
                     @NotNull MapControl<G,​A,​R> mapControl)
        Save one map.
        Parameters:
        mapControl - the map
        Returns:
        false if saving failed, true otherwise
      • saveAllMaps

        void saveAllMaps()
        Saves all maps.
      • closeAllMaps

        boolean closeAllMaps()
        Invoked when the user wants to close all maps.
        Returns:
        true if all maps closed, false if 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:
        false if the user cancelled the save or if saving failed, true otherwise
      • confirmSaveChanges

        boolean confirmSaveChanges​(@NotNull
                                   @NotNull MapControl<G,​A,​R> mapControl)
        Asks the user whether to save changes of a map. Returns true (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 saving
        message - 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 saving
        message - 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 to
        message - the error message