Package org.jmol.awtjs2d
Class JsG2D
java.lang.Object
org.jmol.awtjs2d.JsG2D
- All Implemented Interfaces:
GenericGraphics
generic 2D drawing methods -- JavaScript version
- Author:
- Bob Hanson hansonr@stolaf.edu
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
(package private) boolean
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
private void
void
void
drawCircle
(Object g, int x, int y, int diameter) void
drawGrayScaleImage
(Object g, Object image, int destX0, int destY0, int destX1, int destY1, int srcX0, int srcY0, int srcX1, int srcY1) void
void
drawPolygon
(Object g, int[] ayPoints, int[] axPoints, int nPoints) void
void
drawString
(Object g, String s, int x, int y) void
drawStringRotated
(Object g, String s, int x, int y, double angle) void
fillBackground
(Object g, javajs.api.GenericColor bgcolor) void
fillCircle
(Object g, int x, int y, int diameter) void
fillPolygon
(Object g, int[] ayPoints, int[] axPoints, int nPoints) void
javajs.api.GenericColor
getColor1
(int rgb) javajs.api.GenericColor
getColor3
(int r, int g, int b) javajs.api.GenericColor
getColor4
(int r, int g, int b, int a) void
newGrayScaleImage
(Object context, Object image, int width, int height, int[] grayBuffer) void
setGraphicsColor
(Object g, javajs.api.GenericColor c) void
setStrokeBold
(Object g, boolean tf) void
setWindowParameters
(int width, int height) void
translateScale
(Object g, double x, double y, double scale)
-
Field Details
-
windowWidth
private int windowWidth -
windowHeight
private int windowHeight -
isShifted
boolean isShifted -
inPath
boolean inPath
-
-
Constructor Details
-
JsG2D
public JsG2D()
-
-
Method Details
-
getColor4
public javajs.api.GenericColor getColor4(int r, int g, int b, int a) - Specified by:
getColor4
in interfaceGenericGraphics
-
getColor3
public javajs.api.GenericColor getColor3(int r, int g, int b) - Specified by:
getColor3
in interfaceGenericGraphics
-
getColor1
public javajs.api.GenericColor getColor1(int rgb) - Specified by:
getColor1
in interfaceGenericGraphics
-
newGrayScaleImage
public Object newGrayScaleImage(Object context, Object image, int width, int height, int[] grayBuffer) - Specified by:
newGrayScaleImage
in interfaceGenericGraphics
-
drawGrayScaleImage
public void drawGrayScaleImage(Object g, Object image, int destX0, int destY0, int destX1, int destY1, int srcX0, int srcY0, int srcX1, int srcY1) - Specified by:
drawGrayScaleImage
in interfaceGenericGraphics
-
drawLine
- Specified by:
drawLine
in interfaceGenericGraphics
-
drawCircle
- Specified by:
drawCircle
in interfaceGenericGraphics
-
drawPolygon
- Specified by:
drawPolygon
in interfaceGenericGraphics
-
doPoly
- Parameters:
g
-axPoints
-ayPoints
-nPoints
-doFill
-
-
drawRect
- Specified by:
drawRect
in interfaceGenericGraphics
-
drawString
- Specified by:
drawString
in interfaceGenericGraphics
-
drawStringRotated
- Specified by:
drawStringRotated
in interfaceGenericGraphics
-
fillBackground
- Specified by:
fillBackground
in interfaceGenericGraphics
-
fillCircle
- Specified by:
fillCircle
in interfaceGenericGraphics
-
fillPolygon
- Specified by:
fillPolygon
in interfaceGenericGraphics
-
fillRect
- Specified by:
fillRect
in interfaceGenericGraphics
-
setGraphicsColor
- Specified by:
setGraphicsColor
in interfaceGenericGraphics
-
setFont
- Specified by:
setFont
in interfaceGenericGraphics
-
setStrokeBold
- Specified by:
setStrokeBold
in interfaceGenericGraphics
-
setWindowParameters
public void setWindowParameters(int width, int height) - Specified by:
setWindowParameters
in interfaceGenericGraphics
-
translateScale
- Specified by:
translateScale
in interfaceGenericGraphics
-
canDoLineTo
public boolean canDoLineTo()- Specified by:
canDoLineTo
in interfaceGenericGraphics
-
doStroke
- Specified by:
doStroke
in interfaceGenericGraphics
-
lineTo
- Specified by:
lineTo
in interfaceGenericGraphics
-