congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Listener
Code IndexAdd Tabnine to your IDE (free)

How to use
Listener
in
com.github.rinde.rinsim.event

Best Java code snippets using com.github.rinde.rinsim.event.Listener (Showing top 6 results out of 315)

origin: rinde/RinSim

void close() {
 if (!shell.isDisposed()) {
  display.asyncExec(new Runnable() {
   @Override
   public void run() {
    shell.close();
   }
  });
 }
 if (builder.callback().isPresent()) {
  builder.callback().get()
   .handleEvent(new Event(Clock.ClockEventType.STOPPED, null));
 }
}
origin: com.github.rinde/rinsim-event

public void safeDispatchEvent(Event e) {
 dispatching.incrementAndGet();
 final Set<Listener> targetListeners;
 synchronized (listeners) {
  checkCanDispatchEventType(e.getEventType());
  targetListeners = ImmutableSet.copyOf(listeners.get(e.getEventType()));
 }
 for (final Listener l : targetListeners) {
  l.handleEvent(e);
 }
 dispatching.decrementAndGet();
 update();
}
origin: rinde/RinSim

public void safeDispatchEvent(Event e) {
 dispatching.incrementAndGet();
 final Set<Listener> targetListeners;
 synchronized (listeners) {
  checkCanDispatchEventType(e.getEventType());
  targetListeners = ImmutableSet.copyOf(listeners.get(e.getEventType()));
 }
 for (final Listener l : targetListeners) {
  l.handleEvent(e);
 }
 dispatching.decrementAndGet();
 update();
}
origin: com.github.rinde/rinsim-event

/**
 * Dispatch an event. Notifies all listeners that are listening for this type
 * of event.
 * @param e The event to be dispatched, only events with a supported type can
 *          be dispatched.
 */
public void dispatchEvent(Event e) {
 synchronized (listeners) {
  dispatching.incrementAndGet();
  checkCanDispatchEventType(e.getEventType());
  for (final Listener l : listeners.get(e.getEventType())) {
   l.handleEvent(e);
  }
  dispatching.decrementAndGet();
 }
 update();
}
origin: rinde/RinSim

/**
 * Dispatch an event. Notifies all listeners that are listening for this type
 * of event.
 * @param e The event to be dispatched, only events with a supported type can
 *          be dispatched.
 */
public void dispatchEvent(Event e) {
 synchronized (listeners) {
  dispatching.incrementAndGet();
  checkCanDispatchEventType(e.getEventType());
  for (final Listener l : listeners.get(e.getEventType())) {
   l.handleEvent(e);
  }
  dispatching.decrementAndGet();
 }
 update();
}
origin: rinde/RinSim

@Override
public void show() {
 shell.open();
 for (final Listener l : listeners) {
  l.handleEvent(new Event(EventType.SHOW, this));
 }
 if (!builder.viewOptions().contains(ViewOption.ASYNC)) {
  while (!shell.isDisposed()) {
   if (!display.readAndDispatch()) {
    display.sleep();
   }
  }
  if (shell.isDisposed()) {
   clockController.stop();
  }
 }
}
com.github.rinde.rinsim.eventListener

Javadoc

Interface for listening to Events.

Most used methods

  • handleEvent
    Is called to notify the listener that an Event was issued.

Popular in Java

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • ImageIO (javax.imageio)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now