Class MainView


  • public class MainView
    extends java.lang.Object
    Main window of the level editor. Contains the desktop for the map windows (internal frames) and the tools.
    • Constructor Summary

      Constructors 
      Constructor Description
      MainView​(@NotNull javax.swing.JFrame frame, @NotNull java.awt.event.ActionListener exitAction, @NotNull java.awt.Component mapDesktop, @Nullable javax.swing.ImageIcon icon, @NotNull Exiter exiter)
      Constructs the main view and registers the given main controller.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTab​(@NotNull Tab tab)
      Adds a tab.
      @Nullable Tab getActiveTab​(@NotNull Location location, boolean alternativeLocation)
      Returns the active Tab on a given Location of the main view.
      void handleThrowable​(java.lang.Throwable t)
      This implementation displays the exception in a modal message dialog.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MainView

        public MainView​(@NotNull
                        @NotNull javax.swing.JFrame frame,
                        @NotNull
                        @NotNull java.awt.event.ActionListener exitAction,
                        @NotNull
                        @NotNull java.awt.Component mapDesktop,
                        @Nullable
                        @Nullable javax.swing.ImageIcon icon,
                        @NotNull
                        @NotNull Exiter exiter)
        Constructs the main view and registers the given main controller.
        Parameters:
        frame - the main window of the editor
        exitAction - the action to execute when the window is closed
        mapDesktop - the map desktop to show
        icon - the application's icon or null for default
        exiter - the exiter instance
    • Method Detail

      • addTab

        public void addTab​(@NotNull
                           @NotNull Tab tab)
        Adds a tab.
        Parameters:
        tab - the tab
      • getActiveTab

        @Nullable
        public @Nullable Tab getActiveTab​(@NotNull
                                          @NotNull Location location,
                                          boolean alternativeLocation)
        Returns the active Tab on a given Location of the main view.
        Parameters:
        location - the location
        alternativeLocation - whether the alternative location should be checked
        Returns:
        the tab or null if no active tab exists
      • handleThrowable

        public void handleThrowable​(java.lang.Throwable t)
        This implementation displays the exception in a modal message dialog.