1 23 24 package org.objectweb.fractal.gui.graph.model; 25 26 import org.objectweb.fractal.api.control.BindingController; 27 28 import java.util.Map ; 29 import java.util.HashMap ; 30 import java.util.Iterator ; 31 32 35 36 public class DisplayNotifier implements DisplayListener, BindingController { 37 38 42 43 public final static String DISPLAY_LISTENERS_BINDING = "display-listeners"; 44 45 48 49 private Map displayListeners; 50 51 54 55 public DisplayNotifier () { 56 displayListeners = new HashMap (); 57 } 58 59 63 public String [] listFc () { 64 return (String [])displayListeners.keySet().toArray( 65 new String [displayListeners.size()]); 66 } 67 68 public Object lookupFc (final String clientItfName) { 69 if (clientItfName.startsWith(DISPLAY_LISTENERS_BINDING)) { 70 return displayListeners.get(clientItfName); 71 } 72 return null; 73 } 74 75 public void bindFc ( 76 final String clientItfName, 77 final Object serverItf) 78 { 79 if (clientItfName.startsWith(DISPLAY_LISTENERS_BINDING)) { 80 displayListeners.put(clientItfName, serverItf); 81 } 82 } 83 84 public void unbindFc (final String clientItfName) { 85 if (clientItfName.startsWith(DISPLAY_LISTENERS_BINDING)) { 86 displayListeners.remove(clientItfName); 87 } 88 } 89 90 94 public void displayedAreaChanged (final Rect oldValue) { 95 Iterator i = displayListeners.values().iterator(); 96 while (i.hasNext()) { 97 ((DisplayListener)i.next()).displayedAreaChanged(oldValue); 98 } 99 } 100 101 public void antialiasingChanged () { 102 Iterator i = displayListeners.values().iterator(); 103 while (i.hasNext()) { 104 ((DisplayListener)i.next()).antialiasingChanged(); 105 } 106 } 107 108 public void maxDepthChanged () { 109 Iterator i = displayListeners.values().iterator(); 110 while (i.hasNext()) { 111 ((DisplayListener)i.next()).maxDepthChanged(); 112 } 113 } 114 115 public void itfNameDisplayModeChanged () { 116 Iterator i = displayListeners.values().iterator(); 117 while (i.hasNext()) { 118 ((DisplayListener)i.next()).itfNameDisplayModeChanged(); 119 } 120 } 121 } 122 123 | Popular Tags |