/*
 * 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 ZonaPlata extends JPanel {
    private int[] xPoints = {60, 300, 700, 940, 900, 700, 300, 100}; // Nuevas coordenadas X de los puntos
    private int[] yPoints = {140, 60, 60, 140, 240, 160, 160, 240}; // Nuevas coordenadas Y de los puntos

    private Color silverColor = new Color(192, 192, 192); // Plata

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(silverColor);
        g.fillPolygon(scalePolygon(xPoints, 2), scalePolygon(yPoints, 2), xPoints.length);
        g.setColor(Color.black);
        g.drawPolygon(scalePolygon(xPoints, 2), scalePolygon(yPoints, 2), 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;
    }
}