Examples of NotificationType


Examples of de.hpi.eworld.observer.NotificationType

  @SuppressWarnings("rawtypes")
  @Override
  public void update(Observable o, Object arg) {
    if (arg instanceof ObserverNotification) {
      ObserverNotification notification = (ObserverNotification) arg;
      NotificationType type = notification.getType();
     
      // dispatch events to methods handling a special event
      switch (type) {
        case itemButtonClicked:
          onItemButtonClicked((AbstractView) notification.getObj1(), (AbstractButton)notification.getObj2());
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

  @Override
  public void update(Observable o, Object arg) {
    if (arg instanceof ObserverNotification) {
      // cast notification and type.
      final ObserverNotification notification = (ObserverNotification) arg;
      final NotificationType type = notification.getType();
      // we're going to make some assumptions about the class of some
      // objects returned from the notification. those might be wrong,
      // hence the try/catch with ClassCastException.
      switch (type) {
      case startBatchProcess:
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

  @Override
  public void update(final Observable o, final Object arg) {
    if (arg instanceof ObserverNotification) {
      final ObserverNotification notification = (ObserverNotification) arg;
      final NotificationType type = notification.getType();

      switch (type) {
        case modelCleared:
          onModelCleared();
          break;
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

    simulationStatistic.observable.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.simulationStatisticClosed)) {
            onSimulationStatisticClosed();
          }
        }
      }
    });
   
    dump = new SumoDump();
    dump.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.importSuccessful)) {
            onNewImport();
          }
        }
      }
    });
   
    /*
    StatisticsDataManager.getInstance().sumoSimDone.connect(
        this, "onSimulationFinished(String)");
    */
    TriggerSumo.getInstance().observable.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.sumoDone)) {
            onSimulationFinished((String) arg);
          }
        }
      }
    });
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

    this.visualizerPlugin.getSimControlToolbar().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.simulationFinished)) {
            onSimulationFinished((String) arg);
          }
        }
      }
    });
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

  @Override
  public synchronized void update(final Observable o, final Object arg) {
    if (arg instanceof ObserverNotification) {
      final ObserverNotification notification = (ObserverNotification) arg;
      final NotificationType type = notification.getType();
      try {
        if (type.equals(NotificationType.loadFromFile)) {
          final PersistenceProviderInterface plugin = (PersistenceProviderInterface) notification.getObj1();
          final Collection<?> items = (Collection<?>) notification.getObj2();
          if (this == plugin) {
            loadFromFile(items);
          }
        } else if (type.equals(NotificationType.clearModel)) {
          final PersistenceProviderInterface plugin = (PersistenceProviderInterface) notification.getObj1();
          if (this == plugin) {
            clearModel();
          }
        }
        if (type.equals(NotificationType.saveToFile)) {
          final PersistenceProviderInterface plugin = (PersistenceProviderInterface) notification.getObj1();
          @SuppressWarnings("unchecked")
          final Collection<Object> items = (Collection<Object>) notification.getObj2();
          if (this == plugin) {
            saveToFile(items);
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

    ModelManager.getInstance().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.modelCleared)) {
            onNewModel();
          }
        }
      }
    });
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

    ModelManager.getInstance().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.elementAdded)) {
            if(arg instanceof ModelElement) {
              onModelElementAdded((ModelElement) arg);
            }
          }
        }
      }
    });
   
    ModelManager.getInstance().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.modelCleared)) {
            onModelCleared();
          }
        }
      }
    });
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

  @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.elementAdded)) {
        if(arg instanceof ModelElement) {
          onModelElementAdded((ModelElement) arg);
        }
      }
    }
View Full Code Here

Examples of de.hpi.eworld.observer.NotificationType

    if (arg instanceof ObserverNotification) {

      // cast notification and type.
      final ObserverNotification notification = (ObserverNotification) arg;
      final NotificationType type = notification.getType();

      logger.debug("Received notification: " + type.toString());
      switch (type) {
      case configFinished:
        storeSimulationSettings((SimulationSettings) notification.getObj1());
        break;
      case simulationError:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.