1 7 package javax.swing.event; 8 9 import java.awt.AWTEvent ; 10 import javax.swing.JInternalFrame ; 11 12 39 public class InternalFrameEvent extends AWTEvent { 40 41 44 public static final int INTERNAL_FRAME_FIRST = 25549; 45 46 49 public static final int INTERNAL_FRAME_LAST = 25555; 50 51 57 public static final int INTERNAL_FRAME_OPENED = INTERNAL_FRAME_FIRST; 58 59 70 public static final int INTERNAL_FRAME_CLOSING = 1 + INTERNAL_FRAME_FIRST; 71 72 81 public static final int INTERNAL_FRAME_CLOSED = 2 + INTERNAL_FRAME_FIRST; 82 83 90 public static final int INTERNAL_FRAME_ICONIFIED = 3 + INTERNAL_FRAME_FIRST; 91 92 98 public static final int INTERNAL_FRAME_DEICONIFIED = 4 + INTERNAL_FRAME_FIRST; 99 100 107 public static final int INTERNAL_FRAME_ACTIVATED = 5 + INTERNAL_FRAME_FIRST; 108 109 115 public static final int INTERNAL_FRAME_DEACTIVATED = 6 + INTERNAL_FRAME_FIRST; 116 117 122 public InternalFrameEvent(JInternalFrame source, int id) { 123 super(source, id); 124 } 125 126 132 public String paramString() { 133 String typeStr; 134 switch(id) { 135 case INTERNAL_FRAME_OPENED: 136 typeStr = "INTERNAL_FRAME_OPENED"; 137 break; 138 case INTERNAL_FRAME_CLOSING: 139 typeStr = "INTERNAL_FRAME_CLOSING"; 140 break; 141 case INTERNAL_FRAME_CLOSED: 142 typeStr = "INTERNAL_FRAME_CLOSED"; 143 break; 144 case INTERNAL_FRAME_ICONIFIED: 145 typeStr = "INTERNAL_FRAME_ICONIFIED"; 146 break; 147 case INTERNAL_FRAME_DEICONIFIED: 148 typeStr = "INTERNAL_FRAME_DEICONIFIED"; 149 break; 150 case INTERNAL_FRAME_ACTIVATED: 151 typeStr = "INTERNAL_FRAME_ACTIVATED"; 152 break; 153 case INTERNAL_FRAME_DEACTIVATED: 154 typeStr = "INTERNAL_FRAME_DEACTIVATED"; 155 break; 156 default: 157 typeStr = "unknown type"; 158 } 159 return typeStr; 160 } 161 162 163 169 170 public JInternalFrame getInternalFrame () { 171 return (source instanceof JInternalFrame )? (JInternalFrame )source : null; 172 } 173 174 175 } 176 | Popular Tags |