44 lines
1.1 KiB
Java
44 lines
1.1 KiB
Java
package Modelo;
|
|
|
|
/*
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
|
*/
|
|
|
|
/**
|
|
*
|
|
* @author reyes
|
|
*/
|
|
public abstract class Lienzo {
|
|
private int acho;
|
|
private int alto;
|
|
int x;
|
|
int y;
|
|
public char lienzo [][];
|
|
|
|
public Lienzo(int ancho, int alto, char lienzo[][]){
|
|
this.acho=ancho;
|
|
this.alto=alto;
|
|
this.lienzo=lienzo;
|
|
}
|
|
public void limpiarMatriz(char[][] lienzo, int filas, int col){
|
|
for(int i=0;i<filas;i++){
|
|
for(int j=0;j<col;j++){
|
|
lienzo[i][j]=' ';
|
|
}
|
|
System.out.println("");
|
|
}
|
|
}
|
|
public void setPen(int x, int y, char c){
|
|
lienzo[x][y]=c;
|
|
}
|
|
public void paint(int filas, int col, char[][] lienzo){
|
|
for(int i=0;i<filas;i++){
|
|
for(int j=0;j<col;j++){
|
|
System.out.print(lienzo[i][j]);
|
|
}
|
|
System.out.println("");
|
|
}
|
|
}
|
|
}
|