001/* 002 * Copyright 2010-2015 Institut Pasteur. 003 * 004 * This file is part of Icy. 005 * 006 * Icy is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * Icy is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with Icy. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package icy.gui.frame; 020 021import java.awt.AWTEvent; 022import java.awt.event.WindowEvent; 023 024import javax.swing.event.InternalFrameEvent; 025 026/** 027 * @author stephane 028 */ 029public class IcyFrameEvent 030{ 031 private final IcyFrame frame; 032 033 private final InternalFrameEvent internalFrameEvent; 034 private final WindowEvent externalFrameEvent; 035 036 /** 037 * @param frame 038 * @param internalFrameEvent 039 * @param externalFrameEvent 040 */ 041 public IcyFrameEvent(IcyFrame frame, InternalFrameEvent internalFrameEvent, WindowEvent externalFrameEvent) 042 { 043 super(); 044 045 this.frame = frame; 046 this.internalFrameEvent = internalFrameEvent; 047 this.externalFrameEvent = externalFrameEvent; 048 } 049 050 /** 051 * @return the frame 052 */ 053 public IcyFrame getFrame() 054 { 055 return frame; 056 } 057 058 /** 059 * @return the internalFrameEvent 060 */ 061 public InternalFrameEvent getInternalFrameEvent() 062 { 063 return internalFrameEvent; 064 } 065 066 /** 067 * @return the externalFrameEvent 068 */ 069 public WindowEvent getExternalFrameEvent() 070 { 071 return externalFrameEvent; 072 } 073 074 /** 075 * Return the active event 076 */ 077 public AWTEvent getEvent() 078 { 079 if (internalFrameEvent != null) 080 return internalFrameEvent; 081 082 return externalFrameEvent; 083 } 084 085}