Package org.graffiti.plugin.parameter
Class AbstractSingleParameter
java.lang.Object
org.graffiti.plugin.parameter.AbstractSingleParameter
- All Implemented Interfaces:
Displayable,Parameter,SingleParameter
- Direct Known Subclasses:
AbstractLimitableParameter,BooleanParameter,ClusterColorParameter,ColorParameter,EdgeParameter,EnumParameter,JComponentParameter,NodeParameter,ObjectListParameter,ObjectParameter,SelectionParameter,SliderParameter,StringParameter
public abstract class AbstractSingleParameter extends Object implements SingleParameter
Implements functions that are common in all SingleParameters.
- Version:
- $Revision: 1.6 $
-
Constructor Summary
Constructors Constructor Description AbstractSingleParameter(Object val, String name, String description)Constructs a new abstract single parameter class.AbstractSingleParameter(String name, String description)Constructs a new abstract single parameter class. -
Method Summary
Modifier and Type Method Description StringgetDescription()Returns the description of the parameter.JComponentgetIcon()BufferedImagegetImage()Returns the image representing the parameter.StringgetName()Returns the name of the parameter.ObjectgetValue()Returns the encapsulated object.booleanisLeftAligned()voidsetDescription(String description)Sets the description.voidsetLeftAligned(boolean left_aligned)voidsetValue(Object val)Sets the encapsulated object.StringtoString()StringtoXMLString()Returns a well-formed XML string representing the Displayable.
-
Constructor Details
-
AbstractSingleParameter
Constructs a new abstract single parameter class.- Parameters:
val- DOCUMENT ME!name- the name of the parameter.description- the description of the parameter.
-
AbstractSingleParameter
Constructs a new abstract single parameter class.- Parameters:
name- the name of the parameter.description- the description of the parameter.
-
-
Method Details
-
setDescription
Sets the description.- Specified by:
setDescriptionin interfaceDisplayable- Parameters:
description-
-
getDescription
Returns the description of the parameter.- Specified by:
getDescriptionin interfaceDisplayable- Returns:
- the description of the parameter.
-
getImage
Returns the image representing the parameter. -
getName
Returns the name of the parameter.- Specified by:
getNamein interfaceDisplayable- Returns:
- the name of the parameter.
-
setValue
Description copied from interface:DisplayableSets the encapsulated object.- Specified by:
setValuein interfaceDisplayable- Throws:
IllegalArgumentException- thrown if val is not of the appropriate type.
-
getValue
Description copied from interface:DisplayableReturns the encapsulated object.- Specified by:
getValuein interfaceDisplayable- Returns:
- Object
-
toString
-
toXMLString
Description copied from interface:DisplayableReturns 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:
toXMLStringin interfaceDisplayable- Returns:
- string holding an XML representation of this Displayable
-
getIcon
- Specified by:
getIconin interfaceDisplayable
-
isLeftAligned
public boolean isLeftAligned() -
setLeftAligned
public void setLeftAligned(boolean left_aligned)
-