if (ShapeBrush.class.isInstance(currentBrush)) {
if (!(currentBrush instanceof CustomBrush)) {
    public void setCurrentTile(Tile tile) {        if (currentTile != tile) {            currentTile = tile;            if (ShapeBrush.class.isInstance(currentBrush)) {                ((ShapeBrush)currentBrush).setTile(tile);            }            tilePaletteButton.setTile(currentTile);        }    }