 |
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;
63 final int index =
input.getSelectedIndex();
64 final int attributeValue = index == 0 ? 0 :
numberSpells.getSpell(index - 1).getNumber();
65 final String archetypeAttributeName =
getRef().getArchetypeAttributeName();
66 return archetype.getAttributeInt(archetypeAttributeName) == attributeValue ?
"" : archetypeAttributeName +
" " + attributeValue;
70 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
71 final Object selectedItem =
input.getSelectedItem();
72 if (selectedItem ==
null) {
76 final String value = selectedItem.toString().trim();
77 if (value.isEmpty() || value.startsWith(
"<")) {
81 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.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String @NotNull[] newMsg, @NotNull final ArchetypeType archetypeType)
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.
final JComboBox<?> input
The input ui component for editing the value.
Interface for MapArchObjects.
Describes a numbered in-game spell.
DialogAttributeSpell(@NotNull final ArchetypeAttributeSpell ref, @NotNull final JComboBox<?> input, @NotNull final Spells< NumberSpell > numberSpells)
Creates a new instance.
An ArchetypeAttribute for selecting spells encoded as in integer attribute.
Contains the data of one Gridarta Object-Type.
Common base class for spells and spell lists.
void appendSummary(@NotNull final Document doc, @NotNull final Style style)
final Spells< NumberSpell > numberSpells
The number spells to display.