public class GraphicElement
extends java.lang.Object
Red (johnr) |
Yellow (neuendor) |
Constructor and Description |
---|
GraphicElement(java.lang.String type)
Create a new GraphicElement with the given type.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set |
attributeNameSet()
Return a set of all the attribute names, where each element of
the set is a String.
|
boolean |
containsAttribute(java.lang.String name)
Test if this element has an attribute with the given name.
|
void |
exportMoML(java.io.Writer out,
java.lang.String prefix)
Write the GraphicElement in XML format to the given writer.
|
java.lang.String |
getAttribute(java.lang.String name)
Return the value of the attribute with the given name.
|
java.lang.String |
getLabel()
Return the label of this graphic element.
|
PaintedObject |
getPaintedObject()
Return a new painted object that looks like this graphic element.
|
java.lang.String |
getType()
Return the type of this graphic element.
|
void |
removeAttribute(java.lang.String name)
Remove an attribute from this element.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set the attribute with the given name to the given value.
|
void |
setLabel(java.lang.String name)
Set the label for this graphic element.
|
java.lang.String |
toString()
Return a string this representing this GraphicElement.
|
public GraphicElement(java.lang.String type)
type
- The type.public java.util.Set attributeNameSet()
public void exportMoML(java.io.Writer out, java.lang.String prefix) throws java.io.IOException
out
- The writer.prefix
- The prefix, usually a string of spaces.java.io.IOException
- If there is a problem writing the MoML.public java.lang.String getAttribute(java.lang.String name)
name
- The name of the attribute.setAttribute(String, String)
public java.lang.String getLabel()
setLabel(String)
public PaintedObject getPaintedObject()
public java.lang.String getType()
public boolean containsAttribute(java.lang.String name)
name
- The name.public void removeAttribute(java.lang.String name)
name
- The name of the attribute to removepublic void setAttribute(java.lang.String name, java.lang.String value)
name
- The name of the attribute.value
- The value of the attribute.getAttribute(String)
public void setLabel(java.lang.String name)
name
- The name.getLabel()
public java.lang.String toString()
toString
in class java.lang.Object