Class GraphicsServices

java.lang.Object
noaa.coastwatch.render.GraphicsServices

public class GraphicsServices extends Object
The graphics services class defines various static methods relating to the java.awt.Graphics2D class.
Since:
3.1.1
Author:
Peter Hollemans
  • Method Details

    • supportsAlpha

      public static boolean supportsAlpha(Graphics2D g)
      Determines if the graphics device supports colors with an alpha component.
    • isRasterDevice

      public static boolean isRasterDevice(Graphics2D g)
      Determines if the graphics device is raster-based as opposed to vector-based.
    • supportsBinaryWithTransparency

      public static boolean supportsBinaryWithTransparency(Graphics2D g)
      Determines if the graphics device supports a binary mask with a transparent color. If so, BufferedImage objects may be created with a BufferedImage.TYPE_BYTE_BINARY type and 2 color model in which one of the colors is transparent. The resulting mask image may be drawn over top of existing graphics content and the existing graphics will show through where the mask is set to be transparent. This does not work with all Java implementations, in which case a BufferedImage.TYPE_BYTE_INDEXED type must be used which requires more space in memory.
    • drawRect

      public static void drawRect(Graphics g, Rectangle rect)
      Draws a rectangle using a series of lines.
      Parameters:
      g - the graphics device to draw to.
      rect - the rectangle to draw.