public Component(int rotation, int x, int y,int w, int h, double resistance, double emf) {
        super();
        this.setSize(w,h);
        this.setLocation(x,y);
        this.rotation = rotation;
        this.resistance = resistance;
        this.emf = emf;
        this.x = x+100;
        this.y = y+100;
        if (this.rotation % 2 == 1) {
            xone = this.x - 100;
            xtwo = this.x + 100;
            yone = this.y;
            ytwo = this.y;
        }
        if (this.rotation %2 == 0) {
            xone = this.x;
            xtwo = this.x;
            yone = this.y + 100;
            ytwo = this.y - 100;
        }
    }