Package adams.gui.tools.audioannotator
Class Binding
- java.lang.Object
-
- adams.gui.tools.audioannotator.Binding
-
public class Binding extends Object
Represents a key binding Bindings can be toggleable or not and can be inverted or not. An inverted binding just means that when pressed it will output false rather than true this makes it possible to represent a negative event X stops doing Y as well as positive events X does Y in the final output.- Author:
- sjb90
-
-
Field Summary
Fields Modifier and Type Field Description static long
DEFAULT_INTERVAL
protected KeyStroke
m_Binding
the keystroke the name is bound toprotected long
m_Interval
the interval to repete a toggleable bindingprotected boolean
m_Inverted
is the binding invertedprotected String
m_Name
the name of the bindingprotected boolean
m_Toggleable
is the binding toggleable?
-
Constructor Summary
Constructors Constructor Description Binding(adams.core.Properties props, String prefix)
Binding(String name, String binding, boolean toggle, long interval, boolean inverted)
Constructor for the binding class.Binding(String name, KeyStroke binding, boolean toggle, long interval, boolean inverted)
Constructor for the binding class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KeyStroke
getBinding()
getter for the keystroke of the bindinglong
getInterval()
a getter for the interval for this bindingString
getName()
getter for the name of the bindingboolean
isInverted()
getter for the inverted optionboolean
isToggleable()
getter for the toggleable optionadams.core.Properties
toProperty(int prefix)
Turns this Binding into a propertyString
toString()
-
-
-
Field Detail
-
DEFAULT_INTERVAL
public static final long DEFAULT_INTERVAL
- See Also:
- Constant Field Values
-
m_Name
protected String m_Name
the name of the binding
-
m_Binding
protected KeyStroke m_Binding
the keystroke the name is bound to
-
m_Toggleable
protected boolean m_Toggleable
is the binding toggleable?
-
m_Inverted
protected boolean m_Inverted
is the binding inverted
-
m_Interval
protected long m_Interval
the interval to repete a toggleable binding
-
-
Constructor Detail
-
Binding
public Binding(adams.core.Properties props, String prefix) throws InvalidKeyException
- Throws:
InvalidKeyException
-
Binding
public Binding(String name, String binding, boolean toggle, long interval, boolean inverted) throws InvalidKeyException
Constructor for the binding class.- Parameters:
name
- the name of the bindingbinding
- the key to bind to in String formattoggle
- is this binding toggleableinverted
- is this binding inverted- Throws:
InvalidKeyException
-
Binding
public Binding(String name, KeyStroke binding, boolean toggle, long interval, boolean inverted) throws InvalidKeyException
Constructor for the binding class.- Parameters:
name
- the name of the bindingbinding
- the key to bind to as a KeyStroketoggle
- is this binding toggleableinverted
- is this binding inverted- Throws:
InvalidKeyException
-
-
Method Detail
-
getName
public String getName()
getter for the name of the binding- Returns:
- the name of the binding
-
getBinding
public KeyStroke getBinding()
getter for the keystroke of the binding- Returns:
- the keystroke for this binding
-
isToggleable
public boolean isToggleable()
getter for the toggleable option- Returns:
- true if this binding is toggleable
-
isInverted
public boolean isInverted()
getter for the inverted option- Returns:
- true if this binding is inverted
-
toProperty
public adams.core.Properties toProperty(int prefix)
Turns this Binding into a property- Returns:
- a Properties object representing this key binding.
-
getInterval
public long getInterval()
a getter for the interval for this binding- Returns:
- the interval for this binding
-
-