Can't figure out code for changing line color in drawing applet
<p>I have a button in my applet that allows any shape drawn to be changed to the current drawn shape color. I have an if clause inside the change method but I can't figure out what needs to go inside the clause. Could anyone help?</p>

<p>The method:</p>

<pre><code>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(i) instanceof Line) { 
                if (shape.get(selectedInstance) instanceof Rectangle) {
                    ((Rectangle)shape.get(selectedInstance)).setFill(actionPanel.isFillChecked()); 
                }
            }
        }
    }
 }
</code></pre>
