public class ArchetypeChooserPanel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
implements java.io.Serializable
ArchetypeChooserModel
. A panel consists of a
set of ArchetypeChooserFolders
. One panel is
selected at any time.Constructor and Description |
---|
ArchetypeChooserPanel(java.lang.String name)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addArchetype(java.lang.String folder,
R archetype)
Adds an
Archetype to this panel. |
void |
addArchetypeChooserPanelListener(ArchetypeChooserPanelListener<G,A,R> listener)
Adds a listener to be notified of changes.
|
ArchetypeChooserFolder<G,A,R> |
getDefaultFolder()
Returns the default
ArchetypeChooserFolder that contains all
Archetypes of all folders. |
ArchetypeChooserFolder<G,A,R> |
getFolder(java.lang.String folderName)
Returns an
ArchetypeChooserFolder by folder name. |
java.util.List<ArchetypeChooserFolder<G,A,R>> |
getFolders()
Returns the
ArchetypeChooserFolders . |
java.lang.String |
getName()
Returns the panel name.
|
ArchetypeChooserFolder<G,A,R> |
getSelectedFolder()
Returns the selected
ArchetypeChooserFolder . |
void |
removeArchetypeChooserPanelListener(ArchetypeChooserPanelListener<G,A,R> listener)
Removes a listener to be notified of changes.
|
void |
setSelectedFolder(ArchetypeChooserFolder<G,A,R> selectedFolder)
Sets the selected
ArchetypeChooserFolder . |
public ArchetypeChooserPanel(@NotNull java.lang.String name)
name
- the panel namepublic void addArchetypeChooserPanelListener(@NotNull ArchetypeChooserPanelListener<G,A,R> listener)
listener
- the listenerpublic void removeArchetypeChooserPanelListener(@NotNull ArchetypeChooserPanelListener<G,A,R> listener)
listener
- the listener@NotNull public java.lang.String getName()
@NotNull public java.util.List<ArchetypeChooserFolder<G,A,R>> getFolders()
ArchetypeChooserFolders
.public void addArchetype(@NotNull java.lang.String folder, @NotNull R archetype)
Archetype
to this panel.folder
- the folder name to add toarchetype
- the archetype to add@NotNull public ArchetypeChooserFolder<G,A,R> getDefaultFolder()
ArchetypeChooserFolder
that contains all
Archetypes
of all folders.@Nullable public ArchetypeChooserFolder<G,A,R> getFolder(@NotNull java.lang.String folderName)
ArchetypeChooserFolder
by folder name.folderName
- the folder namenull
if no such folder exists@NotNull public ArchetypeChooserFolder<G,A,R> getSelectedFolder()
ArchetypeChooserFolder
.public void setSelectedFolder(@NotNull ArchetypeChooserFolder<G,A,R> selectedFolder)
ArchetypeChooserFolder
.selectedFolder
- the selected folder