Package megamek.common.util
Class DistractableDelegate
java.lang.Object
megamek.common.util.DistractableDelegate
- All Implemented Interfaces:
Serializable,EventListener,Distractable
This class implements the Distractable interface. It is intended to be the underlying implementation for any class
that implements the interface.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a delegate object to handle the distraction state of another object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidStop just ignoring events and actually stop listening to them.voidsetIgnoringEvents(boolean distracted) Specify if the listener should be distracted.
-
Constructor Details
-
DistractableDelegate
public DistractableDelegate()Creates a delegate object to handle the distraction state of another object.
-
-
Method Details
-
isIgnoringEvents
public boolean isIgnoringEvents()- Specified by:
isIgnoringEventsin interfaceDistractable- Returns:
- true if the listener is currently distracted, i.e. ignoring events.
-
setIgnoringEvents
public void setIgnoringEvents(boolean distracted) Description copied from interface:DistractableSpecify if the listener should be distracted. An event that occurs while the listener is distracted is completely ignored, i.e. it is not processed, neither when it arrives nor at any later point.- Specified by:
setIgnoringEventsin interfaceDistractable- Parameters:
distracted- true if the listener should ignore events, false if the listener should pay attention
-
removeAllListeners
public void removeAllListeners()Description copied from interface:DistractableStop just ignoring events and actually stop listening to them.- Specified by:
removeAllListenersin interfaceDistractable
-