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.Rect; 30 import org.objectweb.fractal.swing.AbstractAction; 31 32 import java.awt.event.ActionEvent ; 33 import java.net.URL ; 34 35 import javax.swing.ImageIcon ; 36 37 42 43 public class MaximizeAction extends AbstractAction 44 implements BindingController 45 { 46 47 52 53 public final static String DISPLAY_BINDING = "display"; 54 55 58 59 private Display display; 60 61 64 65 public MaximizeAction () { 66 putValue(NAME, "Maximize"); 67 URL url = getClass().getResource( 68 "/org/objectweb/fractal/gui/resources/maximize.gif"); 69 putValue(SMALL_ICON, new ImageIcon (url)); 70 } 71 72 76 public String [] listFc () { 77 return new String [] { DISPLAY_BINDING }; 78 } 79 80 public Object lookupFc (final String clientItfName) { 81 if (DISPLAY_BINDING.equals(clientItfName)) { 82 return display; 83 } 84 return null; 85 } 86 87 public void bindFc ( 88 final String clientItfName, 89 final Object serverItf) 90 { 91 if (DISPLAY_BINDING.equals(clientItfName)) { 92 display = (Display)serverItf; 93 } 94 } 95 96 public void unbindFc (final String clientItfName) { 97 if (DISPLAY_BINDING.equals(clientItfName)) { 98 display = null; 99 } 100 } 101 102 106 public void actionPerformed (final ActionEvent e) { 107 display.setDisplayedArea(new Rect(0.01, 0.01, 0.99, 0.99)); 108 } 109 } 110 111 | Popular Tags |