 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.dialog.gameobjectattributes;
22 import javax.swing.text.Document;
23 import javax.swing.text.JTextComponent;
24 import javax.swing.text.Style;
32 import org.jetbrains.annotations.NotNull;
42 private final JTextComponent
input;
65 final String
inline =
input.getText().trim();
67 final String archetypeAttributeName =
getRef().getArchetypeAttributeName();
68 if (!isNone &&
treasureTree.
get(
inline) ==
null && !
inline.equalsIgnoreCase(archetype.getAttributeString(archetypeAttributeName))) {
74 if (!
inline.equalsIgnoreCase(archetype.getAttributeString(archetypeAttributeName)) && !(isNone && !archetype.hasAttribute(archetypeAttributeName))) {
75 return archetypeAttributeName +
" " + (isNone ?
"none" :
inline);
82 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
83 final String text =
input.getText();
88 final String value = text.trim();
93 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.
Indicates that an attribute cannot be encoded.
void appendSummary(@NotNull final Document doc, @NotNull final Style style)
TreasureTreeNode get(@NotNull final String name)
Returns a treasure list by name.
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 JTextComponent input
The input ui component for editing the value.
Graphical User Interface of Gridarta.
A single Attribute, combining an ArchetypeAttribute with its input component(s).
GameObjects are the objects based on Archetypes found on maps.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String @NotNull[] newMsg, @NotNull final ArchetypeType archetypeType)
Stores all defined treasure lists.
Interface for MapArchObjects.
An ArchetypeAttribute representing a treasurelist.
static final String NONE_SYM
The string displayed in attribute dialog for "none".
final TreasureTree treasureTree
The TreasureTree to use.
Contains the data of one Gridarta Object-Type.
DialogAttributeTreasure(@NotNull final ArchetypeAttributeTreasure ref, @NotNull final JTextComponent input, @NotNull final TreasureTree treasureTree)
Creates a new instance.
The CFTreasureListTree class fully manages treasurelists.