package math.complex;

import javax.swing.*;
import java.awt.*;

public class Complex13 extends JFrame {
    private static final long serialVersionUID = 431281611636634328L;
    public static final int fw = 1000;
    public static final int fh = 1000;

    public static void main(String[] args) {
        SwingUtilities.invokeLater(() -> {
            Complex c = new Complex(0, 1, CType.Normal);
            Complex c0 = c.pow(0);
            Complex c1 = c.pow(1);
            Complex c2 = c.pow(2);
            Complex c3 = c.pow(3);
            Complex c4 = c.pow(4);
            Complex c5 = c.pow(5);
            Complex c6 = c.pow(6);
            Complex[] tab = {c0, c1, c2, c3, c4, c5, c6};
            System.out.println(tab[0].toString(CType.Trigo));
            System.out.println(tab[1].toString(CType.Trigo));
            System.out.println(tab[2].toString(CType.Trigo));
            System.out.println(tab[3].toString(CType.Trigo));
            System.out.println(tab[4].toString(CType.Trigo));
            System.out.println(tab[5].toString(CType.Trigo));
            System.out.println(tab[6].toString(CType.Trigo));
            new Complex13(new ComplexPanel(tab, false, CType.Trigo));
        });
    }

    public Complex13(JComponent comp) {
        setLayout(null);
        setPreferredSize(new Dimension(fw, fh));
        setBounds((Toolkit.getDefaultToolkit().getScreenSize().width / 2)
                        - (fw / 2),
                (Toolkit.getDefaultToolkit().getScreenSize().height / 2)
                        - (fh / 2), fw, fh);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setTitle("Ramka Graficzna");
        //	setResizable(false);
        JPanel panel = (JPanel) comp;
        panel.setLocation((fw - panel.getWidth()) / 2,
                (fh - panel.getHeight()) / 2);
        add(panel);
        setVisible(true);
    }
}
