sm
Interface InteractiveObject

All Known Implementing Classes:
SMCanvas, SMShape, SMTag

public interface InteractiveObject

An interactive object is a graphical representation: a SMCanvas or a part of a SMCanvas. For instance, SMCanvas, SMTag and SMShape are interactive objects. A state machine can be attached to it to manage interaction with the objects belonging to this interactive object.

Author:
Caroline Appert

Method Summary
 void attachSM(StateMachine sm, boolean reset)
          Attaches a state machine to this interactive object to describe its behavior.
 boolean containsPoint(double x, double y)
          Tests if a point is in this interactive object.
 boolean containsPoint(java.awt.geom.Point2D point)
          Tests if a point is in this interactive object.
 void detachSM(StateMachine sm)
          Detaches a state machine from this interactive object.
 SMCanvas getCanvas()
          Returns the canvas in which this interactive object is displayed.
 

Method Detail

getCanvas

public SMCanvas getCanvas()
Returns the canvas in which this interactive object is displayed.

Returns:
Returns the canvas.

attachSM

public void attachSM(StateMachine sm,
                     boolean reset)
Attaches a state machine to this interactive object to describe its behavior.

Parameters:
sm - The State machine that describes the behavior of this interactive object.
reset - True if the machine must be reset, false otherwise.

detachSM

public void detachSM(StateMachine sm)
Detaches a state machine from this interactive object.

Parameters:
sm - The State machine to detach.

containsPoint

public boolean containsPoint(java.awt.geom.Point2D point)
Tests if a point is in this interactive object.

Parameters:
point - The point to test.
Returns:
Returns true if point is in this interactive object, false otherwise.

containsPoint

public boolean containsPoint(double x,
                             double y)
Tests if a point is in this interactive object.

Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
Returns:
Returns true if (x, y) is in this interactive object, false otherwise.