20 package net.sf.gridarta.gui.panel.archetypechooser;
22 import java.awt.Component;
23 import java.util.Collections;
24 import java.util.HashMap;
25 import java.util.Iterator;
26 import java.util.List;
36 import net.
sf.japi.swing.action.ActionBuilder;
37 import net.
sf.japi.swing.action.ActionBuilderFactory;
38 import org.jetbrains.annotations.NotNull;
39 import org.jetbrains.annotations.Nullable;
51 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
57 private final Map<R, ArchetypePanel<G, A, R>>
archetypes =
new HashMap<>();
85 archetypes.put(archetype, archetypePanel);
112 return Collections.unmodifiableSet(archetypes.keySet()).
iterator();
142 return archObject == null ? Collections.emptyList() : Collections.singletonList(archObject);
List< R > getSelections()
Returns the selected game objects.
R getSelectedArchetype()
Returns the selected Archetype.
String getTitle()
Returns the title to display in the object chooser.
Graphical User Interface of Gridarta.
final ArchetypeChooserModel< G, A, R > archetypeChooserModel
The archetype chooser's model.
A named panel within the ArchetypeChooserModel.
boolean isMatching(@NotNull final G gameObject)
Returns whether the current selection matches the given game object.
void setActive(final boolean active)
Called whenever this tab becomes active or inactive.
A named folder within the ArchetypeChooserModel.
Collection< R > getArchetypes()
Returns the Archetypes.
static final ActionBuilder ACTION_BUILDER
The action builder.
A panel showing a set of archetypes.
ArchetypeChooserControl(@NotNull final ArchetypeChooserModel< G, A, R > archetypeChooserModel, @NotNull final ArchetypeChooserView< G, A, R > archetypeChooserView)
Creates a new instance.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
R getSelection()
Returns the selected game object.
Base package of all Gridarta classes.
ArchetypeChooserPanel< G, A, R > getSelectedPanel()
Returns the selected ArchetypeChooserPanel.
Reflects a game object (object on a map).
Iterator< R > iterator()
Returns all archetypes in the panel.
GameObjects are the objects based on Archetypes found on maps.
Component getComponent()
Returns the component to show in the object chooser.
void selectArchetype(@NotNull final R archetype)
Select an archetype.
final Map< R, ArchetypePanel< G, A, R > > archetypes
Maps archetype to archetype panel containing the archetype.
Utility class for ActionBuilder related functions.
The view of the archetype chooser.
final ArchetypeChooserView< G, A, R > archetypeChooserView
The archetype chooser's view.
void selectArchetype(@NotNull final R archetype)
Selects an archetype.
ArchetypeChooserFolder< G, A, R > getSelectedFolder()
Returns the selected ArchetypeChooserFolder.
final void setSelectedPanel(@NotNull final ArchetypePanel< G, A, R > selectedPanel)
Selects an archetype panel.
That control of the archetype chooser.
Interface for MapArchObjects.
Interface for classes being part of the object chooser.