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  /**
12   * HTMLDevice.java. <br>
13   * <br>
14   * Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
15   * for project information <a href="https://www.simulation.tudelft.nl/" target="_blank">www.simulation.tudelft.nl</a>. The
16   * source code and binary code of this software is proprietary information of Delft University of Technology.
17   * @author <a href="https://www.tudelft.nl/averbraeck" target="_blank">Alexander Verbraeck</a>
18   */
19  public class HTMLDevice extends GraphicsDevice
20  {
21      /** the GraphicsConfigurations for this HTMLDevice. */
22      private GraphicsConfiguration[] htmlGraphicsConfigurations;
23  
24      /**
25       * @param htmlGraphicsConfiguration GraphicsConfiguration; the GraphicsConfiguration to add to the HTMLDevice
26       */
27      public HTMLDevice(GraphicsConfiguration htmlGraphicsConfiguration)
28      {
29          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.<init>");
30          this.htmlGraphicsConfigurations = new GraphicsConfiguration[] {htmlGraphicsConfiguration};
31      }
32  
33      /** {@inheritDoc} */
34      @Override
35      public int getType()
36      {
37          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getType()");
38          return GraphicsDevice.TYPE_RASTER_SCREEN;
39      }
40  
41      /** {@inheritDoc} */
42      @Override
43      public String getIDstring()
44      {
45          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getIDString()");
46          return "HTMLDevice";
47      }
48  
49      /** {@inheritDoc} */
50      @Override
51      public GraphicsConfiguration[] getConfigurations()
52      {
53          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getConfiguration()");
54          return this.htmlGraphicsConfigurations;
55      }
56  
57      /** {@inheritDoc} */
58      @Override
59      public GraphicsConfiguration getDefaultConfiguration()
60      {
61          CategoryLogger.filter(Cat.WEB).trace("HTMLDevice.getDefaultConfiguration()");
62          return this.htmlGraphicsConfigurations[0];
63      }
64  
65  }