com.rolemodelsoft.drawlet
Interface SequenceOfFigures

All Known Subinterfaces:
Drawing, DrawingCanvas

public interface SequenceOfFigures
extends java.io.Serializable

A generic SequenceOfFigures from which Figures can be inserted, moved, and/or deleted.


Method Summary
 void addFigure(Figure figure)
          Add the figure to the receiver.
 void addFigureBehind(Figure figure, Figure existingFigure)
          Add the figure to the receiver, sticking it behind an existingFigure which is already there.
 Figure figureAt(int x, int y)
          Answer the figure at a given point
 FigureEnumeration figures()
          Answer a FigureEnumeration over the figures of the receiver.
 void moveFigureBehind(Figure figure, Figure existingFigure)
          Move the figure behind an existingFigure if it is not already there.
 void moveFigureInFront(Figure figure, Figure existingFigure)
          Move the figure in front of an existingFigure if it is not already there.
 void moveFigureToBack(Figure figure)
          Move the figure behind all other figures.
 void moveFigureToFront(Figure figure)
          Move the figure in front of all other figures.
 Figure otherFigureAt(Figure excludedFigure, int x, int y)
          Answer the figure at a given point excluding the identified figure
 void removeFigure(Figure figure)
          Remove the figure.
 

Method Detail

addFigure

public void addFigure(Figure figure)
Add the figure to the receiver.
Parameters:
figure - the figure to add

addFigureBehind

public void addFigureBehind(Figure figure,
                            Figure existingFigure)
Add the figure to the receiver, sticking it behind an existingFigure which is already there.
Parameters:
figure - the figure to add
existingFigure - the figure to which the new figure should be behind

figureAt

public Figure figureAt(int x,
                       int y)
Answer the figure at a given point
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the Figure at the given point

figures

public FigureEnumeration figures()
Answer a FigureEnumeration over the figures of the receiver.
Returns:
a FigureEnumeration over the figures of the receiver

moveFigureBehind

public void moveFigureBehind(Figure figure,
                             Figure existingFigure)
Move the figure behind an existingFigure if it is not already there. Reflect the change if it's visible.
Parameters:
figure - the figure to move
existingFigure - the figure to which the new figure should be behind

moveFigureInFront

public void moveFigureInFront(Figure figure,
                              Figure existingFigure)
Move the figure in front of an existingFigure if it is not already there. Reflect the change if it's visible.
Parameters:
figure - the figure to move
existingFigure - the figure to which the new figure should be in front

moveFigureToBack

public void moveFigureToBack(Figure figure)
Move the figure behind all other figures. Reflect the change if it's visible.
Parameters:
figure - the figure to add

moveFigureToFront

public void moveFigureToFront(Figure figure)
Move the figure in front of all other figures. Reflect the change if it's visible.
Parameters:
figure - the figure to add

otherFigureAt

public Figure otherFigureAt(Figure excludedFigure,
                            int x,
                            int y)
Answer the figure at a given point excluding the identified figure
Parameters:
figure - the figure to exclude from the search
x - the x coordinate
y - the y coordinate
Returns:
the Figure at the given point excluding the identified Figure

removeFigure

public void removeFigure(Figure figure)
Remove the figure. Implementors may choose to tell the figure to dispose of itself completely... It is recommended that this occur unless implementors have a reason for using a different strategy.
Parameters:
figure - the figure to remove