 |
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;
74 final int attributeValueTmp1 =
input1.getSelectedIndex();
77 final int attributeValueTmp2 =
input2.getSelectedIndex();
80 final int attributeValue = (attributeValue1 & 0x0F) | (attributeValue2 << 4);
81 final String archetypeAttributeName =
getRef().getArchetypeAttributeName();
82 return archetype.getAttributeInt(archetypeAttributeName) == attributeValue ?
"" : archetypeAttributeName +
" " + attributeValue;
86 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
87 final Object selectedItem1 =
input1.getSelectedItem();
88 if (selectedItem1 ==
null) {
92 final Object selectedItem2 =
input2.getSelectedItem();
93 if (selectedItem2 ==
null) {
97 final String value1 = selectedItem1.toString().trim();
98 if (value1.isEmpty() || value1.startsWith(
"<")) {
102 final String value2 = selectedItem2.toString().trim();
103 if (value2.isEmpty() || value2.startsWith(
"<")) {
107 addLine(doc, style,
"",
" = " + value1 +
" / " + value2);
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).
Manages ArchetypeType instances, list, and bitmask definitions.
void appendSummary(@NotNull final Document doc, @NotNull final Style style)
A single Attribute, combining an ArchetypeAttribute with its input component(s).
GameObjects are the objects based on Archetypes found on maps.
A DialogAttribute for ArchetypeAttributeList2.
Interface for MapArchObjects.
Pair< Integer, String > get(final int index)
Returns an entry by index.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String @NotNull[] newMsg, @NotNull final ArchetypeType archetypeType)
final JComboBox<?> input2
The input ui component for editing bits 4+ of the value.
An ArchetypeAttribute for selecting a value from two lists.
DialogAttributeList2(@NotNull final ArchetypeAttributeList2 ref, @NotNull final JComboBox<?> input1, @NotNull final JComboBox<?> input2, @NotNull final ArchetypeTypeSet archetypeTypeSet)
Creates a new instance.
final JComboBox<?> input1
The input ui component for editing bits 0-3 of the value.
Contains the data of one Gridarta Object-Type.
final ArchetypeTypeSet archetypeTypeSet
The archetype type set.