Cartel.java 646 Bytes
Newer Older
Cesar Giulano Gonzalez Maqueda committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
package com.bootcamp20_10.carteles;

public class Cartel {
    private Forma forma;
    private String text;

    public Cartel(Forma forma, String text){
        this.forma = forma;
        this.text = text;
    }

    public void rellenarForma(){
        if(forma.cuadroFixText(this.text)){
            if(forma instanceof Rectangulo){
                System.out.println("Se a rellenado el cuadrado exitosamente.");
            }else{
                System.out.println("Se a rellenado el circulo exitosamente.");
            }
        }else{
            System.out.println("No se a podido rellenar la forma, falta espacio");
        }
    }
}