public interface CElement
Canvas
, a Tag
or a CShape
.
It can be linked to a state machine.Modifier and Type | Method and Description |
---|---|
CElement |
above(CElement before)
Changes the display list order so that every CShape contained in this CElement is right above
the top most shape in another CElement.
|
CElement |
aboveAll()
Calls
aboveAll() for every CShape contained in this CElement . |
void |
addGhost()
Calls addGhost() on every CShape contained in this
CElement . |
CElement |
addTag(CExtensionalTag t)
Calls
addTag(Canvas.Tag t) for every CShape contained in this CElement . |
CElement |
addTag(java.lang.String t)
Calls
addTag(String t) for every CShape contained in this CElement . |
CElement |
animate(Animation anim)
Calls
animate(Animation animTagScale) for every CShape contained in this CElement . |
void |
attachSM(CStateMachine sm,
boolean reset)
Attaches a state machine to this
CElement to describe its behavior. |
CElement |
below(CElement after)
Changes the display list order so that every CShape contained in this CElement is right below
the top least shape in another CElement.
|
CElement |
belowAll()
Calls
belowAll() for every CShape contained in this CElement . |
CShape |
contains(double x,
double y)
Returns the topmost CShape containing the point (x, y).
|
CShape |
contains(double x,
double y,
double w,
double h)
Returns the topmost CShape containing a given rectangle R.
|
CShape |
contains(java.awt.geom.Point2D p)
Returns the topmost CShape containing the point p.
|
CShape |
contains(java.awt.Rectangle r)
Returns the topmost CShape containing a given rectangle.
|
void |
detachSM(CStateMachine sm)
Detaches a state machine from this
CElement . |
CShape |
firstShape()
Returns the first shape contained in this
CElement . |
CElement |
fixReferenceShapeToCurrent() |
java.util.LinkedList<CShape> |
getAntialiasedShapes()
Returns the list of CShape that have this tag and that are antialiased.
|
CRectangle |
getBoundingBox() |
Canvas |
getCanvas()
Returns the canvas in which this CElement is displayed.
|
double |
getCenterX() |
double |
getCenterY() |
java.util.LinkedList<CShape> |
getFilledShapes()
Returns the list of CShape that have this tag and that are filled.
|
CShape |
getFirstAntialiasedShape()
Returns the first antialiased CShape contained in this
CElement . |
CShape |
getFirstFilledShape()
Returns the first CShape contained in this
CElement and that is filled. |
CShape |
getFirstHavingTag(CTag t)
Returns the topmost CShape that has tag t.
|
CShape |
getFirstOutlinedShape()
Returns the first CShape contained in this
CElement and that is outlined. |
CPolyLine |
getIntersection(CShape s)
Tests whether a
CShape s intersects this CElement . |
double |
getMaxX() |
double |
getMaxY() |
double |
getMinX() |
double |
getMinY() |
java.util.LinkedList<CShape> |
getOutlinedShapes()
Returns the list of CShape that have this tag and that are outlined.
|
boolean |
hasTag(CTag t)
Returns true if every shape with this tag also has tag t.
|
boolean |
hasTag(java.lang.String t)
Returns true if every shape with this tag also has tag t.
|
CShape |
intersects(CShape s)
Returns the topmost
CShape that intersects the given CShape s. |
boolean |
isAntialiased()
Calls
isAntialiased() for every CShape contained in this CElement . |
boolean |
isDrawable()
Returns true if every shape contained in this
CElement is drawable. |
boolean |
isFilled()
Calls
isFilled() for every CShape contained in this CElement . |
CShape |
isOnOutline(java.awt.geom.Point2D p)
Returns the topmost CShape whose outline contains the point p.
|
boolean |
isOutlined()
Returns true if every shape contained in this
CElement is outlined. |
boolean |
isPickable()
Returns true if every shape contained in this
CElement is pickable. |
void |
removeGhost()
Calls removeGhost() on every CShape contained in this
CElement . |
CElement |
removeTag(CExtensionalTag t)
Calls
removeTag(Tag t) for every CShape contained in this CElement only if t is a SMExtensionalTag ,
does nothing otherwise. |
CElement |
removeTag(java.lang.String t)
Calls
removeTag(String t) for every CShape contained in this CElement . |
CElement |
rotateBy(double dt)
Calls
rotateBy(double theta) for every CShape contained in this CElement . |
CElement |
rotateTo(double t)
Calls
rotateTo(double theta) for every CShape contained in this CElement . |
CElement |
scaleBy(double ds)
Calls
scaleBy(double s) for every CShape contained in this CElement . |
CElement |
scaleBy(double x,
double y)
Calls
scale(double sx, double sy) for every CShape contained in this CElement . |
CElement |
scaleTo(double s)
Calls
scaleTo(double s) for every CShape contained in this CElement . |
CElement |
scaleTo(double x,
double y)
Calls
scaleTo(double sx, double sy) for every CShape contained in this CElement . |
CElement |
setAntialiased(boolean a)
Calls
setAntialiased(boolean) for every CShape contained in this CElement . |
CElement |
setClip(CShape clip)
Calls
setClip(CShape clip) for every CShape contained in this CElement . |
CElement |
setDrawable(boolean f)
Calls
setDrawable(boolean) for every CShape contained in this CElement . |
CElement |
setFilled(boolean f)
Calls
setFilled(boolean) for every CShape contained in this CElement . |
CElement |
setFillPaint(java.awt.Paint fp)
Calls
setFillPaint(Paint fp) for every CShape contained in this CElement . |
CElement |
setOutlined(boolean f)
Calls
setOutlined(boolean) for every CShape contained in this CElement . |
CElement |
setOutlinePaint(java.awt.Paint op)
Calls
setOutlinePaint(Paint op) for every CShape contained in this CElement . |
CElement |
setParent(CShape parent)
Calls
setParent(CShape parent) for every CShape contained in this CElement . |
CElement |
setPickable(boolean pick)
Calls
setPickable(boolean) for every CShape contained in this CElement . |
CElement |
setReferencePoint(double x,
double y)
Calls
setReferencePoint(double x, double y) for every CShape contained in this CElement . |
CElement |
setRenderingHint(java.awt.RenderingHints.Key hintKey,
java.lang.Object hintValue)
Calls
setRenderingHint(hintKey, hintValue) for every CShape contained in this CElement . |
CElement |
setShape(java.awt.Shape sh)
Calls
setShape(Shape sh) for every CShape contained in this CElement . |
CElement |
setStroke(java.awt.Stroke str)
Calls
setStroke(Shape sh) for every CShape contained in this CElement . |
CElement |
setTransformToIdentity()
Calls
setTransformToIdentity() for every CShape contained in this CElement . |
CElement |
setTransparencyFill(java.awt.AlphaComposite transparencyFill)
Calls
setTransparencyFill(AlphaComposite transparencyFill) for every CShape contained in this CElement . |
CElement |
setTransparencyFill(float alpha)
Calls
setTransparencyFill(float alpha) for every CShape contained in this CElement . |
CElement |
setTransparencyOutline(java.awt.AlphaComposite transparencyOutline)
Calls
setTransparencyOutline(AlphaComposite transparencyOutline) for every CShape contained in this CElement . |
CElement |
setTransparencyOutline(float alpha)
Calls
setTransparencyOutline(float alpha) for every CShape contained in this CElement . |
CElement |
translateBy(double dx,
double dy)
Calls
translateBy(double tx, double ty) for every CShape contained in this CElement . |
CElement |
translateTo(double x,
double y)
Calls
translateTo(double tx, double ty) every CShape contained in this CElement . |
CElement fixReferenceShapeToCurrent()
void attachSM(CStateMachine sm, boolean reset)
CElement
to describe its behavior.sm
- The State machine that describes the behavior of this CElement
.reset
- True if the machine must be reset, false otherwise.void detachSM(CStateMachine sm)
CElement
.sm
- The State machine to detach.Canvas getCanvas()
CElement setShape(java.awt.Shape sh)
setShape(Shape sh)
for every CShape contained in this CElement
.sh
- The shapeCElement
CShape.setShape(java.awt.Shape)
CElement setParent(CShape parent)
setParent(CShape parent)
for every CShape contained in this CElement
.parent
- The parent shapeCElement
CShape.setParent(CShape)
CElement setStroke(java.awt.Stroke str)
setStroke(Shape sh)
for every CShape contained in this CElement
.str
- The strokeCElement
CShape.setStroke(java.awt.Stroke)
CElement setTransparencyFill(java.awt.AlphaComposite transparencyFill)
setTransparencyFill(AlphaComposite transparencyFill)
for every CShape contained in this CElement
.transparencyFill
- The transparencyCElement
CShape.setTransparencyFill(AlphaComposite)
CElement setTransparencyFill(float alpha)
setTransparencyFill(float alpha)
for every CShape contained in this CElement
.alpha
- The transparencyCElement
CShape.setTransparencyFill(float)
CElement setTransparencyOutline(java.awt.AlphaComposite transparencyOutline)
setTransparencyOutline(AlphaComposite transparencyOutline)
for every CShape contained in this CElement
.transparencyOutline
- The transparencyCElement
CShape.setTransparencyOutline(AlphaComposite)
CElement setTransparencyOutline(float alpha)
setTransparencyOutline(float alpha)
for every CShape contained in this CElement
.alpha
- The transparencyCElement
CShape.setTransparencyOutline(float)
CElement setFillPaint(java.awt.Paint fp)
setFillPaint(Paint fp)
for every CShape contained in this CElement
.fp
- The paint valueCElement
CShape.setFillPaint(Paint)
CElement setOutlinePaint(java.awt.Paint op)
setOutlinePaint(Paint op)
for every CShape contained in this CElement
.op
- The paint valueCElement
CShape.setOutlinePaint(Paint)
boolean isAntialiased()
isAntialiased()
for every CShape contained in this CElement
.CElement
is antialiased.CShape.isAntialiased()
java.util.LinkedList<CShape> getAntialiasedShapes()
CShape.isAntialiased()
CElement setAntialiased(boolean a)
setAntialiased(boolean)
for every CShape contained in this CElement
.a
- True to activate the antialiasing, false to deactivate it.CElement
CShape.setAntialiased(boolean)
CElement setRenderingHint(java.awt.RenderingHints.Key hintKey, java.lang.Object hintValue)
setRenderingHint(hintKey, hintValue)
for every CShape contained in this CElement
.
See java.awt.RenderingHints
for available hint keys and hint values.hintKey
- The hint keyhintValue
- The hint valueCElement
.boolean isFilled()
isFilled()
for every CShape contained in this CElement
.CElement
is filled.CShape.isFilled()
java.util.LinkedList<CShape> getFilledShapes()
CShape.isFilled()
CElement setFilled(boolean f)
setFilled(boolean)
for every CShape contained in this CElement
.f
- True if the shape must be filled, false otherwise.CElement
CShape.setFilled(boolean)
boolean isOutlined()
CElement
is outlined.CElement
is outlined.CShape.isOutlined()
java.util.LinkedList<CShape> getOutlinedShapes()
CShape.isOutlined()
CElement setOutlined(boolean f)
setOutlined(boolean)
for every CShape contained in this CElement
.f
- True if the shape must be outlined, false otherwise.CElement
CShape.setOutlined(boolean)
boolean isDrawable()
CElement
is drawable.CElement
is drawable.CShape.isDrawable()
CElement setDrawable(boolean f)
setDrawable(boolean)
for every CShape contained in this CElement
.f
- True if the shape must be drawn, false otherwise.CElement
CShape.setDrawable(boolean)
boolean isPickable()
CElement
is pickable.CElement
is pickable.CShape.isPickable()
CElement setPickable(boolean pick)
setPickable(boolean)
for every CShape contained in this CElement
.pick
- True if the shape must be pickable, false otherwise.CElement
CShape.setOutlined(boolean)
CElement setReferencePoint(double x, double y)
setReferencePoint(double x, double y)
for every CShape contained in this CElement
.x
- The x coordinate of the new reference point.y
- The y coordinate of the new reference point.CElement
CShape.setReferencePoint(double, double)
CElement setTransformToIdentity()
setTransformToIdentity()
for every CShape contained in this CElement
.CElement
CShape.setTransformToIdentity()
CElement translateBy(double dx, double dy)
translateBy(double tx, double ty)
for every CShape contained in this CElement
.dx
- The x offsetdy
- The y offsetCElement
CShape.translateBy(double, double)
CElement translateTo(double x, double y)
translateTo(double tx, double ty)
every CShape contained in this CElement
.x
- The x coordinatey
- The y coordinateCElement
CShape.translateTo(double, double)
CElement scaleBy(double x, double y)
scale(double sx, double sy)
for every CShape contained in this CElement
.x
- The x scale factory
- The y scale factorCElement
CShape.scaleBy(double, double)
CElement scaleBy(double ds)
scaleBy(double s)
for every CShape contained in this CElement
.ds
- The scale factorCElement
CShape.scaleBy(double)
CElement scaleTo(double x, double y)
scaleTo(double sx, double sy)
for every CShape contained in this CElement
.x
- The x scaley
- The y scaleCElement
CShape.scaleTo(double, double)
CElement scaleTo(double s)
scaleTo(double s)
for every CShape contained in this CElement
.s
- The scale valueCElement
CShape.scaleTo(double)
CElement rotateBy(double dt)
rotateBy(double theta)
for every CShape contained in this CElement
.dt
- The angle offsetCElement
CShape.rotateBy(double)
CElement rotateTo(double t)
rotateTo(double theta)
for every CShape contained in this CElement
.t
- The angleCElement
CShape.rotateTo(double)
CShape contains(double x, double y)
x
- The x coordinatey
- The y coordinateCShape.contains(double, double)
CShape contains(java.awt.geom.Point2D p)
p
- The point.CShape.contains(Point2D)
CShape contains(double x, double y, double w, double h)
x
- The x coordinate of the upper left corner of Ry
- The y coordinate of the upper left corner of Rw
- The width of Rh
- The height of RCShape.contains(double, double, double, double)
CShape contains(java.awt.Rectangle r)
r
- The rectangleCShape.contains(Rectangle)
CShape isOnOutline(java.awt.geom.Point2D p)
p
- The pointCShape.isOnOutline(Point2D)
CShape intersects(CShape s)
CShape
that intersects the given CShape
s.s
- The shapeCShape
that intersects the given CShape
, null if no CShape
intersects s.CShape.intersects(CShape)
CPolyLine getIntersection(CShape s)
CShape
s intersects this CElement
.s
- The shapeCPolyLine
if s intersects it, null otherwise.CShape.getIntersection(CShape)
CShape getFirstHavingTag(CTag t)
t
- The tagCShape.hasTag(fr.lri.swingstates.canvas.CTag)
boolean hasTag(java.lang.String t)
t
- The name of the tagCShape.hasTag(String)
boolean hasTag(CTag t)
t
- The tagCElement above(CElement before)
before
, this method does nothing.before
- The element that must be right below every shape contained in this CElement
in the display listCElement
CShape.below(CElement)
CElement aboveAll()
aboveAll()
for every CShape contained in this CElement
.CElement
CShape.aboveAll()
CElement below(CElement after)
after
, this method does nothing.after
- The element that must be right above every shape contained in this CElement
in the display listCShape.below(CElement)
CElement belowAll()
belowAll()
for every CShape contained in this CElement
.CElement
CShape.belowAll()
CElement setClip(CShape clip)
setClip(CShape clip)
for every CShape contained in this CElement
.clip
- The clipping shape, or null to reset clipping of this shapeCElement
CShape.setClip(CShape)
void addGhost()
CElement
.CShape.addGhost()
void removeGhost()
CElement
.CShape.removeGhost()
CRectangle getBoundingBox()
CElement
.double getMinX()
CElement
.double getMaxX()
CElement
.double getCenterX()
CElement
.double getMinY()
CElement
.double getMaxY()
CElement
.double getCenterY()
CElement
.CShape firstShape()
CElement
.CElement
, null if no shape is contained.CShape getFirstAntialiasedShape()
CElement
.CElement
, null if no CShape is antialiased.CShape.isAntialiased()
CShape getFirstFilledShape()
CElement
and that is filled.CElement
and that is filled, null if no CShape is filled.CShape.isFilled()
CShape getFirstOutlinedShape()
CElement
and that is outlined.CElement
and that is outlined, null if no CShape is outlined.CShape.isOutlined()
CElement addTag(CExtensionalTag t)
addTag(Canvas.Tag t)
for every CShape contained in this CElement
.t
- The tagCElement
CElement addTag(java.lang.String t)
addTag(String t)
for every CShape contained in this CElement
.t
- The name of the tagCElement
CShape.addTag(String)
CElement removeTag(CExtensionalTag t)
removeTag(Tag t)
for every CShape contained in this CElement
only if t is a SMExtensionalTag
,
does nothing otherwise.t
- The tagCElement
CShape.removeTag(CExtensionalTag)
CElement removeTag(java.lang.String t)
removeTag(String t)
for every CShape contained in this CElement
.t
- The name of the tagCElement
CShape.removeTag(String)
CElement animate(Animation anim)
animate(Animation animTagScale)
for every CShape contained in this CElement
.anim
- The animation to associate to each shape.CElement
CShape.animate(Animation)