-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle.java
More file actions
42 lines (40 loc) · 876 Bytes
/
Copy pathRectangle.java
File metadata and controls
42 lines (40 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Clasa Rectangle
* extinde clasa parinte ModelPrimitiva
* @author claudiu
*
*/
public class Rectangle extends ModelPrimitiva{
private char fld; //Caracterul cu care se va umple corpul obiectului
/**
* Constructorul clasei Rectangle
* @param name - numele obiectului
* @param fld - caracterul de umplere
*/
public Rectangle (String name, char fld){
super();
this.nume = name;
this.fld = fld;
}
/**
* Construieste matricea cu caractere
*/
public void MakeBody(){
body = new char[height][width];
int i, j;
for (i=0;i<height;i++){
for (j=0;j<width;j++){
body[i][j] = fld;
}
}
}
/**
* Redimensioneaza obiectul la noile marimi conform parametrilor si reconstruieste corpul
* @param i
* @param j - noile dimensiuni
*/
public void resize(int i, int j){
super.resize(i, j);
MakeBody();//Reconstruiesc corpul
}
}