 |
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;
31 import org.jetbrains.annotations.NotNull;
39 private final JComboBox<?>
input;
62 final int attributeValueTmp =
input.getSelectedIndex();
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.
ArchetypeTypeList getList(@NotNull final String listName)
Returns a list type definition.
T getRef()
Returns the attribute data.
Base package of all Gridarta classes.
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).
final ArchetypeTypeSet archetypeTypeSet
The archetype type set.
Manages ArchetypeType instances, list, and bitmask definitions.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String @NotNull[] newMsg, @NotNull final ArchetypeType archetypeType)
A single Attribute, combining an ArchetypeAttribute with its input component(s).
GameObjects are the objects based on Archetypes found on maps.
DialogAttributeList(@NotNull final ArchetypeAttributeList ref, @NotNull final JComboBox<?> input, @NotNull final ArchetypeTypeSet archetypeTypeSet)
Creates a new instance.
An ArchetypeAttribute for selecting a value from a list.
Interface for MapArchObjects.
Pair< Integer, String > get(final int index)
Returns an entry by index.
Contains the data of one Gridarta Object-Type.
final JComboBox<?> input
The input ui component for editing the value.
void appendSummary(@NotNull final Document doc, @NotNull final Style style)