@Override
    public void draw(Graphics2D g2) {
        
        Color oldColour = g2.getColor();
        // Antialiasing
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        
        // point (x1,y1)  connects to start node
        // point (x2,y2)  connects to end node
        double x1 = getConnectionPoints()[0].getX();
        double x2 = getConnectionPoints()[1].getX();
        double y1 = getConnectionPoints()[0].getY();
        double y2 = getConnectionPoints()[1].getY();
        
        // The distance between point(x1,y1) and point(x2,y2)
        double distance = Math.sqrt(Math.abs(x1-x2)*Math.abs(x1-x2) + 
                                    Math.abs(y1-y2)*Math.abs(y1-y2));
        double h = Math.tan(Math.toRadians(arcAngle)) * distance/2;
        //ctrlX = x1 + distance/2;
        //ctrlY = y1 - h;
        QuadCurve2D arc = new QuadCurve2D.Double(x1, y1, ctrlX, ctrlY, x2, y2);
        FontMetrics fontMetrics = g2.getFontMetrics();
        
        // When arc on drag draw the agnle lines
        if(onDrag){
            g2.setColor(GraphCanvas.selectorColour);
            g2.setStroke(new BasicStroke(1,
			BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER,
			1.f, new float[]{5.0f, 3.0f}, 0));
            g2.draw(new Line2D.Double(x1, y1, x2, y2));
            g2.draw(new Line2D.Double(x1,y1,ctrlX,ctrlY));
            g2.draw(new Line2D.Double(x2,y2,ctrlX,ctrlY));
            String arcAngleStr = "Arc Angle: " + arcAngle;
            float width = fontMetrics.stringWidth(arcAngleStr);
            g2.drawString(arcAngleStr, (float)((x1+x2)/2 - width/2), (float)((y1+y2)/2));
            onDrag = false;
        }
        
        g2.setStroke(getLineStroke());
        g2.setColor(getLineColour());
        g2.draw(arc);
        
        // compute label and arrow position
        // middle point of (x1, y1) (x2, y2)
        float mx1 = (float) (x1+x2)/2;
        float my1 = (float) (y1+y2)/2;
        // middle point of ctrl point to (mx1,my1)
        float mx = (float) (mx1+ctrlX)/2;
        float my = (float) (my1+ctrlY)/2;
        
        // draw label
        if(!getLabel().isEmpty()){
            // Draw lable, labels colour balck
            g2.setColor(Color.BLACK);
            float width = fontMetrics.stringWidth(getLabel());
            g2.drawString(getLabel(), mx - width/2, my - 5.0f);
        }
        Point2D ctrlPoint = new Point2D.Double(ctrlX, ctrlY);
        // draw arrow
        getStartArrow().draw(g2, ctrlPoint,getConnectionPoints()[0], 
                 getLinewidth(), getLineColour());
        
        getEndArrow().draw(g2, ctrlPoint,getConnectionPoints()[1], 
                 getLinewidth(), getLineColour());
        
        // draw arrow string
        String arrows = getArrowString();
        float width = fontMetrics.stringWidth(arrows);
        if (!arrows.equals("-")){
            g2.setColor(getLineColour());
            g2.drawString(arrows, mx - width/2, my - 5.0f - fontMetrics.getHeight());
        }
        
        
        g2.setColor(oldColour);
    }