接口 ThirdPartyRenderer
- 所有已知实现类:
MockThirdPartyRenderer
public interface ThirdPartyRenderer
Mock interface for a third-party rendering library.
This represents an external API that we need to adapt.
-
方法概要
修饰符和类型方法说明void
Clear the rendering surfacevoid
drawCircle
(double centerX, double centerY, double radius) Draw a circle in the third-party renderervoid
drawLine
(double startX, double startY, double endX, double endY) Draw a line in the third-party renderervoid
drawPolygon
(int[] xPoints, int[] yPoints, int nPoints) Draw a polygon in the third-party renderervoid
drawRect
(double x, double y, double width, double height) Draw a rectangle in the third-party renderervoid
Update the display
-
方法详细资料
-
drawCircle
void drawCircle(double centerX, double centerY, double radius) Draw a circle in the third-party renderer- 参数:
centerX
- the x coordinate of the centercenterY
- the y coordinate of the centerradius
- the radius of the circle
-
drawRect
void drawRect(double x, double y, double width, double height) Draw a rectangle in the third-party renderer- 参数:
x
- the x coordinate of the top-left cornery
- the y coordinate of the top-left cornerwidth
- the width of the rectangleheight
- the height of the rectangle
-
drawLine
void drawLine(double startX, double startY, double endX, double endY) Draw a line in the third-party renderer- 参数:
startX
- the x coordinate of the start pointstartY
- the y coordinate of the start pointendX
- the x coordinate of the end pointendY
- the y coordinate of the end point
-
drawPolygon
void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) Draw a polygon in the third-party renderer- 参数:
xPoints
- the x coordinates of the verticesyPoints
- the y coordinates of the verticesnPoints
- the number of vertices
-
clearSurface
void clearSurface()Clear the rendering surface -
refreshDisplay
void refreshDisplay()Update the display
-