@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);