Draws the handles for moving arrows in the editor.
963320
function() {

      var data = window.kelmu.data[id];

      if (!data.definitions['step' + data.stepNumber] || !data.definitions['step' + data.stepNumber][data.subStepNumber]) {
        return;
      }

      var step = data.definitions['step' + data.stepNumber][data.subStepNumber];

      container.find('.kelmu-arrow-handle').remove();

      var arrowCounter = 0;
      $.each(step, function(index) {

        if (this.arrow || this.line) {

          var handle1 = $('<div></div>').addClass('kelmu-arrow-handle').attr('data-arrow', arrowCounter).attr('data-type', 'start').attr('data-annotation', index);
          var handle2 = $('<div></div>').addClass('kelmu-arrow-handle').attr('data-arrow', arrowCounter).attr('data-type', 'end').attr('data-annotation', index);
          var handle3 = $('<div></div>').addClass('kelmu-arrow-handle').attr('data-arrow', arrowCounter).attr('data-type', 'middle').attr('data-annotation', index);
          handle1.prependTo(container);
          handle2.prependTo(container);
          handle3.prependTo(container);

          var self = this;
          var arrow = container.find('svg path#arrow-' + arrowCounter);
          arrow.attr('data-prev-x', (self.x2 + self.x1) / 2);
          arrow.attr('data-prev-y', (self.y2 + self.y1) / 2);

          container.find('.kelmu-arrow-handle').css('position', 'absolute').css('cursor', 'move').draggable({
            start: function() {
              $('body').css('cursor', 'move');
            },
            stop: function() {
              $('body').css('cursor', 'auto');
              notifyModifications();
              updateView(true, true);
            }
          });

          handle1.css('top', this.y1);
          handle1.css('left', this.x1);
          handle2.css('top', this.y2);
          handle2.css('left', this.x2);
          handle3.css('top', (this.y2 + this.y1) / 2);
          handle3.css('left', (this.x2 + this.x1) / 2);

          container.find('.kelmu-arrow-handle').on('drag', function(event, ui) {

            var elem = $(this);
            data.selectedElementNumber = parseInt(elem.attr('data-annotation'), 10);

            var arrow = container.find('svg path#arrow-' + $(this).attr('data-arrow'));
            var isStart = $(this).attr('data-type') === 'start';
            var isEnd = $(this).attr('data-type') === 'end';
            var isMiddle = $(this).attr('data-type') === 'middle';
            var previous = arrow.attr('d').split(' ');

            var number = elem.attr('data-annotation');
            var elemData = data.definitions['step' + data.stepNumber][data.subStepNumber][number];

            if (isStart) {
              arrow.attr('d', 'M ' + ui.position.left + ' ' + ui.position.top + ' L ' + previous[4] + ' ' + previous[5]);
              elemData.x1 = ui.position.left;
              elemData.y1 = ui.position.top;
              container.find('.kelmu-arrow-handle[data-annotation="' + elem.attr('data-annotation') + '"][data-type!="start"]').hide();
            } else if (isEnd) {
              arrow.attr('d', 'M ' + previous[1] + ' ' + previous[2] + ' L ' + ui.position.left + ' ' + ui.position.top);
              elemData.x2 = ui.position.left;
              elemData.y2 = ui.position.top;
              container.find('.kelmu-arrow-handle[data-annotation="' + elem.attr('data-annotation') + '"][data-type!="end"]').hide();
            } else if (isMiddle) {
              var prevX = parseFloat(arrow.attr('data-prev-x'));
              var prevY = parseFloat(arrow.attr('data-prev-y'));
              var dx = ui.position.left - prevX;
              var dy = ui.position.top - prevY;
              arrow.attr('d', 'M ' + (parseFloat(previous[1]) + dx) + ' ' + (parseFloat(previous[2]) + dy) + ' L ' + (parseFloat(previous[4]) + dx) + ' ' + (parseFloat(previous[5]) + dy));
              elemData.x1 = parseFloat(previous[1]) + dx;
              elemData.y1 = parseFloat(previous[2]) + dy;
              elemData.x2 = parseFloat(previous[4]) + dx;
              elemData.y2 = parseFloat(previous[5]) + dy;
              container.find('.kelmu-arrow-handle[data-annotation="' + elem.attr('data-annotation') + '"][data-type!="middle"]').hide();
            }

            arrow.attr('data-prev-x', (elemData.x2 + elemData.x1) / 2);
            arrow.attr('data-prev-y', (elemData.y2 + elemData.y1) / 2);

          });

          var handlers = container.find('.kelmu-arrow-handle');
          handlers.css('opacity', 0.2).css('margin-left', '-5px').css('margin-top', '-5px').css('width', '10px');
          handlers.css('height', '10px').css('border-radius', '5px').css('background-color', 'black').css('z-index', 52000);

          arrowCounter += 1;

        }
      });
    }
835448
function drawRadialNeedle(context, options) {
    if (!options.needle) return;

    let value = options.ticksAngle < 360 ?
        drawings.normalizedValue(options).indented : options.value;
    let max = maxRadialRadius(context, options);
    //noinspection JSUnresolvedFunction
    let r1 = abs(max / 100 * options.needleCircleSize);
    //noinspection JSUnresolvedFunction
    let r2 = abs(max / 100 * options.needleCircleSize * 0.75);
    //noinspection JSUnresolvedFunction
    let rIn = abs(max / 100 * options.needleEnd);
    //noinspection JSUnresolvedFunction
    let rStart = abs(options.needleStart ?
            max / 100 * options.needleStart : 0);
    //noinspection JSUnresolvedFunction
    let pad1 = max / 100 * options.needleWidth;
    let pad2 = max / 100 * options.needleWidth / 2;
    let pixelRatio = SmartCanvas.pixelRatio;
    let isFixed = options.animationTarget !== 'needle';

    context.save();

    drawings.drawNeedleShadow(context, options);

    context.rotate(drawings.radians(isFixed ? options.startAngle :
        (options.startAngle + (value -
            options.minValue) / (options.maxValue - options.minValue) *
            options.ticksAngle)));

    context.fillStyle = drawings.linearGradient(
        context,
        options.colorNeedle,
        options.colorNeedleEnd,
        rIn - rStart);

    if (options.needleType === 'arrow') {
        context.beginPath();
        context.moveTo(-pad2, -rStart);
        context.lineTo(-pad1, 0);
        context.lineTo(-1 * pixelRatio, rIn);
        context.lineTo(pixelRatio, rIn);
        context.lineTo(pad1, 0);
        context.lineTo(pad2, -rStart);
        context.closePath();
        context.fill();

        context.beginPath();
        context.lineTo(-0.5 * pixelRatio, rIn);
        context.lineTo(-1 * pixelRatio, rIn);
        context.lineTo(-pad1, 0);
        context.lineTo(-pad2, -rStart);
        context.lineTo(pad2 / 2 * pixelRatio - 2 * pixelRatio, -rStart);
        context.closePath();
        context.fillStyle = options.colorNeedleShadowUp;
        context.fill();
    }

    else { // simple line needle
        context.beginPath();
        context.moveTo(-pad2, rIn);
        context.lineTo(-pad2, rStart);
        context.lineTo(pad2, rStart);
        context.lineTo(pad2, rIn);
        context.closePath();
        context.fill();
    }

    if (options.needleCircleSize) {
        context.restore();

        drawings.drawNeedleShadow(context, options);

        if (options.needleCircleOuter) {
            context.beginPath();
            context.arc(0, 0, r1, 0, PI * 2, true);
            context.fillStyle = drawings.linearGradient(
                context,
                options.colorNeedleCircleOuter,
                options.colorNeedleCircleOuterEnd,
                r1
            );
            context.fill();
            context.closePath();
        }

        if (options.needleCircleInner) {
            context.beginPath();
            context.arc(0, 0, r2, 0, PI * 2, true);
            context.fillStyle = drawings.linearGradient(
                context,
                options.colorNeedleCircleInner,
                options.colorNeedleCircleInnerEnd,
                r2
            );
            context.fill();
            context.closePath();
        }

        context.restore();
    }
}
996196
private void drawKnob() {
		// Abort if not attached
		if (!isAttached()) {
			return;
		}

		// Move the knob to the correct position
		Element knobElement = knobImage.getElement();
		int lineWidth = lineElement.getOffsetWidth();
		int knobWidth = knobElement.getOffsetWidth();
		int knobLeftOffset = (int) (lineLeftOffset + (getKnobPercent() * lineWidth) - (knobWidth / 2));
		knobLeftOffset = Math.min(knobLeftOffset, lineLeftOffset + lineWidth - (knobWidth / 2) - 1);
		DOM.setStyleAttribute(knobElement, "left", knobLeftOffset + "px");
	}
684851
protected void onDraw(Effect shape, Canvas canvas, Paint paint) {
        shape.draw(canvas, paint);
    }
1272978
function updateRectHandles(parent) {
	var handle, h;
	if (parent._handles) {
		// Move handles when dragging
		for (h = 0; h < parent._handles.length; h += 1) {
			handle = parent._handles[h];
			handle.x = parent.x + ((parent.width / 2 * handle._px) + ((parent.fromCenter) ? 0 : parent.width / 2));
			handle.y = parent.y + ((parent.height / 2 * handle._py) + ((parent.fromCenter) ? 0 : parent.height / 2));
		}
	}
	updateRectGuides(parent);
}
448660
def update_handles(self, key, axis, element, ranges, style):
        
        self.teardown_handles()
        plot_data, plot_kwargs, axis_kwargs = self.get_data(element, ranges, style)

        with abbreviated_exception():
            handles = self.init_artists(axis, plot_data, plot_kwargs)
        self.handles.update(handles)
        return axis_kwargs
667042
function() {
      this.ctx = this.canvas.getContext("2d");
      this.ctx.strokeStyle = this.settings.lineColor;
      this.ctx.lineWidth = this.settings.lineWidth;
    }
1287546
def Draw(self, dc):
        '''  '''
        self.hot_map = []
        dc.BeginDrawing()
        brush = wx.Brush( self.BackgroundColour  )
        dc.SetBackground( brush )
        dc.Clear()
        if self.model:
            self.max_depth_seen = 0
            font = self.FontForLabels(dc)
            dc.SetFont(font)
            self._em_size_ = dc.GetFullTextExtent( 'm', font )[0]
            w, h = dc.GetSize()
            self.DrawBox( dc, self.model, 0,0,w,h, hot_map = self.hot_map )
        dc.EndDrawing()
503656
function drawConnectors(dv) {
    if (!dv.showDifferences) return;

    if (dv.svg) {
      clear(dv.svg);
      var w = dv.gap.offsetWidth;
      attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight);
    }
    clear(dv.copyButtons);

    var flip = dv.type == "left";
    var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport();
    var sTopEdit = dv.edit.getScrollInfo().top, sTopOrig = dv.orig.getScrollInfo().top;
    iterateChunks(dv.diff, function(topOrig, botOrig, topEdit, botEdit) {
      if (topEdit > vpEdit.to || botEdit < vpEdit.from ||
          topOrig > vpOrig.to || botOrig < vpOrig.from)
        return;
      var topLpx = dv.orig.heightAtLine(topOrig, "local") - sTopOrig, top = topLpx;
      if (dv.svg) {
        var topRpx = dv.edit.heightAtLine(topEdit, "local") - sTopEdit;
        if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; }
        var botLpx = dv.orig.heightAtLine(botOrig, "local") - sTopOrig;
        var botRpx = dv.edit.heightAtLine(botEdit, "local") - sTopEdit;
        if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; }
        var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx;
        var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx;
        attrs(dv.svg.appendChild(document.createElementNS(svgNS, "path")),
              "d", "M -1 " + topRpx + curveTop + " L " + (w + 2) + " " + botLpx + curveBot + " z",
              "class", dv.classes.connect);
      }
      var copy = dv.copyButtons.appendChild(elt("div", dv.type == "left" ? "\u21dd" : "\u21dc",
                                                "CodeMirror-merge-copy"));
      copy.title = "Revert chunk";
      copy.chunk = {topEdit: topEdit, botEdit: botEdit, topOrig: topOrig, botOrig: botOrig};
      copy.style.top = top + "px";
    });
  }
1260449
@Override
    public void drawWithTransforms(final Context2D context, final double alpha, final BoundingBox bounds)
    {
        if ((context.isSelection()) && (false == isListening()))
        {
            return;
        }
        if (context.isDrag() || isVisible())
        {
            context.saveContainer();

            final Transform xfrm = getPossibleNodeTransform();

            if (null != xfrm)
            {
                context.transform(xfrm);
            }
            drawWithoutTransforms(context, alpha, bounds);

            context.restoreContainer();
        }
    }
130284
function drawHorizontalRule(editor) {
	var cm = editor.codemirror;
	var stat = getState(cm);
	var options = editor.options;
	_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);
}
422168
public static void drawRight(Font font, String s, int x, int y, int width) {
		drawString(font, s, Alignment.RIGHT, x, y, width, Color.white);
	}
797105
function drawCols(cellPositions, tableHeight, tablePosition) {
        Tools.each(cellPositions, function (cellPosition) {
          var left = cellPosition.x - RESIZE_BAR_THICKNESS / 2,
            top = tablePosition.y,
            height = tableHeight,
            width = RESIZE_BAR_THICKNESS;

          editor.dom.add(getBody(), 'div',
            generateBar(RESIZE_BAR_COL_CLASS, RESIZE_BAR_COL_CURSOR_STYLE,
              left, top, height, width, RESIZE_BAR_COL_DATA_ATTRIBUTE, cellPosition.index));
        });
      }
807354
def editors(self):
        
        lay = self.layout()
        return [lay.itemAt(i).widget() for i in range(lay.count())]
1238018
function(x, y){
            var coords = this.renderer.mouseToTileCoords(x, y),
                tile = this.map.get(coords.x, coords.y);
            if(tile){
                this.renderer.hoveredTileX = tile.x;
                this.renderer.hoveredTileY = tile.y;
            } else {
                this.renderer.hoveredTileX = null;
                this.renderer.hoveredTileY = null;
            }
            this.renderer.draw();
        }
958448
void drawDivider(Canvas canvas, Rect bounds, int childIndex) {
        final Drawable divider = getDivider();
        divider.setBounds(bounds);
        divider.draw(canvas);
    }
166692
def makedraw(self):
        
        if self.draw == None:
            self.draw = imdw.Draw(self.pilimage)