Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / src / javajs / api / GenericPlatform.java
index c804846..9c99e41 100644 (file)
-package javajs.api;\r
-\r
-\r
-import java.net.URL;\r
-import java.util.Map;\r
-\r
-\r
-import javajs.awt.Font;\r
-import javajs.util.P3;\r
-\r
-public interface GenericPlatform extends FontManager {\r
-\r
-  public final static int CURSOR_DEFAULT = 0;\r
-  public final static int CURSOR_CROSSHAIR = 1;\r
-  public final static int CURSOR_WAIT = 3;\r
-  public final static int CURSOR_ZOOM = 8;\r
-  public final static int CURSOR_HAND = 12;\r
-  public final static int CURSOR_MOVE = 13;\r
-\r
-  void setViewer(PlatformViewer vwr, Object display);\r
-  \r
-  /////// Display\r
-\r
-  boolean isHeadless();\r
-  \r
-  void convertPointFromScreen(Object display, P3 ptTemp);\r
-\r
-  void getFullScreenDimensions(Object display, int[] widthHeight);\r
-  \r
-  boolean hasFocus(Object display);\r
-\r
-  String prompt(String label, String data, String[] list, boolean asButtons);\r
-\r
-  void repaint(Object display);\r
-\r
-  void requestFocusInWindow(Object display);\r
-\r
-  void setCursor(int i, Object display);\r
-\r
-  void setTransparentCursor(Object display);\r
-\r
-  ////  Mouse \r
-\r
-  GenericMouseInterface getMouseManager(double privateKey, Object display);\r
-\r
-  ///// core Image handling\r
-  \r
-  Object allocateRgbImage(int windowWidth, int windowHeight, int[] pBuffer,\r
-                          int windowSize, boolean backgroundTransparent, boolean isImageWrite);\r
-\r
-  void disposeGraphics(Object graphicForText);\r
-\r
-  void drawImage(Object g, Object img, int x, int y, int width, int height);\r
-\r
-  int[] drawImageToBuffer(Object gObj, Object imageOffscreen,\r
-                          Object image, int width, int height, int bgcolor);\r
-\r
-  void flushImage(Object imagePixelBuffer);\r
-\r
-  Object getStaticGraphics(Object image, boolean backgroundTransparent);\r
-\r
-  Object getGraphics(Object image);\r
-\r
-  int getImageWidth(Object image);\r
-\r
-  int getImageHeight(Object image);\r
-\r
-  Object newBufferedImage(Object image, int i, int height);\r
-\r
-  Object newOffScreenImage(int w, int h);\r
-  \r
-  @Deprecated\r
-  void renderScreenImage(Object g, Object currentSize);\r
-\r
-  int[] getTextPixels(String text, Font font3d, Object gObj,\r
-                      Object image, int mapWidth, int height,\r
-                      int ascent);\r
-\r
-  ///// Image creation for export (optional for any platform)\r
-\r
-  /**\r
-   * can be ignored (return null) if platform cannot save images\r
-   * \r
-   * @param ret\r
-   * @return     null only if this platform cannot save images\r
-   */\r
-  Object createImage(Object ret);\r
-\r
-  /**\r
-   * \r
-   * @param image\r
-   * @param width\r
-   * @param height\r
-   * @param pixels \r
-   * @param startRow \r
-   * @param nRows \r
-   * @return         pixels\r
-   */\r
-  int[] grabPixels(Object image, int width, int height, \r
-                   int[] pixels, int startRow, int nRows);\r
-\r
-  /**\r
-   * can be ignored (return false) if platform cannot save images\r
-   * \r
-   * @param boolIsEcho\r
-   * @param image\r
-   * @return        false only if this platform cannot save images\r
-   * @throws InterruptedException\r
-   */\r
-  boolean waitForDisplay(Object boolIsEcho, Object image) throws InterruptedException;\r
-\r
-  GenericMenuInterface getMenuPopup(String menuStructure, char type);\r
-\r
-  Object getJsObjectInfo(Object[] jsObject, String method, Object[] args);\r
-\r
-  boolean isSingleThreaded();\r
-\r
-  void notifyEndOfRendering();\r
-\r
-  String getDateFormat(String isoType);\r
-  \r
-  GenericFileInterface newFile(String name);\r
-  \r
-  Object getBufferedFileInputStream(String name);\r
-  \r
-  /**\r
-   * \r
-   * @param url\r
-   * @param outputBytes\r
-   * @param post\r
-   * @param asString\r
-   * @return may be javajs.util.SB or byte[] or java.io.InputStream\r
-   */\r
-  Object getURLContents(URL url, byte[] outputBytes, String post, boolean asString);\r
-\r
-  String getLocalUrl(String fileName);\r
-\r
-  GenericImageDialog getImageDialog(String title,\r
-                                 Map<String, GenericImageDialog> imageMap);\r
-\r
-}\r
+package javajs.api;
+
+
+import java.net.URL;
+import java.util.Map;
+
+
+import javajs.awt.Font;
+import javajs.util.P3;
+
+public interface GenericPlatform extends FontManager {
+
+  public final static int CURSOR_DEFAULT = 0;
+  public final static int CURSOR_CROSSHAIR = 1;
+  public final static int CURSOR_WAIT = 3;
+  public final static int CURSOR_ZOOM = 8;
+  public final static int CURSOR_HAND = 12;
+  public final static int CURSOR_MOVE = 13;
+
+  void setViewer(PlatformViewer vwr, Object display);
+  
+  /////// Display
+
+  boolean isHeadless();
+  
+  void convertPointFromScreen(Object display, P3 ptTemp);
+
+  void getFullScreenDimensions(Object display, int[] widthHeight);
+  
+  boolean hasFocus(Object display);
+
+  String prompt(String label, String data, String[] list, boolean asButtons);
+
+  void repaint(Object display);
+
+  void requestFocusInWindow(Object display);
+
+  void setCursor(int i, Object display);
+
+  void setTransparentCursor(Object display);
+
+  ////  Mouse 
+
+  GenericMouseInterface getMouseManager(double privateKey, Object display);
+
+  ///// core Image handling
+  
+  Object allocateRgbImage(int windowWidth, int windowHeight, int[] pBuffer,
+                          int windowSize, boolean backgroundTransparent, boolean isImageWrite);
+
+  void disposeGraphics(Object graphicForText);
+
+  void drawImage(Object g, Object img, int x, int y, int width, int height);
+
+  int[] drawImageToBuffer(Object gObj, Object imageOffscreen,
+                          Object image, int width, int height, int bgcolor);
+
+  void flushImage(Object imagePixelBuffer);
+
+  Object getStaticGraphics(Object image, boolean backgroundTransparent);
+
+  Object getGraphics(Object image);
+
+  int getImageWidth(Object image);
+
+  int getImageHeight(Object image);
+
+  Object newBufferedImage(Object image, int i, int height);
+
+  Object newOffScreenImage(int w, int h);
+  
+  @Deprecated
+  void renderScreenImage(Object g, Object currentSize);
+
+  int[] getTextPixels(String text, Font font3d, Object gObj,
+                      Object image, int mapWidth, int height,
+                      int ascent);
+
+  ///// Image creation for export (optional for any platform)
+
+  /**
+   * can be ignored (return null) if platform cannot save images
+   * 
+   * @param ret
+   * @return     null only if this platform cannot save images
+   */
+  Object createImage(Object ret);
+
+  /**
+   * 
+   * @param image
+   * @param width
+   * @param height
+   * @param pixels 
+   * @param startRow 
+   * @param nRows 
+   * @return         pixels
+   */
+  int[] grabPixels(Object image, int width, int height, 
+                   int[] pixels, int startRow, int nRows);
+
+  /**
+   * can be ignored (return false) if platform cannot save images
+   * 
+   * @param boolIsEcho
+   * @param image
+   * @return        false only if this platform cannot save images
+   * @throws InterruptedException
+   */
+  boolean waitForDisplay(Object boolIsEcho, Object image) throws InterruptedException;
+
+  GenericMenuInterface getMenuPopup(String menuStructure, char type);
+
+  Object getJsObjectInfo(Object[] jsObject, String method, Object[] args);
+
+  boolean isSingleThreaded();
+
+  void notifyEndOfRendering();
+
+  String getDateFormat(String isoType);
+  
+  GenericFileInterface newFile(String name);
+  
+  Object getBufferedFileInputStream(String name);
+  
+  /**
+   * 
+   * @param url
+   * @param outputBytes
+   * @param post
+   * @param asString
+   * @return may be javajs.util.SB or byte[] or java.io.InputStream
+   */
+  Object getURLContents(URL url, byte[] outputBytes, String post, boolean asString);
+
+  String getLocalUrl(String fileName);
+
+  GenericImageDialog getImageDialog(String title,
+                                 Map<String, GenericImageDialog> imageMap);
+
+}