public class ArchetypeChooserControl<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements java.lang.Iterable<R>, ObjectChooserTab<G,A,R>
| Constructor and Description |
|---|
ArchetypeChooserControl(@NotNull ArchetypeChooserModel<G,A,R> archetypeChooserModel,
@NotNull ArchetypeChooserView<G,A,R> archetypeChooserView)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull java.awt.Component |
getComponent()
Returns the component to show in the object chooser.
|
R |
getSelection()
Returns the selected game object.
|
@NotNull java.util.List<R> |
getSelections()
Returns the selected game objects.
|
@NotNull java.lang.String |
getTitle()
Returns the title to display in the object chooser.
|
boolean |
isMatching(G gameObject)
Returns whether the current selection matches the given game object.
|
@NotNull java.util.Iterator<R> |
iterator()
Returns all archetypes in the panel.
|
void |
selectArchetype(R archetype)
Select an archetype.
|
void |
setActive(boolean active)
Called whenever this tab becomes active or inactive.
|
public ArchetypeChooserControl(@NotNull
@NotNull ArchetypeChooserModel<G,A,R> archetypeChooserModel,
@NotNull
@NotNull ArchetypeChooserView<G,A,R> archetypeChooserView)
archetypeChooserModel - the archetype chooser model to use; no new
archetypes must be added afterwardsarchetypeChooserView - the archetype chooser view to usepublic void selectArchetype(@NotNull
R archetype)
archetype - the archetype to select@NotNull public @NotNull java.util.Iterator<R> iterator()
@NotNull public @NotNull java.awt.Component getComponent()
ObjectChooserTabgetComponent in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>public void setActive(boolean active)
ObjectChooserTabsetActive in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>active - whether this tab is activepublic boolean isMatching(@NotNull
G gameObject)
ObjectChooserTabisMatching in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>gameObject - the game object to compare to@Nullable public R getSelection()
ObjectChooserTabgetSelection in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>null if no game
objects are selected@NotNull public @NotNull java.util.List<R> getSelections()
ObjectChooserTabgetSelections in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>@NotNull public @NotNull java.lang.String getTitle()
ObjectChooserTabgetTitle in interface ObjectChooserTab<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>