public mxPoint drawMarker(Element parent,Object type,mxPoint p0,mxPoint pe,float size,float strokeWidth,String color){
  mxPoint offset=null;
  double dx=pe.getX() - p0.getX();
  double dy=pe.getY() - p0.getY();
  double dist=Math.max(1,Math.sqrt(dx * dx + dy * dy));
  double absSize=size * scale;
  double nx=dx * absSize / dist;
  double ny=dy * absSize / dist;
  pe=(mxPoint)pe.clone();
  pe.setX(pe.getX() - nx * strokeWidth / (2 * size));
  pe.setY(pe.getY() - ny * strokeWidth / (2 * size));
  nx*=0.5 + strokeWidth / 2;
  ny*=0.5 + strokeWidth / 2;
  Element path=document.createElement("path");
  path.setAttribute("stroke-width",String.valueOf(strokeWidth * scale));
  path.setAttribute("stroke",color);
  path.setAttribute("fill",color);
  String d=null;
  if (type.equals(mxConstants.ARROW_CLASSIC) || type.equals(mxConstants.ARROW_BLOCK)) {
    d="M " + pe.getX() + " "+ pe.getY()+ " L "+ (pe.getX() - nx - ny / 2)+ " "+ (pe.getY() - ny + nx / 2)+ ((!type.equals(mxConstants.ARROW_CLASSIC)) ? "" : " L " + (pe.getX() - nx * 3 / 4) + " "+ (pe.getY() - ny * 3 / 4))+ " L "+ (pe.getX() + ny / 2 - nx)+ " "+ (pe.getY() - ny - nx / 2)+ " z";
  }
 else   if (type.equals(mxConstants.ARROW_OPEN)) {
    nx*=1.2;
    ny*=1.2;
    d="M " + (pe.getX() - nx - ny / 2) + " "+ (pe.getY() - ny + nx / 2)+ " L "+ (pe.getX() - nx / 6)+ " "+ (pe.getY() - ny / 6)+ " L "+ (pe.getX() + ny / 2 - nx)+ " "+ (pe.getY() - ny - nx / 2)+ " M "+ pe.getX()+ " "+ pe.getY();
    path.setAttribute("fill","none");
  }
 else   if (type.equals(mxConstants.ARROW_OVAL)) {
    nx*=1.2;
    ny*=1.2;
    absSize*=1.2;
    d="M " + (pe.getX() - ny / 2) + " "+ (pe.getY() + nx / 2)+ " a "+ (absSize / 2)+ " "+ (absSize / 2)+ " 0  1,1 "+ (nx / 8)+ " "+ (ny / 8)+ " z";
  }
 else   if (type.equals(mxConstants.ARROW_DIAMOND)) {
    d="M " + (pe.getX() + nx / 2) + " "+ (pe.getY() + ny / 2)+ " L "+ (pe.getX() - ny / 2)+ " "+ (pe.getY() + nx / 2)+ " L "+ (pe.getX() - nx / 2)+ " "+ (pe.getY() - ny / 2)+ " L "+ (pe.getX() + ny / 2)+ " "+ (pe.getY() - nx / 2)+ " z";
  }
  if (d != null) {
    path.setAttribute("d",d);
    parent.appendChild(path);
  }
  return offset;
}

public mxPoint drawMarker ( Element parent , Object type , mxPoint p0 , mxPoint pe , float size , float strokeWidth , String color ) { mxPoint offset = null ; double dx = pe . getX ( ) - p0 . getX ( ) ; double dy = pe . getY ( ) - p0 . getY ( ) ; double dist = Math . max ( 1 , Math . sqrt ( dx * dx + dy * dy ) ) ; double absSize = size * scale ; double nx = dx * absSize / dist ; double ny = dy * absSize / dist ; pe = ( mxPoint ) pe . clone ( ) ; pe . setX ( pe . getX ( ) - nx * strokeWidth / ( 2 * size ) ) ; pe . setY ( pe . getY ( ) - ny * strokeWidth / ( 2 * size ) ) ; nx *= 0.5 + strokeWidth / 2 ; ny *= 0.5 + strokeWidth / 2 ; Element path = document . createElement ( "path" ) ; path . setAttribute ( "stroke-width" , String . valueOf ( strokeWidth * scale ) ) ; path . setAttribute ( "stroke" , color ) ; path . setAttribute ( "fill" , color ) ; String d = null ; if ( type . equals ( mxConstants . ARROW_CLASSIC ) || type . equals ( mxConstants . ARROW_BLOCK ) ) { d = "M " + pe . getX ( ) + " " + pe . getY ( ) + " L " + ( pe . getX ( ) - nx - ny / 2 ) + " " + ( pe . getY ( ) - ny + nx / 2 ) + ( ( ! type . equals ( mxConstants . ARROW_CLASSIC ) ) ? "" : " L " + ( pe . getX ( ) - nx * 3 / 4 ) + " " + ( pe . getY ( ) - ny * 3 / 4 ) ) + " L " + ( pe . getX ( ) + ny / 2 - nx ) + " " + ( pe . getY ( ) - ny - nx / 2 ) + " z" ; } else if ( type . equals ( mxConstants . ARROW_OPEN ) ) { nx *= 1.2 ; ny *= 1.2 ; d = "M " + ( pe . getX ( ) - nx - ny / 2 ) + " " + ( pe . getY ( ) - ny + nx / 2 ) + " L " + ( pe . getX ( ) - nx / 6 ) + " " + ( pe . getY ( ) - ny / 6 ) + " L " + ( pe . getX ( ) + ny / 2 - nx ) + " " + ( pe . getY ( ) - ny - nx / 2 ) + " M " + pe . getX ( ) + " " + pe . getY ( ) ; path . setAttribute ( "fill" , "none" ) ; } else if ( type . equals ( mxConstants . ARROW_OVAL ) ) { nx *= 1.2 ; ny *= 1.2 ; absSize *= 1.2 ; d = "M " + ( pe . getX ( ) - ny / 2 ) + " " + ( pe . getY ( ) + nx / 2 ) + " a " + ( absSize / 2 ) + " " + ( absSize / 2 ) + " 0  1,1 " + ( nx / 8 ) + " " + ( ny / 8 ) + " z" ; } else if ( type . equals ( mxConstants . ARROW_DIAMOND ) ) { d = "M " + ( pe . getX ( ) + nx / 2 ) + " " + ( pe . getY ( ) + ny / 2 ) + " L " + ( pe . getX ( ) - ny / 2 ) + " " + ( pe . getY ( ) + nx / 2 ) + " L " + ( pe . getX ( ) - nx / 2 ) + " " + ( pe . getY ( ) - ny / 2 ) + " L " + ( pe . getX ( ) + ny / 2 ) + " " + ( pe . getY ( ) - nx / 2 ) + " z" ; } if ( d != null ) { path . setAttribute ( "d" , d ) ; parent . appendChild ( path ) ; } return offset ; }
draws the specified marker as a child path in the given parent .
