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();
63 final int attributeValue = archetypeTypeSet.
getList(
getRef().getListName()).
get(attributeValueTmp).getFirst();
65 final String archetypeAttributeName =
getRef().getArchetypeAttributeName();
66 if (archetype.getAttributeInt(archetypeAttributeName) != attributeValue) {
67 return archetypeAttributeName +
" " + attributeValue;
74 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
75 final Object selectedItem = input.getSelectedItem();
76 if (selectedItem == null) {
80 final String value = selectedItem.toString().trim();
81 if (value.isEmpty() || value.startsWith(
"<")) {
85 addLine(doc, style,
"",
" = " + value);
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType)
Manages ArchetypeType instances, list, and bitmask definitions.
Contains the data of one Gridarta Object-Type.
T getRef()
Returns the attribute data.
final ArchetypeTypeSet archetypeTypeSet
The archetype type set.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
DialogAttributeList(@NotNull final ArchetypeAttributeList ref, @NotNull final JComboBox<?> input, @NotNull final ArchetypeTypeSet archetypeTypeSet)
Creates a new instance.
GameObjects are the objects based on Archetypes found on maps.
final T ref
Reference to the attribute data.
final JComboBox<?> input
The input ui component for editing the value.
A single Attribute, combining an ArchetypeAttribute with its input component(s).
void appendSummary(@NotNull final Document doc, @NotNull final Style style)
Pair< Integer, String > get(final int index)
Returns an entry by index.
void addLine( @NotNull final Document doc, @NotNull final AttributeSet style, @NotNull final String prefix, @NotNull final String postfix)
Appends a line to a Document.
ArchetypeTypeList getList(@NotNull final String listName)
Returns a list type definition.
An ArchetypeAttribute for selecting a value from a list.
Defines types of GameObjects with corresponding attributes.
Interface for MapArchObjects.