Draws the selection box.
193313
function(pos) {
    var octx = this.octx,
      options = this.options.crosshair,
      plotOffset = this.plotOffset,
      x = plotOffset.left + Math.round(pos.relX) + 0.5,
      y = plotOffset.top + Math.round(pos.relY) + 0.5;
    
    if (pos.relX < 0 || pos.relY < 0 || pos.relX > this.plotWidth || pos.relY > this.plotHeight) {
      this.el.style.cursor = null;
      D.removeClass(this.el, 'flotr-crosshair');
      return; 
    }
    
    if (options.hideCursor) {
      this.el.style.cursor = 'none';
      D.addClass(this.el, 'flotr-crosshair');
    }
    
    octx.save();
    octx.strokeStyle = options.color;
    octx.lineWidth = 1;
    octx.beginPath();
    
    if (options.mode.indexOf('x') != -1) {
      octx.moveTo(x, plotOffset.top);
      octx.lineTo(x, plotOffset.top + this.plotHeight);
    }
    
    if (options.mode.indexOf('y') != -1) {
      octx.moveTo(plotOffset.left, y);
      octx.lineTo(plotOffset.left + this.plotWidth, y);
    }
    
    octx.stroke();
    octx.restore();
  }
156110
def draw_widget(self, item):
        """"""
        if item:
            self.filter_remove(remember=True)
            selected_id = self.treedata[item]['id']
            item = self.get_toplevel_parent(item)
            widget_id = self.treedata[item]['id']
            wclass = self.treedata[item]['class']
            xmlnode = self.tree_node_to_xml('', item)
            self.previewer.draw(item, widget_id, xmlnode, wclass)
            self.previewer.show_selected(item, selected_id)
            self.filter_restore()
548980
def Draw(self, grid, attr, dc, rect, row, col, is_selected):
        """"""

        render = wx.RendererNative.Get()

        # clear the background
        dc.SetBackgroundMode(wx.SOLID)

        if is_selected:
            dc.SetBrush(wx.Brush(wx.BLUE, wx.SOLID))
            dc.SetPen(wx.Pen(wx.BLUE, 1, wx.SOLID))
        else:
            dc.SetBrush(wx.Brush(wx.WHITE, wx.SOLID))
            dc.SetPen(wx.Pen(wx.WHITE, 1, wx.SOLID))
        dc.DrawRectangleRect(rect)

        cb_lbl = grid.GetCellValue(row, col)
        string_x = rect.x + 2
        string_y = rect.y + 2
        dc.DrawText(cb_lbl, string_x, string_y)

        button_x = rect.x + rect.width - self.iconwidth
        button_y = rect.y
        button_width = self.iconwidth
        button_height = rect.height
        button_size = button_x, button_y, button_width, button_height
        render.DrawComboBoxDropButton(grid, dc, button_size,
                                      wx.CONTROL_CURRENT)
486633
function drawImage(editor) {
	var cm = editor.codemirror;
	var stat = getState(cm);
	var options = editor.options;
	var url = "http://";
	if(options.promptURLs) {
		url = prompt(options.promptTexts.image);
		if(!url) {
			return false;
		}
	}
	_replaceSelection(cm, stat.image, options.insertTexts.image, url);
}
186281
def _draw(self):
        
        self._window.draw(self._width, self._height, self.terminal)
667847
protected void paintBox (Graphics g, Rectangle box)
    {
        // just draw the box in our foreground color
        g.setColor(getForeground());
        g.drawRect(box.x, box.y, box.width, box.height);
    }
259581
def Draw_a_drawing_of_one_sheet(self, nr_of_boxes, box_names):
        
        thickness = 2  # Line thickness
        center_x = []    # x of the center of box[i] on canvas
        center_y = []    # y of the center of box[i] on canvas
        mid_points = []
        box_width = 100  # pixels
        box_height = 100  # pixels
        delta_x = self.screen_width / (nr_of_boxes + 1)
        delta_y = self.screen_height / (nr_of_boxes + 1)
        # Draw the boxes
        for box_nr in range(0, nr_of_boxes):
            center_x.append(delta_x + box_nr * delta_x)
            center_y.append(delta_y + box_nr * delta_y)
            name = box_names[box_nr]
            ident = str(box_nr + 1)
            # Draw one box at the specified location
            mid_points.append(self.box_type_1(
                center_x[box_nr], center_y[box_nr],
                name, ident, box_width,box_height))

        # Draw a line with arrow head to the first box
        x2 = mid_points[0][3][0]
        y2 = mid_points[0][3][1]
        x1 = x2 - 150
        y1 = y2
        line_0 = gui.SvgLine(x1, y1, x2, y2)
        line_0.set_stroke(width=thickness, color='black')
        self.sheet.append(line_0)
        # Add an arrow head to line_0
        head_0 = SvgPolygon(4)
        arrow_height = 20
        arrow_width = arrow_height / 3
        recess = arrow_height / 5
        head_0.add_arrow_coord(line_0, arrow_height, arrow_width, recess)
        head_0.set_stroke(width=thickness, color='black')
        head_0.set_fill(color='blue')
        self.sheet.append(head_0)

        # Draw a rhombus polygon
        x = (center_x[0] + center_x[1]) / 2
        y = (center_y[0] + center_y[1]) / 2
        self.int_id += 1
        str_id = str(self.int_id)
        hor_size = 15  # pixels
        vert_size = 25  # pixels
        rhombus = self.rhombus_polygon(x, y, str_id, hor_size, vert_size)

        # Determine points of the first polyline
        line_1_points = []
        line_1_points.append(mid_points[0][2])
        corner = [rhombus[0][0], mid_points[0][2][1]]
        line_1_points.append(corner)
        line_1_points.append(rhombus[0])
        # Draw a polyline from box_1 to rhombus
        line1 = gui.SvgPolyline(_maxlen=4)
        for pt in line_1_points:
            line1.add_coord(*pt)
        line1.set_stroke(width=thickness, color='black')
        self.sheet.append(line1)

        # Determine points of the second polyline
        line_2_points = []
        line_2_points.append(rhombus[1])
        corner = [rhombus[1][0], mid_points[1][3][1]]
        line_2_points.append(corner)
        line_2_points.append(mid_points[1][3])
        # Drawa polyline from rhombus to box_2
        line2 = gui.SvgPolyline(_maxlen=4)
        for pt in line_2_points:
            line2.add_coord(pt[0], pt[1])
        line2.set_stroke(width=thickness, color='black')
        self.sheet.append(line2)
        
        # Add an arrow head to line2
        head = SvgPolygon(4)
        head.add_arrow_coord(line2, arrow_height, arrow_width, recess)
        head.set_stroke(width=thickness, color='black')
        head.set_fill(color='blue')
        self.sheet.append(head)
159313
function drawSelectionCursor(cm, range, output) {
    var pos = cursorCoords(cm, range.head, "div", null, null, !cm.options.singleCursorHeightPerLine);

    var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor"));
    cursor.style.left = pos.left + "px";
    cursor.style.top = pos.top + "px";
    cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";

    if (pos.other) {
      // Secondary cursor, shown when on a 'jump' in bi-directional text
      var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor"));
      otherCursor.style.display = "";
      otherCursor.style.left = pos.other.left + "px";
      otherCursor.style.top = pos.other.top + "px";
      otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
    }
  }
930448
function drawBars(table) {
        var tableDetails = getTableDetails(table);
        var tableGrid = getTableGrid(tableDetails);
        var rows = getRowBlocks(tableGrid);
        var cols = getColumnBlocks(tableGrid);

        var tablePosition = editor.dom.getPos(table);
        var rowPositions = rows.length > 0 ? findPositions(getTopEdge, getBottomEdge, rows) : [];
        var colPositions = cols.length > 0 ? findPositions(getInnerEdge, getOuterEdge, cols) : [];

        drawRows(rowPositions, table.offsetWidth, tablePosition);
        drawCols(colPositions, table.offsetHeight, tablePosition);
      }
867416
private void drawTicks() {
		// Abort if not attached
		if (!isAttached()) {
			return;
		}

		// Draw the ticks
		int lineWidth = lineElement.getOffsetWidth();
		if (numTicks > 0) {
			// Create the ticks or make them visible
			for (int i = 0; i <= numTicks; i++) {
				Element tick = null;
				if (i < tickElements.size()) {
					tick = tickElements.get(i);
				} else { // Create the new tick
					tick = DOM.createDiv();
					DOM.setStyleAttribute(tick, "position", "absolute");
					DOM.setStyleAttribute(tick, "display", "none");
					DOM.appendChild(getElement(), tick);
					tickElements.add(tick);
				}
				if (enabled) {
					DOM.setElementProperty(tick, "className", SLIDER_TICK);
				} else {
					DOM.setElementProperty(tick, "className", SLIDER_TICK + " "
							+ SLIDER_TICK_SLIDING);
				}
				// Position the tick and make it visible
				DOM.setStyleAttribute(tick, "visibility", "hidden");
				DOM.setStyleAttribute(tick, "display", "");
				int tickWidth = tick.getOffsetWidth();
				int tickLeftOffset = lineLeftOffset + (lineWidth * i / numTicks) - (tickWidth / 2);
				tickLeftOffset = Math.min(tickLeftOffset, lineLeftOffset + lineWidth - tickWidth);
				DOM.setStyleAttribute(tick, "left", tickLeftOffset + "px");
				DOM.setStyleAttribute(tick, "visibility", "visible");
			}

			// Hide unused ticks
			for (int i = (numTicks + 1); i < tickElements.size(); i++) {
				DOM.setStyleAttribute(tickElements.get(i), "display", "none");
			}
		} else { // Hide all ticks
			for (Element elem : tickElements) {
				DOM.setStyleAttribute(elem, "display", "none");
			}
		}
	}
1166320
@Override
    public void draw(Canvas canvas) {
        drawSpacings(canvas);
        drawBaselineGrid(canvas);
        drawKeylines(canvas);
    }
953668
def draw(surface, z_order, colour)
      surface.draw_rectangle(position, size, z_order, colour)
    end
1028137
public void draw(Shape shape, ShapeFill fill) {
		predraw();
		TextureImpl.bindNone();

		ShapeRenderer.draw(shape, fill);

		currentColor.bind();
		postdraw();
	}
1061471
def draw(self):
        
        devs = normal(size=self._sig.shape[1])
        p = inner(self._sig, devs) + self._mu
        self._set_stochastics(p)
232719
public void onDrawFrame(float frameTime)
    {
        if (isEnabled() && (mScene != null) && mPickEventLock.tryLock())
        {
            // Don't call if we are in the middle of processing another pick
            try
            {
                doPick();
            }
            finally
            {
                mPickEventLock.unlock();
            }
        }
    }
32161
function() {

    this.selection.fireSelectEvent('selecting');

    var s = this.selection.selection,
      octx = this.octx,
      options = this.options,
      plotOffset = this.plotOffset,
      prevSelection = this.selection.prevSelection;
    
    if (prevSelection &&
      s.first.x == prevSelection.first.x &&
      s.first.y == prevSelection.first.y && 
      s.second.x == prevSelection.second.x &&
      s.second.y == prevSelection.second.y) {
      return;
    }

    octx.save();
    octx.strokeStyle = this.processColor(options.selection.color, {opacity: 0.8});
    octx.lineWidth = 1;
    octx.lineJoin = 'miter';
    octx.fillStyle = this.processColor(options.selection.color, {opacity: 0.4});

    this.selection.prevSelection = {
      first: { x: s.first.x, y: s.first.y },
      second: { x: s.second.x, y: s.second.y }
    };

    var x = Math.min(s.first.x, s.second.x),
        y = Math.min(s.first.y, s.second.y),
        w = Math.abs(s.second.x - s.first.x),
        h = Math.abs(s.second.y - s.first.y);

    octx.fillRect(x + plotOffset.left+0.5, y + plotOffset.top+0.5, w, h);
    octx.strokeRect(x + plotOffset.left+0.5, y + plotOffset.top+0.5, w, h);
    octx.restore();
  }
479681
function(){
		var cross = this.getcross();
		if(cross.isnull || cross===this.mouseCell){ return;}

		this.mouseCell = cross;

		var xlist = new this.klass.CrossList([cross]);
		if(this.puzzle.playmode){ xlist.ansclear();}
		else                    { xlist.allclear();}

		cross.draw();
	}