Class PickmapChooserView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>


  • public class PickmapChooserView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    A View for choosing pickmaps.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChangeListener​(@NotNull javax.swing.event.ChangeListener changeListener)
      Adds a ChangeListener to be notified when the selected pickmap tab changes.
      @NotNull java.awt.Component getPickmapPanel()
      Returns the JTabbedPane with all pickmaps.
      int getSelectedIndex()
      Returns the selected index.
      void newPickmap​(@NotNull Size2D mapSize, @NotNull java.lang.String pickmapName)
      Add a new pickmap.
      void setPopupMenu​(@NotNull javax.swing.JPopupMenu popupMenu)
      Sets the popup menu to show.
      • Methods inherited from class java.lang.Object

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

      • PickmapChooserView

        public PickmapChooserView​(@NotNull
                                  @NotNull PickmapChooserModel<G,​A,​R> pickmapChooserModel,
                                  @NotNull
                                  @NotNull MapFolderTree<G,​A,​R> mapFolderTree,
                                  @NotNull
                                  @NotNull MapArchObjectFactory<A> mapArchObjectFactory,
                                  @NotNull
                                  @NotNull MapReaderFactory<G,​A> mapReaderFactory,
                                  @NotNull
                                  @NotNull MapManager<G,​A,​R> pickmapManager)
        Creates a new instance.
        Parameters:
        pickmapChooserModel - the attached pickmap chooser model
        mapFolderTree - the model to display
        mapArchObjectFactory - the map arch object factory instance
        mapReaderFactory - the map reader factory instance
        pickmapManager - the pickmap manager for loading pickmaps
    • Method Detail

      • setPopupMenu

        public void setPopupMenu​(@NotNull
                                 @NotNull javax.swing.JPopupMenu popupMenu)
        Sets the popup menu to show.
        Parameters:
        popupMenu - the popup menu to use
      • addChangeListener

        public void addChangeListener​(@NotNull
                                      @NotNull javax.swing.event.ChangeListener changeListener)
        Adds a ChangeListener to be notified when the selected pickmap tab changes.
        Parameters:
        changeListener - the listener to add
      • getPickmapPanel

        @NotNull
        public @NotNull java.awt.Component getPickmapPanel()
        Returns the JTabbedPane with all pickmaps.
        Returns:
        the JTabbedPane with all pickmaps
      • getSelectedIndex

        public int getSelectedIndex()
        Returns the selected index.
        Returns:
        the index
      • newPickmap

        public void newPickmap​(@NotNull
                               @NotNull Size2D mapSize,
                               @NotNull
                               @NotNull java.lang.String pickmapName)
                        throws DuplicatePickmapException,
                               java.io.IOException
        Add a new pickmap.
        Parameters:
        mapSize - the pickmap size in squares
        pickmapName - the name of the pickmap
        Throws:
        java.io.IOException - if an I/O error occurs
        DuplicatePickmapException - if the pickmap name is not unique