01: package org.columba.core.tagging;
02:
03: import java.awt.Color;
04:
05: import org.columba.core.tagging.api.ITag;
06:
07: /**
08: * Tag has a unique internal ID, a mandatory tag name and an optional color and description.
09: *
10: * @author mhub
11: * @author frd
12: */
13: public class Tag implements ITag {
14:
15: private String id;
16: //private Hashtable properties = new Hashtable();
17: private Color color;
18: private String name;
19: private String description;
20:
21: public Tag(String newId, String name) {
22: this .id = newId;
23: this .name = name;
24: }
25:
26: public String getId() {
27: return id;
28: }
29:
30: // public String getProperty(String name) {
31: // return (String) properties.get(name);
32: // }
33: //
34: // public void setProperty(String name, String value) {
35: // properties.put(name, value);
36: // }
37: //
38: // public Hashtable getProperties() {
39: // return properties;
40: // }
41:
42: public Color getColor() {
43: return color;
44: }
45:
46: public String getName() {
47: return name;
48: }
49:
50: public void setColor(Color color) {
51: if (color == null)
52: throw new IllegalArgumentException("color == null");
53: this .color = color;
54: }
55:
56: public void setName(String name) {
57: if (name == null)
58: throw new IllegalArgumentException("name == null");
59: if (name.length() == 0)
60: throw new IllegalArgumentException("name length == 0");
61:
62: this .name = name;
63: }
64:
65: public String getDescription() {
66: return description;
67: }
68:
69: public void setDescription(String description) {
70: this.description = description;
71: }
72:
73: }
|