Package de.hpi.eworld.observer

Examples of de.hpi.eworld.observer.ObserverNotification


      // when model belonged, but not anymore
      if (set.belongsToCurrentMap()) {
        checkBelongToMap(edges, set, false);
      }
    }
      this.notifyObservers(new ObserverNotification(NotificationType.datasetsChanged));
  }
View Full Code Here


      hasReachedThreshold = true;
    }

    if (!Arrays.equals(lastPosition, position) || hasReachedThreshold) {
      setChanged();
      notifyObservers(new ObserverNotification(NotificationType.elementChanged, this));
      clearChanged();
    }
  }
View Full Code Here

    this.messageTime = updateCount;
    this.sentCount++;

    if (!wasSendingMessage) {
      setChanged();
      notifyObservers(new ObserverNotification(NotificationType.elementChanged, this));
      clearChanged();
    }
  }
View Full Code Here

    this.receivingMessage = true;
    this.messageTime = updateCount;
    this.receivedCount++;

    setChanged();
    notifyObservers(new ObserverNotification(NotificationType.elementChanged, this));
    clearChanged();
  }
View Full Code Here

    importThread.addObserver(new Observer() {
      @Override
      public void update(Observable o, Object arg) {
        if (arg instanceof ObserverNotification) {
          final ObserverNotification notification = (ObserverNotification) arg;
          final NotificationType type = notification.getType();
         
          if (type.equals(NotificationType.sumoDumpThreadProgress)) {
            progressDialog.setProgressValue((Integer) arg);
          } else if(type.equals(NotificationType.sumoDumpThreadDone)) {
            threadDone();
View Full Code Here

  /**
   * Displays a message in the status bar and
   * emits {@link #dataImported} signal
   */
  private void threadDone() {
    observable.notifyObservers(new ObserverNotification(NotificationType.dataImported));
    //set status bar text
    StatisticsDataManager statManager = StatisticsDataManager.getInstance();
    int size = statManager.getLastDataset().numIntervals();
    MainStatusBar.getInstance().showMessage( "SUMO import successful. " + String.valueOf(size) + " intervals imported", 10000 );
   
View Full Code Here

    log.debug("ModelManager is empty: " + wasEmpty);
    if (!modelElements.containsKey(element.getInternalID())) {
      modelElements.put(element.getInternalID(), element);
     
      setChanged();
      notifyObservers(new ObserverNotification(NotificationType.elementAdded, element));

      if(wasEmpty) {
        setChanged();
        notifyObservers(new ObserverNotification(NotificationType.notEmpty));
        log.debug("Send notEmpty signal");
      }

      element.addObserver(this);
View Full Code Here

   */
  public boolean removeModelElement(ModelElement element) {
    if(modelElements.containsKey(element.getInternalID())) {
      modelElements.remove(element.getInternalID());
      setChanged();
      notifyObservers(new ObserverNotification(NotificationType.elementRemoved, element));
      element.deleteObserver(this);
      return true;
    } else {
      return false;
    }
View Full Code Here

   * This method is used as slot for the signal elementChanged from ModelElement to have a central accessing point.
   * @param element The ModelElement, which was changed.
   */
  public void modelElementChanged(ModelElement element) {
    setChanged();
    notifyObservers(new ObserverNotification(NotificationType.elementChanged, element));
  }
View Full Code Here

      e.deleteObserver(this);
    }
    modelElements = new HashMap<>();

    setChanged();
    notifyObservers(new ObserverNotification(NotificationType.modelCleared));

    //run garbage collection
    System.gc();
  }
View Full Code Here

TOP

Related Classes of de.hpi.eworld.observer.ObserverNotification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.