 |
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;
45 private final JComboBox<?>
input;
70 final int index =
input.getSelectedIndex();
72 final boolean isModified;
73 switch (gameObject.countInvObjects()) {
96 final String invObjectArchetypeName = invObject.
getArchetype().getArchetypeName();
106 gameObject.removeAll();
109 gameObject.addLast(spellObject);
113 final int modelSize =
input.getModel().getSize();
115 input.removeItemAt(modelSize - 1);
124 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
125 final Object selectedItem =
input.getSelectedItem();
126 if (selectedItem ==
null) {
130 final String value = selectedItem.toString().trim();
131 if (value.isEmpty() || value.startsWith(
"<")) {
135 addLine(doc, style,
"",
" = " + value);
final T ref
Reference to the attribute data.
Defines types of GameObjects with corresponding attributes.
String getArchetypeName()
Returns the archetype name of the spell object.
void appendSummary(@NotNull final Document doc, @NotNull final Style style)
Base package of all Gridarta classes.
final Spells< GameObjectSpell< G, A, R > > gameObjectSpells
The game object spells to display.
Describes a numbered in-game spell.
Iterator< G > iterator()
The Iterator returned does not recurse, it only contains objects on the first level.
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).
R getArchetype()
Returns the Archetype this GameObject is based on.
A single Attribute, combining an ArchetypeAttribute with its input component(s).
GameObjects are the objects based on Archetypes found on maps.
Interface for MapArchObjects.
An ArchetypeAttribute for selecting a spell encoded as an inventory game object.
DialogAttributeInvSpell(final boolean isOptionalSpell, @NotNull final ArchetypeAttributeInvSpell ref, @NotNull final JComboBox<?> input, @NotNull final Spells< GameObjectSpell< G, A, R >> gameObjectSpells)
Creates a new instance.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String @NotNull[] newMsg, @NotNull final ArchetypeType archetypeType)
Contains the data of one Gridarta Object-Type.
Common base class for spells and spell lists.
final JComboBox<?> input
The input ui component for editing the value.
boolean isDefaultGameObject()
Returns whether this game object is unmodified from its underlying archetype.
final boolean isOptionalSpell
Whether the spell game object is optional.