Class Binding
- java.lang.Object
-
- adams.gui.visualization.annotator.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.- Version:
- $Revision$
- Author:
- sjb90
-
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_INTERVALprotected KeyStrokem_Bindingthe keystroke the name is bound toprotected longm_Intervalthe interval to repete a toggleable bindingprotected booleanm_Invertedis the binding invertedprotected Stringm_Namethe name of the bindingprotected booleanm_Toggleableis 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 KeyStrokegetBinding()getter for the keystroke of the bindinglonggetInterval()a getter for the interval for this bindingStringgetName()getter for the name of the bindingbooleanisInverted()getter for the inverted optionbooleanisToggleable()getter for the toggleable optionadams.core.PropertiestoProperty(int prefix)Turns this Binding into a propertyStringtoString()
-
-
-
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
-
-