 |
Gridarta Editor
|
Go to the documentation of this file.
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 return archetype.getAttributeInt(archetypeAttributeName) == attributeValue ?
"" : archetypeAttributeName +
" " + attributeValue;
76 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
77 final Object selectedItem =
input.getSelectedItem();
78 if (selectedItem ==
null) {
82 final String value = selectedItem.toString().trim();
83 if (value.isEmpty() || value.startsWith(
"<")) {
87 addLine(doc, style,
"",
" = " + value);
final T ref
Reference to the attribute data.
Defines types of GameObjects with corresponding attributes.
T getRef()
Returns the attribute data.
Base package of all Gridarta classes.
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.
Reflects a game object (object on a map).
A single Attribute, combining an ArchetypeAttribute with its input component(s).
GameObjects are the objects based on Archetypes found on maps.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String @NotNull[] newMsg, @NotNull final ArchetypeType archetypeType)
Interface for MapArchObjects.
Describes a numbered in-game spell.
final int undefinedSpellIndex
The index used for "no" spell.
final JComboBox<?> input
The input ui component for editing the value.
Contains the data of one Gridarta Object-Type.
final Spells< NumberSpell > numberSpells
The number spells to display.
Common base class for spells and spell lists.
DialogAttributeZSpell(@NotNull final ArchetypeAttributeZSpell ref, @NotNull final JComboBox<?> input, @NotNull final Spells< NumberSpell > numberSpells, final int undefinedSpellIndex)
Creates a new instance.
An ArchetypeAttribute for selecting an optional spell encoded as an integer attribute.