Package de.hpi.eworld.observer

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();
        final Object transportedObject = notification.getObj1();
        // 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){
View Full Code Here


  @Override
  public 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.itemHoverEntered)) {
          infoDock.onViewItemHoverEntered((AbstractView<?>) notification.getObj1());
        } else if (type.equals(NotificationType.itemHoverLeft)) {
          infoDock.onViewItemHoverLeft();
        } else if (type.equals(NotificationType.itemClicked)) {
          infoDock.onViewItemClicked((AbstractView<?>) notification.getObj1());
        } else if (type.equals(NotificationType.freeSpaceClicked)) {
          infoDock.onFreeSpaceClicked();
        }
      } catch (final ClassCastException e) {
        throw new IllegalArgumentException("ObserverNotification holds objects of unexpected type '"
                + arg.getClass().getSimpleName() + "'.", e);
View Full Code Here

TOP

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

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.