|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.argouml.cognitive.DesignMaterial
Abstract class to represent the materials being used in design. The nature of these materials is domain-dependent. For example, in the domain of software architecture the design materials are software components and connectors. There is not much that can be said about generic design materials at this level of abstraction. But the Argo kernel provides for all DesignMaterials to (1) be Observable, (2) have Properties (in addition to instance variables supplied in subclasses) that can be shown in a property sheet, (3) ask Agency to critique them, (4) keep a list of the ToDoItem's that are generated from that critiquing, (5) be notified when the user selects them in an editor, (6) highlight themselves to draw the designer's attention.
TODO: should I implement virtual copying? or instance-based inheritiance of properties? How are properties shared (it at all)? For examples of subclasing see the package jargo.softarch. For instructions on how to define subclasses for DesignMaterials in your domain, see the Argo cookbook entry for define_design_material
Design
,
Serialized FormField Summary | |
private boolean |
highlight
|
private Vector |
parents
Other DesignMaterial's that contain this one. |
private ToDoList |
pendingItems
ToDoList items that are on the designers ToDoList because of this material. |
private Vector |
persistObservers
Observers of this object that should be saved and loaded with this object. |
private Vector |
propertyListeners
|
private Hashtable |
props
"Soft" Properties that this DesignMaterial may have, but we do not want to allocate an instance variable to them. |
Fields inherited from class java.util.Observable |
|
Constructor Summary | |
DesignMaterial()
Construct a new DesignMaterial with empty Properties. |
|
DesignMaterial(Hashtable ht)
Construct a new DesignMaterial with the given Properties. |
Method Summary | |
(package private) void |
addParent(Design d)
Make the given Design be the parent of this DesignMaterial. |
void |
addPersistantObserver(Observer o)
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
boolean |
canPut(String key)
|
void |
changedProperty(String key)
|
void |
critique(Designer dsgr)
Critique this DesignMaterial and post ToDoItem's to the Designer's list. |
void |
define(String k,
boolean v)
Set the value of a property iff it is not already set. |
void |
define(String k,
int v)
Set the value of a property iff it is not already set. |
boolean |
define(String k,
Object v)
|
void |
dispose()
Remove this DesignMaterial from the design document and free up memory and other resources as much as possible. |
void |
firePropertyChange(String propertyName,
boolean oldValue,
boolean newValue)
|
void |
firePropertyChange(String propertyName,
int oldValue,
int newValue)
|
void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
|
Object |
get(String k)
|
Object |
get(String key,
Object defaultValue)
|
boolean |
getBoolean(String k)
Convenient function for getting the value of boolean properties. |
boolean |
getBoolProperty(String k)
Reply the value an boolean property, if not found reply false. |
boolean |
getBoolProperty(String k,
boolean defaultValue)
Reply the value an int property, if not found reply defaultValue. |
boolean |
getHighlight()
|
int |
getIntProperty(String k)
Reply the value an int property, if not found reply 0. |
int |
getIntProperty(String k,
int defaultValue)
Reply the value an int property, if not found reply defaultValue. |
Object |
getProperty(String k)
Reply the value of one property, if not found reply null. |
Object |
getProperty(String key,
Object defaultValue)
Reply the value of one property, if not found reply defaultValue. |
void |
inform(ToDoItem item)
When a critic produces a ToDoItem, both the Designer and the "offending" DesignMaterial's are notified. |
Enumeration |
keysIn(String cat)
|
void |
notifyObservers(Object arg)
|
void |
notifyPersistantObservers(Object arg)
|
Enumeration |
parents()
Enumerate over all my parents. |
void |
put(Hashtable ht)
|
boolean |
put(String k,
boolean v)
Convenient function for setting the value of boolean properties. |
boolean |
put(String k,
int v)
Convenient function for setting the value of boolean properties. |
boolean |
put(String k,
Object v)
Set the value of a property. |
(package private) void |
removeParent(Design d)
Remove the given parent. |
void |
removePendingItems(Designer dsgr)
Remove all the ToDoItem's generated by this DesignMaterial from the ToDoList of the given Designer. |
void |
removePersistObserver(Observer o)
|
Object |
removeProperty(String k)
Make the given property undefined. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
setHighlight(boolean h)
Draw the Designer's attention to this DesignMaterial in all views. |
void |
setProperty(String k,
boolean v)
|
void |
setProperty(String k,
int v)
|
void |
setProperty(String k,
Object v)
|
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Vector persistObservers
private transient Vector propertyListeners
private ToDoList pendingItems
private Vector parents
private Hashtable props
private boolean highlight
Constructor Detail |
public DesignMaterial()
public DesignMaterial(Hashtable ht)
ht
- the hashtableMethod Detail |
void addParent(Design d)
void removeParent(Design d)
public Enumeration parents()
public Object getProperty(String key, Object defaultValue)
key
- the key of the propertydefaultValue
- the default value if not found
public Object getProperty(String k)
k
- the key of the property
public Object get(String k)
k
- the key of the property
public Object get(String key, Object defaultValue)
key
- the key of the propertydefaultValue
- the default value if not found
public int getIntProperty(String k)
k
- the key of the property
public int getIntProperty(String k, int defaultValue)
k
- the key of the propertydefaultValue
- the default value of the property
public boolean getBoolProperty(String k)
k
- the key of the property
public boolean getBoolProperty(String k, boolean defaultValue)
k
- the key of the propertydefaultValue
- the default value of the property
public boolean put(String k, Object v)
k
- the key of the propertyv
- the value of the property
public void put(Hashtable ht)
ht
- the hashtablepublic boolean put(String k, boolean v)
k
- the key of the propertyv
- the value of the property
public boolean put(String k, int v)
k
- the key of the propertyv
- the value of the property
public void setProperty(String k, Object v)
k
- the key of the propertyv
- the value of the propertypublic void setProperty(String k, int v)
k
- the key of the propertyv
- the value of the propertypublic void setProperty(String k, boolean v)
k
- the key of the propertyv
- the value of the propertypublic boolean define(String k, Object v)
k
- the key of the propertyv
- the value of the property
public boolean canPut(String key)
key
- the key of the property
public Enumeration keysIn(String cat)
cat
- the category
public void define(String k, boolean v)
k
- the key of the propertyv
- the value of the propertypublic void define(String k, int v)
k
- the key of the propertyv
- the value of the propertypublic Object removeProperty(String k)
k
- the key of the property
null
if the key did not have a mappingpublic boolean getBoolean(String k)
k
- the key of the property
public void critique(Designer dsgr)
dsgr
- the designerpublic void removePendingItems(Designer dsgr)
dsgr
- the designerpublic void dispose()
public void inform(ToDoItem item)
TODO: do I need a Clarifier object in the framework?
item
- the todo itempublic void setHighlight(boolean h)
setHighlight
in interface org.tigris.gef.ui.Highlightable
Highlightable.setHighlight(boolean)
public boolean getHighlight()
getHighlight
in interface org.tigris.gef.ui.Highlightable
Highlightable.getHighlight()
public void changedProperty(String key)
key
- the key of the propertypublic void addPersistantObserver(Observer o)
o
- the observer to be addedpublic void removePersistObserver(Observer o)
o
- the observer to be removedpublic void notifyPersistantObservers(Object arg)
arg
- the argumentpublic void notifyObservers(Object arg)
Observable.notifyObservers(java.lang.Object)
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface org.tigris.gef.ui.Highlightable
Highlightable.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface org.tigris.gef.ui.Highlightable
Highlightable.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
propertyName
- the key of the propertyoldValue
- the old value of the propertynewValue
- the new value of the propertypublic void firePropertyChange(String propertyName, int oldValue, int newValue)
propertyName
- the key of the propertyoldValue
- the old value of the propertynewValue
- the new value of the propertypublic void firePropertyChange(String propertyName, Object oldValue, Object newValue)
propertyName
- the key of the propertyoldValue
- the old value of the propertynewValue
- the new value of the property
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |