< prev index next >

src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 2026,2037 **** static class RoundishRectIterator implements PathIterator { double x, y, w, h, aw, ah; AffineTransform affine; int index; ! double ctrlpts[][]; ! int types[]; private static final double angle = Math.PI / 4.0; private static final double a = 1.0 - Math.cos(angle); private static final double b = Math.tan(angle); private static final double c = Math.sqrt(1.0 + b * b) - 1 + a; --- 2026,2037 ---- static class RoundishRectIterator implements PathIterator { double x, y, w, h, aw, ah; AffineTransform affine; int index; ! double[][] ctrlpts; ! int[] types; private static final double angle = Math.PI / 4.0; private static final double a = 1.0 - Math.cos(angle); private static final double b = Math.tan(angle); private static final double c = Math.sqrt(1.0 + b * b) - 1 + a;
*** 2040,2050 **** // For each array: // 4 values for each point {v0, v1, v2, v3}: // point = (x + v0 * w + v1 * arcWidth, // y + v2 * h + v3 * arcHeight); ! private static final double CtrlPtTemplate[][] = { { 0.0, 0.0, 1.0, 0.0 }, /* BOTTOM LEFT corner */ { 0.0, 0.0, 1.0, -0.5 }, /* BOTTOM LEFT arc start */ { 0.0, 0.0, 1.0, -acv, /* BOTTOM LEFT arc curve */ 0.0, acv, 1.0, 0.0, 0.0, 0.5, 1.0, 0.0 }, --- 2040,2050 ---- // For each array: // 4 values for each point {v0, v1, v2, v3}: // point = (x + v0 * w + v1 * arcWidth, // y + v2 * h + v3 * arcHeight); ! private static final double[][] CtrlPtTemplate = { { 0.0, 0.0, 1.0, 0.0 }, /* BOTTOM LEFT corner */ { 0.0, 0.0, 1.0, -0.5 }, /* BOTTOM LEFT arc start */ { 0.0, 0.0, 1.0, -acv, /* BOTTOM LEFT arc curve */ 0.0, acv, 1.0, 0.0, 0.0, 0.5, 1.0, 0.0 },
*** 2063,2073 **** { 0.0, acv, 0.0, 0.0, /* TOP LEFT arc curve */ 0.0, 0.0, 0.0, acv, 0.0, 0.0, 0.0, 0.5 }, {}, /* Closing path element */ }; ! private static final int CornerFlags[] = { RoundRectClipShape.BOTTOM_LEFT, RoundRectClipShape.BOTTOM_RIGHT, RoundRectClipShape.TOP_RIGHT, RoundRectClipShape.TOP_LEFT, }; --- 2063,2073 ---- { 0.0, acv, 0.0, 0.0, /* TOP LEFT arc curve */ 0.0, 0.0, 0.0, acv, 0.0, 0.0, 0.0, 0.5 }, {}, /* Closing path element */ }; ! private static final int[] CornerFlags = { RoundRectClipShape.BOTTOM_LEFT, RoundRectClipShape.BOTTOM_RIGHT, RoundRectClipShape.TOP_RIGHT, RoundRectClipShape.TOP_LEFT, };
*** 2124,2134 **** public int currentSegment(float[] coords) { if (isDone()) { throw new NoSuchElementException("roundrect iterator out of bounds"); } ! double ctrls[] = ctrlpts[index]; int nc = 0; for (int i = 0; i < ctrls.length; i += 4) { coords[nc++] = (float) (x + ctrls[i + 0] * w + ctrls[i + 1] * aw); coords[nc++] = (float) (y + ctrls[i + 2] * h + ctrls[i + 3] * ah); } --- 2124,2134 ---- public int currentSegment(float[] coords) { if (isDone()) { throw new NoSuchElementException("roundrect iterator out of bounds"); } ! double[] ctrls = ctrlpts[index]; int nc = 0; for (int i = 0; i < ctrls.length; i += 4) { coords[nc++] = (float) (x + ctrls[i + 0] * w + ctrls[i + 1] * aw); coords[nc++] = (float) (y + ctrls[i + 2] * h + ctrls[i + 3] * ah); }
*** 2140,2150 **** public int currentSegment(double[] coords) { if (isDone()) { throw new NoSuchElementException("roundrect iterator out of bounds"); } ! double ctrls[] = ctrlpts[index]; int nc = 0; for (int i = 0; i < ctrls.length; i += 4) { coords[nc++] = x + ctrls[i + 0] * w + ctrls[i + 1] * aw; coords[nc++] = y + ctrls[i + 2] * h + ctrls[i + 3] * ah; } --- 2140,2150 ---- public int currentSegment(double[] coords) { if (isDone()) { throw new NoSuchElementException("roundrect iterator out of bounds"); } ! double[] ctrls = ctrlpts[index]; int nc = 0; for (int i = 0; i < ctrls.length; i += 4) { coords[nc++] = x + ctrls[i + 0] * w + ctrls[i + 1] * aw; coords[nc++] = y + ctrls[i + 2] * h + ctrls[i + 3] * ah; }
< prev index next >