/** * Copyright (c) 2006-2015, JGraph Ltd * Copyright (c) 2006-2015, Gaudenz Alder */ /** * Class: mxLine * * Extends to implement a horizontal line shape. * This shape is registered under in * . * * Constructor: mxLine * * Constructs a new line shape. * * Parameters: * * bounds - that defines the bounds. This is stored in * . * stroke - String that defines the stroke color. Default is 'black'. This is * stored in . * strokewidth - Optional integer that defines the stroke width. Default is * 1. This is stored in . */ function mxLine(bounds, stroke, strokewidth) { mxShape.call(this); this.bounds = bounds; this.stroke = stroke; this.strokewidth = (strokewidth != null) ? strokewidth : 1; }; /** * Extends mxShape. */ mxUtils.extend(mxLine, mxShape); /** * Function: paintVertexShape * * Redirects to redrawPath for subclasses to work. */ mxLine.prototype.paintVertexShape = function(c, x, y, w, h) { var mid = y + h / 2; c.begin(); c.moveTo(x, mid); c.lineTo(x + w, mid); c.stroke(); };