Package org.jmol.awt

Class Platform

    • Constructor Detail

      • Platform

        public Platform()
    • Method Detail

      • hasFocus

        public boolean hasFocus​(java.lang.Object display)
        Specified by:
        hasFocus in interface GenericPlatform
      • prompt

        public java.lang.String prompt​(java.lang.String label,
                                       java.lang.String data,
                                       java.lang.String[] list,
                                       boolean asButtons)
        Specified by:
        prompt in interface GenericPlatform
      • renderScreenImage

        public void renderScreenImage​(java.lang.Object g,
                                      java.lang.Object size)
        legacy apps will use this
        Specified by:
        renderScreenImage in interface GenericPlatform
        Parameters:
        g -
        size -
      • repaint

        public void repaint​(java.lang.Object display)
        Specified by:
        repaint in interface GenericPlatform
      • setCursor

        public void setCursor​(int c,
                              java.lang.Object display)
        Specified by:
        setCursor in interface GenericPlatform
      • allocateRgbImage

        public java.lang.Object allocateRgbImage​(int windowWidth,
                                                 int windowHeight,
                                                 int[] pBuffer,
                                                 int windowSize,
                                                 boolean backgroundTransparent,
                                                 boolean isImageWrite)
        Specified by:
        allocateRgbImage in interface GenericPlatform
      • createImage

        public java.lang.Object createImage​(java.lang.Object data)
        could be byte[] (from ZIP file) or String (local file name) or URL
        Specified by:
        createImage in interface GenericPlatform
        Parameters:
        data -
        Returns:
        image object
      • drawImage

        public void drawImage​(java.lang.Object g,
                              java.lang.Object img,
                              int x,
                              int y,
                              int width,
                              int height,
                              boolean isDTI)
        Specified by:
        drawImage in interface GenericPlatform
      • grabPixels

        public int[] grabPixels​(java.lang.Object imageobj,
                                int width,
                                int height,
                                int[] pixels,
                                int startRow,
                                int nRows)
        Specified by:
        grabPixels in interface GenericPlatform
        Returns:
        pixels
      • drawImageToBuffer

        public int[] drawImageToBuffer​(java.lang.Object gOffscreen,
                                       java.lang.Object imageOffscreen,
                                       java.lang.Object imageobj,
                                       int width,
                                       int height,
                                       int bgcolor)
        Specified by:
        drawImageToBuffer in interface GenericPlatform
      • getTextPixels

        public int[] getTextPixels​(java.lang.String text,
                                   Font font3d,
                                   java.lang.Object gObj,
                                   java.lang.Object image,
                                   int width,
                                   int height,
                                   int ascent)
        Specified by:
        getTextPixels in interface GenericPlatform
      • flushImage

        public void flushImage​(java.lang.Object imagePixelBuffer)
        Specified by:
        flushImage in interface GenericPlatform
      • getGraphics

        public java.lang.Object getGraphics​(java.lang.Object image)
        Specified by:
        getGraphics in interface GenericPlatform
      • getStaticGraphics

        public java.lang.Object getStaticGraphics​(java.lang.Object image,
                                                  boolean backgroundTransparent)
        Specified by:
        getStaticGraphics in interface GenericPlatform
      • newBufferedImage

        public java.lang.Object newBufferedImage​(java.lang.Object image,
                                                 int w,
                                                 int h)
        Specified by:
        newBufferedImage in interface GenericPlatform
      • waitForDisplay

        public boolean waitForDisplay​(java.lang.Object ignored,
                                      java.lang.Object image)
                               throws java.lang.InterruptedException
        Description copied from interface: GenericPlatform
        can be ignored (return false) if platform cannot save images
        Specified by:
        waitForDisplay in interface GenericPlatform
        Returns:
        false only if this platform cannot save images
        Throws:
        java.lang.InterruptedException
      • getFontAscent

        public int getFontAscent​(java.lang.Object fontMetrics)
        Specified by:
        getFontAscent in interface FontManager
      • getFontDescent

        public int getFontDescent​(java.lang.Object fontMetrics)
        Specified by:
        getFontDescent in interface FontManager
      • getFontMetrics

        public java.lang.Object getFontMetrics​(Font font,
                                               java.lang.Object graphics)
        Specified by:
        getFontMetrics in interface FontManager
      • newFont

        public java.lang.Object newFont​(java.lang.String fontFace,
                                        boolean isBold,
                                        boolean isItalic,
                                        float fontSize)
        Specified by:
        newFont in interface FontManager
      • getJsObjectInfo

        public java.lang.Object getJsObjectInfo​(java.lang.Object[] jsObject,
                                                java.lang.String method,
                                                java.lang.Object[] args)
        Specified by:
        getJsObjectInfo in interface GenericPlatform
      • getWindow

        public static java.awt.Window getWindow​(java.awt.Container p)
        Parameters:
        p -
        Returns:
        The hosting frame or JDialog.
      • getDateFormat

        public java.lang.String getDateFormat​(java.lang.String isoType)
        Specified by:
        getDateFormat in interface GenericPlatform
      • getURLContents

        public java.lang.Object getURLContents​(java.net.URL url,
                                               byte[] outputBytes,
                                               java.lang.String post,
                                               boolean asString)
        Specified by:
        getURLContents in interface GenericPlatform
        Returns:
        may be javajs.util.SB or byte[] or java.io.InputStream
      • getLocalUrl

        public java.lang.String getLocalUrl​(java.lang.String fileName)
        Specified by:
        getLocalUrl in interface GenericPlatform
      • confirm

        public int confirm​(java.lang.String msg,
                           java.lang.String msgNo)
        Specified by:
        confirm in interface GenericPlatform