public class ArchetypeChooserFolder<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 folder consists of
a set of Archetypes
. One (or no) archetype may be selected
at any time.Constructor and Description |
---|
ArchetypeChooserFolder(@NotNull java.lang.String name)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addArchetype(R archetype)
Adds an
Archetype to this folder. |
void |
addArchetypeChooserFolderListener(@NotNull ArchetypeChooserFolderListener<G,A,R> listener)
Adds a listener to be notified of changes.
|
boolean |
containsArchetype(R archetype)
Returns whether an
Archetype is part of this folder. |
@NotNull java.util.Collection<R> |
getArchetypes()
Returns the
Archetypes . |
@NotNull java.lang.String |
getName()
Returns the folder name.
|
R |
getSelectedArchetype()
Returns the selected
Archetype . |
void |
removeArchetypeChooserFolderListener(@NotNull ArchetypeChooserFolderListener<G,A,R> listener)
Removes a listener to be notified of changes.
|
void |
setSelectedArchetype(R selectedArchetype)
Sets the selected
Archetype . |
public ArchetypeChooserFolder(@NotNull @NotNull java.lang.String name)
name
- the folder namepublic void addArchetypeChooserFolderListener(@NotNull @NotNull ArchetypeChooserFolderListener<G,A,R> listener)
listener
- the listenerpublic void removeArchetypeChooserFolderListener(@NotNull @NotNull ArchetypeChooserFolderListener<G,A,R> listener)
listener
- the listener@NotNull public @NotNull java.lang.String getName()
@NotNull public @NotNull java.util.Collection<R> getArchetypes()
Archetypes
.public void addArchetype(@NotNull R archetype)
Archetype
to this folder.archetype
- the archetype to add@Nullable public R getSelectedArchetype()
Archetype
.null
if none is selectedpublic void setSelectedArchetype(@Nullable R selectedArchetype)
Archetype
.selectedArchetype
- the selected archetype or null
if none
is selected