Package com.example.renderer.proxy
Class RemoteRendererProxy
java.lang.Object
com.example.renderer.proxy.RemoteRendererProxy
- All Implemented Interfaces:
Renderer
远程渲染器代理实现类
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawCircle(int x, int y, int radius) 代理绘制圆形操作,添加远程调用日志。voiddrawEllipse(int x, int y, int width, int height) 绘制椭圆voiddrawRectangle(int x, int y, int width, int height) 绘制矩形voiddrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3) 绘制三角形
-
Constructor Details
-
RemoteRendererProxy
创建远程渲染器代理- Parameters:
realRenderer- 实际渲染器实例(非null)- Throws:
NullPointerException- 如果realRenderer为null
-
-
Method Details
-
drawCircle
public void drawCircle(int x, int y, int radius) 代理绘制圆形操作,添加远程调用日志。- Specified by:
drawCirclein interfaceRenderer- Parameters:
x- 圆心x坐标y- 圆心y坐标radius- 圆形半径- See Also:
-
drawRectangle
public void drawRectangle(int x, int y, int width, int height) Description copied from interface:Renderer绘制矩形- Specified by:
drawRectanglein interfaceRenderer- Parameters:
x- 左上角x坐标y- 左上角y坐标width- 矩形宽度(必须>0)height- 矩形高度(必须>0)
-
drawTriangle
public void drawTriangle(int x1, int y1, int x2, int y2, int x3, int y3) Description copied from interface:Renderer绘制三角形- Specified by:
drawTrianglein interfaceRenderer- Parameters:
x1- 第一个顶点x坐标y1- 第一个顶点y坐标x2- 第二个顶点x坐标y2- 第二个顶点y坐标x3- 第三个顶点x坐标y3- 第三个顶点y坐标
-
drawEllipse
public void drawEllipse(int x, int y, int width, int height) Description copied from interface:Renderer绘制椭圆- Specified by:
drawEllipsein interfaceRenderer- Parameters:
x- 椭圆外接矩形左上角x坐标y- 椭圆外接矩形左上角y坐标width- 椭圆宽度(必须>0)height- 椭圆高度(必须>0)
-