01: /*
02: * $RCSfile: WritablePropertySource.java,v $
03: *
04: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Use is subject to license terms.
07: *
08: * $Revision: 1.1 $
09: * $Date: 2005/02/11 04:57:25 $
10: * $State: Exp $
11: */
12: package javax.media.jai;
13:
14: /**
15: * Sub-interface of <code>PropertySource</code> which permits setting
16: * the values of JAI properties in addition to obtaining their names
17: * and values. As the values of properties managed by classes which
18: * implement this interface may change, this is also a sub-interface
19: * of <code>PropertyChangeEmitter</code>. This permits other objects
20: * to register as listeners of particular JAI properties.
21: *
22: * <p> The case of the names of properties added via this interface
23: * should be retained although the case will be ignored in queries via
24: * <code>getProperty()</code> and will be forced to lower case in
25: * emitted <code>PropertySourceChangeEvent<code>.
26: *
27: * @see PropertySource
28: * @see PropertyChangeEmitter
29: *
30: * @since JAI 1.1
31: */
32: public interface WritablePropertySource extends PropertySource,
33: PropertyChangeEmitter {
34: /**
35: * Adds the property value associated with the supplied name to
36: * the <code>WritablePropertySource</code>. Properties set by
37: * this means will supersede any properties of the same name
38: * which might otherwise be derived dynamically.
39: *
40: * <p> Implementing classes which should
41: * fire a <code>PropertySourceChangeEvent</code> with a name set to
42: * that of the set property (retaining case), source set to the
43: * <code>WritablePropertySource</code>, and old and new values set to
44: * the previous and current values of the property, respectively.
45: * Neither the old nor the new value may <code>null</code>: undefined
46: * properties must as usual be indicated by an the constant value
47: * <code>java.awt.Image.UndefinedProperty</code>. It is however
48: * legal for either but not both of the old and new property values
49: * to equal <code>java.awt.Image.UndefinedProperty</code>.
50: *
51: * @param propertyName the name of the property, as a <code>String</code>.
52: * @param propertyValue the property, as a general <code>Object</code>.
53: *
54: * @exception IllegalArgumentException if <code>propertyName</code>
55: * or <code>propertyValue</code>
56: * is <code>null</code>.
57: */
58: void setProperty(String propertyName, Object propertyValue);
59:
60: /**
61: * Removes the named property from the <code>WritablePropertySource</code>.
62: * This method will clear any locally cached (static) properties
63: * but may have no effect on properties which would be derived
64: * dynamically.
65: *
66: * @param propertyName the name of the property, as a <code>String</code>.
67: * @param propertyValue the property, as a general <code>Object</code>.
68: *
69: * @exception IllegalArgumentException if <code>propertyName</code>
70: * is <code>null</code>.
71: */
72: void removeProperty(String propertyName);
73: }
|