Paints the barcode. If no exception was thrown a valid barcode is available.
1645
public void paintCode() {
        int maxErr, lenErr, tot, pad;
        if ((options & PDF417_USE_RAW_CODEWORDS) != 0) {
            if (lenCodewords > MAX_DATA_CODEWORDS || lenCodewords < 1 || lenCodewords != codewords[0]) {
                throw new IllegalArgumentException("Invalid codeword size.");
            }
        }
        else {
            if (text == null)
                throw new NullPointerException("Text cannot be null.");
            if (text.length > ABSOLUTE_MAX_TEXT_SIZE) {
                throw new IndexOutOfBoundsException("The text is too big.");
            }
            segmentList = new SegmentList();
            breakString();
            //dumpList();
            assemble();
            segmentList = null;
            codewords[0] = lenCodewords = cwPtr;
        }
        maxErr = maxPossibleErrorLevel(MAX_DATA_CODEWORDS + 2 - lenCodewords);
        if ((options & PDF417_USE_ERROR_LEVEL) == 0) {
            if (lenCodewords < 41)
                errorLevel = 2;
            else if (lenCodewords < 161)
                errorLevel = 3;
            else if (lenCodewords < 321)
                errorLevel = 4;
            else
                errorLevel = 5;
        }
        if (errorLevel < 0)
            errorLevel = 0;
        else if (errorLevel > maxErr)
            errorLevel = maxErr;
        if (codeColumns < 1)
            codeColumns = 1;
        else if (codeColumns > 30)
            codeColumns = 30;
        if (codeRows < 3)
            codeRows = 3;
        else if (codeRows > 90)
            codeRows = 90;
        lenErr = 2 << errorLevel;
        boolean fixedColumn = (options & PDF417_FIXED_ROWS) == 0;
        boolean skipRowColAdjust = false;
        tot = lenCodewords + lenErr;
        if ((options & PDF417_FIXED_RECTANGLE) != 0) {
            tot = codeColumns * codeRows;
            if (tot > MAX_DATA_CODEWORDS + 2) {
                tot = getMaxSquare();
            }
            if (tot < lenCodewords + lenErr)
                tot = lenCodewords + lenErr;
            else
                skipRowColAdjust = true;
        }
        else if ((options & (PDF417_FIXED_COLUMNS | PDF417_FIXED_ROWS)) == 0) {
            double c, b;
            fixedColumn = true;
            if (aspectRatio < 0.001)
                aspectRatio = 0.001f;
            else if (aspectRatio > 1000)
                aspectRatio = 1000;
            b = 73 * aspectRatio - 4;
            c = (-b + Math.sqrt(b * b + 4 * 17 * aspectRatio * (lenCodewords + lenErr) * yHeight)) / (2 * 17 * aspectRatio);
            codeColumns = (int)(c + 0.5);
            if (codeColumns < 1)
                codeColumns = 1;
            else if (codeColumns > 30)
                codeColumns = 30;
        }
        if (!skipRowColAdjust) {
            if (fixedColumn) {
                codeRows = (tot - 1) / codeColumns + 1;
                if (codeRows < 3)
                    codeRows = 3;
                else if (codeRows > 90) {
                    codeRows = 90;
                    codeColumns = (tot - 1) / 90 + 1;
                }
            }
            else {
                codeColumns = (tot - 1) / codeRows + 1;
                if (codeColumns > 30) {
                    codeColumns = 30;
                    codeRows = (tot - 1) / 30 + 1;
                }
            }
            tot = codeRows * codeColumns;
        }
        if (tot > MAX_DATA_CODEWORDS + 2) {
            tot = getMaxSquare();
        }
        errorLevel = maxPossibleErrorLevel(tot - lenCodewords);
        lenErr = 2 << errorLevel;
        pad = tot - lenErr - lenCodewords;
        if ((options & PDF417_USE_MACRO) != 0) {
            // the padding comes before the control block
            System.arraycopy(codewords, macroIndex, codewords, macroIndex + pad, pad);
            cwPtr = lenCodewords + pad;
            while (pad-- != 0)
                codewords[macroIndex++] = TEXT_MODE;
        }
        else {
            cwPtr = lenCodewords;
            while (pad-- != 0)
                codewords[cwPtr++] = TEXT_MODE;
        }
        codewords[0] = lenCodewords = cwPtr;
        calculateErrorCorrection(lenCodewords);
        lenCodewords = tot;
        outPaintCode();
    }
436126
private void setupPaints() {
    barPaint.setColor(barColor);
    barPaint.setAntiAlias(true);
    barPaint.setStyle(Style.STROKE);
    barPaint.setStrokeWidth(barWidth);

    rimPaint.setColor(rimColor);
    rimPaint.setAntiAlias(true);
    rimPaint.setStyle(Style.STROKE);
    rimPaint.setStrokeWidth(rimWidth);
  }
698238
def draw(self, mode, selection):
        
        if not self._linked:
            raise RuntimeError('Cannot draw program if code has not been set')
        # Init
        gl.check_error('Check before draw')
        mode = as_enum(mode)
        # Draw
        if len(selection) == 3:
            # Selection based on indices
            id_, gtype, count = selection
            if count:
                self._pre_draw()
                ibuf = self._parser.get_object(id_)
                ibuf.activate()
                gl.glDrawElements(mode, count, as_enum(gtype), None)
                ibuf.deactivate()
        else:
            # Selection based on start and count
            first, count = selection
            if count:
                self._pre_draw()
                gl.glDrawArrays(mode, first, count)
        # Wrap up
        gl.check_error('Check after draw')
        self._post_draw()
916254
@Override
	public void paint(final RenderContext renderContext) {
		// Check interceptor is enabled
		if (!DebugValidateXML.isEnabled()) {
			super.paint(renderContext);
			return;
		}

		if (!(renderContext instanceof WebXmlRenderContext)) {
			LOG.warn("Unable to validate against a " + renderContext);
			super.paint(renderContext);
			return;
		}

		LOG.debug("Validate XML Interceptor: Start");

		WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
		PrintWriter writer = webRenderContext.getWriter();

		// Generate XML
		StringWriter tempBuffer = new StringWriter();
		PrintWriter tempWriter = new PrintWriter(tempBuffer);
		WebXmlRenderContext tempContext = new WebXmlRenderContext(tempWriter, UIContextHolder.
				getCurrent().getLocale());

		super.paint(tempContext);
		String xml = tempBuffer.toString();

		// If no errors, check against the schema
		String error = DebugValidateXML.validateXMLAgainstSchema(xml);

		if (error != null) {
			// XML is NOT valid, so Report Errors and Wrap the original XML
			LOG.debug("Validate XML Interceptor: XML Has Errors");
			writer.println("<div>");

			writer.println("<div>");
			writer.println("Invalid XML");
			writer.println("<ul><li>" + WebUtilities.encode(error) + "</li></ul>");
			writer.println("<br/>");
			writer.println("</div>");

			// If a schema error detected, Wrap XML so line numbers reported in validation message are correct
			String testXML = DebugValidateXML.wrapXMLInRootElement(xml);
			paintOriginalXML(testXML, writer);

			writer.println("</div>");
		} else {
			// XML is valid
			writer.write(xml);
		}

		LOG.debug("Validate XML Interceptor: Finished");
	}
100075
def paintEvent(self, event):
        
        if not self.autoRaise() or (self._hovered and self.isEnabled()):
            super(XComboBox, self).paintEvent(event)
            
            text = QComboBox.currentText(self)
            if not text and self._hint and not self.lineEdit():
                text = self._hint
                palette = self.palette()
                with XPainter(self) as painter:
                    painter.setPen(palette.color(palette.Disabled, palette.Text))
                    painter.drawText(5, 0, self.width(), self.height(),
                                     Qt.AlignLeft | Qt.AlignVCenter,
                                     self.currentText())
            
        else:
            palette = self.palette()
            
            with XPainter(self) as painter:
                text = QComboBox.currentText(self)
                if not text:
                    text = self.hint()
                    painter.setPen(palette.color(palette.Disabled,
                                                 palette.WindowText))
                
                painter.drawText(5, 0, self.width(), self.height(),
                                 Qt.AlignLeft | Qt.AlignVCenter, text)
                
                x = self.width() - 15
                y = 4
                pixmap = QPixmap(resources.find('img/treeview/triangle_down.png'))
                painter.drawPixmap(x, y, pixmap)
37944
def after_painting(flag = true, & block)
      if flag
        @peer.after_paint_action = PaintAction.new(& block)
      else
        @peer.after_paint_action = nil
      end
    end
339717
def paintEvent(self, event):
        """"""
        painter = QPainter(self)
        painter.setRenderHint(QPainter.Antialiasing)
        # Decoration
        painter.fillPath(self.path_current, QBrush(self.color))
        painter.strokePath(self.path_decoration, QPen(self.color_decoration,
                                                      self.stroke_decoration))
133783
def repaint
      acolor = get_color($reversecolor, @color, @bgcolor)
      #@parent.window.printstring( @row, 0, "|%s|" % ("-"*@width), acolor)
      @parent.window.mvwhline( @row, 1, Ncurses::ACS_HLINE, @width)
      # these 2 are probably overwritten by the borders
      @parent.window.mvaddch( @row, 0, Ncurses::ACS_LTEE)
      @parent.window.mvaddch( @row, @width+1, Ncurses::ACS_RTEE)
    end
814444
private void paintCheckIconEnabled(Graphics2D g, int width, int height) {
        g.setPaint(iconEnabled);
        g.drawRoundRect(0, 1, width-1, height-2, 4, 4);
    }
344901
private void paintCheckIconDisabledAndSelected(Graphics2D g, int width, int height) {
        Shape s = shapeGenerator.createCheckMark(0, 0, width, height);

        g.setPaint(iconDisabledSelected);
        g.fill(s);

    }
868471
def render(self, code):
        
        if self._callbacks['initialize'] is not None:
            self._callbacks['initialize'](code)
        ypos = 1.0
        for cc, line in enumerate(code):
            """
            Pack line to list give better gfx result, otherwise in can
            result in aliasing gaps
            '11010111' -> [2, -1, 1, -1, 3]
            """
            line += ' '
            c = 1
            mlist = []
            for i in range(0, len(line) - 1):
                if line[i] == line[i+1]:
                    c += 1
                else:
                    if line[i] == "1":
                        mlist.append(c)
                    else:
                        mlist.append(-c)
                    c = 1
            # Left quiet zone is x startposition
            xpos = self.quiet_zone
            bxs = xpos  # x start of barcode
            for mod in mlist:
                if mod < 1:
                    color = self.background
                else:
                    color = self.foreground
                # remove painting for background colored tiles?
                self._callbacks['paint_module'](
                    xpos, ypos, self.module_width * abs(mod), color
                )
                xpos += self.module_width * abs(mod)
            bxe = xpos
            # Add right quiet zone to every line, except last line,
            # quiet zone already provided with background,
            # should it be removed complety?
            if (cc + 1) != len(code):
                self._callbacks['paint_module'](
                    xpos, ypos, self.quiet_zone, self.background
                )
            ypos += self.module_height
        if self.text and self._callbacks['paint_text'] is not None:
            ypos += self.text_distance
            if self.center_text:
                # better center position for text
                xpos = bxs + ((bxe - bxs) / 2.0)
            else:
                xpos = bxs
            self._callbacks['paint_text'](xpos, ypos)
        return self._callbacks['finish']()
678570
public void paint (Graphics2D gfx)
    {
        // for debugging, show the bobble bounds
        gfx.setColor(Color.RED);
        gfx.drawRect(_sx - _dx, _sy - _dy, _dx * 2, _dy * 2);
    }
179208
def paintEvent(self, event):
        
        pen = QPen(Qt.DashLine)
        pen.setColor(QColor('red'))
        with XPainter(self) as painter:
            painter.setPen(pen)
            clr = QColor('black')
            clr.setAlpha(100)
            painter.setBrush(clr)
            
            painter.drawRect(self._region)
528040
def paintEvent(self, event):
        
        super(IconLineEdit, self).paintEvent(event)
        painter = QPainter(self)

        rect = self.geometry()
        space = int((rect.height())/6)
        h = rect.height() - space
        w = rect.width() - h

        if self._icon_visible:
            if self._status and self._status_set:
                pixmap = self._set_icon.pixmap(h, h)
            elif self._status:
                pixmap = self._valid_icon.pixmap(h, h)
            else:
                pixmap = self._invalid_icon.pixmap(h, h)

            painter.drawPixmap(w, space, pixmap)

        application_style = QApplication.style().objectName()
        if self._application_style != application_style:
            self._application_style = application_style
            self._refresh()

        # Small hack to gurantee correct padding on Spyder start
        if self._paint_count < 5:
            self._paint_count += 1
            self._refresh()
552506
def paint( self, painter, option, widget ):
        
        painter.save()
        pen = QPen(self.color())
        pen.setWidth(2)
        painter.setPen(pen)
        painter.drawPath(self._basePath)
        painter.setRenderHint(painter.Antialiasing)
        
        
        pen.setColor(QColor('white'))
        painter.setPen(pen)
        painter.setBrush(self.color())
        for ellipse in self._ellipses:
            painter.drawEllipse(ellipse, 6, 6)
        
        painter.restore()
572897
def on_paint(self, event):
        ''''''
        dc = wx.AutoBufferedPaintDC(self)
        dc.DrawBitmap(self._bmp, 0, 0)
1163314
protected void paint(IDrawVisitor drawVisitor, IRenderingElement diagram) {
        if (diagram == null) return;

        // cache the diagram for quick-redraw
        this.cachedDiagram = diagram;

        fontManager.setFontName(rendererModel.getParameter(FontName.class).getValue());
        fontManager.setFontStyle(rendererModel.getParameter(UsedFontStyle.class).getValue());

        drawVisitor.setFontManager(this.fontManager);
        drawVisitor.setTransform(this.transform);
        drawVisitor.setRendererModel(this.rendererModel);
        diagram.accept(drawVisitor);
    }