001package jmri.jmrit.logixng;
002
003import java.awt.Toolkit;
004import java.awt.event.InputEvent;
005import java.awt.event.KeyEvent;
006
007/**
008 * An enum with the values "is" and "is not"
009 *
010 * @author Daniel Bergqvist 2019
011 */
012public enum FemaleSocketOperation {
013
014    Remove(Bundle.getMessage("FemaleSocketOperation_Remove"), KeyEvent.VK_R,
015            Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx() + InputEvent.SHIFT_DOWN_MASK),
016    InsertBefore(Bundle.getMessage("FemaleSocketOperation_InsertBefore")),
017    InsertAfter(Bundle.getMessage("FemaleSocketOperation_InsertAfter")),
018    MoveUp(Bundle.getMessage("FemaleSocketOperation_MoveUp")),
019    MoveDown(Bundle.getMessage("FemaleSocketOperation_MoveDown"));
020
021    private final String _text;
022    private final int _keyCode;
023    private final int _modifiers;
024
025    private FemaleSocketOperation(String text) {
026        this._text = text;
027        this._keyCode = 0;
028        this._modifiers = 0;
029    }
030
031    private FemaleSocketOperation(String text, int keyCode, int modifiers) {
032        this._text = text;
033        this._keyCode = keyCode;
034        this._modifiers = modifiers;
035    }
036
037    public boolean hasKey() {
038        return _keyCode != 0;
039    }
040
041    public int getKeyCode() {
042        return _keyCode;
043    }
044
045    public int getModifiers() {
046        return _modifiers;
047    }
048
049    @Override
050    public String toString() {
051        return _text;
052    }
053
054}