View Javadoc
1   package nl.tudelft.simulation.dsol.web.animation;
2   
3   import java.awt.GraphicsConfiguration;
4   import java.awt.GraphicsDevice;
5   
6   import org.djutils.logger.CategoryLogger;
7   
8   import nl.tudelft.simulation.dsol.logger.Cat;
9   
10  /**
11   * HTMLDevice.java.
12   * <p>
13   * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
14   * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
15   * </p>
16   * @author <a href="https://github.com/averbraeck" target="_blank">Alexander Verbraeck</a>
17   */
18  public class HtmlDevice extends GraphicsDevice
19  {
20      /** the GraphicsConfigurations for this HTMLDevice. */
21      private GraphicsConfiguration[] htmlGraphicsConfigurations;
22  
23      /**
24       * @param htmlGraphicsConfiguration the GraphicsConfiguration to add to the HTMLDevice
25       */
26      public HtmlDevice(GraphicsConfiguration htmlGraphicsConfiguration)
27      {
28          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.<init>");
29          this.htmlGraphicsConfigurations = new GraphicsConfiguration[] {htmlGraphicsConfiguration};
30      }
31  
32      @Override
33      public int getType()
34      {
35          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getType()");
36          return GraphicsDevice.TYPE_RASTER_SCREEN;
37      }
38  
39      @Override
40      public String getIDstring()
41      {
42          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getIDString()");
43          return "HTMLDevice";
44      }
45  
46      @Override
47      public GraphicsConfiguration[] getConfigurations()
48      {
49          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getConfiguration()");
50          return this.htmlGraphicsConfigurations;
51      }
52  
53      @Override
54      public GraphicsConfiguration getDefaultConfiguration()
55      {
56          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getDefaultConfiguration()");
57          return this.htmlGraphicsConfigurations[0];
58      }
59  
60  }