Class ArchetypeChooserModel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel<G,A,R>
-
- All Implemented Interfaces:
java.io.Serializable
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.SerializableThe view of the archetype chooser.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArchetypeChooserModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddArchetype(@NotNull java.lang.String panel, @NotNull java.lang.String folder, R archetype)Adds anArchetypeto this model.voidaddArchetypeChooserModelListener(@NotNull ArchetypeChooserModelListener<G,A,R> listener)Adds a listener to be notified of changes.@Nullable java.lang.IntegergetDirection()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 anArchetypeChooserPanelby panel name.@NotNull java.lang.Iterable<ArchetypeChooserPanel<G,A,R>>getPanels()Returns theArchetypeChooserPanels.@Nullable ArchetypeChooserPanel<G,A,R>getSelectedPanel()Returns the selectedArchetypeChooserPanel.voidremoveArchetypeChooserModelListener(@NotNull ArchetypeChooserModelListener<G,A,R> listener)Removes a listener to be notified of changes.voidsetDirection(@Nullable java.lang.Integer direction)Sets the default direction for game objects created from archetypes.voidsetDisplayMode(@NotNull DisplayMode<G,A,R> displayMode)Updates the display mode.voidsetSelectedPanel(@NotNull ArchetypeChooserPanel<G,A,R> selectedPanel)Sets the selectedArchetypeChooserPanel.
-
-
-
Method Detail
-
addArchetypeChooserModelListener
public void addArchetypeChooserModelListener(@NotNull @NotNull ArchetypeChooserModelListener<G,A,R> listener)Adds a listener to be notified of changes.- Parameters:
listener- the listener
-
removeArchetypeChooserModelListener
public void removeArchetypeChooserModelListener(@NotNull @NotNull ArchetypeChooserModelListener<G,A,R> listener)Removes a listener to be notified of changes.- Parameters:
listener- the listener
-
getPanels
@NotNull public @NotNull java.lang.Iterable<ArchetypeChooserPanel<G,A,R>> getPanels()
Returns theArchetypeChooserPanels.- Returns:
- the panels ordered by panel name
-
addArchetype
public void addArchetype(@NotNull @NotNull java.lang.String panel, @NotNull @NotNull java.lang.String folder, @NotNull R archetype)Adds anArchetypeto this model.- Parameters:
panel- the panel name to add tofolder- the folder name to add toarchetype- the archetype to add
-
getPanel
@NotNull public @NotNull ArchetypeChooserPanel<G,A,R> getPanel(@NotNull @NotNull java.lang.String panelName)
Returns anArchetypeChooserPanelby panel name. The panel is created if it does not yet exist.- Parameters:
panelName- the panel name- Returns:
- the folder
-
getSelectedPanel
@Nullable public @Nullable ArchetypeChooserPanel<G,A,R> getSelectedPanel()
Returns the selectedArchetypeChooserPanel.- Returns:
- the selected panel
-
setSelectedPanel
public void setSelectedPanel(@NotNull @NotNull ArchetypeChooserPanel<G,A,R> selectedPanel)Sets the selectedArchetypeChooserPanel.- Parameters:
selectedPanel- the selected panel
-
getDirection
@Nullable public @Nullable java.lang.Integer getDirection()
Returns the default direction for game objects created from archetypes.- Returns:
- the direction or
nullfor default
-
setDirection
public void setDirection(@Nullable @Nullable java.lang.Integer direction)Sets the default direction for game objects created from archetypes.- Parameters:
direction- the direction ornullfor default
-
getDisplayMode
@NotNull public @NotNull DisplayMode<G,A,R> getDisplayMode()
Returns the current display mode.- Returns:
- the current display mode
-
setDisplayMode
public void setDisplayMode(@NotNull @NotNull DisplayMode<G,A,R> displayMode)Updates the display mode.- Parameters:
displayMode- the new display mode
-
-