/** * 指定した属性でJDGradientPaintを構築します. * * @param p1 ユーザー空間で最初に指定されたPoint<br> * p2 ユーザー空間で2番目に指定されたPoint<br> * ; c1 ポイントp1のカラー<br> * c2 ポイントp2のカラー<br> * cp p1からp2間の制御点 cols 制御点のカラー gTyp 塗りのタイプ */ public JDGradientPaint( Point2D p1, Point2D p2, Color c1, Color c2, float[] cp, Color[] cols, int gType) { this.p1 = p1; this.p2 = p2; this.c1 = c1; this.c2 = c2; this.controlPoints = cp; this.colors = cols; this.gType = gType; dx = (float) (p2.getX() - p1.getX()); dy = (float) (p2.getY() - p1.getY()); distance = (float) Math.sqrt(dx * dx + dy * dy); startC = new float[4]; endC = new float[4]; startC = c1.getComponents(startC); endC = c2.getComponents(endC); }