001    package sale;
002    import java.io.*;
003    import sale.events.*;
004    import java.awt.Rectangle;
005    
006    /**
007     * A dummy display, that cannot display anything. This display is used for background processes that
008     * must not display any Form- or MenuSheets. All methods of this display, except
009     * {@link #isUseableDisplay} throw an {@link InvalidDisplayException}.
010     *
011     * @author Steffen Zschaler
012     * @version 2.0 27/05/1999
013     * @since v2.0
014     */
015    public final class NullDisplay implements Display {
016    
017        /**
018         * Private constructor to make sure the singleton pattern is used.
019         */
020        private NullDisplay() {
021            super();
022        }
023    
024        /**
025         * Throws an {@link InvalidDisplayException}.
026         *
027         * @override Never
028         */
029        public final void setFormSheet(FormSheet fs) {
030            throw new InvalidDisplayException();
031        }
032    
033        /**
034         * Throws an {@link InvalidDisplayException}.
035         *
036         * @override Never
037         */
038        public void setBounds(Rectangle r) {
039            throw new InvalidDisplayException();
040        }
041    
042        /**
043         * Throws an {@link InvalidDisplayException}.
044         *
045         * @override Never
046         */
047        public Rectangle getBounds() {
048            throw new InvalidDisplayException();
049        }
050    
051        /**
052         * Throws an {@link InvalidDisplayException}.
053         *
054         * @override Never
055         */
056        public FormSheet getFormSheet() {
057            throw new InvalidDisplayException();
058        }
059    
060        /**
061         * Throws an {@link InvalidDisplayException}.
062         *
063         * @override Never
064         */
065        public MenuSheet getMenuSheet() {
066            throw new InvalidDisplayException();
067        }
068    
069        /**
070         * Throws an {@link InvalidDisplayException}.
071         *
072         * @override Never
073         */
074        public final void closeFormSheet() {
075            throw new InvalidDisplayException();
076        }
077    
078        /**
079         * Throws an {@link InvalidDisplayException}.
080         *
081         * @override Never
082         */
083        public final void popUpFormSheet(FormSheet fs) {
084            throw new InvalidDisplayException();
085        }
086    
087        /**
088         * Throws an {@link InvalidDisplayException}.
089         *
090         * @override Never
091         */
092        public final void setMenuSheet(MenuSheet ms) {
093            throw new InvalidDisplayException();
094        }
095    
096        /**
097         * Returns false to indicate this display is not useable.
098         *
099         * @override Never
100         */
101        public final boolean isUseableDisplay() {
102            return false;
103        }
104    
105        /**
106         * Throws an {@link InvalidDisplayException}.
107         *
108         * @override Never
109         */
110        public final void addFormSheetListener(FormSheetListener fsl) {
111            throw new InvalidDisplayException();
112        }
113    
114        /**
115         * Throws an {@link InvalidDisplayException}.
116         *
117         * @override Never
118         */
119        public void removeFormSheetListener(FormSheetListener fsl) {
120            throw new InvalidDisplayException();
121        }
122    
123        /**
124         * Throws an {@link InvalidDisplayException}.
125         *
126         * @override Never
127         */
128        public void toFront() {}
129    
130        /**
131         * Throws an {@link InvalidDisplayException}.
132         *
133         * @override Never
134         */
135        public void load(ObjectInputStream ois) throws IOException, ClassNotFoundException {
136            throw new InvalidDisplayException();
137        }
138    
139        /**
140         * Throws an {@link InvalidDisplayException}.
141         *
142         * @override Never
143         */
144        public void save(ObjectOutputStream oos) throws IOException {
145            throw new InvalidDisplayException();
146        }
147    
148    
149        /**
150         * The singleton NullDisplay used in the entire application.
151         */
152        public static NullDisplay s_ndGlobal = new NullDisplay();
153    
154    
155    }