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(@NotNull java.lang.String panel,
@NotNull java.lang.String folder,
R archetype)
Adds an
Archetype to this model. |
void |
addArchetypeChooserModelListener(@NotNull ArchetypeChooserModelListener<G,A,R> listener)
Adds a listener to be notified of changes.
|
@Nullable java.lang.Integer |
getDirection()
Returns the default direction for game objects created from archetypes.
|
@NotNull DisplayMode<G,A,R> |
getDisplayMode()
Returns the current display mode.
|
@NotNull ArchetypeChooserPanel<G,A,R> |
getPanel(@NotNull java.lang.String panelName)
Returns an
ArchetypeChooserPanel by panel name. |
@NotNull java.lang.Iterable<ArchetypeChooserPanel<G,A,R>> |
getPanels()
Returns the
ArchetypeChooserPanels . |
@Nullable ArchetypeChooserPanel<G,A,R> |
getSelectedPanel()
Returns the selected
ArchetypeChooserPanel . |
void |
removeArchetypeChooserModelListener(@NotNull ArchetypeChooserModelListener<G,A,R> listener)
Removes a listener to be notified of changes.
|
void |
setDirection(@Nullable java.lang.Integer direction)
Sets the default direction for game objects created from archetypes.
|
void |
setDisplayMode(@NotNull DisplayMode<G,A,R> displayMode)
Updates the display mode.
|
void |
setSelectedPanel(@NotNull ArchetypeChooserPanel<G,A,R> selectedPanel)
Sets the selected
ArchetypeChooserPanel . |
public void addArchetypeChooserModelListener(@NotNull @NotNull ArchetypeChooserModelListener<G,A,R> listener)
listener
- the listenerpublic void removeArchetypeChooserModelListener(@NotNull @NotNull ArchetypeChooserModelListener<G,A,R> listener)
listener
- the listener@NotNull public @NotNull java.lang.Iterable<ArchetypeChooserPanel<G,A,R>> getPanels()
ArchetypeChooserPanels
.public void addArchetype(@NotNull @NotNull java.lang.String panel, @NotNull @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 @NotNull ArchetypeChooserPanel<G,A,R> getPanel(@NotNull @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 @Nullable ArchetypeChooserPanel<G,A,R> getSelectedPanel()
ArchetypeChooserPanel
.public void setSelectedPanel(@NotNull @NotNull ArchetypeChooserPanel<G,A,R> selectedPanel)
ArchetypeChooserPanel
.selectedPanel
- the selected panel@Nullable public @Nullable java.lang.Integer getDirection()
null
for defaultpublic void setDirection(@Nullable @Nullable java.lang.Integer direction)
direction
- the direction or null
for default@NotNull public @NotNull DisplayMode<G,A,R> getDisplayMode()
public void setDisplayMode(@NotNull @NotNull DisplayMode<G,A,R> displayMode)
displayMode
- the new display mode