Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
Loading...
Searching...
No Matches
com.example.graphics.render.SvgRenderer Class Reference
Inheritance diagram for com.example.graphics.render.SvgRenderer:
Inheritance graph
Collaboration diagram for com.example.graphics.render.SvgRenderer:
Collaboration graph

Public Member Functions

 SvgRenderer (int width, int height)
void clear ()
void display ()
String getSvgContent ()
void renderCircle (Circle circle)
void renderLine (Line line)
void renderRectangle (Rectangle rectangle)
void renderTriangle (Triangle triangle)
Public Member Functions inherited from com.example.graphics.render.Renderer
default int getHeight ()
default int getWidth ()

Private Attributes

final int height
StringBuilder svgContent
final int width

Detailed Description

SVG implementation of the Renderer interface. Part of the Bridge pattern.

Definition at line 12 of file SvgRenderer.java.

Constructor & Destructor Documentation

◆ SvgRenderer()

com.example.graphics.render.SvgRenderer.SvgRenderer ( int width,
int height )
inline

Constructor initializes the SVG renderer with specified dimensions

Parameters
widththe width of the SVG canvas
heightthe height of the SVG canvas

Definition at line 22 of file SvgRenderer.java.

References clear(), height, and width.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void com.example.graphics.render.SvgRenderer.clear ( )
inline

Clear the rendering surface

Implements com.example.graphics.render.Renderer.

Definition at line 63 of file SvgRenderer.java.

References height, svgContent, and width.

Referenced by SvgRenderer().

Here is the caller graph for this function:

◆ display()

void com.example.graphics.render.SvgRenderer.display ( )
inline

Display the rendered content

Implements com.example.graphics.render.Renderer.

Definition at line 73 of file SvgRenderer.java.

References svgContent.

◆ getSvgContent()

String com.example.graphics.render.SvgRenderer.getSvgContent ( )
inline

Get the SVG content as a string

Returns
the SVG content

Definition at line 83 of file SvgRenderer.java.

References svgContent.

◆ renderCircle()

void com.example.graphics.render.SvgRenderer.renderCircle ( Circle circle)
inline

Render a circle

Parameters
circlethe circle to render

Implements com.example.graphics.render.Renderer.

Definition at line 29 of file SvgRenderer.java.

References com.example.graphics.model.Circle.getRadius(), com.example.graphics.model.Circle.getX(), com.example.graphics.model.Circle.getY(), and svgContent.

Here is the call graph for this function:

◆ renderLine()

void com.example.graphics.render.SvgRenderer.renderLine ( Line line)
inline

Render a line

Parameters
linethe line to render

Implements com.example.graphics.render.Renderer.

Definition at line 45 of file SvgRenderer.java.

References com.example.graphics.model.Line.getX1(), com.example.graphics.model.Line.getX2(), com.example.graphics.model.Line.getY1(), com.example.graphics.model.Line.getY2(), and svgContent.

Here is the call graph for this function:

◆ renderRectangle()

void com.example.graphics.render.SvgRenderer.renderRectangle ( Rectangle rectangle)
inline

Render a rectangle

Parameters
rectanglethe rectangle to render

Implements com.example.graphics.render.Renderer.

Definition at line 37 of file SvgRenderer.java.

References com.example.graphics.model.Rectangle.getHeight(), com.example.graphics.model.Rectangle.getWidth(), com.example.graphics.model.Rectangle.getX(), com.example.graphics.model.Rectangle.getY(), and svgContent.

Here is the call graph for this function:

◆ renderTriangle()

void com.example.graphics.render.SvgRenderer.renderTriangle ( Triangle triangle)
inline

Member Data Documentation

◆ height

final int com.example.graphics.render.SvgRenderer.height
private

Definition at line 15 of file SvgRenderer.java.

Referenced by SvgRenderer(), and clear().

◆ svgContent

StringBuilder com.example.graphics.render.SvgRenderer.svgContent
private

◆ width

final int com.example.graphics.render.SvgRenderer.width
private

Definition at line 14 of file SvgRenderer.java.

Referenced by SvgRenderer(), and clear().


The documentation for this class was generated from the following file: