public class ArchetypeChooserModel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
ArchetypeChooserModel() |
Modifier and Type | Method and Description |
---|---|
void |
addArchetype(java.lang.String panel,
java.lang.String folder,
R archetype)
Adds an
Archetype to this model. |
void |
addArchetypeChooserModelListener(ArchetypeChooserModelListener<G,A,R> listener)
Adds a listener to be notified of changes.
|
java.lang.Integer |
getDirection()
Returns the default direction for game objects created from archetypes.
|
DisplayMode<G,A,R> |
getDisplayMode()
Returns the current display mode.
|
ArchetypeChooserPanel<G,A,R> |
getPanel(java.lang.String panelName)
Returns an
ArchetypeChooserPanel by panel name. |
java.lang.Iterable<ArchetypeChooserPanel<G,A,R>> |
getPanels()
Returns the
ArchetypeChooserPanels . |
ArchetypeChooserPanel<G,A,R> |
getSelectedPanel()
Returns the selected
ArchetypeChooserPanel . |
void |
removeArchetypeChooserModelListener(ArchetypeChooserModelListener<G,A,R> listener)
Removes a listener to be notified of changes.
|
void |
setDirection(java.lang.Integer direction)
Sets the default direction for game objects created from archetypes.
|
void |
setDisplayMode(DisplayMode<G,A,R> displayMode)
Updates the display mode.
|
void |
setSelectedPanel(ArchetypeChooserPanel<G,A,R> selectedPanel)
Sets the selected
ArchetypeChooserPanel . |
public void addArchetypeChooserModelListener(@NotNull ArchetypeChooserModelListener<G,A,R> listener)
listener
- the listenerpublic void removeArchetypeChooserModelListener(@NotNull ArchetypeChooserModelListener<G,A,R> listener)
listener
- the listener@NotNull public java.lang.Iterable<ArchetypeChooserPanel<G,A,R>> getPanels()
ArchetypeChooserPanels
.public void addArchetype(@NotNull java.lang.String panel, @NotNull java.lang.String folder, @NotNull R archetype)
Archetype
to this model.panel
- the panel name to add tofolder
- the folder name to add toarchetype
- the archetype to add@NotNull public ArchetypeChooserPanel<G,A,R> getPanel(@NotNull java.lang.String panelName)
ArchetypeChooserPanel
by panel name. The panel is
created if it does not yet exist.panelName
- the panel name@Nullable public ArchetypeChooserPanel<G,A,R> getSelectedPanel()
ArchetypeChooserPanel
.public void setSelectedPanel(@NotNull ArchetypeChooserPanel<G,A,R> selectedPanel)
ArchetypeChooserPanel
.selectedPanel
- the selected panel@Nullable public java.lang.Integer getDirection()
null
for defaultpublic void setDirection(@Nullable java.lang.Integer direction)
direction
- the direction or null
for default@NotNull public DisplayMode<G,A,R> getDisplayMode()
public void setDisplayMode(@NotNull DisplayMode<G,A,R> displayMode)
displayMode
- the new display mode