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))) {
76 return archetypeAttributeName +
" none";
78 return archetypeAttributeName +
" " +
inline;
86 public void appendSummary(@NotNull
final Document doc, @NotNull
final Style style) {
87 final String text = input.getText();
92 final String value = text.trim();
97 addLine(doc, style,
"",
" = " + value);
TreasureTreeNode get(@NotNull final String name)
Returns a treasure list by name.
Graphical User Interface of Gridarta.
DialogAttributeTreasure(@NotNull final ArchetypeAttributeTreasure ref, @NotNull final JTextComponent input, @NotNull final TreasureTree treasureTree)
Creates a new instance.
Contains the data of one Gridarta Object-Type.
T getRef()
Returns the attribute data.
void appendSummary(@NotNull final Document doc, @NotNull final Style style)
Base package of all Gridarta classes.
Reflects a game object (object on a map).
GameObjects are the objects based on Archetypes found on maps.
final T ref
Reference to the attribute data.
final TreasureTree treasureTree
The TreasureTree to use.
The CFTreasureListTree class fully manages treasurelists.
String getObjectText(@NotNull final G gameObject, @NotNull final Archetype< G, A, R > archetype, @NotNull final String[] newMsg, @NotNull final ArchetypeType archetypeType)
static final String NONE_SYM
The string displayed in attribute dialog for "none".
Indicates that an attribute cannot be encoded.
A single Attribute, combining an ArchetypeAttribute with its input component(s).
final JTextComponent input
The input ui component for editing the value.
Stores all defined treasure lists.
void addLine( @NotNull final Document doc, @NotNull final AttributeSet style, @NotNull final String prefix, @NotNull final String postfix)
Appends a line to a Document.
An ArchetypeAttribute representing a treasurelist.
Defines types of GameObjects with corresponding attributes.
Interface for MapArchObjects.