Class PickmapChooserView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView<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.ObjectA View for choosing pickmaps.
-
-
Constructor Summary
Constructors Constructor Description PickmapChooserView(@NotNull PickmapChooserModel<G,A,R> pickmapChooserModel, @NotNull MapFolderTree<G,A,R> mapFolderTree, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull MapReaderFactory<G,A> mapReaderFactory, @NotNull MapManager<G,A,R> pickmapManager)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChangeListener(@NotNull javax.swing.event.ChangeListener changeListener)Adds aChangeListenerto be notified when the selected pickmap tab changes.@NotNull java.awt.ComponentgetPickmapPanel()Returns theJTabbedPanewith all pickmaps.intgetSelectedIndex()Returns the selected index.voidnewPickmap(@NotNull Size2D mapSize, @NotNull java.lang.String pickmapName)Add a new pickmap.voidsetPopupMenu(@NotNull javax.swing.JPopupMenu popupMenu)Sets the popup menu to show.
-
-
-
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 modelmapFolderTree- the model to displaymapArchObjectFactory- the map arch object factory instancemapReaderFactory- the map reader factory instancepickmapManager- 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 aChangeListenerto be notified when the selected pickmap tab changes.- Parameters:
changeListener- the listener to add
-
getPickmapPanel
@NotNull public @NotNull java.awt.Component getPickmapPanel()
Returns theJTabbedPanewith all pickmaps.- Returns:
- the
JTabbedPanewith 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.IOExceptionAdd a new pickmap.- Parameters:
mapSize- the pickmap size in squarespickmapName- the name of the pickmap- Throws:
java.io.IOException- if an I/O error occursDuplicatePickmapException- if the pickmap name is not unique
-
-