public class PickmapChooserView<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
Constructor and Description |
---|
PickmapChooserView(PickmapChooserModel<G,A,R> pickmapChooserModel,
MapFolderTree<G,A,R> mapFolderTree,
MapArchObjectFactory<A> mapArchObjectFactory,
MapReaderFactory<G,A> mapReaderFactory,
MapManager<G,A,R> pickmapManager)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener changeListener)
Adds a
ChangeListener to be notified when the selected pickmap
tab changes. |
java.awt.Component |
getPickmapPanel()
Returns the
JTabbedPane with all pickmaps. |
int |
getSelectedIndex()
Returns the selected index.
|
java.lang.String |
getTitle(PickmapState<G,A,R> pickmapState)
Returns the title of a pickmap to use as the tab name.
|
void |
newPickmap(Size2D mapSize,
java.lang.String pickmapName)
Add a new pickmap.
|
void |
setActivePickmap(PickmapState<G,A,R> pickmapState)
Sets the active pickmap.
|
void |
setPopupMenu(javax.swing.JPopupMenu popupMenu)
Sets the popup menu to show.
|
public 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)
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 pickmapspublic void setPopupMenu(@NotNull javax.swing.JPopupMenu popupMenu)
popupMenu
- the popup menu to usepublic void addChangeListener(@NotNull javax.swing.event.ChangeListener changeListener)
ChangeListener
to be notified when the selected pickmap
tab changes.changeListener
- the listener to addpublic void setActivePickmap(@NotNull PickmapState<G,A,R> pickmapState)
pickmapState
- the pickmap@NotNull public java.lang.String getTitle(@NotNull PickmapState<G,A,R> pickmapState)
pickmapState
- the pickmap@NotNull public java.awt.Component getPickmapPanel()
JTabbedPane
with all pickmaps.JTabbedPane
with all pickmapspublic int getSelectedIndex()
public void newPickmap(@NotNull Size2D mapSize, @NotNull java.lang.String pickmapName) throws DuplicatePickmapException, java.io.IOException
mapSize
- the pickmap size in squarespickmapName
- the name of the pickmapjava.io.IOException
- if an I/O error occursDuplicatePickmapException
- if the pickmap name is not unique