/*
 * 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
 */
package Vista;

/**
 *
 * @author mario
 */
import javax.swing.*;
import java.awt.*;

class ZonaDiamante extends JPanel {
    private int[] xPoints = {10, 90, 100, 220, 230, 310, 260, 210, 110, 60}; // Nuevas coordenadas X de los puntos
    private int[] yPoints = {30, 0, 61, 61, 0, 30, 170, 154, 154, 170}; // Nuevas coordenadas Y de los puntos

    private Color diamondColor = new Color(224, 116, 186); // Diamante

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(diamondColor);
        g.fillPolygon(scalePolygon(xPoints, 3), scalePolygon(yPoints, 3), xPoints.length);
        g.setColor(Color.black);
        g.drawPolygon(scalePolygon(xPoints, 3), scalePolygon(yPoints, 3), xPoints.length);
    }

    private int[] scalePolygon(int[] points, double scaleFactor) {
        int[] scaledPoints = new int[points.length];
        for (int i = 0; i < points.length; i++) {
            scaledPoints[i] = (int) (points[i] * scaleFactor);
        }
        return scaledPoints;
    }
}