public abstract class CExtensionalTag extends CTag
A CExtensionalTag
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.
CTag
Constructor and Description |
---|
CExtensionalTag()
Builds a CExtensionalTag that can tag shapes.
|
CExtensionalTag(Canvas c)
Builds a CExtensionalTag that can tag the shapes displayed on the canvas c.
|
Modifier and Type | Method and Description |
---|---|
void |
added(CShape s)
Method called when this tag is added to an CShape.
|
CExtensionalTag |
addTo(CShape s)
Adds the shape s to the collection containing all the shapes that have this tag.
|
void |
removed(CShape s)
Method called when this tag is removed from an CShape.
|
CExtensionalTag |
removeFrom(CShape s)
Removes the shape s from the collection containing all the shapes that have this tag.
|
void |
reset()
Inits the tag's iterator.
|
above, aboveAll, action, action, addGhost, addTag, addTag, and, and, animate, attachSM, below, belowAll, contains, contains, contains, contains, detachSM, firstShape, fixReferenceShapeToCurrent, getAntialiasedShapes, getBoundingBox, getCanvas, getCenterX, getCenterY, getFilledShapes, getFirstAntialiasedShape, getFirstFilledShape, getFirstHavingTag, getFirstOutlinedShape, getIntersection, getMaxX, getMaxY, getMinX, getMinY, getOutlinedShapes, getTopLeastShape, getTopMostShape, hasNext, hasTag, hasTag, intersects, isAntialiased, isDrawable, isFilled, isOnOutline, isOutlined, isPickable, next, nextShape, or, or, removeGhost, removeTag, removeTag, rotateBy, rotateTo, scaleBy, scaleBy, scaleTo, scaleTo, setAntialiased, setClip, setDrawable, setFilled, setFillPaint, setOutlined, setOutlinePaint, setParent, setPickable, setReferencePoint, setRenderingHint, setShape, setStroke, setTransformToIdentity, setTransparencyFill, setTransparencyFill, setTransparencyOutline, setTransparencyOutline, tagsShape, translateBy, translateTo
getCollection, remove, size
public CExtensionalTag()
public CExtensionalTag(Canvas c)
c
- The canvaspublic void added(CShape s)
s
- The CShapepublic void removed(CShape s)
s
- The CShapepublic final CExtensionalTag addTo(CShape s)
begin(CShape)
, 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 CShapeadded(CShape)
public final CExtensionalTag removeFrom(CShape s)
end(CShape)
, 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 CShaperemoved(CShape)