1 23 24 package org.objectweb.fractal.gui.graph.control; 25 26 import org.objectweb.fractal.api.control.BindingController; 27 28 import org.objectweb.fractal.gui.graph.model.Display; 29 import org.objectweb.fractal.gui.graph.model.DisplayListener; 30 import org.objectweb.fractal.gui.graph.model.Rect; 31 import org.objectweb.fractal.swing.AbstractAction; 32 33 import java.awt.event.ActionEvent ; 34 import java.net.URL ; 35 36 import javax.swing.ImageIcon ; 37 import javax.swing.KeyStroke ; 38 39 45 46 public class ChangeItfDisplayAction extends AbstractAction implements 47 DisplayListener, 48 BindingController 49 { 50 51 56 57 public final static String DISPLAY_BINDING = "display"; 58 59 62 63 private Display display; 64 65 68 69 public ChangeItfDisplayAction () { 70 putValue(NAME, "Change Display Itf Name"); 71 putValue(SHORT_DESCRIPTION, "Change Display Itf Name"); 72 URL url = getClass().getResource( 73 "/org/objectweb/fractal/gui/resources/empty.gif"); 74 putValue(SMALL_ICON, new ImageIcon (url)); 75 putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("alt R")); 76 } 77 78 82 public String [] listFc () { 83 return new String [] { DISPLAY_BINDING }; 84 } 85 86 public Object lookupFc (final String clientItfName) { 87 if (DISPLAY_BINDING.equals(clientItfName)) { 88 return display; 89 } 90 return null; 91 } 92 93 public void bindFc ( 94 final String clientItfName, 95 final Object serverItf) 96 { 97 if (DISPLAY_BINDING.equals(clientItfName)) { 98 display = (Display)serverItf; 99 } 100 } 101 102 public void unbindFc (final String clientItfName) { 103 if (DISPLAY_BINDING.equals(clientItfName)) { 104 display = null; 105 } 106 } 107 108 112 public void displayedAreaChanged (final Rect oldValue) { 113 } 115 116 public void antialiasingChanged () { 117 } 119 120 public void maxDepthChanged () { 121 } 123 124 public void itfNameDisplayModeChanged() { 125 } 126 127 131 public void actionPerformed (final ActionEvent e) { 132 display.setItfNameDisplayMode(); 133 } 134 } 135 | Popular Tags |