Package org.graffiti.attributes
Class StringAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.StringAttribute
- All Implemented Interfaces:
Attribute
,DeepCopy
,Displayable
- Direct Known Subclasses:
ArrowShapeAttribute
,ChartAttribute
,ChartColorAttribute
,ClusterColorAttribute
,CompoundAttribute
,CompoundPositionAttribute
,EdgeShapeAttribute
,FontAttribute
,KeggGroupPartAttribute
,KeggIdAttribute
,KeggReactionIdAttribute
,KeggReactionTypeAttribute
,KeggRelationSrcTgtAttribute
,KeggRelationSubTypeAttribute
,KeggRelationTypeAttribute
,KeggTypeAttribute
,LabelAlignmentAttribute
,LabelColorAttribute
,LabelFontAttribute
,LabelStyleAttribute
,NodePathwayLinkVisualizationAttribute
,NodeShapeAttribute
,ObjectAttribute
,SourceDockingAttribute
,TargetDockingAttribute
,URLAttribute
,XMLAttribute
public class StringAttribute extends AbstractAttribute
Contains a String.
- Version:
- $Revision: 1.8 $
-
Field Summary
-
Constructor Summary
Constructors Constructor Description StringAttribute()
StringAttribute(String id, String value)
Constructs a new instance of aStringAttribute
with the given value. -
Method Summary
Modifier and Type Method Description Object
copy()
Returns a deep copy of this instance.String
getString()
Returns the value of this object.static Attribute
getTypedStringAttribute(String id)
static Attribute
getTypedStringAttribute(String id, String value)
Object
getValue()
Returns the value of this attribute, i.e.static void
putAttributeType(String id, Class<? extends Attribute> attributeType)
void
setDefaultValue()
The attribute's value is set so that itsgetValue()
method will not returnnull
.void
setString(String value)
Sets the value of this object.String
toString(int n)
Returns a string representation prepended byn
spaces of this attribute.String
toXMLString()
Returns a well-formed XML string representing the Displayable.Methods inherited from class org.graffiti.attributes.AbstractAttribute
addEdgeAttributeType, addNodeAttributeType, getAttributable, getDescription, getIcon, getId, getName, getParent, getPath, getTypedAttribute, isDeleted, isTypedAttributeFromID, setDeleted, setDescription, setId, setParent, setValue, toString
-
Constructor Details
-
StringAttribute
Constructs a new instance of aStringAttribute
with the given value.- Parameters:
id
- the id of the attribute.value
- the value of theAttribute
.
-
StringAttribute
public StringAttribute()
-
-
Method Details
-
getTypedStringAttribute
-
getTypedStringAttribute
-
setDefaultValue
public void setDefaultValue()Description copied from interface:Attribute
The attribute's value is set so that itsgetValue()
method will not returnnull
.- See Also:
Attribute.setDefaultValue()
-
setString
Sets the value of this object. TheListenerManager
is informed by the methodsetValue()
.- Parameters:
value
- the new value of this object.
-
getString
Returns the value of this object.- Returns:
- the value of this object.
-
getValue
Returns the value of this attribute, i.e. contained Sting object.- Returns:
- the value of the attribute, i.e. contained String object.
-
copy
Returns a deep copy of this instance.- Returns:
- a deep copy of this instance.
-
toString
Description copied from interface:Attribute
Returns a string representation prepended byn
spaces of this attribute.- Specified by:
toString
in interfaceAttribute
- Overrides:
toString
in classAbstractAttribute
- Returns:
- DOCUMENT ME!
- See Also:
Attribute.toString(int)
-
toXMLString
Description copied from interface:Displayable
Returns a well-formed XML string representing the Displayable. The Displayable should be reconstructable via this representation. Therefore it must at least include the type of Displayable (classname) and a representation of its value. PROBABLE FUTURE DESIGN: The Displayables themselves will provide a method to reconstruct their value from the XML representation they provided.- Specified by:
toXMLString
in interfaceDisplayable
- Overrides:
toXMLString
in classAbstractAttribute
- Returns:
- string holding an XML representation of this Displayable
- See Also:
Displayable.toXMLString()
-
putAttributeType
-