예제 #1
0
  private void communicate() {
    try {
      if (MapControl.getInstance().getMainMap().isPanEnabled()) {
        final ArrayList<Zone> zones = Communicator.getZones();

        if (zones != null && zones.size() > 0) {
          ZoneManager.getInstance().setZones(zones);
          MapControl.getInstance().updateUI();
        }
      }

      final ArrayList<Entity> recentEntities = Communicator.getRecentEntities();

      if (recentEntities != null && recentEntities.size() > 0) {
        EntityManager.getInstance().setEntities(recentEntities);
        MapControl.getInstance().updateUI();
      }

      final ArrayList<Entity> entities = Communicator.getEntities();

      if (entities != null && entities.size() > 0) {
        DataManager.getInstance().setData("entities", entities);
      }
    } catch (final MiddlewareNotReachableException e) {
      EventManager.getInstance().fireEvent("MiddlewareNotReachable", e);
    }
  }
예제 #2
0
 @Override
 public void run() {
   if (Simulator.getInstance().isEnabled()) {
     this.simulate();
   } else if (Communicator.getInstance().isOnline()) {
     this.communicate();
   }
 }