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