|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsm.SMTag
sm.SMExtensionalTag
A SMExtensionalTag
tag is a tag that can be explicitely attached to and detached from a shape,
i.e. a shape can be added to or removed to the tag's collection.
Constructor Summary | |
SMExtensionalTag(SMCanvas c)
Builds a SMTag that can tag the shapes displayed on the canvas c. |
Method Summary | |
void |
added(SMShape s)
Method called when this tag is added to an SMShape. |
SMExtensionalTag |
addTo(SMShape s)
Adds the shape s to the collection containing all the shapes that have this tag. |
abstract boolean |
hasNext()
Tests if there is other shapes tagged by this tag. |
abstract SMShape |
nextShape()
|
void |
removed(SMShape s)
Method called when this tag is removed from an SMShape. |
SMExtensionalTag |
removeFrom(SMShape s)
Removes the shape s from the collection containing all the shapes that have this tag. |
abstract void |
reset()
Inits the tag's iterator. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SMExtensionalTag(SMCanvas c)
c
- The canvas.Method Detail |
public abstract void reset()
SMTag
reset
in class SMTag
public abstract boolean hasNext()
SMTag
hasNext
in interface java.util.Iterator
hasNext
in class SMTag
Iterator.hasNext()
public abstract SMShape nextShape()
nextShape
in class SMTag
public void added(SMShape s)
s
- The SMShapepublic void removed(SMShape s)
s
- The SMShapepublic SMExtensionalTag addTo(SMShape s)
begin(SMShape)
, which can be redefined in subclasses
to specify side effects, such as changing the color of the attached object when the tag is added.
s
- The SMShape
added(SMShape)
public SMExtensionalTag removeFrom(SMShape s)
end(SMShape)
, which can be redefined in subclasses
to specify side effects, such as changing the color of the attached object when the tag is removed.
s
- The SMShape
removed(SMShape)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |