类 SvgRenderer
java.lang.Object
com.example.graphics.render.SvgRenderer
- 所有已实现的接口:
Renderer
SVG implementation of the Renderer interface.
Part of the Bridge pattern.
-
字段概要
字段 -
构造器概要
构造器构造器说明SvgRenderer
(int width, int height) Constructor initializes the SVG renderer with specified dimensions -
方法概要
修饰符和类型方法说明void
clear()
Clear the rendering surfacevoid
display()
Display the rendered contentGet the SVG content as a stringvoid
renderCircle
(Circle circle) Render a circlevoid
renderLine
(Line line) Render a linevoid
renderRectangle
(Rectangle rectangle) Render a rectanglevoid
renderTriangle
(Triangle triangle) Render a triangle
-
字段详细资料
-
svgContent
-
width
private final int width -
height
private final int height
-
-
构造器详细资料
-
SvgRenderer
public SvgRenderer(int width, int height) Constructor initializes the SVG renderer with specified dimensions- 参数:
width
- the width of the SVG canvasheight
- the height of the SVG canvas
-
-
方法详细资料
-
renderCircle
从接口复制的说明:Renderer
Render a circle- 指定者:
renderCircle
在接口中Renderer
- 参数:
circle
- the circle to render
-
renderRectangle
从接口复制的说明:Renderer
Render a rectangle- 指定者:
renderRectangle
在接口中Renderer
- 参数:
rectangle
- the rectangle to render
-
renderLine
从接口复制的说明:Renderer
Render a line- 指定者:
renderLine
在接口中Renderer
- 参数:
line
- the line to render
-
renderTriangle
从接口复制的说明:Renderer
Render a triangle- 指定者:
renderTriangle
在接口中Renderer
- 参数:
triangle
- the triangle to render
-
clear
public void clear()从接口复制的说明:Renderer
Clear the rendering surface -
display
public void display()从接口复制的说明:Renderer
Display the rendered content -
getSvgContent
Get the SVG content as a string- 返回:
- the SVG content
-