|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.psika.numerist.Memento
cz.psika.numerist.ItemMemento
public class ItemMemento
Item history object.
Field Summary | |
---|---|
protected java.lang.Integer |
id
Internal entry identifier. |
protected java.lang.String |
sourceString
Source string. |
protected Style |
style
Style. |
Constructor Summary | |
---|---|
protected |
ItemMemento()
Constructor. |
Method Summary | |
---|---|
void |
addObserver(ItemObserver observer)
Attach observer to the object. |
protected void |
copyId(int identifier)
Copy identifier from original Item object. |
Memento |
createMemento()
Create history object. |
void |
deleteObserver(ItemObserver observer)
Detach observer. |
DiagramCanvas |
fetchDiagram(boolean thumbnail)
|
Entry |
fetchEntry()
Get entry representing the diagram or current Entry object. |
protected java.lang.Integer |
getId()
Get internal identifier. |
protected java.lang.String |
getString()
Get source string. |
protected Style |
getStyle()
Get entry's style. |
void |
notifyObservers(Constants.ItemEvents event)
Notify all attached observers. |
void |
setMemento(Memento memento)
Initialize object to state in the past. |
protected void |
setString(java.lang.String itemString)
Set source string. |
protected void |
setStyle(Style itemStyle)
Set style for the entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Integer id
protected java.lang.String sourceString
protected Style style
Constructor Detail |
---|
protected ItemMemento()
Method Detail |
---|
protected void setString(java.lang.String itemString)
itemString
- source string (not truncated)protected java.lang.String getString()
protected void setStyle(Style itemStyle)
itemStyle
- style to setprotected Style getStyle()
protected void copyId(int identifier)
Item
object.
Be very careful about use of this method.
Dont assign existing identifiers to different entries.
identifier
- internal identifierprotected java.lang.Integer getId()
public DiagramCanvas fetchDiagram(boolean thumbnail)
public Entry fetchEntry()
Item
Entry
object.
Beware of that the object returned is always original, not just copy.
This method is called often, so we need direct access to instance.
Whenever you need copy of the object, implement that functionality
elsewhere out of this interface.
fetchEntry
in interface Item
Entry
objectpublic Memento createMemento()
History
Memento
class is just abstract class,
because items and diagram variations need to save specific
values.
See classes derived from Memento
for next details.
createMemento
in interface History
Memento
used to save history statuspublic void setMemento(Memento memento)
History
setMemento
in interface History
memento
- Memento
object saving history statusHistory.createMemento()
public void addObserver(ItemObserver observer)
ItemObservable
addObserver
in interface ItemObservable
observer
- an observer to attachpublic void deleteObserver(ItemObserver observer)
ItemObservable
deleteObserver
in interface ItemObservable
observer
- to removepublic void notifyObservers(Constants.ItemEvents event)
ItemObservable
notifyObservers
in interface ItemObservable
event
- type of event to notify all registered observers
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |