constructor(x, y, scope = globalScope, dir = 'RIGHT') {
        super(x, y, scope, dir, 1);
        /*
        this.scope['TflipFlop'].push(this);
        */
        this.directionFixed = true;
        this.fixedBitWidth = true;
        this.setDimensions(20, 20);
        this.rectangleObject = true;
        this.clockInp = new Node(-20, +10, 0, this, 1, 'Clock');
        this.dInp = new Node(-20, -10, 0, this, this.bitWidth, 'T');
        this.qOutput = new Node(20, -10, 1, this, this.bitWidth, 'Q');
        this.qInvOutput = new Node(20, 10, 1, this, this.bitWidth, 'Q Inverse');
        this.reset = new Node(10, 20, 0, this, 1, 'Asynchronous Reset');
        this.preset = new Node(0, 20, 0, this, this.bitWidth, 'Preset');
        this.en = new Node(-10, 20, 0, this, 1, 'Enable');
        this.masterState = 0;
        this.slaveState = 0;
        this.prevClockState = 0;

        // this.wasClicked = false;
    }
@class
TflipFlop
T flip flop has 5 input nodes:
clock, data input, preset, reset ,enable.
@extends CircuitElement
@param {number} x - x coord of element
@param {number} y - y coord of element
@param {Scope=} scope - the ciruit in which we want the Element
@param {string=} dir - direcion in which element has to drawn
@category sequential