Here you can find the source of drawBeamVariableRadiusVertical(Graphics g, Color c, int midx, int y1, int y2, int r1, int r2)
public static void drawBeamVariableRadiusVertical(Graphics g, Color c, int midx, int y1, int y2, int r1, int r2)
//package com.java2s; /***//from w ww .ja v a2s . c o m * Copyright (C) 2010 Johan Henriksson * This code is under the Endrov / BSD license. See www.endrov.net * for the full text and how to cite. */ import java.awt.Color; import java.awt.Graphics; public class Main { public static void drawBeamVariableRadiusVertical(Graphics g, Color c, int midx, int y1, int y2, int r1, int r2) { float[] carr = c.getRGBColorComponents(null); for (int y = y1; y < y2; y++) { double fact = (y - y1) / (double) (y2 - y1); int hereBeamR = (int) ((1 - fact) * r1 + fact * r2); for (int i = -hereBeamR; i < hereBeamR; i++) { double weight = 1 - Math.abs(i) / (double) hereBeamR; g.setColor(new Color(carr[0], carr[1], carr[2], (float) weight)); g.drawLine(midx + i, y, midx + i, y); } } } }