private void renderPoly(Graphics2D graphics, Color color, Polygon polygon) { if (polygon != null) { graphics.setColor(color); graphics.setStroke(new BasicStroke(2)); graphics.draw(polygon); graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20)); graphics.fill(polygon); } } }
public void draw(Graphics2D g2d) { g2d.setStroke(new BasicStroke((float) 1.5)); g2d.draw(curve); g2d.setStroke(new BasicStroke()); }
g2.setColor(Color.white); g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND)); new BasicStroke( strokeWeight, new BasicStroke( strokeWeight, BasicStroke.CAP_BUTT, g2.setStroke(normalStroke); shapesIt = storageShapes.iterator(); while(shapesIt.hasNext()){ g2.setColor(shape.getFillColor()); g2.fill(path); g2.setStroke(dashStroke); g2.draw(path); g2.fill(path); g2.draw(path); g2.draw(path);
for (BufferedImage icon : icons) graphics.setStroke(new BasicStroke(2)); graphics.setColor(COLOR_ICON_BACKGROUND); graphics.fillOval( point.getX() - totalWidth / 2 + currentPosX - bgPadding, icon.getHeight() + bgPadding * 2); graphics.setColor(COLOR_ICON_BORDER); graphics.drawOval( point.getX() - totalWidth / 2 + currentPosX - bgPadding, null); graphics.setColor(COLOR_ICON_BORDER_FILL); Arc2D.Double arc = new Arc2D.Double( point.getX() - totalWidth / 2 + currentPosX - bgPadding, gorilla.getAttacksUntilSwitch()) / DemonicGorilla.ATTACKS_PER_SWITCH, Arc2D.OPEN); graphics.draw(arc);
pointerLength = Math.max(pointerLength, radius); imageGraphic = image.createGraphics(); imageGraphic.setColor(circleColor); imageGraphic.fillOval( circleCenterX - radius, circleCenterY - radius, radius * 2, radius * 2); imageGraphic.setColor(wedgeColor); imageGraphic.fillArc( circleCenterX - radius, calculateWedgeAngle(pointerDirection, wedgeWidth), wedgeWidth * 2); imageGraphic.setColor(barUncColor); imageGraphic.fillRect( circleCenterX - barUncWidth, calculateEndOfPointer( circleCenterX, circleCenterY, pointerLength, pointerDirection); imageGraphic.setStroke(new java.awt.BasicStroke(3)); imageGraphic.setColor(pointerColor); imageGraphic.draw( new java.awt.geom.Line2D.Double( circleCenterX, circleCenterY, endPoint[0], endPoint[1])); imageGraphic.setStroke(new java.awt.BasicStroke(3)); imageGraphic.setColor(barColor); imageGraphic.draw( new java.awt.geom.Line2D.Double( circleCenterX, circleCenterY, circleCenterX, circleCenterY - barHeight));
g2.setColor(paintColor); g2.drawString(nodeStr, (float) (nodeTab + start.getX()), (float) (start.getY() + nodeAscent)); g2.setColor(curColor); double layerMultiplier = (1.0 + belowLineSkip + aboveLineSkip + parentSkip); double layerHeight = nodeHeight * layerMultiplier; g2.draw(new Line2D.Double(lineStartX, lineStartY, lineEndX, lineEndY)); childStartX += cWidth; if (i < t.children().length - 1) {
protected void drawDecoration(Graphics2D graphics, Paint line, BasicStroke stroke) { if(line == null) { return; } graphics.setPaint(line); List<Outline> lst = new ArrayList<>(); LineDecoration deco = getShape().getLineDecoration(); Outline head = getHeadDecoration(graphics, deco, stroke); if (head != null) { lst.add(head); } Outline tail = getTailDecoration(graphics, deco, stroke); if (tail != null) { lst.add(tail); } for(Outline o : lst){ java.awt.Shape s = o.getOutline(); Path p = o.getPath(); graphics.setRenderingHint(Drawable.GRADIENT_SHAPE, s); if(p.isFilled()) { graphics.fill(s); } if(p.isStroked()) { graphics.draw(s); } } }
public void plotDirectedEdge(Graphics2D g2, double lat, double lon, double lat2, double lon2, float width) { g2.setStroke(new BasicStroke(width)); int startLon = (int) getX(lon); int startLat = (int) getY(lat); int destLon = (int) getX(lon2); int destLat = (int) getY(lat2); g2.drawLine(startLon, startLat, destLon, destLat); // only for deep zoom show direction if (scaleX < 0.0001) { g2.setStroke(new BasicStroke(3)); Path2D.Float path = new Path2D.Float(); path.moveTo(destLon, destLat); path.lineTo(destLon + 6, destLat - 2); path.lineTo(destLon + 6, destLat + 2); path.lineTo(destLon, destLat); AffineTransform at = new AffineTransform(); double angle = Math.atan2(lat2 - lat, lon2 - lon); at.rotate(-angle + Math.PI, destLon, destLat); path.transform(at); g2.draw(path); } }
public static void drawBorder(UParam param, HtmlColor color, ColorMapper mapper, UShapeSized sized, Shape shape, Graphics2D g2d, double x, double y) { if (color == null) { return; } if (color instanceof HtmlColorGradient) { final GradientPaint paint = getPaintGradient(x, y, mapper, sized.getWidth(), sized.getHeight(), color); g2d.setPaint(paint); } else { g2d.setColor(mapper.getMappedColor(color)); } DriverLineG2d.manageStroke(param, g2d); g2d.draw(shape); }
public void drawRoute(Graphics2D g, double lon1, double lat1, double lon2, double lat2, boolean straight, boolean dashed) { int x1 = translateLongitudeToX(lon1); int y1 = translateLatitudeToY(lat1); int x2 = translateLongitudeToX(lon2); int y2 = translateLatitudeToY(lat2); if (dashed) { g.setStroke(TangoColorFactory.FAT_DASHED_STROKE); } if (straight) { g.drawLine(x1, y1, x2, y2); } else { double xDistPart = (x2 - x1) / 3.0; double yDistPart = (y2 - y1) / 3.0; double ctrlx1 = x1 + xDistPart + yDistPart; double ctrly1 = y1 - xDistPart + yDistPart; double ctrlx2 = x2 - xDistPart - yDistPart; double ctrly2 = y2 + xDistPart - yDistPart; g.draw(new CubicCurve2D.Double(x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2)); } if (dashed) { g.setStroke(TangoColorFactory.NORMAL_STROKE); } }
@Override public void strokePath() throws IOException { graphics.setComposite(getGraphicsState().getStrokingJavaComposite()); graphics.setPaint(getStrokingPaint()); graphics.setStroke(getStroke()); setClip(); //TODO bbox of shading pattern should be used here? (see fillPath) if (isContentRendered()) { graphics.draw(linePath); } linePath.reset(); }
int y2 = getHeight(); Line2D line = new Line2D.Double(x1, y1, x2, y2); Rectangle2D rect = new Rectangle2D.Double(x, y, width, height); g2d.draw(rect); g2d.draw(line); for (Point2D p : ps) { if (p != null) { g2d.fill(new Ellipse2D.Double(p.getX() - 4, p.getY() - 4, 8, 8)); new Line2D.Double( rectangle.getX(), rectangle.getY(), new Line2D.Double( rectangle.getX(), rectangle.getY() + rectangle.getHeight(),
private void renderTargetOverlay(Graphics2D graphics, NPC actor, Color color) { Polygon objectClickbox = actor.getConvexHull(); if (objectClickbox != null) { graphics.setColor(color); graphics.setStroke(new BasicStroke(2)); graphics.draw(objectClickbox); graphics.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 20)); graphics.fill(objectClickbox); } } }
public static void renderHoverableArea(Graphics2D graphics, Area area, net.runelite.api.Point mousePosition, Color fillColor, Color borderColor, Color borderHoverColor) { if (area != null) { if (area.contains(mousePosition.getX(), mousePosition.getY())) { graphics.setColor(borderHoverColor); } else { graphics.setColor(borderColor); } graphics.draw(area); graphics.setColor(fillColor); graphics.fill(area); } }