View Javadoc

1   package cz.cuni.amis.pogamut.multi.communication.worldview.property;
2   
3   import java.awt.Color;
4   
5   import cz.cuni.amis.pogamut.base.communication.worldview.object.WorldObjectId;
6   import cz.cuni.amis.pogamut.multi.communication.worldview.object.ISharedProperty;
7   
8   /**
9    * Implementation of the ISharedProperty interface for Color value type.
10   * @author srlok
11   *
12   */
13  public class ColorProperty extends AbstractSharedProperty<Color> {
14  	
15  	@SuppressWarnings("rawtypes")
16  	public ColorProperty(WorldObjectId objId, String identifier, Color value, Class compositeClass)
17  	{
18  		super(objId, identifier, value, compositeClass);
19  	}
20  	
21  	public ColorProperty(ColorProperty other)
22  	{
23  		super(other);
24  	}
25  
26  	@Override
27  	public ISharedProperty clone() {
28  		return new ColorProperty(this);
29  	}
30  
31  	@Override
32  	public Class getPropertyValueClass() {
33  		return Color.class;
34  	}
35  
36  	@Override
37  	protected Color cloneValue() {
38  		if (this.value == null) return null;
39  		return new Color(value.getRGB());
40  	}
41  		
42  }