dks.src.gradientEditor
Class CGradientColor

java.lang.Object
  extended by dks.src.gradientEditor.CGradientColor
All Implemented Interfaces:
Changeable, XMLWritable, java.io.Serializable, java.lang.Comparable<CGradientColor>

public class CGradientColor
extends java.lang.Object
implements java.lang.Comparable<CGradientColor>, XMLWritable, java.io.Serializable, Changeable

The class implements a color which can be save in a XML format

date : 3 sept. 07

Author:
DarK Sidious
See Also:
Serialized Form

Constructor Summary
CGradientColor(java.awt.Color color, int position)
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener listener)
          Add a ChangeListener which will notify when the object change
 int compareTo(CGradientColor color)
           
 boolean equals(java.lang.Object obj)
           
 java.awt.Color getColor()
           
 int getPosition()
           
 int hashCode()
           
 void removeChangeListener(javax.swing.event.ChangeListener listener)
          Remove a ChangeListener
 void setColor(java.awt.Color color)
           
 void setPosition(int position)
           
 java.lang.String toString()
           
 void XMLload(org.jdom.Element root)
          Construct the object with the data contains in the root DOM Element
 void XMLsave(org.jdom.Element root)
          Generate a DOM Element containing the children make by the object
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CGradientColor

public CGradientColor(java.awt.Color color,
                      int position)
Parameters:
color - the color to use
position - the position of the color
Method Detail

getColor

public java.awt.Color getColor()
Returns:
the color to use

setColor

public void setColor(java.awt.Color color)
Parameters:
color - the color to use

getPosition

public int getPosition()
Returns:
the position of the color

setPosition

public void setPosition(int position)
Parameters:
position - the position of the color

compareTo

public int compareTo(CGradientColor color)
Specified by:
compareTo in interface java.lang.Comparable<CGradientColor>
See Also:
Comparable.compareTo(java.lang.Object)

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener listener)
Description copied from interface: Changeable
Add a ChangeListener which will notify when the object change

Specified by:
addChangeListener in interface Changeable
Parameters:
listener - the ChangeListener to add

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener listener)
Description copied from interface: Changeable
Remove a ChangeListener

Specified by:
removeChangeListener in interface Changeable
Parameters:
listener - the ChangeListener to remove

XMLload

public void XMLload(org.jdom.Element root)
             throws org.jdom.JDOMException
Description copied from interface: XMLWritable
Construct the object with the data contains in the root DOM Element

Specified by:
XMLload in interface XMLWritable
Parameters:
root - the XML Dom element used to save the properties of the color
Throws:
org.jdom.JDOMException
See Also:
XMLWritable.XMLload(org.jdom.Element)

XMLsave

public void XMLsave(org.jdom.Element root)
Description copied from interface: XMLWritable
Generate a DOM Element containing the children make by the object

Specified by:
XMLsave in interface XMLWritable
Parameters:
root - the XML DOM element used to load the properties of the color
See Also:
XMLWritable.XMLsave(org.jdom.Element)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode of the object
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare
Returns:
the equality of the object
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object