Class AwtGraphicFactory

  • All Implemented Interfaces:
    org.mapsforge.core.graphics.GraphicFactory

    public class AwtGraphicFactory
    extends java.lang.Object
    implements org.mapsforge.core.graphics.GraphicFactory
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.mapsforge.core.graphics.GraphicFactory INSTANCE  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void clearResourceFileCache()  
      static void clearResourceMemoryCache()  
      org.mapsforge.core.graphics.Bitmap createBitmap​(int width, int height)  
      org.mapsforge.core.graphics.Bitmap createBitmap​(int width, int height, boolean isTransparent)  
      org.mapsforge.core.graphics.Canvas createCanvas()  
      int createColor​(int alpha, int red, int green, int blue)  
      int createColor​(org.mapsforge.core.graphics.Color color)  
      static org.mapsforge.core.graphics.GraphicContext createGraphicContext​(java.awt.Graphics graphics)  
      org.mapsforge.core.graphics.Matrix createMatrix()  
      AwtHillshadingBitmap createMonoBitmap​(int width, int height, byte[] buffer, int padding, org.mapsforge.core.model.BoundingBox area)  
      org.mapsforge.core.graphics.Paint createPaint()  
      org.mapsforge.core.graphics.Paint createPaint​(org.mapsforge.core.graphics.Paint paint)  
      org.mapsforge.core.graphics.Path createPath()  
      org.mapsforge.core.mapelements.PointTextContainer createPointTextContainer​(org.mapsforge.core.model.Point xy, org.mapsforge.core.graphics.Display display, int priority, java.lang.String text, org.mapsforge.core.graphics.Paint paintFront, org.mapsforge.core.graphics.Paint paintBack, org.mapsforge.core.mapelements.SymbolContainer symbolContainer, org.mapsforge.core.graphics.Position position, int maxTextWidth)  
      org.mapsforge.core.graphics.ResourceBitmap createResourceBitmap​(java.io.InputStream inputStream, float scaleFactor, int width, int height, int percent, int hash)  
      org.mapsforge.core.graphics.TileBitmap createTileBitmap​(int tileSize, boolean hasAlpha)  
      org.mapsforge.core.graphics.TileBitmap createTileBitmap​(java.io.InputStream inputStream, int tileSize, boolean hasAlpha)  
      static java.awt.image.BufferedImage getBitmap​(org.mapsforge.core.graphics.Bitmap bitmap)
      Returns the internal image representation.
      static java.awt.Graphics2D getGraphics​(org.mapsforge.core.graphics.Canvas canvas)  
      static AwtPaint getPaint​(org.mapsforge.core.graphics.Paint paint)  
      java.io.InputStream platformSpecificSources​(java.lang.String relativePathPrefix, java.lang.String src)  
      org.mapsforge.core.graphics.ResourceBitmap renderSvg​(java.io.InputStream inputStream, float scaleFactor, int width, int height, int percent, int hash)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INSTANCE

        public static final org.mapsforge.core.graphics.GraphicFactory INSTANCE
    • Constructor Detail

      • AwtGraphicFactory

        public AwtGraphicFactory()
    • Method Detail

      • createGraphicContext

        public static org.mapsforge.core.graphics.GraphicContext createGraphicContext​(java.awt.Graphics graphics)
      • getGraphics

        public static java.awt.Graphics2D getGraphics​(org.mapsforge.core.graphics.Canvas canvas)
      • getPaint

        public static AwtPaint getPaint​(org.mapsforge.core.graphics.Paint paint)
      • clearResourceFileCache

        public static void clearResourceFileCache()
      • clearResourceMemoryCache

        public static void clearResourceMemoryCache()
      • createBitmap

        public org.mapsforge.core.graphics.Bitmap createBitmap​(int width,
                                                               int height)
        Specified by:
        createBitmap in interface org.mapsforge.core.graphics.GraphicFactory
      • createBitmap

        public org.mapsforge.core.graphics.Bitmap createBitmap​(int width,
                                                               int height,
                                                               boolean isTransparent)
        Specified by:
        createBitmap in interface org.mapsforge.core.graphics.GraphicFactory
      • getBitmap

        public static java.awt.image.BufferedImage getBitmap​(org.mapsforge.core.graphics.Bitmap bitmap)
        Returns the internal image representation.
        Parameters:
        bitmap - Mapsforge Bitmap
        Returns:
        platform specific image.
      • createCanvas

        public org.mapsforge.core.graphics.Canvas createCanvas()
        Specified by:
        createCanvas in interface org.mapsforge.core.graphics.GraphicFactory
      • createColor

        public int createColor​(org.mapsforge.core.graphics.Color color)
        Specified by:
        createColor in interface org.mapsforge.core.graphics.GraphicFactory
      • createColor

        public int createColor​(int alpha,
                               int red,
                               int green,
                               int blue)
        Specified by:
        createColor in interface org.mapsforge.core.graphics.GraphicFactory
      • createMatrix

        public org.mapsforge.core.graphics.Matrix createMatrix()
        Specified by:
        createMatrix in interface org.mapsforge.core.graphics.GraphicFactory
      • createMonoBitmap

        public AwtHillshadingBitmap createMonoBitmap​(int width,
                                                     int height,
                                                     byte[] buffer,
                                                     int padding,
                                                     org.mapsforge.core.model.BoundingBox area)
        Specified by:
        createMonoBitmap in interface org.mapsforge.core.graphics.GraphicFactory
      • createPaint

        public org.mapsforge.core.graphics.Paint createPaint()
        Specified by:
        createPaint in interface org.mapsforge.core.graphics.GraphicFactory
      • createPaint

        public org.mapsforge.core.graphics.Paint createPaint​(org.mapsforge.core.graphics.Paint paint)
        Specified by:
        createPaint in interface org.mapsforge.core.graphics.GraphicFactory
      • createPath

        public org.mapsforge.core.graphics.Path createPath()
        Specified by:
        createPath in interface org.mapsforge.core.graphics.GraphicFactory
      • createPointTextContainer

        public org.mapsforge.core.mapelements.PointTextContainer createPointTextContainer​(org.mapsforge.core.model.Point xy,
                                                                                          org.mapsforge.core.graphics.Display display,
                                                                                          int priority,
                                                                                          java.lang.String text,
                                                                                          org.mapsforge.core.graphics.Paint paintFront,
                                                                                          org.mapsforge.core.graphics.Paint paintBack,
                                                                                          org.mapsforge.core.mapelements.SymbolContainer symbolContainer,
                                                                                          org.mapsforge.core.graphics.Position position,
                                                                                          int maxTextWidth)
        Specified by:
        createPointTextContainer in interface org.mapsforge.core.graphics.GraphicFactory
      • createResourceBitmap

        public org.mapsforge.core.graphics.ResourceBitmap createResourceBitmap​(java.io.InputStream inputStream,
                                                                               float scaleFactor,
                                                                               int width,
                                                                               int height,
                                                                               int percent,
                                                                               int hash)
                                                                        throws java.io.IOException
        Specified by:
        createResourceBitmap in interface org.mapsforge.core.graphics.GraphicFactory
        Throws:
        java.io.IOException
      • createTileBitmap

        public org.mapsforge.core.graphics.TileBitmap createTileBitmap​(java.io.InputStream inputStream,
                                                                       int tileSize,
                                                                       boolean hasAlpha)
                                                                throws java.io.IOException
        Specified by:
        createTileBitmap in interface org.mapsforge.core.graphics.GraphicFactory
        Throws:
        java.io.IOException
      • createTileBitmap

        public org.mapsforge.core.graphics.TileBitmap createTileBitmap​(int tileSize,
                                                                       boolean hasAlpha)
        Specified by:
        createTileBitmap in interface org.mapsforge.core.graphics.GraphicFactory
      • platformSpecificSources

        public java.io.InputStream platformSpecificSources​(java.lang.String relativePathPrefix,
                                                           java.lang.String src)
                                                    throws java.io.IOException
        Specified by:
        platformSpecificSources in interface org.mapsforge.core.graphics.GraphicFactory
        Throws:
        java.io.IOException
      • renderSvg

        public org.mapsforge.core.graphics.ResourceBitmap renderSvg​(java.io.InputStream inputStream,
                                                                    float scaleFactor,
                                                                    int width,
                                                                    int height,
                                                                    int percent,
                                                                    int hash)
                                                             throws java.io.IOException
        Specified by:
        renderSvg in interface org.mapsforge.core.graphics.GraphicFactory
        Throws:
        java.io.IOException