src/main/java/com/mxgraph/shape/mxConnectorShape.java
public mxPoint paintMarker(mxGraphics2DCanvas canvas, mxCellState state, boolean source)
	{
		Map<String, Object> style = state.getStyle();
		float strokeWidth = (float) (mxUtils.getFloat(style,
				mxConstants.STYLE_STROKEWIDTH, 1) * canvas.getScale());
		String type = mxUtils.getString(style,
				(source) ? mxConstants.STYLE_STARTARROW
						: mxConstants.STYLE_ENDARROW, "");
		float size = (mxUtils.getFloat(style,
				(source) ? mxConstants.STYLE_STARTSIZE
						: mxConstants.STYLE_ENDSIZE,
				mxConstants.DEFAULT_MARKERSIZE));
		Color color = mxUtils.getColor(style, mxConstants.STYLE_STROKECOLOR);
		canvas.getGraphics().setColor(color);

		double absSize = size * canvas.getScale();

		List<mxPoint> points = state.getAbsolutePoints();
		mxLine markerVector = getMarkerVector(points, source, absSize);
		mxPoint p0 = new mxPoint(markerVector.getX(), markerVector.getY());
		mxPoint pe = markerVector.getEndPoint();

		mxPoint offset = null;

		// Computes the norm and the inverse norm
		double dx = pe.getX() - p0.getX();
		double dy = pe.getY() - p0.getY();

		double dist = Math.max(1, Math.sqrt(dx * dx + dy * dy));
		double unitX = dx / dist;
		double unitY = dy / dist;
		double nx = unitX * absSize;
		double ny = unitY * absSize;

		// Allow for stroke width in the end point used and the 
		// orthogonal vectors describing the direction of the
		// marker
		double strokeX = unitX * strokeWidth;
		double strokeY = unitY * strokeWidth;
		pe = (mxPoint) pe.clone();
		pe.setX(pe.getX() - strokeX / 2.0);
		pe.setY(pe.getY() - strokeY / 2.0);
		
		mxIMarker marker = mxMarkerRegistry.getMarker(type);
		
		if (marker != null)
		{
			offset = marker.paintMarker(canvas, state, type, pe, nx, ny, absSize, source);
			
			if (offset != null)
			{
				offset.setX(offset.getX() - strokeX / 2.0);
				offset.setY(offset.getY() - strokeY / 2.0);
			}
		}
		else
		{
			// Offset for the strokewidth
			nx = dx * strokeWidth / dist;
			ny = dy * strokeWidth / dist;

			offset = new mxPoint(-strokeX / 2.0, -strokeY / 2.0);
		}

		return offset;
	}
/**
	 * Draws the marker for the given edge.
	 * 
	 * @return the offset of the marker from the end of the line
	 */
Draws the marker for the given edge.

@return the offset of the marker from the end of the line
Draws the marker for the given edge . @return the offset of the marker from the end of the line
public mxPoint paintMarker(mxGraphics2DCanvas canvas, mxCellState state, boolean source)
	{
		Map<String, Object> style = state.getStyle();
		float strokeWidth = (float) (mxUtils.getFloat(style,
				mxConstants.STYLE_STROKEWIDTH, 1) * canvas.getScale());
		String type = mxUtils.getString(style,
				(source) ? mxConstants.STYLE_STARTARROW
						: mxConstants.STYLE_ENDARROW, "");
		float size = (mxUtils.getFloat(style,
				(source) ? mxConstants.STYLE_STARTSIZE
						: mxConstants.STYLE_ENDSIZE,
				mxConstants.DEFAULT_MARKERSIZE));
		Color color = mxUtils.getColor(style, mxConstants.STYLE_STROKECOLOR);
		canvas.getGraphics().setColor(color);
		double absSize = size * canvas.getScale();
		List<mxPoint> points = state.getAbsolutePoints();
		mxLine markerVector = getMarkerVector(points, source, absSize);
		mxPoint p0 = new mxPoint(markerVector.getX(), markerVector.getY());
		mxPoint pe = markerVector.getEndPoint();
		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 unitX = dx / dist;
		double unitY = dy / dist;
		double nx = unitX * absSize;
		double ny = unitY * absSize;
		double strokeX = unitX * strokeWidth;
		double strokeY = unitY * strokeWidth;
		pe = (mxPoint) pe.clone();
		pe.setX(pe.getX() - strokeX / 2.0);
		pe.setY(pe.getY() - strokeY / 2.0);
		mxIMarker marker = mxMarkerRegistry.getMarker(type);
		if (marker != null)
		{
			offset = marker.paintMarker(canvas, state, type, pe, nx, ny, absSize, source);
			if (offset != null)
			{
				offset.setX(offset.getX() - strokeX / 2.0);
				offset.setY(offset.getY() - strokeY / 2.0);
			}
		}
		else
		{
			nx = dx * strokeWidth / dist;
			ny = dy * strokeWidth / dist;
			offset = new mxPoint(-strokeX / 2.0, -strokeY / 2.0);
		}
		return offset;
	}
public mxPoint paintMarker ( mxGraphics2DCanvas canvas , mxCellState state , boolean source ) { Map < String , Object > style = state . getStyle ( ) ; float strokeWidth = ( float ) ( mxUtils . getFloat ( style , mxConstants . STYLE_STROKEWIDTH , 1 ) * canvas . getScale ( ) ) ; String type = mxUtils . getString ( style , ( source ) ? mxConstants . STYLE_STARTARROW : mxConstants . STYLE_ENDARROW , "" ) ; float size = ( mxUtils . getFloat ( style , ( source ) ? mxConstants . STYLE_STARTSIZE : mxConstants . STYLE_ENDSIZE , mxConstants . DEFAULT_MARKERSIZE ) ) ; Color color = mxUtils . getColor ( style , mxConstants . STYLE_STROKECOLOR ) ; canvas . getGraphics ( ) . setColor ( color ) ; double absSize = size * canvas . getScale ( ) ; List < mxPoint > points = state . getAbsolutePoints ( ) ; mxLine markerVector = getMarkerVector ( points , source , absSize ) ; mxPoint p0 = new mxPoint ( markerVector . getX ( ) , markerVector . getY ( ) ) ; mxPoint pe = markerVector . getEndPoint ( ) ; 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 unitX = dx / dist ; double unitY = dy / dist ; double nx = unitX * absSize ; double ny = unitY * absSize ; double strokeX = unitX * strokeWidth ; double strokeY = unitY * strokeWidth ; pe = ( mxPoint ) pe . clone ( ) ; pe . setX ( pe . getX ( ) - strokeX / 2.0 ) ; pe . setY ( pe . getY ( ) - strokeY / 2.0 ) ; mxIMarker marker = mxMarkerRegistry . getMarker ( type ) ; if ( marker != null ) { offset = marker . paintMarker ( canvas , state , type , pe , nx , ny , absSize , source ) ; if ( offset != null ) { offset . setX ( offset . getX ( ) - strokeX / 2.0 ) ; offset . setY ( offset . getY ( ) - strokeY / 2.0 ) ; } } else { nx = dx * strokeWidth / dist ; ny = dy * strokeWidth / dist ; offset = new mxPoint ( - strokeX / 2.0 , - strokeY / 2.0 ) ; } return offset ; }
Draws the marker for the given edge.
Draws the marker for the given edge .
// Computes the norm and the inverse norm // Allow for stroke width in the end point used and the  // orthogonal vectors describing the direction of the // marker // Offset for the strokewidth