Can't figure out how to make line shape change color like other shapes
<p>I'm working on a drawing applet and currently can only get other shapes to change color when the change button is selected, but I cannot figure out what code needs to be added to get the line shape to work like the others.</p>

<p>Here is the method for the change button:</p>

<pre><code> public void mousePressed(MouseEvent e) { 

   if (model.getAction() == Model.Actions.CHANGE) {
        selectedInstance = model.getSelectedInstance(e.getX(), e.getY());
        if (selectedInstance != -1) {
            Shape selected = model.getShapes().get(selectedInstance);
            startX = selected.getX();
            startY = selected.getY();
            int width = selected.getWidth();
            int height = selected.getHeight();
            if (shape.get(selectedInstance) != null) {
                shape.get(selectedInstance).setLineColor(colorPanel.getLineColorSelection());
                shape.get(selectedInstance).setFillColor(colorPanel.getFillColorSelection());
                if (shape.get(selectedInstance) instanceof Rectangle) {
                    ((Rectangle) shape.get(selectedInstance)).setFill(actionPanel.isFillChecked());
                }
            }
        }
    }
    model.getContainer().repaint();
}
</code></pre>
