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

How to use
dispatchEvent
method
in
com.github.rinde.rinsim.event.EventDispatcher

Best Java code snippets using com.github.rinde.rinsim.event.EventDispatcher.dispatchEvent (Showing top 20 results out of 315)

origin: com.github.rinde/rinlog

@Override
public void receiveParcel(Auctioneer<T> auctioneer, Parcel p,
  long auctionStartTime) {
 LOGGER.info("{} receiveParcel {}", this, p);
 assignedParcels.add(p);
 eventDispatcher
  .dispatchEvent(new Event(CommunicatorEventType.CHANGE, this));
}
origin: com.github.rinde/rinsim-scenario

@SuppressWarnings("unchecked")
<T extends TimedEvent> void dispatch(T e) {
 ((TimedEventHandler<T>) handlers.get(e.getClass())).handleTimedEvent(e,
  simulator);
 disp.dispatchEvent(new ScenarioEvent(e));
}
origin: rinde/RinSim

@SuppressWarnings("unchecked")
<T extends TimedEvent> void dispatch(T e) {
 ((TimedEventHandler<T>) handlers.get(e.getClass())).handleTimedEvent(e,
  simulator);
 disp.dispatchEvent(new ScenarioEvent(e));
}
origin: rinde/RinSim

void addDevice(CommDevice device, CommUser user) {
 usersDevices.put(user, device);
 usersHasChanged = true;
 if (eventDispatcher.hasListenerFor(EventTypes.ADD_COMM_USER)) {
  eventDispatcher.dispatchEvent(new CommModelEvent(
   EventTypes.ADD_COMM_USER, this, device, user));
 }
}
origin: com.github.rinde/rinlog

@Override
public boolean releaseParcel(Parcel p) {
 checkArgument(!pdpModel.get().getParcelState(p).isPickedUp()
  && !pdpModel.get().getParcelState(p).isTransitionState());
 LOGGER.info("{} releaseParcel {}", this, p);
 checkArgument(assignedParcels.contains(p));
 assignedParcels.remove(p);
 checkState(!assignedParcels.contains(p));
 eventDispatcher
  .dispatchEvent(new Event(CommunicatorEventType.CHANGE, this));
 return true;
}
origin: rinde/RinSim

/**
 * Start the simulation.
 */
@Override
public final void start() {
 checkState(!isTicking(), "Time is already ticking.");
 isTicking = true;
 eventDispatcher.dispatchEvent(new Event(ClockEventType.STARTED, this));
 doStart();
 eventDispatcher.dispatchEvent(new Event(ClockEventType.STOPPED, this));
}
origin: com.github.rinde/rinsim-geom

@Override
public void addConnection(Connection<E> connection) {
 delegate.addConnection(connection);
 eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
  this, connection));
}
origin: rinde/RinSim

@Override
public void addConnection(Connection<E> connection) {
 delegate.addConnection(connection);
 eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
  this, connection));
}
origin: rinde/RinSim

@OverridingMethodsMustInvokeSuper
void cleanUpAfterException() {
 eventDispatcher.dispatchEvent(new Event(ClockEventType.STOPPED, this));
}
origin: com.github.rinde/rinsim-geom

@Override
public Optional<E> setConnectionData(Point from, Point to, E connectionData) {
 final Optional<E> val =
  delegate.setConnectionData(from, to, connectionData);
 eventDispatcher.dispatchEvent(new GraphEvent(
  EventTypes.CHANGE_CONNECTION_DATA, this, getConnection(from, to)));
 return val;
}
origin: rinde/RinSim

@Override
public Optional<E> removeConnectionData(Point from, Point to) {
 final Optional<E> val = delegate.removeConnectionData(from, to);
 eventDispatcher.dispatchEvent(new GraphEvent(
  EventTypes.CHANGE_CONNECTION_DATA, this, getConnection(from, to)));
 return val;
}
origin: rinde/RinSim

@Override
public void removeConnection(Point from, Point to) {
 final Connection<?> conn = delegate.getConnection(from, to);
 delegate.removeConnection(from, to);
 eventDispatcher
  .dispatchEvent(new GraphEvent(
   EventTypes.REMOVE_CONNECTION, this, conn));
}
origin: rinde/RinSim

@Override
public void removeObject(RoadUser roadUser) {
 checkArgument(registry().containsObject(roadUser),
  "RoadUser: %s does not exist.", roadUser);
 registry().removeObject(roadUser);
 objDestinations.remove(roadUser);
 eventDispatcher.dispatchEvent(new RoadModelEvent(
  RoadEventType.REMOVE_ROAD_USER, this, roadUser));
}
origin: com.github.rinde/rinsim-geom

@Override
public Optional<E> removeConnectionData(Point from, Point to) {
 final Optional<E> val = delegate.removeConnectionData(from, to);
 eventDispatcher.dispatchEvent(new GraphEvent(
  EventTypes.CHANGE_CONNECTION_DATA, this, getConnection(from, to)));
 return val;
}
origin: com.github.rinde/rinsim-geom

@Override
public void addConnection(Point from, Point to) {
 delegate.addConnection(from, to);
 eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
  this, getConnection(from, to)));
}
origin: rinde/RinSim

@Override
public void addConnection(Point from, Point to, E connData) {
 delegate.addConnection(from, to, connData);
 eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
  this, getConnection(from, to)));
}
origin: rinde/RinSim

@Override
public void addConnection(Point from, Point to) {
 delegate.addConnection(from, to);
 eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
  this, getConnection(from, to)));
}
origin: com.github.rinde/rinsim-geom

@Override
public void addConnection(Point from, Point to, E connData) {
 delegate.addConnection(from, to, connData);
 eventDispatcher.dispatchEvent(new GraphEvent(EventTypes.ADD_CONNECTION,
  this, getConnection(from, to)));
}
origin: com.github.rinde/rinsim-geom

@Override
public void removeConnection(Point from, Point to) {
 final Connection<?> conn = delegate.getConnection(from, to);
 delegate.removeConnection(from, to);
 eventDispatcher
  .dispatchEvent(new GraphEvent(
   EventTypes.REMOVE_CONNECTION, this, conn));
}
origin: rinde/RinSim

@Override
public void addObjectAt(RoadUser newObj, Point pos) {
 checkArgument(!registry().containsObject(newObj),
  "Object is already added: %s.", newObj);
 registry().addAt(newObj, pos);
 eventDispatcher.dispatchEvent(new RoadModelEvent(
  RoadEventType.ADD_ROAD_USER, this, newObj));
}
com.github.rinde.rinsim.eventEventDispatcherdispatchEvent

Javadoc

Dispatch an event. Notifies all listeners that are listening for this type of event.

Popular methods of EventDispatcher

  • <init>
    Creates a new EventDispatcher instance which is capable of dispatching any Event with a type attribu
  • getPublicEventAPI
    This method returns the public EventAPI instance associated to this EventDispatcher. This instance c
  • addListener
  • hasListenerFor
    Checks if the dispatcher has a listener for the specific event type.
  • containsListener
  • removeListener
  • add
    Adds the specified listener. From now on, the specified listener will be notified of events with one
  • checkCanDispatchEventType
  • safeDispatchEvent
  • update

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Sublime Text 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