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 String
getDescription()
Returns the description of the parameter.JComponent
getIcon()
BufferedImage
getImage()
Returns the image representing the parameter.String
getName()
Returns the name of the parameter.Object
getValue()
Returns the encapsulated object.boolean
isLeftAligned()
void
setDescription(String description)
Sets the description.void
setLeftAligned(boolean left_aligned)
void
setValue(Object val)
Sets the encapsulated object.String
toString()
String
toXMLString()
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:
setDescription
in interfaceDisplayable
- Parameters:
description
-
-
getDescription
Returns the description of the parameter.- Specified by:
getDescription
in interfaceDisplayable
- Returns:
- the description of the parameter.
-
getImage
Returns the image representing the parameter. -
getName
Returns the name of the parameter.- Specified by:
getName
in interfaceDisplayable
- Returns:
- the name of the parameter.
-
setValue
Description copied from interface:Displayable
Sets the encapsulated object.- Specified by:
setValue
in interfaceDisplayable
- Throws:
IllegalArgumentException
- thrown if val is not of the appropriate type.
-
getValue
Description copied from interface:Displayable
Returns the encapsulated object.- Specified by:
getValue
in interfaceDisplayable
- Returns:
- Object
-
toString
-
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
- Returns:
- string holding an XML representation of this Displayable
-
getIcon
- Specified by:
getIcon
in interfaceDisplayable
-
isLeftAligned
public boolean isLeftAligned() -
setLeftAligned
public void setLeftAligned(boolean left_aligned)
-