001 package sale.events;
002
003 import java.util.EventObject;
004
005 import sale.FormSheet;
006 import sale.Display;
007
008 /**
009 * An EventObject describing a FormSheet that was set or closed at a Display.
010 *
011 * @see sale.FormSheet
012 * @see sale.Display
013 *
014 * @author Steffen Zschaler
015 * @version 2.0 27/05/1999
016 * @since v2.0
017 */
018 public class FormSheetEvent extends EventObject {
019
020 /**
021 * ID for Serialization.
022 */
023 private static final long serialVersionUID = -8686843900758311771L;
024
025 /**
026 * The FormSheet that was affected by the event.
027 *
028 * @serial
029 */
030 private FormSheet m_fsFormSheet;
031
032 /**
033 * Was the event caused by an explicit call to the responsible method or was it caused indirectly?
034 *
035 * @serial
036 */
037 private boolean m_fExplicit;
038
039 /**
040 * Create a new FormSheetEvent.
041 *
042 * @param src the Display originating the event.
043 * @param fs the FormSheet that was affected by the event.
044 * @param fExplicit was the event caused by a direct call to the originating method or indirectly?
045 */
046 public FormSheetEvent(Display src, FormSheet fs, boolean fExplicit) {
047 super(src);
048
049 m_fsFormSheet = fs;
050 m_fExplicit = fExplicit;
051 }
052
053 /**
054 * Get the affected FormSheet.
055 *
056 * @override Never
057 */
058 public FormSheet getFormSheet() {
059 return m_fsFormSheet;
060 }
061
062 /**
063 * Was the event caused by a direct call to the originating method or indirectly?
064 *
065 * <p><code>formSheetSet</code> events are always considered explicit. In contrast,
066 * <code>formSheetRemoved</code> events are explicit only if they were originated as the consequence
067 * of a call to <code>closeFormSheet</code> or <code>setFormSheet (<b>null</b>)</code>. FormSheet
068 * removals that were caused by setting another FormSheet are not considered explicit.</p>
069 *
070 * @override Never
071 */
072 public boolean isExplicit() {
073 return m_fExplicit;
074 }
075 }