CH.ifa.draw.figures
Class FigureAttributes
- java.lang.Object
-
- CH.ifa.draw.figures.FigureAttributes
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class FigureAttributes extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableA container for a figure's attributes. The attributes are stored as key/value pairs.- See Also:
Figure, Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description FigureAttributes()Constructs the FigureAttributes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()Clones the attributes.java.lang.Objectget(java.lang.String name)Gets the attribute with the given name.booleanhasDefined(java.lang.String name)Tests if an attribute is defined.voidread(StorableInput dr)Reads the attributes from a StorableInput.static java.awt.ColorreadColor(StorableInput dr)voidset(java.lang.String name, java.lang.Object value)Sets the attribute with the given name and overwrites its previous value.voidwrite(StorableOutput dw)Writes the attributes to a StorableInput.static voidwriteColor(StorableOutput dw, java.lang.String colorName, java.awt.Color color)
-
-
-
Method Detail
-
get
public java.lang.Object get(java.lang.String name)
Gets the attribute with the given name.
-
set
public void set(java.lang.String name, java.lang.Object value)Sets the attribute with the given name and overwrites its previous value.
-
hasDefined
public boolean hasDefined(java.lang.String name)
Tests if an attribute is defined.
-
clone
public java.lang.Object clone()
Clones the attributes.- Overrides:
clonein classjava.lang.Object
-
read
public void read(StorableInput dr) throws java.io.IOException
Reads the attributes from a StorableInput. FigureAttributes store the following types directly: Color, Boolean, String, Int. Other attribute types have to implement the Storable interface or they have to be wrapped by an object that implements Storable.- Throws:
java.io.IOException- See Also:
Storable,write(CH.ifa.draw.util.StorableOutput)
-
write
public void write(StorableOutput dw)
Writes the attributes to a StorableInput. FigureAttributes store the following types directly: Color, Boolean, String, Int. Other attribute types have to implement the Storable interface or they have to be wrapped by an object that implements Storable.- See Also:
Storable,write(CH.ifa.draw.util.StorableOutput)
-
writeColor
public static void writeColor(StorableOutput dw, java.lang.String colorName, java.awt.Color color)
-
readColor
public static java.awt.Color readColor(StorableInput dr) throws java.io.IOException
- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG