@Override
    public void update(Observable o, Object arg) {
        //force une pause entre les différents messages
        try {
            Thread.sleep(Constante.TIME_SLEEP_BETWEEN_ACTION);
        } catch (InterruptedException ex) {
        }
        int hpEnnemy = getPlayer().getMediator().getHPForPokemon(getPlayer().getMediator().getEnnemyPokemon(getPlayer().getPokemon()));
        int hpOwn = getPlayer().getMediator().getHPForPokemon(getPlayer().getPokemon());

        progressBarHealthOwn.setValue((int) ((float) hpOwn / (float) getPlayer().getPokemon().getHp() * 100));

        System.out.println("------------------HP " + hpOwn);
        System.out.println("------------------HPF " + getPlayer().getPokemon().getHp());

        if (progressBarHealthOwn.getValue() <= 50) {
            if (progressBarHealthOwn.getValue() <= 20) {
                progressBarHealthOwn.setForeground(Color.RED);
            } else {
                progressBarHealthOwn.setForeground(Color.ORANGE);
            }
        }

        progressBarHealthEnnemy.setValue((int) ((float) hpEnnemy / (float) getPlayer().getMediator().getEnnemyPokemon(getPlayer().getPokemon()).getHp() * 100));

        if (progressBarHealthEnnemy.getValue() <= 50) {
            if (progressBarHealthEnnemy.getValue() <= 20) {
                progressBarHealthEnnemy.setForeground(Color.RED);
            } else {
                progressBarHealthEnnemy.setForeground(Color.ORANGE);
            }
        }

        labelOwnHP.setText(Integer.toString(hpOwn));
        labelEnnemyHP.setText(Integer.toString(hpEnnemy));
        switch (getPlayer().getActionCode()) {
            case SELECT_CODE:
                panelAttacks.setVisible(true);
                panelMessage.setVisible(false);
                break;
            case DEFEAT_CODE:
                labelMessage.setText("Défaite");
                panelMessage.add(btnClose);
                panelAttacks.setVisible(false);
                panelMessage.setVisible(true);
                break;
            case VICTORY_CODE:
                labelMessage.setText("Victoire");
                panelMessage.add(btnClose);
                panelAttacks.setVisible(false);
                panelMessage.setVisible(true);
                break;
            default:
            case MESSAGE_CODE:
                labelMessage.setText(getPlayer().getMessage());
                panelAttacks.setVisible(false);
                panelMessage.setVisible(true);
                break;
        }
    }