Circulo.java 725 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 24 25 26 27 28 29 30 31 32 33
package com.bootcamp20_10.carteles;

public class Circulo implements Forma{
    private float radio;
    private String color;

    public Circulo(float radio, String color) {
        this.radio = radio;
        this.color = color;
    }

    public float getRadio() {
        return radio;
    }

    public void setRadio(float radio) {
        this.radio = radio;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public boolean cuadroFixText(String text) {
        System.out.println("Forma: Circulo\nEspacio: "+this.radio*2+"\nLongitud Texto: "+text.length());
        return text.length() <= radio*2;
    }
}