public class Platform extends java.lang.Object implements ApiPlatform
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.Object |
canvas |
(package private) java.lang.Object |
context |
private JmolFileAdapter |
fileAdapter |
(package private) JmolViewer |
viewer |
Constructor and Description |
---|
Platform() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
allocateRgbImage(int windowWidth,
int windowHeight,
int[] pBuffer,
int windowSize,
boolean backgroundTransparent,
boolean isImageWrite) |
void |
convertPointFromScreen(java.lang.Object canvas,
P3 ptTemp) |
java.lang.Object |
createImage(java.lang.Object data)
could be byte[] (from ZIP file) or String (local file name) or URL
|
void |
disposeGraphics(java.lang.Object gOffscreen) |
void |
drawImage(java.lang.Object context,
java.lang.Object canvas,
int x,
int y,
int width,
int height) |
int[] |
drawImageToBuffer(java.lang.Object gOffscreen,
java.lang.Object imageOffscreen,
java.lang.Object canvas,
int width,
int height,
int bgcolor) |
void |
flushImage(java.lang.Object imagePixelBuffer) |
int |
fontStringWidth(JmolFont font,
java.lang.Object context,
java.lang.String text) |
java.lang.String |
getDateFormat() |
JmolFileAdapterInterface |
getFileAdapter() |
int |
getFontAscent(java.lang.Object context) |
int |
getFontDescent(java.lang.Object context) |
java.lang.Object |
getFontMetrics(JmolFont font,
java.lang.Object context) |
void |
getFullScreenDimensions(java.lang.Object canvas,
int[] widthHeight) |
java.lang.Object |
getGraphics(java.lang.Object image) |
int |
getImageHeight(java.lang.Object canvas) |
int |
getImageWidth(java.lang.Object canvas) |
java.lang.Object |
getJpgImage(Viewer viewer,
int quality,
java.lang.String comment)
used for JPG writing only; can be ignored
|
java.lang.Object |
getJsObjectInfo(java.lang.Object[] jsObject,
java.lang.String method,
java.lang.Object[] args) |
JmolPopupInterface |
getMenuPopup(Viewer viewer,
java.lang.String menuStructure,
char type) |
JmolMouseInterface |
getMouseManager(Viewer viewer,
ActionManager actionManager) |
java.lang.Object |
getStaticGraphics(java.lang.Object image,
boolean backgroundTransparent) |
int[] |
getTextPixels(java.lang.String text,
JmolFont font3d,
java.lang.Object context,
java.lang.Object image,
int width,
int height,
int ascent) |
int[] |
grabPixels(java.lang.Object canvas,
int width,
int height,
int[] pixels,
int startRow,
int nRows) |
boolean |
hasFocus(java.lang.Object canvas) |
boolean |
isHeadless() |
boolean |
isSingleThreaded() |
java.lang.Object |
newBufferedImage(java.lang.Object image,
int w,
int h) |
JmolFileInterface |
newFile(java.lang.String name) |
java.lang.Object |
newFont(java.lang.String fontFace,
boolean isBold,
boolean isItalic,
float fontSize) |
java.lang.Object |
newOffScreenImage(int w,
int h) |
void |
notifyEndOfRendering() |
java.lang.String |
prompt(java.lang.String label,
java.lang.String data,
java.lang.String[] list,
boolean asButtons) |
void |
renderScreenImage(JmolViewer viewer,
java.lang.Object context,
java.lang.Object size)
legacy apps will use this
|
void |
repaint(java.lang.Object canvas) |
void |
requestFocusInWindow(java.lang.Object canvas) |
void |
setCursor(int c,
java.lang.Object canvas) |
void |
setTransparentCursor(java.lang.Object canvas) |
void |
setViewer(JmolViewer viewer,
java.lang.Object canvas) |
boolean |
waitForDisplay(java.lang.Object echoNameAndPath,
java.lang.Object zipBytes)
can be ignored (return false) if platform cannot save images
|
java.lang.Object canvas
JmolViewer viewer
java.lang.Object context
private JmolFileAdapter fileAdapter
public void setViewer(JmolViewer viewer, java.lang.Object canvas)
setViewer
in interface ApiPlatform
public boolean isSingleThreaded()
isSingleThreaded
in interface ApiPlatform
public java.lang.Object getJsObjectInfo(java.lang.Object[] jsObject, java.lang.String method, java.lang.Object[] args)
getJsObjectInfo
in interface ApiPlatform
public boolean isHeadless()
isHeadless
in interface ApiPlatform
public JmolFileAdapterInterface getFileAdapter()
getFileAdapter
in interface ApiPlatform
public JmolFileInterface newFile(java.lang.String name)
newFile
in interface ApiPlatform
public JmolMouseInterface getMouseManager(Viewer viewer, ActionManager actionManager)
getMouseManager
in interface ApiPlatform
public void convertPointFromScreen(java.lang.Object canvas, P3 ptTemp)
convertPointFromScreen
in interface ApiPlatform
public void getFullScreenDimensions(java.lang.Object canvas, int[] widthHeight)
getFullScreenDimensions
in interface ApiPlatform
public JmolPopupInterface getMenuPopup(Viewer viewer, java.lang.String menuStructure, char type)
getMenuPopup
in interface ApiPlatform
public boolean hasFocus(java.lang.Object canvas)
hasFocus
in interface ApiPlatform
public java.lang.String prompt(java.lang.String label, java.lang.String data, java.lang.String[] list, boolean asButtons)
prompt
in interface ApiPlatform
public void renderScreenImage(JmolViewer viewer, java.lang.Object context, java.lang.Object size)
renderScreenImage
in interface ApiPlatform
viewer
- context
- size
- public void drawImage(java.lang.Object context, java.lang.Object canvas, int x, int y, int width, int height)
drawImage
in interface ApiPlatform
public void requestFocusInWindow(java.lang.Object canvas)
requestFocusInWindow
in interface ApiPlatform
public void repaint(java.lang.Object canvas)
repaint
in interface ApiPlatform
public void setTransparentCursor(java.lang.Object canvas)
setTransparentCursor
in interface ApiPlatform
public void setCursor(int c, java.lang.Object canvas)
setCursor
in interface ApiPlatform
public java.lang.Object allocateRgbImage(int windowWidth, int windowHeight, int[] pBuffer, int windowSize, boolean backgroundTransparent, boolean isImageWrite)
allocateRgbImage
in interface ApiPlatform
public void notifyEndOfRendering()
notifyEndOfRendering
in interface ApiPlatform
public java.lang.Object createImage(java.lang.Object data)
createImage
in interface ApiPlatform
data
- public void disposeGraphics(java.lang.Object gOffscreen)
disposeGraphics
in interface ApiPlatform
public int[] grabPixels(java.lang.Object canvas, int width, int height, int[] pixels, int startRow, int nRows)
grabPixels
in interface ApiPlatform
public int[] drawImageToBuffer(java.lang.Object gOffscreen, java.lang.Object imageOffscreen, java.lang.Object canvas, int width, int height, int bgcolor)
drawImageToBuffer
in interface ApiPlatform
public int[] getTextPixels(java.lang.String text, JmolFont font3d, java.lang.Object context, java.lang.Object image, int width, int height, int ascent)
getTextPixels
in interface ApiPlatform
public void flushImage(java.lang.Object imagePixelBuffer)
flushImage
in interface ApiPlatform
public java.lang.Object getGraphics(java.lang.Object image)
getGraphics
in interface ApiPlatform
public int getImageHeight(java.lang.Object canvas)
getImageHeight
in interface ApiPlatform
public int getImageWidth(java.lang.Object canvas)
getImageWidth
in interface ApiPlatform
public java.lang.Object getJpgImage(Viewer viewer, int quality, java.lang.String comment)
ApiPlatform
getJpgImage
in interface ApiPlatform
public java.lang.Object getStaticGraphics(java.lang.Object image, boolean backgroundTransparent)
getStaticGraphics
in interface ApiPlatform
public java.lang.Object newBufferedImage(java.lang.Object image, int w, int h)
newBufferedImage
in interface ApiPlatform
public java.lang.Object newOffScreenImage(int w, int h)
newOffScreenImage
in interface ApiPlatform
public boolean waitForDisplay(java.lang.Object echoNameAndPath, java.lang.Object zipBytes) throws java.lang.InterruptedException
ApiPlatform
waitForDisplay
in interface ApiPlatform
java.lang.InterruptedException
public int fontStringWidth(JmolFont font, java.lang.Object context, java.lang.String text)
fontStringWidth
in interface ApiPlatform
public int getFontAscent(java.lang.Object context)
getFontAscent
in interface ApiPlatform
public int getFontDescent(java.lang.Object context)
getFontDescent
in interface ApiPlatform
public java.lang.Object getFontMetrics(JmolFont font, java.lang.Object context)
getFontMetrics
in interface ApiPlatform
public java.lang.Object newFont(java.lang.String fontFace, boolean isBold, boolean isItalic, float fontSize)
newFont
in interface ApiPlatform
public java.lang.String getDateFormat()
getDateFormat
in interface ApiPlatform