// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryAddedEvent.java
// public class CategoryAddedEvent extends EventObject {
//    private static final long serialVersionUID = 3366814253028410097L;
// 
//    private final Category addedCategory;
// 
//    public CategoryAddedEvent(PinBoard source, Category addedCategory) {
//       super(source);
//       this.addedCategory = addedCategory;
//    }
// 
//    @Override
//    public PinBoard getSource() {
//       return (PinBoard)source;
//    }
// 
//    public Category getAddedCategory() {
//       return addedCategory;
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryAddedEventListener.java
// public interface CategoryAddedEventListener extends EventListener {
//    void categoryAdded(CategoryAddedEvent event);
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryChangedEvent.java
// public class CategoryChangedEvent extends ObjectChangedEvent<Category> {
//    private static final long serialVersionUID = -1625574299332502650L;
// 
//    public CategoryChangedEvent(Category source) {
//       super(source);
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryChangedEventListener.java
// public interface CategoryChangedEventListener extends EventListener {
//    void categoryChanged(CategoryChangedEvent event);
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryRemovedEvent.java
// public class CategoryRemovedEvent extends EventObject {
//    private static final long serialVersionUID = 5340998352321719112L;
// 
//    private final Category removedCategory;
// 
//    public CategoryRemovedEvent(PinBoard source, Category removedCategory) {
//       super(source);
//       this.removedCategory = removedCategory;
//    }
// 
//    @Override
//    public PinBoard getSource() {
//       return (PinBoard)source;
//    }
// 
//    public Category getAddedCategory() {
//       return removedCategory;
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryRemovedEventListener.java
// public interface CategoryRemovedEventListener extends EventListener {
//    void categoryRemoved(CategoryRemovedEvent event);
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/settings/UserSettingsChangedEvent.java
// public class UserSettingsChangedEvent extends ObjectChangedEvent<UserSettings> {
//    private static final long serialVersionUID = -1625574299332502650L;
// 
//    public UserSettingsChangedEvent(UserSettings source) {
//       super(source);
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/settings/UserSettingsChangedEventListener.java
// public interface UserSettingsChangedEventListener extends EventListener {
//    void settingsChanged(UserSettingsChangedEvent event);
// }


import net.sourceforge.pinemup.core.model.CategoryAddedEvent;
import net.sourceforge.pinemup.core.model.CategoryAddedEventListener;
import net.sourceforge.pinemup.core.model.CategoryChangedEvent;
import net.sourceforge.pinemup.core.model.CategoryChangedEventListener;
import net.sourceforge.pinemup.core.model.CategoryRemovedEvent;
import net.sourceforge.pinemup.core.model.CategoryRemovedEventListener;
import net.sourceforge.pinemup.core.settings.UserSettingsChangedEvent;
import net.sourceforge.pinemup.core.settings.UserSettingsChangedEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package net.sourceforge.pinemup.ui.swing.tray;



public class TrayMenuUpdater implements CategoryChangedEventListener, UserSettingsChangedEventListener, CategoryAddedEventListener,
      CategoryRemovedEventListener {
   private static final Logger LOG = LoggerFactory.getLogger(TrayMenuUpdater.class);

   private final TrayMenu trayMenu;

   public TrayMenuUpdater(TrayMenu trayMenu) {
      this.trayMenu = trayMenu;
   }

   @Override
   public void settingsChanged(UserSettingsChangedEvent event) {
      trayMenu.initWithNewLanguage();
   }

   @Override
   public void categoryChanged(CategoryChangedEvent event) {
      LOG.debug("Received CategoryChangedEvent.");
      trayMenu.createCategoriesMenu();
   }

   @Override
   public void categoryRemoved(CategoryRemovedEvent event) {
      LOG.debug("Received CategoryRemovedEvent.");
      trayMenu.createCategoriesMenu();
   }

// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryAddedEvent.java
// public class CategoryAddedEvent extends EventObject {
//    private static final long serialVersionUID = 3366814253028410097L;
// 
//    private final Category addedCategory;
// 
//    public CategoryAddedEvent(PinBoard source, Category addedCategory) {
//       super(source);
//       this.addedCategory = addedCategory;
//    }
// 
//    @Override
//    public PinBoard getSource() {
//       return (PinBoard)source;
//    }
// 
//    public Category getAddedCategory() {
//       return addedCategory;
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryAddedEventListener.java
// public interface CategoryAddedEventListener extends EventListener {
//    void categoryAdded(CategoryAddedEvent event);
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryChangedEvent.java
// public class CategoryChangedEvent extends ObjectChangedEvent<Category> {
//    private static final long serialVersionUID = -1625574299332502650L;
// 
//    public CategoryChangedEvent(Category source) {
//       super(source);
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryChangedEventListener.java
// public interface CategoryChangedEventListener extends EventListener {
//    void categoryChanged(CategoryChangedEvent event);
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryRemovedEvent.java
// public class CategoryRemovedEvent extends EventObject {
//    private static final long serialVersionUID = 5340998352321719112L;
// 
//    private final Category removedCategory;
// 
//    public CategoryRemovedEvent(PinBoard source, Category removedCategory) {
//       super(source);
//       this.removedCategory = removedCategory;
//    }
// 
//    @Override
//    public PinBoard getSource() {
//       return (PinBoard)source;
//    }
// 
//    public Category getAddedCategory() {
//       return removedCategory;
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/model/CategoryRemovedEventListener.java
// public interface CategoryRemovedEventListener extends EventListener {
//    void categoryRemoved(CategoryRemovedEvent event);
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/settings/UserSettingsChangedEvent.java
// public class UserSettingsChangedEvent extends ObjectChangedEvent<UserSettings> {
//    private static final long serialVersionUID = -1625574299332502650L;
// 
//    public UserSettingsChangedEvent(UserSettings source) {
//       super(source);
//    }
// }
// 
// Path: src/main/java/net/sourceforge/pinemup/core/settings/UserSettingsChangedEventListener.java
// public interface UserSettingsChangedEventListener extends EventListener {
//    void settingsChanged(UserSettingsChangedEvent event);
// }


// Path: src/main/java/net/sourceforge/pinemup/ui/swing/tray/TrayMenuUpdater.java
import net.sourceforge.pinemup.core.model.CategoryAddedEvent;
import net.sourceforge.pinemup.core.model.CategoryAddedEventListener;
import net.sourceforge.pinemup.core.model.CategoryChangedEvent;
import net.sourceforge.pinemup.core.model.CategoryChangedEventListener;
import net.sourceforge.pinemup.core.model.CategoryRemovedEvent;
import net.sourceforge.pinemup.core.model.CategoryRemovedEventListener;
import net.sourceforge.pinemup.core.settings.UserSettingsChangedEvent;
import net.sourceforge.pinemup.core.settings.UserSettingsChangedEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

package net.sourceforge.pinemup.ui.swing.tray;



public class TrayMenuUpdater implements CategoryChangedEventListener, UserSettingsChangedEventListener, CategoryAddedEventListener,
      CategoryRemovedEventListener {
   private static final Logger LOG = LoggerFactory.getLogger(TrayMenuUpdater.class);

   private final TrayMenu trayMenu;

   public TrayMenuUpdater(TrayMenu trayMenu) {
      this.trayMenu = trayMenu;
   }

   @Override
   public void settingsChanged(UserSettingsChangedEvent event) {
      trayMenu.initWithNewLanguage();
   }

   @Override
   public void categoryChanged(CategoryChangedEvent event) {
      LOG.debug("Received CategoryChangedEvent.");
      trayMenu.createCategoriesMenu();
   }

   @Override
   public void categoryRemoved(CategoryRemovedEvent event) {
      LOG.debug("Received CategoryRemovedEvent.");
      trayMenu.createCategoriesMenu();
   }

   @Override