Renders instance on a given context
@method render
@param {CanvasRenderingContext2D} ctx context to render instance on
541223
function(ctx, noTransform) {
      ctx.save();
      this.transform(ctx);

      var groupScaleFactor = Math.max(this.scaleX, this.scaleY);

      for (var i = 0, len = this.objects.length, object; object = this.objects[i]; i++) {
        var originalScaleFactor = object.borderScaleFactor;
        object.borderScaleFactor = groupScaleFactor;
        object.render(ctx);
        object.borderScaleFactor = originalScaleFactor;
      }
      if (!noTransform && this.active) {
        this.drawBorders(ctx);
        this.hideCorners || this.drawCorners(ctx);
      }
      ctx.restore();
      this.setCoords();
    }
920249
function RenderContext() {
		this._aBuffer = [];
		var that = this;
		this.add = function() {
			that._aBuffer.push.apply(that._aBuffer, arguments);
		};
		this.addWithParam = function(s, o) {
			for (var n in o) {
				var reg = new RegExp("\{" + n + "\}","g");
				s = s.replace(reg,o[n]);
			}
			that.add(s);
		};
		this.toString = function() {
			return that._aBuffer.join("");
		};
	}
1365302
def render(self, template: str, **vars) -> str:
        
        vars.setdefault('ctx', self._ctx)
        return self._renderer.render(template, **vars)
1116795
@Override
	public void paint(final RenderContext renderContext) {
		super.paint(renderContext);

		if (!DebugUtil.isDebugFeaturesEnabled() || !(renderContext instanceof WebXmlRenderContext)) {
			return;
		}

		XmlStringBuilder xml = ((WebXmlRenderContext) renderContext).getWriter();

		xml.appendTag("ui:debug");
		writeDebugInfo(getUI(), xml);
		xml.appendEndTag("ui:debug");
	}
1251232
@Override
	public void paint(final RenderContext renderContext) {

		if (!doTransform) {
			super.paint(renderContext);
			return;
		}

		if (!(renderContext instanceof WebXmlRenderContext)) {
			LOG.warn("Unable to transform a " + renderContext);
			super.paint(renderContext);
			return;
		}
		LOG.debug("Transform XML Interceptor: Start");

		UIContext uic = UIContextHolder.getCurrent();

		// Set up a render context to buffer the XML payload.
		StringWriter xmlBuffer = new StringWriter();
		PrintWriter xmlWriter = new PrintWriter(xmlBuffer);

		WebXmlRenderContext xmlContext = new WebXmlRenderContext(xmlWriter, uic.getLocale());

		super.paint(xmlContext);  // write the XML to the buffer

		// Get a handle to the true PrintWriter.
		WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
		PrintWriter writer = webRenderContext.getWriter();

		/*
		 * Switch the response content-type to HTML.
		 * In theory the transformation could be to ANYTHING (not just HTML) so perhaps it would make more sense to
		 *    write a new interceptor "ContentTypeInterceptor" which attempts to sniff payloads and choose the correct
		 *    content-type. This is exactly the kind of thing IE6 loved to do, so perhaps it's a bad idea.
		 */
		Response response = getResponse();
		response.setContentType(WebUtilities.CONTENT_TYPE_HTML);

		String xml = xmlBuffer.toString();
		if (isAllowCorruptCharacters() && !Util.empty(xml)) {
			// Remove illegal HTML characters from the content before transforming it.
			xml = removeCorruptCharacters(xml);
		}
		// Double encode template tokens in the XML
		xml = WebUtilities.doubleEncodeBrackets(xml);
		// Setup temp writer
		StringWriter tempBuffer = new StringWriter();
		PrintWriter tempWriter = new PrintWriter(tempBuffer);
		// Perform the transformation and write the result.
		transform(xml, uic, tempWriter);
		// Decode Double Encoded Brackets
		String tempResp = tempBuffer.toString();
		tempResp = WebUtilities.doubleDecodeBrackets(tempResp);
		// Write response
		writer.write(tempResp);

		LOG.debug("Transform XML Interceptor: Finished");
	}
577782
private void paintContainerResponse(final RenderContext renderContext,
			final AjaxOperation operation) {
		WebXmlRenderContext webRenderContext = (WebXmlRenderContext) renderContext;
		XmlStringBuilder xml = webRenderContext.getWriter();

		// Get trigger's context
		ComponentWithContext trigger = AjaxHelper.getCurrentTriggerAndContext();
		if (trigger == null) {
			throw new SystemException("No context available for trigger " + operation.getTriggerId());
		}

		xml.appendTagOpen("ui:ajaxtarget");
		xml.appendAttribute("id", operation.getTargetContainerId());
		xml.appendAttribute("action", AjaxOperation.AjaxAction.REPLACE_CONTENT.getDesc());
		xml.appendClose();

		// Paint targets - Assume targets are in the same context as the trigger
		UIContextHolder.pushContext(trigger.getContext());
		try {
			for (String targetId : operation.getTargets()) {
				ComponentWithContext target;
				if (targetId.equals(operation.getTriggerId())) {
					target = trigger;
				} else {
					target = WebUtilities.getComponentById(targetId, true);
					if (target == null) {
						LOG.warn("Could not find ajax target to render [" + targetId + "]");
						continue;
					}
				}
				target.getComponent().paint(renderContext);
			}
		} finally {
			UIContextHolder.popContext();
		}

		xml.appendEndTag("ui:ajaxtarget");
	}
788757
function render(ctxt, directive){
    var fn = typeof directive === 'function' ? directive : plugins.compile( directive, false, this[0] );
    for(var i = 0, ii = this.length; i < ii; i++){
      this[i] = replaceWith( this[i], fn( ctxt, false ));
    }
    context = null;
    return this;
  }
146442
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPopup popup = (WPopup) component;
		XmlStringBuilder xml = renderContext.getWriter();
		int width = popup.getWidth();
		int height = popup.getHeight();
		String targetWindow = popup.getTargetWindow();

		xml.appendTagOpen("ui:popup");
		xml.appendUrlAttribute("url", popup.getUrl());
		xml.appendOptionalAttribute("width", width > 0, width);
		xml.appendOptionalAttribute("height", height > 0, height);
		xml.appendOptionalAttribute("resizable", popup.isResizable(), "true");
		xml.appendOptionalAttribute("showScrollbars", popup.isScrollable(), "true");
		xml.appendOptionalAttribute("targetWindow", !Util.empty(targetWindow), targetWindow);
		xml.appendClose();
		xml.appendEndTag("ui:popup");
	}
303993
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WInternalLink link = (WInternalLink) component;
		XmlStringBuilder xml = renderContext.getWriter();

		if (Util.empty(link.getText())) {
			return;
		}

		xml.appendTagOpen("ui:link");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("toolTip", link.getToolTip());
		xml.appendOptionalAttribute("accessibleText", link.getAccessibleText());
		xml.appendUrlAttribute("url", "#" + link.getReference().getId());
		xml.appendClose();
		xml.appendEscaped(link.getText());
		xml.appendEndTag("ui:link");

	}
62628
def render(template, context=None, **kwargs):
    
    renderer = Renderer()
    return renderer.render(template, context, **kwargs)
63093
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WSelectToggle toggle = (WSelectToggle) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("ui:selecttoggle");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");

		State state = toggle.getState();

		if (State.ALL.equals(state)) {
			xml.appendAttribute("selected", "all");
		} else if (State.NONE.equals(state)) {
			xml.appendAttribute("selected", "none");
		} else {
			xml.appendAttribute("selected", "some");
		}

		xml.appendOptionalAttribute("disabled", toggle.isDisabled(), "true");
		xml.appendAttribute("target", toggle.getTarget().getId());
		xml.appendAttribute("renderAs", toggle.isRenderAsText() ? "text" : "control");
		xml.appendOptionalAttribute("roundTrip", !toggle.isClientSide(), "true");
		xml.appendEnd();
	}
1096422
@Override
	public void render(final WComponent component, final RenderContext context) {
		PrintWriter out = ((WebXmlRenderContext) context).getWriter();

		// If we are debugging the layout, write markers so that the html
		// designer can see where templates start and end.
		boolean debugLayout = ConfigurationProperties.getDeveloperVelocityDebug();

		if (debugLayout) {
			String templateUrl = url;

			if (url == null && component instanceof AbstractWComponent) {
				templateUrl = ((AbstractWComponent) component).getTemplate();
			}

			out.println("<!-- Start " + templateUrl + " -->");
			paintXml(component, out);
			out.println("<!-- End   " + templateUrl + " -->");
		} else {
			paintXml(component, out);
		}
	}
23164
def render(self, ctx=None):
        '''
        
        '''
        super(Pad, self).render(ctx)
        self.set_current_value(self._pad_buffer(self._current_rendered))
        return self._current_rendered
20351
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WDialog dialog = (WDialog) component;
		int state = dialog.getState();

		if (state == WDialog.ACTIVE_STATE || dialog.getTrigger() != null) {
			int width = dialog.getWidth();
			int height = dialog.getHeight();
			String title = dialog.getTitle();
			XmlStringBuilder xml = renderContext.getWriter();

			xml.appendTagOpen("ui:dialog");
			xml.appendAttribute("id", component.getId());
			xml.appendOptionalAttribute("class", component.getHtmlClass());
			xml.appendOptionalAttribute("track", component.isTracking(), "true");
			xml.appendOptionalAttribute("width", width > 0, width);
			xml.appendOptionalAttribute("height", height > 0, height);
			xml.appendOptionalAttribute("modal", dialog.getMode() == WDialog.MODAL, "true");
			xml.appendOptionalAttribute("open", dialog.getState() == WDialog.ACTIVE_STATE, "true");
			xml.appendOptionalAttribute("title", title);

			DialogOpenTrigger trigger = dialog.getTrigger();
			if (trigger != null) {
				xml.appendOptionalAttribute("triggerid", trigger.getId());
				if (dialog.hasLegacyTriggerButton()) {
					xml.appendClose();
					trigger.paint(renderContext);
					xml.appendEndTag("ui:dialog");
				} else {
					xml.appendEnd();
				}
			} else {
				xml.appendEnd();
			}
		}
	}
556030
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WAbbrText abbrText = (WAbbrText) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("abbr");
		xml.appendOptionalAttribute("title", abbrText.getToolTip());
		xml.appendOptionalAttribute("class", abbrText.getHtmlClass());
		xml.appendClose();
		xml.append(abbrText.getText(), abbrText.isEncodeText());
		xml.appendEndTag("abbr");
	}
951036
@Override
	public void paint(final RenderContext renderContext) {
		if (renderContext instanceof WebXmlRenderContext) {
			PageContentHelper.addAllHeadlines(((WebXmlRenderContext) renderContext).getWriter(),
					getUI().getHeaders());
		}

		getBackingComponent().paint(renderContext);
	}
470792
@Override
    public Object render(Map<String, Object> context, LNode... nodes) {
        return nodes[0].render(context);
    }