20 package net.sf.gridarta.gui.dialog.gameobjectattributes;
22 import javax.swing.JComboBox;
23 import javax.swing.text.Document;
24 import javax.swing.text.Style;
32 import org.jetbrains.annotations.NotNull;
40 private final JComboBox<?>
input;
69 final int index = input.getSelectedIndex();
71 final String archetypeAttributeName =
getRef().getArchetypeAttributeName();
72 if (archetype.getAttributeInt(archetypeAttributeName) != attributeValue) {
73 return archetypeAttributeName +
" " + attributeValue;
80 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
81 final Object selectedItem = input.getSelectedItem();
82 if (selectedItem == null) {
86 final String value = selectedItem.toString().trim();
87 if (value.isEmpty() || value.startsWith(
"<")) {
91 addLine(doc, style,
"",
" = " + value);
final JComboBox<?> input
The input ui component for editing the value.
An ArchetypeAttribute for selecting an optional spell encoded as an integer attribute.
Contains the data of one Gridarta Object-Type.
T getRef()
Returns the attribute data.
Describes a numbered in-game spell.
final Spells< NumberSpell > numberSpells
The number spells to display.
Base package of all Gridarta classes.
Common base class for spells and spell lists.
Reflects a game object (object on a map).
GameObjects are the objects based on Archetypes found on maps.
final T ref
Reference to the attribute data.
final int undefinedSpellIndex
The index used for "no" spell.
A single Attribute, combining an ArchetypeAttribute with its input component(s).
void appendSummary(@NotNull final Document doc, @NotNull final Style style)
void addLine( @NotNull final Document doc, @NotNull final AttributeSet style, @NotNull final String prefix, @NotNull final String postfix)
Appends a line to a Document.
S getSpell(final int index)
Return one spell object by index.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType)
Defines types of GameObjects with corresponding attributes.
DialogAttributeZSpell(@NotNull final ArchetypeAttributeZSpell ref, @NotNull final JComboBox<?> input, @NotNull final Spells< NumberSpell > numberSpells, final int undefinedSpellIndex)
Creates a new instance.
Interface for MapArchObjects.