|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--dog.gui.DItem
Class to encapsulate the notion of an item.
This might be a list or (popup)menu item, or a node in a tree.
It can contain multiple fields, an icon, and an object reference.
| Field Summary | |
protected java.util.Hashtable |
fields
The fields contained in the item. |
protected java.awt.Image |
icon
The icon image. |
protected java.lang.String |
label
The default text to display in the item. |
protected java.util.Vector |
listeners
|
protected java.lang.Object |
reference
The object reference associated with the item. |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
DItem()
Constructs an item with the label "New item", and no icon. |
|
DItem(java.lang.String label)
Constructs an item with the specified label. |
|
DItem(java.lang.String label,
java.awt.Image icon)
Constructs an item with the specified label and icon. |
|
DItem(java.lang.String label,
java.awt.Image icon,
java.lang.Object reference)
Constructs an item with the specified label, icon and reference. |
|
DItem(java.lang.String label,
java.lang.String icon)
Constructs an item with the specified label and icon. |
|
DItem(java.lang.String label,
java.lang.String icon,
java.lang.Object reference)
Constructs an item with the specified label, icon and reference. |
|
DItem(java.lang.String label,
java.net.URL icon)
Constructs an item with the specified label and icon. |
|
DItem(java.lang.String label,
java.net.URL icon,
java.lang.Object reference)
Constructs an item with the specified label, icon and reference. |
|
| Method Summary | |
void |
addField(java.lang.String name,
java.lang.Object value)
Adds a field identified by the specified name. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds the specified property change listener to receive property change events from this item. |
boolean |
equals(java.lang.Object other)
Determines if this item is equal to another. |
java.lang.Object |
getField(java.lang.String name)
Returns the field identified by the specified name. |
java.lang.String[] |
getFieldNames()
Returns an array of the field names in the item. |
java.awt.Image |
getIcon()
Returns the icon. |
java.lang.String |
getLabel()
Returns the label. |
java.lang.Object |
getReference()
Returns the object reference. |
java.lang.String |
getText()
This is an alias for getLabel(). |
int |
hashCode()
Returns a hashcode value for storing this item in a hashtable. |
boolean |
imageUpdate(java.awt.Image image,
int flags,
int x,
int y,
int w,
int h)
The item's icon has arrived... |
protected java.lang.String |
paramString()
Returns a parameter string for this object. |
protected void |
processPropertyChangeEvent(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
Processes property changes on this item. |
void |
removeField(java.lang.String name)
Removes the field identified by the specified name. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the specified property change listener so it no longer receives property change events from this item. |
void |
setIcon(java.awt.Image icon)
Sets the icon. |
void |
setIcon(java.lang.String file)
Sets the icon from a file. |
void |
setIcon(java.net.URL url)
Sets the icon from a URL. |
void |
setLabel(java.lang.String label)
Sets the label. |
void |
setReference(java.lang.Object reference)
Sets the object reference. |
void |
setText(java.lang.String text)
This is an alias for setLabel(). |
java.lang.String |
toString()
Returns a string description of this object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String label
protected java.awt.Image icon
protected java.lang.Object reference
protected java.util.Hashtable fields
protected java.util.Vector listeners
| Constructor Detail |
public DItem()
public DItem(java.lang.String label)
public DItem(java.lang.String label,
java.awt.Image icon)
public DItem(java.lang.String label,
java.awt.Image icon,
java.lang.Object reference)
public DItem(java.lang.String label,
java.lang.String icon)
public DItem(java.lang.String label,
java.lang.String icon,
java.lang.Object reference)
public DItem(java.lang.String label,
java.net.URL icon)
public DItem(java.lang.String label,
java.net.URL icon,
java.lang.Object reference)
| Method Detail |
public java.lang.String getText()
getLabel()public void setText(java.lang.String text)
setLabel(java.lang.String)public java.lang.String getLabel()
setLabel(java.lang.String)public void setLabel(java.lang.String label)
label - the label text.getLabel()public java.awt.Image getIcon()
public void setIcon(java.awt.Image icon)
icon - the icon image.public void setIcon(java.lang.String file)
file - the image file.public void setIcon(java.net.URL url)
url - the image URL.
public boolean imageUpdate(java.awt.Image image,
int flags,
int x,
int y,
int w,
int h)
imageUpdate in interface java.awt.image.ImageObserverpublic java.lang.Object getReference()
getReference in interface Referentialpublic void setReference(java.lang.Object reference)
setReference in interface Referentialreference - the object reference to store.public java.lang.String[] getFieldNames()
getField(java.lang.String),
addField(java.lang.String, java.lang.Object),
removeField(java.lang.String)public java.lang.Object getField(java.lang.String name)
getFieldNames(),
addField(java.lang.String, java.lang.Object),
removeField(java.lang.String)
public void addField(java.lang.String name,
java.lang.Object value)
getFieldNames(),
getField(java.lang.String),
removeField(java.lang.String)public void removeField(java.lang.String name)
getFieldNames(),
getField(java.lang.String),
addField(java.lang.String, java.lang.Object)public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - the property change listenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - the property change listener
protected void processPropertyChangeEvent(java.lang.String name,
java.lang.Object oldValue,
java.lang.Object newValue)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String paramString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||