public void draw(Graphics2D g2, Point2D ph, Point2D pe, float lineWidth, Color lineColour){
        
        if(arrowStyle.equals(DEFAULT_ARROW)) return;
        
        
        // used for compute the arrow head angle
        final double ARROW_ANGLE = Math.PI / 6;
        final double ARROW_LENGTH = 8;
        double dx = pe.getX() - ph.getX();
        double dy = pe.getY() - ph.getY();
        double angle = Math.atan2(dy, dx);
        
        // compute the arrow angle when edge moves
        double x1 = pe.getX() - ARROW_LENGTH * Math.cos(angle - ARROW_ANGLE);
        double y1 = pe.getY() - ARROW_LENGTH * Math.sin(angle - ARROW_ANGLE);
        double x2 = pe.getX() - ARROW_LENGTH * Math.cos(angle + ARROW_ANGLE);
        double y2 = pe.getY() - ARROW_LENGTH * Math.sin(angle + ARROW_ANGLE);
        
        // draw a basic < or > shap to represents an arrow head
        GeneralPath path = new GeneralPath();
        path.moveTo((float) pe.getX(), (float) pe.getY());
        path.lineTo((float) x1, (float) y1);
        
        path.moveTo((float) x2, (float) y2);
        path.lineTo((float) pe.getX(), (float) pe.getY()); 
        
        Color oldColor = g2.getColor();
        
        g2.setColor(lineColour);
       
        g2.draw(path);
        g2.setColor(oldColor);
    }