@Override
    public void setTimelineEvent(){
        KeyFrame kf = new KeyFrame(Duration.millis(40), 
                new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent t) {
                
                if(electron[0].getCenterX() == POINT3X-100 && 
                       electron[INDEX_ZERO].getCenterY() == POINT2Y){
                    for(int j = 0; j < 3; j++){
                        brightness[j].setOpacity(1);
                    }                         
                        brightness[INDEX_ZERO].setEndX(brightness[INDEX_ZERO].getEndX() 
                            - lightBrightness());
                        brightness[INDEX_ZERO].setEndY(brightness[INDEX_ZERO].getEndY()
                            - lightBrightness());
                        brightness[INDEX_ONE].setEndX(brightness[INDEX_ONE].getEndX());
                        brightness[INDEX_ONE].setEndY(brightness[INDEX_ONE].getEndY() 
                            - lightBrightness());
                        brightness[INDEX_TWO].setEndX(brightness[INDEX_TWO].getEndX() 
                            + lightBrightness());
                        brightness[INDEX_TWO].setEndY(brightness[INDEX_TWO].getEndY() 
                            - lightBrightness());
                }        
                
                for(int i = 1; i <= circleIndex; i++){
                    if(electron[i-1].getCenterX() > POINT1X && 
                        electron[i-1].getCenterY() == POINT1Y){
                        movePoint1(i);
                    }else if(electron[i-1].getCenterX() == POINT1X && 
                        electron[i-1].getCenterY() > POINT2Y){
                        movePoint2(i);
                    }else if(electron[i-1].getCenterX() < POINT3X && 
                        electron[i-1].getCenterY() == POINT2Y){            
                        movePoint3(i);
                    }else if(electron[i-1].getCenterX() == POINT3X && 
                        electron[i-1].getCenterY() < POINT1Y){
                        movePoint4(i);
                    }else if(electron[i-1].getCenterX() < 315 && 
                        electron[i-1].getCenterY() == POINT1Y){                      
                    }
                    if(electron[i-1].getCenterX() == 300 && 
                        electron[i-1].getCenterY() == 350){
                        movePoint5(i);
                        root_circuit.getChildren().remove(electron[i]);
                    }
                } 
                if(circleIndex < electron.length){
                    if(count%5 == 0){
                        circleIndex++;
                        count++;
                    }else{
                        count++;
                    }
                }
                if(componentX <= voltage - (voltage-current)){
                    componentX++;
                }
                if(componentY <= current){
                    componentY++;
                }                 
                graph.addDataToSeries(componentX,componentY,1);
            }});
        
        circuitAnimationTimeline.setCycleCount(Timeline.INDEFINITE);
        circuitAnimationTimeline.getKeyFrames().add(kf);
    }