Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
|
Public Member Functions | |
ConsoleRenderer (int width, int height) | |
void | clear () |
void | display () |
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 Member Functions | |
void | drawLine (int x1, int y1, int x2, int y2) |
void | drawPixel (int x, int y) |
Private Attributes | |
char[][] | canvas |
final int | height |
final int | width |
Console text-based implementation of the Renderer interface. Part of the Bridge pattern.
Definition at line 12 of file ConsoleRenderer.java.
|
inline |
Constructor initializes the console renderer with specified dimensions
width | the width of the canvas |
height | the height of the canvas |
Definition at line 22 of file ConsoleRenderer.java.
References clear(), height, and width.
|
inline |
Clear the rendering surface
Implements com.example.graphics.render.Renderer.
Definition at line 134 of file ConsoleRenderer.java.
References canvas, height, and width.
Referenced by ConsoleRenderer().
|
inline |
Display the rendered content
Implements com.example.graphics.render.Renderer.
Definition at line 144 of file ConsoleRenderer.java.
|
inlineprivate |
Draw a line between two points
x1 | the x coordinate of the first point |
y1 | the y coordinate of the first point |
x2 | the x coordinate of the second point |
y2 | the y coordinate of the second point |
Definition at line 188 of file ConsoleRenderer.java.
References drawPixel().
Referenced by renderTriangle().
|
inlineprivate |
Draw a pixel at the specified coordinates
x | the x coordinate |
y | the y coordinate |
Definition at line 175 of file ConsoleRenderer.java.
References canvas, and height.
Referenced by drawLine(), renderCircle(), renderLine(), and renderRectangle().
|
inline |
Render a circle
circle | the circle to render |
Implements com.example.graphics.render.Renderer.
Definition at line 29 of file ConsoleRenderer.java.
References drawPixel(), com.example.graphics.model.Circle.getRadius(), com.example.graphics.model.Circle.getX(), and com.example.graphics.model.Circle.getY().
|
inline |
Render a line
line | the line to render |
Implements com.example.graphics.render.Renderer.
Definition at line 81 of file ConsoleRenderer.java.
References drawPixel(), com.example.graphics.model.Line.getX1(), com.example.graphics.model.Line.getX2(), com.example.graphics.model.Line.getY1(), and com.example.graphics.model.Line.getY2().
|
inline |
Render a rectangle
rectangle | the rectangle to render |
Implements com.example.graphics.render.Renderer.
Definition at line 61 of file ConsoleRenderer.java.
References drawPixel(), com.example.graphics.model.Rectangle.getHeight(), com.example.graphics.model.Rectangle.getWidth(), com.example.graphics.model.Rectangle.getX(), and com.example.graphics.model.Rectangle.getY().
|
inline |
Render a triangle
triangle | the triangle to render |
Implements com.example.graphics.render.Renderer.
Definition at line 114 of file ConsoleRenderer.java.
References drawLine(), com.example.graphics.model.Triangle.getX1(), com.example.graphics.model.Triangle.getX2(), com.example.graphics.model.Triangle.getX3(), com.example.graphics.model.Triangle.getY1(), com.example.graphics.model.Triangle.getY2(), and com.example.graphics.model.Triangle.getY3().
|
private |
Definition at line 15 of file ConsoleRenderer.java.
Referenced by clear(), display(), and drawPixel().
|
private |
Definition at line 14 of file ConsoleRenderer.java.
Referenced by ConsoleRenderer(), clear(), display(), and drawPixel().
|
private |
Definition at line 13 of file ConsoleRenderer.java.
Referenced by ConsoleRenderer(), clear(), and display().