Render the current path.

@param g The graphic output.
191993
private void renderPath(Graphic g)
    {
        final int tw = map.getTileWidth();
        final int th = map.getTileHeight();
        for (int i = 0; i < path.getLength(); i++)
        {
            final int x = (int) viewer.getViewpointX(path.getX(i) * (double) tw);
            final int y = (int) viewer.getViewpointY(path.getY(i) * (double) th);
            g.drawRect(x, y - th, tw, th, true);
            if (renderDebug)
            {
                final Tile tile = map.getTile(path.getX(i), path.getY(i));
                if (tile != null)
                {
                    final TilePath tilePath = tile.getFeature(TilePath.class);
                    text.draw(g, x + 2, y - th + 2, String.valueOf(getCost(tilePath.getCategory())));
                }
            }
        }
    }
81743
@Override
    public void update (Graphics g)
    {
        Shape clip = g.getClip();
        Rectangle dirty;
        if (clip != null) {
            dirty = clip.getBounds();
        } else {
            dirty = getRootPane().getBounds();
            // account for our frame insets
            Insets insets = getInsets();
            dirty.x += insets.left;
            dirty.y += insets.top;
        }

        if (_fmgr != null) {
            _fmgr.restoreFromBack(dirty);
        }
    }
1128487
public void updateGraphics(Graphics2D g)
    {
        g.setFont(font);
        g.setColor(color);
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
        g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    }
520906
public void render(Graphic g,
                       Viewer viewer,
                       Origin origin,
                       Shape transformable,
                       List<Collision> cacheColls,
                       Map<Collision, Rectangle> cacheRect)
    {
        if (showCollision)
        {
            final int size = cacheColls.size();
            for (int i = 0; i < size; i++)
            {
                final Collision collision = cacheColls.get(i);
                if (Collision.AUTOMATIC == collision)
                {
                    final int x = (int) Math.round(origin.getX(viewer.getViewpointX(transformable.getX()),
                                                               transformable.getWidth()));
                    final int y = (int) Math.floor(origin.getY(viewer.getViewpointY(transformable.getY()),
                                                               transformable.getHeight()));
                    g.drawRect(x, y, transformable.getWidth(), transformable.getHeight(), false);
                }
                else
                {
                    final Area area = cacheRect.get(collision);
                    final int x = (int) Math.round(viewer.getViewpointX(area.getX()));
                    final int y = (int) Math.floor(viewer.getViewpointY(area.getY())) - area.getHeight();
                    g.drawRect(x, y, area.getWidth(), area.getHeight(), false);
                }
            }
        }
    }
918486
@Override
	protected String renderImage( String componentName, DiagramType type, String relativeImagePath ) {
		String alt = componentName + " - " + type;
		return "<img src=\"" + relativeImagePath + "\" alt=\"" + alt + "\" />\n";
	}
1241552
public void render(@NonNull Resource output) throws IOException {
      render(output, GraphViz.Format.PNG);
   }
1243362
@Override
    protected void paintComponent(Graphics g) {
        if (!isInitialized()) {
            return;
        }

        final Graphics2D G2 = (Graphics2D) g.create();

        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

        // Translate coordinate system related to insets
        G2.translate(getFramelessOffset().getX(), getFramelessOffset().getY());

        // Draw combined background image
        G2.drawImage(bImage, 0, 0, null);

        // Draw an Arc2d object that will visualize the range of measured values
        if (isRangeOfMeasuredValuesVisible()) {
            G2.setPaint(getModel().getRangeOfMeasuredValuesPaint());
            if (getGaugeType() == GaugeType.TYPE3 || getGaugeType() == GaugeType.TYPE4) {
                final Area area = new Area(getModel().getRadialShapeOfMeasuredValues());
                area.subtract(new Area(LCD));
                G2.fill(area);
            } else {
                G2.fill(getModel().getRadialShapeOfMeasuredValues());
            }
        }

        // Draw LED if enabled
        if (isLedVisible()) {
            G2.drawImage(getCurrentLedImage(), (int) (getGaugeBounds().width * getLedPosition().getX()), (int) (getGaugeBounds().height * getLedPosition().getY()), null);
        }

        // Draw user LED if enabled
        if (isUserLedVisible()) {
            G2.drawImage(getCurrentUserLedImage(), (int) (getGaugeBounds().width * getUserLedPosition().getX()), (int) (getGaugeBounds().height * getUserLedPosition().getY()), null);
        }

        // Draw LCD display
        if (isLcdVisible()) {
            if (getLcdColor() == LcdColor.CUSTOM) {
                G2.setColor(getCustomLcdForeground());
            } else {
                G2.setColor(getLcdColor().TEXT_COLOR);
            }
            G2.setFont(getLcdUnitFont());
            if (isLcdTextVisible()) {
            final double UNIT_STRING_WIDTH;
            if (isLcdUnitStringVisible()) {
                unitLayout = new TextLayout(getLcdUnitString(), G2.getFont(), RENDER_CONTEXT);
                UNIT_BOUNDARY.setFrame(unitLayout.getBounds());
                G2.drawString(getLcdUnitString(), (int) (LCD.getX() + (LCD.getWidth() - UNIT_BOUNDARY.getWidth()) - LCD.getWidth() * 0.03), (int) (LCD.getY() + LCD.getHeight() * 0.76));
                UNIT_STRING_WIDTH = UNIT_BOUNDARY.getWidth();
            } else {
                UNIT_STRING_WIDTH = 0;
            }
            G2.setFont(getLcdValueFont());
            switch (getModel().getNumberSystem()) {
                case HEX:
                    valueLayout = new TextLayout(Integer.toHexString((int) getLcdValue()).toUpperCase(), G2.getFont(), RENDER_CONTEXT);
                    VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                    G2.drawString(Integer.toHexString((int) getLcdValue()).toUpperCase(), (int) (LCD.getX() + (LCD.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - LCD.getWidth() * 0.09), (int) (LCD.getY() + LCD.getHeight() * 0.76));
                    break;

                case OCT:
                    valueLayout = new TextLayout(Integer.toOctalString((int) getLcdValue()), G2.getFont(), RENDER_CONTEXT);
                    VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                    G2.drawString(Integer.toOctalString((int) getLcdValue()), (int) (LCD.getX() + (LCD.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - LCD.getWidth() * 0.09), (int) (LCD.getY() + LCD.getHeight() * 0.76));
                    break;

                case DEC:

                default:
                    valueLayout = new TextLayout(formatLcdValue(getLcdValue()), G2.getFont(), RENDER_CONTEXT);
                    VALUE_BOUNDARY.setFrame(valueLayout.getBounds());
                    G2.drawString(formatLcdValue(getLcdValue()), (int) (LCD.getX() + (LCD.getWidth() - UNIT_STRING_WIDTH - VALUE_BOUNDARY.getWidth()) - LCD.getWidth() * 0.09), (int) (LCD.getY() + LCD.getHeight() * 0.76));
                    break;
            }
            }
            // Draw lcd info string
            if (!getLcdInfoString().isEmpty()) {
                G2.setFont(getLcdInfoFont());
                infoLayout = new TextLayout(getLcdInfoString(), G2.getFont(), RENDER_CONTEXT);
                INFO_BOUNDARY.setFrame(infoLayout.getBounds());
                G2.drawString(getLcdInfoString(), LCD.getBounds().x + 5, LCD.getBounds().y + (int) INFO_BOUNDARY.getHeight() + 5);
            }

            // Draw lcd threshold indicator
            if (getLcdNumberSystem() == NumberSystem.DEC && isLcdThresholdVisible() && getLcdValue() >= getLcdThreshold()) {
                G2.drawImage(lcdThresholdImage, (int) (LCD.getX() + LCD.getHeight() * 0.0568181818), (int) (LCD.getY() + LCD.getHeight() - lcdThresholdImage.getHeight() - LCD.getHeight() * 0.0568181818), null);
            }
        }

        // Draw the active leds in dependence on the current value
        final AffineTransform OLD_TRANSFORM = G2.getTransform();

        final double ACTIVE_LED_ANGLE;
        if (!isLogScale()) {
            ACTIVE_LED_ANGLE = getAngleForValue(getValue());
        } else {
            ACTIVE_LED_ANGLE = Math.toDegrees(UTIL.logOfBase(BASE, getValue() - getMinValue()) * getLogAngleStep());
        }

        if (!getModel().isSingleLedBargraphEnabled()) {
            for (double angle = 0; Double.compare(angle, ACTIVE_LED_ANGLE) <= 0; angle += 5.0) {
                G2.rotate(Math.toRadians(angle + getModel().getBargraphOffset()), CENTER.getX(), CENTER.getY());
                // If sections visible, color the bargraph with the given section colors
                G2.setPaint(ledGradient);
                if (isSectionsVisible()) {
                    // Use defined bargraphColor in areas where no section is defined
                    for (Section section : getSections()) {
                        if (Double.compare(angle, sectionAngles.get(section).getX()) >= 0 && angle < sectionAngles.get(section).getY()) {
                            G2.setPaint(sectionGradients.get(section));
                            break;
                        }
                    }
                } else {
                    G2.setPaint(ledGradient);
                }
                G2.fill(led);
                G2.setTransform(OLD_TRANSFORM);
            }
        } else {   // Draw only one led instead of all active leds
            final double ANGLE = Math.toRadians(((getValue() - getMinValue()) / (getMaxValue() - getMinValue())) * getModel().getApexAngle());
            G2.rotate(ANGLE, CENTER.getX(), CENTER.getY());
            if (isSectionsVisible()) {
                for (Section section : getSections()) {
                    if (Double.compare(ANGLE, sectionAngles.get(section).getX()) >= 0 && ANGLE < sectionAngles.get(section).getY()) {
                        G2.setPaint(sectionGradients.get(section));
                        break;
                    }
                }
            } else {
                G2.setPaint(ledGradient);
            }
            G2.fill(led);
            G2.setTransform(OLD_TRANSFORM);
        }

        // Draw peak value if enabled
        if (isPeakValueEnabled() && isPeakValueVisible()) {
            G2.rotate(Math.toRadians(((getPeakValue() - getMinValue()) / (getMaxValue() - getMinValue())) * getModel().getApexAngle() + getModel().getBargraphOffset()), CENTER.getX(), CENTER.getY());
            G2.fill(led);
            G2.setTransform(OLD_TRANSFORM);
        }

        // Draw the foreground
        if (isForegroundVisible()) {
            G2.drawImage(fImage, 0, 0, null);
        }

        // Draw glow indicator
        if (isGlowVisible()) {
            if (isGlowing()) {
                G2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, getGlowAlpha()));
                G2.drawImage(glowImageOn, 0, 0, null);
                G2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
            } else
            {
                G2.drawImage(glowImageOff, 0, 0, null);
            }
        }

        if (!isEnabled()) {
            G2.drawImage(disabledImage, 0, 0, null);
        }

        G2.dispose();
    }
151147
@Override
    public void render(Graphic g, Handlables featurables)
    {
        for (final Renderable renderable : featurables.get(Renderable.class))
        {
            renderable.render(g);
        }
    }
1087508
@Override
    public void renderTile(Graphic g, MapTile map, Tile tile, int x, int y)
    {
        final int tx = tile.getInTileX();
        final int ty = tile.getInTileY();

        final Tile fogTile = mapFogged.getTile(tx, ty);
        if (fogMap && fogTile != null && fogTile.getNumber() != MapTileFog.NO_FOG)
        {
            fogTiles.setLocation(x, y);
            fogTiles.setTile(fogTile.getNumber());
            fogTiles.render(g);
        }

        final Tile hideTile = mapHidden.getTile(tx, ty);
        if (hideMap && hideTile != null && hideTile.getNumber() != MapTileFog.NO_FOG)
        {
            hideTiles.setTile(hideTile.getNumber());
            hideTiles.setLocation(x, y);
            hideTiles.render(g);
        }
    }
391482
public void render() {
		if (list == -1) {
			throw new RuntimeException("Attempt to render cached operations that have been destroyed");
		}
		
		SlickCallable.enterSafeBlock();
		GL.glCallList(list);
		SlickCallable.leaveSafeBlock();
	}
1373671
private void render(SVG.Path obj)
   {
      debug("Path render");

      if (obj.d == null)
         return;

      updateStyleForElement(state, obj);

      if (!display())
         return;
      if (!visible())
         return;
      if (!state.hasStroke && !state.hasFill)
         return;

      if (obj.transform != null)
         canvas.concat(obj.transform);

      Path  path = (new PathConverter(obj.d)).getPath();

      if (obj.boundingBox == null) {
         obj.boundingBox = calculatePathBounds(path);
      }
      updateParentBoundingBox(obj);

      checkForGradientsAndPatterns(obj);
      checkForClipPath(obj);
      
      boolean  compositing = pushLayer();

      if (state.hasFill) {
         path.setFillType(getFillTypeFromState());
         doFilledPath(obj, path);
      }
      if (state.hasStroke)
         doStroke(path);

      renderMarkers(obj);

      if (compositing)
         popLayer(obj);
   }
573922
public void render (Graphics2D gfx)
    {
        Component host = _host.getComponent();

        int x = _bounds.x, y = _bounds.y;

        if (_centerLabel != null) {
            // render the centerpiece label
            _centerLabel.paint(gfx, x + _centerLabel.closedBounds.x,
                               y + _centerLabel.closedBounds.y, this);
        }

        // render each of our items in turn
        int icount = _items.size();
        for (int i = 0; i < icount; i++) {
            RadialMenuItem item = _items.get(i);
            if (!item.isIncluded(this)) {
                continue;
            }
            // we have to wait and render the active item last
            if (item != _activeItem) {
                item.render(host, this, gfx, x + item.closedBounds.x, y + item.closedBounds.y);
            }
        }

        if (_activeItem != null) {
            _activeItem.render(host, this, gfx, x + _activeItem.closedBounds.x,
                               y + _activeItem.closedBounds.y);
        }

        // render our bounds
//         gfx.setColor(Color.green);
//         gfx.draw(_bounds);
//         gfx.setColor(Color.blue);
//         gfx.draw(_tbounds);
    }
886700
private static void renderY(Graphic g, CollisionFunction function, CollisionRange range, int th, int x)
    {
        if (UtilMath.isBetween(x, range.getMinX(), range.getMaxX()))
        {
            g.drawRect(x, th - function.getRenderY(x) - 1, 0, 0, false);
        }
    }
1022774
public void draw(Graphics2D g) {
		if (needsRefresh)
			refreshCurve();
		g.draw(curve); // Draws the main part of the arrow.
		drawArrow(g, end, control); // Draws the arrow head.
		drawText(g);
	}
400127
protected void initGL() {
		Log.info("Starting display "+width+"x"+height);
		GL.initDisplay(width, height);
		
		if (input == null) {
			input = new Input(height);
		}
		input.init(height);
		// no need to remove listeners?
		//input.removeAllListeners();
		if (game instanceof InputListener) {
			input.removeListener((InputListener) game);
			input.addListener((InputListener) game);
		}

		if (graphics != null) {
			graphics.setDimensions(getWidth(), getHeight());
		}
		lastGame = game;
	}
1313019
protected void drawImage(Graphics2D g) {
		// image observer generator
		Function<Integer, ImageObserver> obs = flags->{
			return (image, infoflags, x, y, width, height)->(infoflags & flags)!=flags;
		};
		ImageObserver obs_w = obs.apply(ImageObserver.WIDTH);
		ImageObserver obs_h = obs.apply(ImageObserver.HEIGHT);
		ImageObserver obs_allbits = obs.apply(ImageObserver.ALLBITS);
		
		Image img = this.img;
		if(img != null){
			Point clickPoint = this.clickPoint;
			if(clickPoint == null){
				double imgRatio = img.getWidth(obs_w)*1.0/img.getHeight(obs_h);
				double panelRatio = this.getWidth()*1.0/this.getHeight();
				if(imgRatio > panelRatio) {
					// image wider than panel
					int height = (int) (this.getWidth()/imgRatio);
					int y = (this.getHeight()-height)/2;
					g.drawImage(img, 0, y, this.getWidth(), y+height, 0, 0, img.getWidth(obs_w), img.getHeight(obs_h), obs_allbits);
				} else {
					// image higher than panel
					int width = (int) (this.getHeight()*imgRatio);
					int x = (this.getWidth()-width)/2;
					g.drawImage(img, x, 0, x+width, this.getHeight(), 0, 0, img.getWidth(obs_w), img.getHeight(obs_h), obs_allbits);
				}
			} else {
				float relX = clickPoint.x / (1.0f * this.getWidth());
				float relY = clickPoint.y / (1.0f * this.getHeight());
				int imgW = img.getWidth(obs_w);
				int imgH = img.getHeight(obs_h);
				int imgX = (int) (relX*imgW);
				int imgY = (int) (relY*imgH);
				
				int dx1,dy1,dx2,dy2, sx1,sy1,sx2,sy2;
				dx1 = dy1 = 0;
				dx2 = this.getWidth();
				dy2 = this.getHeight();
				
				sx1 = imgX-this.getWidth()/2;
				sy1 = imgY-this.getHeight()/2;
				sx2 = imgX+this.getWidth()-(this.getWidth()/2);
				sy2 = imgY+this.getHeight()-(this.getHeight()/2);
				
				// manual clipping of image drawing coordinates
				// depending on OS and window manager this may be needed
				// to prevent trail artifacts when moving the image around
				if(sx1 < 0){
					dx1-=sx1; sx1=0;
				}
				if(sy1 < 0){
					dy1-=sy1; sy1=0;
				}
				if(sx2 > imgW){
					dx2-=(sx2-imgW); sx2=imgW;
				}
				if(sy2 > imgH){
					dy2-=(sy2-imgH); sy2=imgH;
				}
				
				g.drawImage(img, 
						dx1, dy1, dx2, dy2, 
						sx1, sy1, sx2, sy2, 
						obs_allbits);
			}
		}
	}
222550
public static void render(Graphics g, Diagram diagram) {
		for (int i=0;i<diagram.getFigureCount();i++) {
			Figure figure = diagram.getFigure(i);

			if (figure.getData().isFilled()) {
				if (figure.getData().isColor(NonGeometricData.FILL)) {
					g.setColor(figure.getData().getAsColor(NonGeometricData.FILL));
					g.fill(diagram.getFigure(i).getShape());
					g.setAntiAlias(true);
					g.draw(diagram.getFigure(i).getShape());
					g.setAntiAlias(false);
				}
				
				String fill = figure.getData().getAsReference(NonGeometricData.FILL);
				if (diagram.getPatternDef(fill) != null){
					System.out.println("PATTERN");
				}
				if (diagram.getGradient(fill) != null) {
					Gradient gradient = diagram.getGradient(fill);
					Shape shape = diagram.getFigure(i).getShape();
					TexCoordGenerator fg = null;
					if (gradient.isRadial()) {
						fg = new RadialGradientFill(shape, diagram.getFigure(i).getTransform(), gradient);	
					} else {
						fg = new LinearGradientFill(shape, diagram.getFigure(i).getTransform(), gradient);
					}
					
			        Color.white.bind();
					ShapeRenderer.texture(shape, gradient.getImage(), fg);
				}
			}
			
			if (figure.getData().isStroked()) {
				if (figure.getData().isColor(NonGeometricData.STROKE)) {
					g.setColor(figure.getData().getAsColor(NonGeometricData.STROKE));
					g.setLineWidth(figure.getData().getAsFloat(NonGeometricData.STROKE_WIDTH));
					g.setAntiAlias(true);
					g.draw(diagram.getFigure(i).getShape());
					g.setAntiAlias(false);
					g.resetLineWidth();
				}
			}
	
			// DEBUG VERSION
//			g.setColor(Color.black);
//			g.draw(diagram.getFigure(i).getShape());
//			g.setColor(Color.red);
//			g.fill(diagram.getFigure(i).getShape());
		}
	}