From 23316d54f1070101a4e5d618e8689d8edaea0b34 Mon Sep 17 00:00:00 2001 From: Marko Živković Date: Wed, 4 Mar 2015 01:41:52 +0000 Subject: Fix USB drive detection problems by using USBWorkspaceManager and refactoring related things git-svn-id: https://svn.code.sf.net/p/xlogo4schools/svn/trunk@35 3b0d7934-f7ef-4143-9606-b51f2e2281fd --- logo/src/xlogo/interfaces/PropertyChangePublisher.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'logo/src/xlogo/interfaces') diff --git a/logo/src/xlogo/interfaces/PropertyChangePublisher.java b/logo/src/xlogo/interfaces/PropertyChangePublisher.java index a953b8c..8cedafb 100644 --- a/logo/src/xlogo/interfaces/PropertyChangePublisher.java +++ b/logo/src/xlogo/interfaces/PropertyChangePublisher.java @@ -11,8 +11,8 @@ public class PropertyChangePublisher> implements Observable private boolean enableEvents = true; - private final HashMap> listeners = new HashMap<>(); - private final List allPropertiesListeners = new ArrayList<>(); + private final HashMap> listeners = new HashMap>(); + private final List allPropertiesListeners = new ArrayList(); @Override public void addPropertyChangeListener(E property, PropertyChangeListener listener) { @@ -26,7 +26,7 @@ public class PropertyChangePublisher> implements Observable } List list = listeners.get(property); if (list == null) { - list = new ArrayList<>(); + list = new ArrayList(); listeners.put(property, list); } list.add(listener); @@ -54,9 +54,15 @@ public class PropertyChangePublisher> implements Observable return; } setEnableEvents(false); - if (listeners.containsKey(property)) - listeners.get(property).forEach((listener) -> listener.propertyChanged()); - allPropertiesListeners.forEach((listener) -> listener.propertyChanged()); + if (listeners.containsKey(property)){ + for(PropertyChangeListener listener : listeners.get(property)){ + listener.propertyChanged(); + } + } + for(PropertyChangeListener listener : allPropertiesListeners){ + listener.propertyChanged(); + } + setEnableEvents(true); } -- cgit v1.2.3