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

Public Member Functions

 Rectangle (int x, int y, int width, int height)
void accept (ShapeVisitor visitor)
Shape clone ()
int getHeight ()
int getWidth ()
int getX ()
int getY ()
void setHeight (int height)
void setPosition (int x, int y)
void setSize (int width, int height)
void setWidth (int width)

Private Attributes

int height
int width
int x
int y

Detailed Description

Rectangle implementation of the Shape interface.

Definition at line 8 of file Rectangle.java.

Constructor & Destructor Documentation

◆ Rectangle()

com.example.graphics.model.Rectangle.Rectangle ( int x,
int y,
int width,
int height )
inline

Constructs a rectangle with the specified parameters

Parameters
xthe x coordinate of the top-left corner
ythe y coordinate of the top-left corner
widththe width of the rectangle
heightthe height of the rectangle

Definition at line 21 of file Rectangle.java.

References height, width, x, and y.

Referenced by clone().

Here is the caller graph for this function:

Member Function Documentation

◆ accept()

void com.example.graphics.model.Rectangle.accept ( ShapeVisitor visitor)
inline

Accept method for the Visitor pattern

Parameters
visitorthe visitor to accept

Implements com.example.graphics.model.Shape.

Definition at line 87 of file Rectangle.java.

◆ clone()

Shape com.example.graphics.model.Rectangle.clone ( )
inline

Clone the shape

Returns
a clone of this shape

Implements com.example.graphics.model.Shape.

Definition at line 92 of file Rectangle.java.

References Rectangle().

Here is the call graph for this function:

◆ getHeight()

◆ getWidth()

◆ getX()

◆ getY()

◆ setHeight()

void com.example.graphics.model.Rectangle.setHeight ( int height)
inline

Set the height of the rectangle

Parameters
heightthe new height

Definition at line 72 of file Rectangle.java.

References height.

◆ setPosition()

void com.example.graphics.model.Rectangle.setPosition ( int x,
int y )
inline

Set the position of the shape

Parameters
xthe x coordinate
ythe y coordinate

Implements com.example.graphics.model.Shape.

Definition at line 39 of file Rectangle.java.

References x, and y.

◆ setSize()

void com.example.graphics.model.Rectangle.setSize ( int width,
int height )
inline

Set both width and height of the rectangle at once

Parameters
widththe new width
heightthe new height

Definition at line 81 of file Rectangle.java.

References height, and width.

◆ setWidth()

void com.example.graphics.model.Rectangle.setWidth ( int width)
inline

Set the width of the rectangle

Parameters
widththe new width

Definition at line 56 of file Rectangle.java.

References width.

Member Data Documentation

◆ height

int com.example.graphics.model.Rectangle.height
private

Definition at line 12 of file Rectangle.java.

Referenced by Rectangle(), getHeight(), setHeight(), and setSize().

◆ width

int com.example.graphics.model.Rectangle.width
private

Definition at line 11 of file Rectangle.java.

Referenced by Rectangle(), getWidth(), setSize(), and setWidth().

◆ x

int com.example.graphics.model.Rectangle.x
private

Definition at line 9 of file Rectangle.java.

Referenced by Rectangle(), getX(), and setPosition().

◆ y

int com.example.graphics.model.Rectangle.y
private

Definition at line 10 of file Rectangle.java.

Referenced by Rectangle(), getY(), and setPosition().


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