org.jmol.awt
Class Platform

java.lang.Object
  extended by org.jmol.awt.Platform
All Implemented Interfaces:
ApiPlatform

public class Platform
extends java.lang.Object
implements ApiPlatform


Field Summary
private  Mouse mouse
           
 
Constructor Summary
Platform()
           
 
Method Summary
 java.lang.Object allocateRgbImage(int windowWidth, int windowHeight, int[] pBuffer, int windowSize, boolean backgroundTransparent)
           
 void clearMouse()
           
 java.lang.Object createImage(java.lang.Object data)
          can be ignored (return null) if platform cannot save images
 void disposeGraphics(java.lang.Object gOffscreen)
           
 void disposeMouse()
           
 void drawImage(java.lang.Object g, java.lang.Object img, int x, int y)
           
 int[] drawImageToBuffer(java.lang.Object gOffscreen, java.lang.Object imageOffscreen, java.lang.Object imageobj, int width, int height, int bgcolor)
           
 void flushImage(java.lang.Object imagePixelBuffer)
           
 int fontStringWidth(java.lang.Object fontMetrics, java.lang.String text)
           
 int getFontAscent(java.lang.Object fontMetrics)
           
 int getFontDescent(java.lang.Object fontMetrics)
           
 java.lang.Object getFontMetrics(java.lang.Object graphics, java.lang.Object font)
           
 java.lang.Object getGraphics(java.lang.Object image)
           
 int getImageHeight(java.lang.Object image)
           
 int getImageWidth(java.lang.Object image)
           
 java.lang.Object getJpgImage(Viewer viewer, int quality, java.lang.String comment)
          used for JPG writing only; can be ignored
 void getMouseManager(Viewer viewer, ActionManager actionManager)
           
 java.lang.Object getStaticGraphics(java.lang.Object image, boolean backgroundTransparent)
           
 void grabPixels(java.lang.Object image, int imageWidth, int imageHeight, int[] values)
          used for JPG writing only; can be ignored
 int[] grabPixels(java.lang.Object image, int x, int y, int width, int height)
           
 boolean handleOldJvm10Event(int id, int x, int y, int modifiers, long time)
           
 boolean hasFocus(java.lang.Object display)
           
 java.lang.Object newBufferedImage(java.lang.Object image, int w, int h)
           
 java.lang.Object newBufferedRgbImage(int w, int h)
           
 java.lang.Object newFont(java.lang.String fontFace, boolean isBold, boolean isItalic, float fontSize)
           
 void renderOffScreen(java.lang.String text, Font3D font3d, java.lang.Object gObj, int mapWidth, int height, int ascent)
           
 void renderScreenImage(JmolViewer viewer, java.lang.Object g, java.lang.Object size)
          legacy apps will use this
 void repaint(java.lang.Object display)
           
 void requestFocusInWindow(java.lang.Object display)
           
 void setCursor(int c, java.lang.Object display)
           
 void setTransparentCursor(java.lang.Object display)
           
 boolean waitForDisplay(java.lang.Object display, java.lang.Object image)
          can be ignored (return false) if platform cannot save images
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mouse

private Mouse mouse
Constructor Detail

Platform

public Platform()
Method Detail

hasFocus

public boolean hasFocus(java.lang.Object display)
Specified by:
hasFocus in interface ApiPlatform

requestFocusInWindow

public void requestFocusInWindow(java.lang.Object display)
Specified by:
requestFocusInWindow in interface ApiPlatform

repaint

public void repaint(java.lang.Object display)
Specified by:
repaint in interface ApiPlatform

renderScreenImage

public void renderScreenImage(JmolViewer viewer,
                              java.lang.Object g,
                              java.lang.Object size)
legacy apps will use this

Specified by:
renderScreenImage in interface ApiPlatform
Parameters:
viewer -
g -
size -

setTransparentCursor

public void setTransparentCursor(java.lang.Object display)
Specified by:
setTransparentCursor in interface ApiPlatform

setCursor

public void setCursor(int c,
                      java.lang.Object display)
Specified by:
setCursor in interface ApiPlatform

getMouseManager

public void getMouseManager(Viewer viewer,
                            ActionManager actionManager)
Specified by:
getMouseManager in interface ApiPlatform

handleOldJvm10Event

public boolean handleOldJvm10Event(int id,
                                   int x,
                                   int y,
                                   int modifiers,
                                   long time)
Specified by:
handleOldJvm10Event in interface ApiPlatform

clearMouse

public void clearMouse()
Specified by:
clearMouse in interface ApiPlatform

disposeMouse

public void disposeMouse()
Specified by:
disposeMouse in interface ApiPlatform

allocateRgbImage

public java.lang.Object allocateRgbImage(int windowWidth,
                                         int windowHeight,
                                         int[] pBuffer,
                                         int windowSize,
                                         boolean backgroundTransparent)
Specified by:
allocateRgbImage in interface ApiPlatform

createImage

public java.lang.Object createImage(java.lang.Object data)
Description copied from interface: ApiPlatform
can be ignored (return null) if platform cannot save images

Specified by:
createImage in interface ApiPlatform
Returns:
null only if this platform cannot save images

disposeGraphics

public void disposeGraphics(java.lang.Object gOffscreen)
Specified by:
disposeGraphics in interface ApiPlatform

drawImage

public void drawImage(java.lang.Object g,
                      java.lang.Object img,
                      int x,
                      int y)
Specified by:
drawImage in interface ApiPlatform

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 ApiPlatform

flushImage

public void flushImage(java.lang.Object imagePixelBuffer)
Specified by:
flushImage in interface ApiPlatform

getGraphics

public java.lang.Object getGraphics(java.lang.Object image)
Specified by:
getGraphics in interface ApiPlatform

getImageHeight

public int getImageHeight(java.lang.Object image)
Specified by:
getImageHeight in interface ApiPlatform

getImageWidth

public int getImageWidth(java.lang.Object image)
Specified by:
getImageWidth in interface ApiPlatform

getJpgImage

public java.lang.Object getJpgImage(Viewer viewer,
                                    int quality,
                                    java.lang.String comment)
Description copied from interface: ApiPlatform
used for JPG writing only; can be ignored

Specified by:
getJpgImage in interface ApiPlatform
Returns:
null only if this platform cannot save images

getStaticGraphics

public java.lang.Object getStaticGraphics(java.lang.Object image,
                                          boolean backgroundTransparent)
Specified by:
getStaticGraphics in interface ApiPlatform

grabPixels

public void grabPixels(java.lang.Object image,
                       int imageWidth,
                       int imageHeight,
                       int[] values)
Description copied from interface: ApiPlatform
used for JPG writing only; can be ignored

Specified by:
grabPixels in interface ApiPlatform

grabPixels

public int[] grabPixels(java.lang.Object image,
                        int x,
                        int y,
                        int width,
                        int height)
Specified by:
grabPixels in interface ApiPlatform

newBufferedImage

public java.lang.Object newBufferedImage(java.lang.Object image,
                                         int w,
                                         int h)
Specified by:
newBufferedImage in interface ApiPlatform

newBufferedRgbImage

public java.lang.Object newBufferedRgbImage(int w,
                                            int h)
Specified by:
newBufferedRgbImage in interface ApiPlatform

renderOffScreen

public void renderOffScreen(java.lang.String text,
                            Font3D font3d,
                            java.lang.Object gObj,
                            int mapWidth,
                            int height,
                            int ascent)
Specified by:
renderOffScreen in interface ApiPlatform

waitForDisplay

public boolean waitForDisplay(java.lang.Object display,
                              java.lang.Object image)
                       throws java.lang.InterruptedException
Description copied from interface: ApiPlatform
can be ignored (return false) if platform cannot save images

Specified by:
waitForDisplay in interface ApiPlatform
Returns:
false only if this platform cannot save images
Throws:
java.lang.InterruptedException

fontStringWidth

public int fontStringWidth(java.lang.Object fontMetrics,
                           java.lang.String text)
Specified by:
fontStringWidth in interface ApiPlatform

getFontAscent

public int getFontAscent(java.lang.Object fontMetrics)
Specified by:
getFontAscent in interface ApiPlatform

getFontDescent

public int getFontDescent(java.lang.Object fontMetrics)
Specified by:
getFontDescent in interface ApiPlatform

getFontMetrics

public java.lang.Object getFontMetrics(java.lang.Object graphics,
                                       java.lang.Object font)
Specified by:
getFontMetrics in interface ApiPlatform

newFont

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