Source of MoveableShape.java


  1: import java.awt.*;

  3: /**
  4:    A shape that can be moved around.
  5: */
  6: public interface MoveableShape
  7: {
  8:    /**
  9:       Draws the shape.
 10:       @param g2 the graphics context
 11:    */
 12:    void draw(Graphics2D g2);
 13:    /**
 14:       Moves the shape by a given amount.
 15:       @param dx the amount to translate in x-direction
 16:       @param dy the amount to translate in y-direction
 17:    */
 18:    void translate(int dx, int dy);
 19: }