package de.ugoe.cs.tasktree.keyboardmaps;

/**
 * TODO comment
 * 
 * @version $Revision: $ $Date: 11.07.2012$
 * @author 2012, last modified by $Author: patrick$
 */
public class KeyStroke {

    /** */
    private String keyStrokeName;

    /** */
    private VirtualKey virtualKey;

    /** */
    private boolean numlock;

    /** */
    private boolean localstate;

    /** */
    private boolean shift;

    /** */
    private boolean altgr;

    /** */
    private boolean inhibit;

    /** */
    private char character;

    /**
     * TODO: comment
     * 
     * @param keyStrokeName
     * @param mapKeyIdToVirtualKey
     * @param numlock
     * @param localstate
     * @param b
     * @param altgr
     * @param inhibit
     */
    public KeyStroke(String keyStrokeName,
                     VirtualKey virtualKey,
                     boolean numlock,
                     boolean localstate,
                     boolean shift,
                     boolean altgr,
                     boolean inhibit,
                     char character)
    {
        this.keyStrokeName = keyStrokeName;
        this.virtualKey = virtualKey;
        this.numlock = numlock;
        this.localstate = localstate;
        this.shift = shift;
        this.altgr = altgr;
        this.inhibit = inhibit;
        this.character = character;
    }

    /**
     * @return the keyStrokeName
     */
    public String getKeyStrokeName() {
        return keyStrokeName;
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public VirtualKey getVirtualKey() {
        return virtualKey;
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public char getCharacter() {
        return character;
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public boolean getInhibit() {
        return inhibit;
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public boolean getAltgr() {
        return altgr;
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public boolean getShift() {
        return shift;
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public boolean getLocalstate() {
        return localstate;
    }

    /**
     * TODO: comment
     * 
     * @return
     */
    public boolean getNumlock() {
        return numlock;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuffer toString = new StringBuffer();
        toString.append("KeyStroke(");
        toString.append(keyStrokeName);
        toString.append(", ");
        toString.append(virtualKey);

        if (character != Character.UNASSIGNED) {
            toString.append(", \'");
            toString.append(character);
            toString.append("\'");
        }

        if (shift) {
            toString.append(", shift");
        }

        if (altgr) {
            toString.append(", altgr");
        }

        if (numlock) {
            toString.append(", numlock");
        }

        if (localstate) {
            toString.append(", localstate");
        }

        if (inhibit) {
            toString.append(", inhibit");
        }

        toString.append(")");

        return toString.toString();
    }

}
