Class DialogAttribute<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,T extends ArchetypeAttribute>
- java.lang.Object
-
- net.sf.gridarta.gui.dialog.gameobjectattributes.DialogAttribute<G,A,R,T>
-
- Direct Known Subclasses:
DialogAttributeAnimationName,DialogAttributeBitmask,DialogAttributeBool,DialogAttributeBoolSpec,DialogAttributeFaceName,DialogAttributeFloat,DialogAttributeInt,DialogAttributeInvSpell,DialogAttributeList,DialogAttributeList2,DialogAttributeLong,DialogAttributeMapPath,DialogAttributeScriptFile,DialogAttributeSpell,DialogAttributeString,DialogAttributeText,DialogAttributeTreasure,DialogAttributeZSpell
public abstract class DialogAttribute<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,T extends ArchetypeAttribute> extends java.lang.ObjectA single Attribute, combining anArchetypeAttributewith its input component(s).
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDialogAttribute(T ref)Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddLine(@NotNull javax.swing.text.Document doc, @NotNull javax.swing.text.AttributeSet style, @NotNull java.lang.String prefix, @NotNull java.lang.String postfix)Appends a line to aDocument.abstract voidappendSummary(@NotNull javax.swing.text.Document doc, @NotNull javax.swing.text.Style style)Appends a summary line for this attribute to aDocument.abstract @NotNull java.lang.StringgetObjectText(G gameObject, @NotNull Archetype<G,A,R> archetype, @NotNull java.lang.String @NotNull [] newMsg, @NotNull ArchetypeType archetypeType)Returns the attribute text for this attribute.TgetRef()Returns the attribute data.
-
-
-
Constructor Detail
-
DialogAttribute
protected DialogAttribute(@NotNull T ref)Creates a new instance.- Parameters:
ref- reference to the attribute data
-
-
Method Detail
-
getRef
@NotNull public T getRef()
Returns the attribute data.- Returns:
- the attribute data
-
getObjectText
@NotNull public abstract @NotNull java.lang.String getObjectText(@NotNull G gameObject, @NotNull @NotNull Archetype<G,A,R> archetype, @NotNull @NotNull java.lang.String @NotNull [] newMsg, @NotNull @NotNull ArchetypeType archetypeType) throws InvalidAttributeExceptionReturns the attribute text for this attribute. The returned string is inserted into the owner's game object text.- Parameters:
gameObject- the ownerarchetype- the owner's new archetype; it might differ fromgameObject's current archetypenewMsg- the new "msg" value for the ownerarchetypeType- the owner's archetype type- Returns:
- the game object text or an empty string
- Throws:
InvalidAttributeException- if the attribute cannot be encoded
-
appendSummary
public abstract void appendSummary(@NotNull @NotNull javax.swing.text.Document doc, @NotNull @NotNull javax.swing.text.Style style)Appends a summary line for this attribute to aDocument.- Parameters:
doc- the document to append tostyle- the style for the new text
-
addLine
protected void addLine(@NotNull @NotNull javax.swing.text.Document doc, @NotNull @NotNull javax.swing.text.AttributeSet style, @NotNull @NotNull java.lang.String prefix, @NotNull @NotNull java.lang.String postfix)Appends a line to aDocument. The line consists of the name of this attribute, possibly with some text prepended and/or appended.- Parameters:
doc- the document to add tostyle- the style for the new textprefix- the text to prepend; may be emptypostfix- the text to append; may be empty
-
-