Exemplo n.º 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);
    }
  }
Exemplo n.º 2
0
  @SuppressWarnings("unchecked")
  private void simulate() {
    final ArrayList<Entity> recentEntities =
        (ArrayList<Entity>) DataManager.getInstance().getData("recentEntities");

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