|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.salespointframework.core.data.AbstractNameable
org.salespointframework.core.data.CatalogItemImpl
public abstract class CatalogItemImpl
Pure Java implementation of the CatalogItem
interface. See the documentation for
CatalogItem
for a description of the semantics of this class.
Field Summary |
---|
Fields inherited from class org.salespointframework.core.data.AbstractNameable |
---|
m_ncContext, m_pcsPropertyListeners, SOME_PROPERTY |
Fields inherited from interface org.salespointframework.core.data.interfaces.CatalogItem |
---|
VALUE_PROPERTY |
Fields inherited from interface org.salespointframework.core.data.interfaces.Nameable |
---|
NAME_PROPERTY |
Fields inherited from interface org.salespointframework.core.data.interfaces.DataBasketKeys |
---|
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY |
Constructor Summary | |
---|---|
CatalogItemImpl(java.lang.String sName)
Create a new CatalogItemImpl. |
|
CatalogItemImpl(java.lang.String sName,
Value vValue)
Create a new CatalogItemImpl. |
|
CatalogItemImpl(java.lang.String sName,
Value vValue,
java.net.URI imagefile)
Create a new CatalogItemImpl. |
Method Summary | ||
---|---|---|
void |
addValueListener(java.beans.PropertyChangeListener pcl)
Add a PropertyChangeListener that will receive events whenever the "value" property changes. |
|
int |
compareTo(java.lang.Object o)
Compare this CatalogItem to an object. |
|
boolean |
equals(java.lang.Object o)
Check whether two objects are equal. |
|
void |
firePropertyChanged()
Signals persistence layer to update objects values |
|
Catalog |
getCatalog()
Get the Catalog of this CatalogItem. |
|
java.awt.image.BufferedImage |
getImage()
Get the image of the CatalogItem |
|
protected byte[] |
getImageBytes()
retrieve image data as byte array |
|
protected
|
getInternalShallowClone()
Get a shallow clone of the CatalogItem. |
|
protected abstract CatalogItemImpl |
getShallowClone()
Get a shallow clone of the CatalogItem. |
|
Value |
getValue()
Get the item's value. |
|
boolean |
isEditable()
Return true if this CatalogItem is editable. |
|
void |
recover(java.util.Map<java.lang.String,java.lang.Object> data,
java.lang.Object recoveryContext,
boolean reInit)
Recover owner and context |
|
void |
removeValueListener(java.beans.PropertyChangeListener pcl)
Remove a PropertyChangeListener for the "value" property. |
|
boolean |
setImage(java.net.URI filename)
Set the image of the CatalogItem for performance reason, you have to call firePropertyChanged() separately |
|
protected void |
setImageBytes(byte[] data)
set image bytes and invalidate image cache |
|
protected void |
setValue(Value vNew)
Set the item's value. |
|
java.lang.String |
toString()
Return a String representation of the item. |
Methods inherited from class org.salespointframework.core.data.AbstractNameable |
---|
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.salespointframework.core.data.interfaces.Nameable |
---|
addNameListener, addPropertyChangeListener, attach, detachNC, getName, removeNameListener, removePropertyChangeListener, setName |
Methods inherited from interface org.salespointframework.core.data.interfaces.SpItem |
---|
getName |
Constructor Detail |
---|
public CatalogItemImpl(java.lang.String sName)
IntegerValue
of 0.
sName
- the name of the new item.public CatalogItemImpl(java.lang.String sName, Value vValue)
sName
- the name of the new item.vValue
- the value of the item.public CatalogItemImpl(java.lang.String sName, Value vValue, java.net.URI imagefile)
sName
- the name of the new item.vValue
- the value of the item.imagefile
- uri to imagefileMethod Detail |
---|
public boolean setImage(java.net.URI filename)
firePropertyChanged()
separately
setImage
in interface CatalogItem
filename
- uri, pointing to the image file
public java.awt.image.BufferedImage getImage()
getImage
in interface CatalogItem
protected byte[] getImageBytes()
protected void setImageBytes(byte[] data)
data
- new image as byte arraypublic Value getValue()
getValue
in interface CatalogItem
protected void setValue(Value vNew)
The method will fire a property change event for the "value" property.
public boolean isEditable()
public Catalog getCatalog()
getCatalog
in interface CatalogItem
public java.lang.String toString()
toString
in class java.lang.Object
protected abstract CatalogItemImpl getShallowClone()
protected <T extends CatalogItemImpl> T getInternalShallowClone()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable<java.lang.Object>
java.lang.ClassCastException
- if the given object cannot be cast into a CatalogItem.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public void addValueListener(java.beans.PropertyChangeListener pcl)
addValueListener
in interface CatalogItem
public void removeValueListener(java.beans.PropertyChangeListener pcl)
removeValueListener
in interface CatalogItem
public void recover(java.util.Map<java.lang.String,java.lang.Object> data, java.lang.Object recoveryContext, boolean reInit)
recover
in interface Recoverable
data
- field to value mappingreInit
- true, id recover was called more than one time on this objectpublic void firePropertyChanged()
firePropertyChanged
in interface CatalogItem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |