1 32 33 package it.businesslogic.ireport.gui.actions; 34 35 import it.businesslogic.ireport.OperationType; 36 import it.businesslogic.ireport.gui.command.FormatCommand; 37 import it.businesslogic.ireport.util.I18n; 38 import it.businesslogic.ireport.util.LanguageChangedEvent; 39 import it.businesslogic.ireport.util.LanguageChangedListener; 40 import javax.swing.AbstractAction ; 41 import javax.swing.ButtonModel ; 42 import javax.swing.ImageIcon ; 43 import javax.swing.KeyStroke ; 44 45 49 public class ActionShrinkSelected extends AbstractAction implements LanguageChangedListener 50 { 51 52 100 101 102 public ActionShrinkSelected() 103 { 104 107 putValue( ACTION_COMMAND_KEY, "shrinkselected"); 108 ImageIcon imageIcon = new javax.swing.ImageIcon (getClass().getResource("/it/businesslogic/ireport/icons/menu/elem_shrink.png")); 110 putValue(SMALL_ICON, imageIcon ); 111 112 this. 113 putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke( java.awt.event.KeyEvent.VK_S, java.awt.Event.CTRL_MASK + java.awt.Event.SHIFT_MASK )); 114 115 applyI18n(); 116 I18n.addOnLanguageChangedListener( this ); 117 } 118 119 public void languageChanged(LanguageChangedEvent evt) 120 { 121 applyI18n(); 122 } 123 124 public void actionPerformed( java.awt.event.ActionEvent evt) 125 { 126 FormatCommand.getCommand(OperationType.SHRINK).execute(); 127 } 128 129 public void applyI18n() 130 { 131 String description = it.businesslogic.ireport.util.I18n.getString( "gui.MainFrame.ShrinkSelected", "Shrink selected"); 132 putValue( NAME, description); 133 putValue(SHORT_DESCRIPTION, description); 134 } 135 136 } 137 | Popular Tags |