/**
 * @(#) ChangeLanguageAction.java 19.07.01
 *
 * jfem - a java finite element system
 *
 * Copyright (C) 1999-2001 HS-MD
 * jfem.support@jfem.de
 * www.jfem.de
 *
 * For License information see License.txt
 */

package org.app.action;

import java.util.*;
import java.awt.event.*;
import org.app.manager.*;
import org.app.manager.property.*;

/** Change the actual language of the GUI. */
/**
 *description:   defines a listener for changing the language
 *
 * @version     1.0  19.07.01
 * @author      Thomas Schmidt, Michael Wilhelem
 * @see         #org.jfem.Action.ChangePLAFAction Organisation:  FH Magdeburg
 */

public class ChangeLanguageAction implements ActionListener {
    /**
     * Create new object that stores the given language.
     * @param loc The locale to which the instance switch to.
     */
    public ChangeLanguageAction(Locale loc) {
        _locale = loc;
    }

    /**
     * Do the switching to locale stored in _locale.
     * @param e Not used.
     * @see #_locale
     */
    public void actionPerformed(ActionEvent e) {
        ((LocaleProperty)AppMan.getProperty(GlobalProperties.APP_LOCALE)).setValue(_locale);
    }

    /**
     * Do the switching to locale stored in _locale.
     * @param e delete
     * @see #_locale
     */
    public void actionPerformed() {
        ((LocaleProperty)AppMan.getProperty(GlobalProperties.APP_LOCALE)).setValue(_locale);
    }

    /** The locale this instance switch to. */
    private Locale _locale;
};
