View Javadoc
1   package nl.tudelft.simulation.dsol.web.animation;
2   
3   import java.awt.Dialog.ModalExclusionType;
4   import java.awt.Dialog.ModalityType;
5   import java.awt.Dimension;
6   import java.awt.EventQueue;
7   import java.awt.Font;
8   import java.awt.FontMetrics;
9   import java.awt.Frame;
10  import java.awt.HeadlessException;
11  import java.awt.Image;
12  import java.awt.PrintJob;
13  import java.awt.Toolkit;
14  import java.awt.datatransfer.Clipboard;
15  import java.awt.font.TextAttribute;
16  import java.awt.im.InputMethodHighlight;
17  import java.awt.image.ColorModel;
18  import java.awt.image.ImageObserver;
19  import java.awt.image.ImageProducer;
20  import java.net.URL;
21  import java.util.Map;
22  import java.util.Properties;
23  
24  import org.djutils.logger.CategoryLogger;
25  
26  import nl.tudelft.simulation.dsol.logger.Cat;
27  
28  /**
29   * HTMLToolkit.java.
30   * <p>
31   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
32   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
33   * </p>
34   * @author <a href="https://github.com/averbraeck" target="_blank">Alexander Verbraeck</a>
35   */
36  @SuppressWarnings("restriction")
37  public class HtmlToolkit extends Toolkit
38  {
39      /** the queue of AWT events to process. */
40      EventQueue eventQueue = new EventQueue();
41  
42      /**
43       * 
44       */
45      public HtmlToolkit()
46      {
47      }
48  
49      /** {@inheritDoc} */
50      @Override
51      public Dimension getScreenSize() throws HeadlessException
52      {
53          CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getScreenSize()");
54          return null;
55      }
56  
57      /** {@inheritDoc} */
58      @Override
59      public int getScreenResolution() throws HeadlessException
60      {
61          CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getScreenResolution()");
62          return 0;
63      }
64  
65      /** {@inheritDoc} */
66      @Override
67      public ColorModel getColorModel() throws HeadlessException
68      {
69          CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getColorModel()");
70          return null;
71      }
72  
73      /** {@inheritDoc} */
74      @Override
75      public String[] getFontList()
76      {
77          CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getFontList()");
78          return null;
79      }
80  
81      /** {@inheritDoc} */
82      @Override
83      public FontMetrics getFontMetrics(Font font)
84      {
85          CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getFontMetrics()");
86          return null;
87      }
88  
89      /** {@inheritDoc} */
90      @Override
91      public void sync()
92      {
93          CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.sync()");
94      }
95  
96      /** {@inheritDoc} */
97      @Override
98      public Image getImage(String filename)
99      {
100         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getImage()");
101         return null;
102     }
103 
104     /** {@inheritDoc} */
105     @Override
106     public Image getImage(URL url)
107     {
108         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getImage()");
109         return null;
110     }
111 
112     /** {@inheritDoc} */
113     @Override
114     public Image createImage(String filename)
115     {
116         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.createImage()");
117         return null;
118     }
119 
120     /** {@inheritDoc} */
121     @Override
122     public Image createImage(URL url)
123     {
124         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.createImage()");
125         return null;
126     }
127 
128     /** {@inheritDoc} */
129     @Override
130     public boolean prepareImage(Image image, int width, int height, ImageObserver observer)
131     {
132         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.prepareImage()");
133         return false;
134     }
135 
136     /** {@inheritDoc} */
137     @Override
138     public int checkImage(Image image, int width, int height, ImageObserver observer)
139     {
140         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.checkImage()");
141         return 0;
142     }
143 
144     /** {@inheritDoc} */
145     @Override
146     public Image createImage(ImageProducer producer)
147     {
148         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.createImage()");
149         return null;
150     }
151 
152     /** {@inheritDoc} */
153     @Override
154     public Image createImage(byte[] imagedata, int imageoffset, int imagelength)
155     {
156         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.createImage()");
157         return null;
158     }
159 
160     /** {@inheritDoc} */
161     @Override
162     public PrintJob getPrintJob(Frame frame, String jobtitle, Properties props)
163     {
164         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getPrintJob()");
165         return null;
166     }
167 
168     /** {@inheritDoc} */
169     @Override
170     public void beep()
171     {
172         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.beep()");
173     }
174 
175     /** {@inheritDoc} */
176     @Override
177     public Clipboard getSystemClipboard() throws HeadlessException
178     {
179         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.getSystemClipboard()");
180         return null;
181     }
182 
183     /** {@inheritDoc} */
184     @Override
185     protected EventQueue getSystemEventQueueImpl()
186     {
187         CategoryLogger.filter(Cat.WEB)
188                 .trace("HTMLToolkit.getSystemEventQueueImpl() -- next event is " + this.eventQueue.peekEvent());
189         return this.eventQueue;
190     }
191 
192     /** {@inheritDoc} */
193     @Override
194     public boolean isModalityTypeSupported(ModalityType modalityType)
195     {
196         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.isModalityTypeSupported()");
197         return false;
198     }
199 
200     /** {@inheritDoc} */
201     @Override
202     public boolean isModalExclusionTypeSupported(ModalExclusionType modalExclusionType)
203     {
204         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.isModalExclusionTypeSupported()");
205         return false;
206     }
207 
208     /** {@inheritDoc} */
209     @Override
210     public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) throws HeadlessException
211     {
212         CategoryLogger.filter(Cat.WEB).trace("HTMLToolkit.mapInputMethodHighlight()");
213         return null;
214     }
215 
216 }