    01: import java.awt.*;
    02: import java.awt.geom.*;
    03:
    04: /**
    05:    A shape that manages its selection state.
    06: */
    07: public abstract class SelectableShape implements SceneShape
    08: {
    09:    public void setSelected(boolean b)
    10:    {
    11:       selected = b;
    12:    }
    13:
    14:    public boolean isSelected()
    15:    {
    16:       return selected;
    17:    }
    18:
    19:    public void drawSelection(Graphics2D g2)
    20:    {
    21:       translate(1, 1);
    22:       draw(g2);
    23:       translate(1, 1);
    24:       draw(g2);
    25:       translate(-2, -2);
    26:    }
    27:
    28:    private boolean selected;
    29: }