Graphic Rendering System
1.0
A Java-based graphic rendering system implementing various design patterns
Loading...
Searching...
No Matches
Rectangle.java
Go to the documentation of this file.
1
package
com.example.graphics.model;
2
3
import
com.example.graphics.visitor.ShapeVisitor;
4
8
public
class
Rectangle
implements
Shape
{
9
private
int
x
;
10
private
int
y
;
11
private
int
width
;
12
private
int
height
;
13
21
public
Rectangle
(
int
x
,
int
y
,
int
width
,
int
height
) {
22
this.x =
x
;
23
this.y =
y
;
24
this.width =
width
;
25
this.height =
height
;
26
}
27
28
@Override
29
public
int
getX
() {
30
return
x
;
31
}
32
33
@Override
34
public
int
getY
() {
35
return
y
;
36
}
37
38
@Override
39
public
void
setPosition
(
int
x
,
int
y
) {
40
this.x =
x
;
41
this.y =
y
;
42
}
43
48
public
int
getWidth
() {
49
return
width
;
50
}
51
56
public
void
setWidth
(
int
width
) {
57
this.width =
width
;
58
}
59
64
public
int
getHeight
() {
65
return
height
;
66
}
67
72
public
void
setHeight
(
int
height
) {
73
this.height =
height
;
74
}
75
81
public
void
setSize
(
int
width
,
int
height
) {
82
this.width =
width
;
83
this.height =
height
;
84
}
85
86
@Override
87
public
void
accept
(
ShapeVisitor
visitor
) {
88
visitor
.visit(
this
);
89
}
90
91
@Override
92
public
Shape
clone
() {
93
return
new
Rectangle
(this.x, this.y, this.width, this.height);
94
}
95
}
com.example.graphics.model.Rectangle.setPosition
void setPosition(int x, int y)
Definition
Rectangle.java:39
com.example.graphics.model.Rectangle.clone
Shape clone()
Definition
Rectangle.java:92
com.example.graphics.model.Rectangle.accept
void accept(ShapeVisitor visitor)
Definition
Rectangle.java:87
com.example.graphics.model.Rectangle.getY
int getY()
Definition
Rectangle.java:34
com.example.graphics.model.Rectangle.width
int width
Definition
Rectangle.java:11
com.example.graphics.model.Rectangle.x
int x
Definition
Rectangle.java:9
com.example.graphics.model.Rectangle.y
int y
Definition
Rectangle.java:10
com.example.graphics.model.Rectangle.getWidth
int getWidth()
Definition
Rectangle.java:48
com.example.graphics.model.Rectangle.setSize
void setSize(int width, int height)
Definition
Rectangle.java:81
com.example.graphics.model.Rectangle.Rectangle
Rectangle(int x, int y, int width, int height)
Definition
Rectangle.java:21
com.example.graphics.model.Rectangle.getX
int getX()
Definition
Rectangle.java:29
com.example.graphics.model.Rectangle.getHeight
int getHeight()
Definition
Rectangle.java:64
com.example.graphics.model.Rectangle.setHeight
void setHeight(int height)
Definition
Rectangle.java:72
com.example.graphics.model.Rectangle.height
int height
Definition
Rectangle.java:12
com.example.graphics.model.Rectangle.setWidth
void setWidth(int width)
Definition
Rectangle.java:56
com.example.graphics.model.Shape
Definition
Shape.java:10
com.example.graphics.visitor.ShapeVisitor
Definition
ShapeVisitor.java:13
com.example.graphics.visitor
Definition
JsonExportVisitor.java:1
src
main
java
com
example
graphics
model
Rectangle.java
Generated on
for Graphic Rendering System by
1.14.0