Class DistractableDelegate

java.lang.Object
megamek.common.util.DistractableDelegate
All Implemented Interfaces:
Serializable, EventListener, Distractable

public class DistractableDelegate extends Object implements Distractable, Serializable
This class implements the Distractable interface. It is intended to be the underlying implementation for any class that implements the interface.
See Also:
  • 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:
      isIgnoringEvents in interface Distractable
      Returns:
      true if the listener is currently distracted, i.e. ignoring events.
    • setIgnoringEvents

      public void setIgnoringEvents(boolean distracted)
      Description copied from interface: Distractable
      Specify 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:
      setIgnoringEvents in interface Distractable
      Parameters:
      distracted - true if the listener should ignore events, false if the listener should pay attention
    • removeAllListeners

      public void removeAllListeners()
      Description copied from interface: Distractable
      Stop just ignoring events and actually stop listening to them.
      Specified by:
      removeAllListeners in interface Distractable