private static void paintPatternedRect(final Graphics2D g2, final Rectangle bounds, final Border border, final BorderColor color, final float[] pattern, final int sides, final int currentSide, int xOffset) {
private static void paintPatternedRect(final Graphics2D g2, final Rectangle bounds, final BorderPropertySet border, final BorderPropertySet color, final float[] pattern, final int sides, final int currentSide, int xOffset) {
    private static void paintPatternedRect(final Graphics2D g2, final Rectangle bounds, final Border border, final BorderColor color, final float[] pattern, final int sides, final int currentSide, int xOffset) {        Polygon clip = getBevelledPolygon(bounds, border, sides, currentSide, true);        Shape old_clip = g2.getClip();        if (clip != null) g2.clip(clip);        Stroke old_stroke = g2.getStroke();        int x = bounds.x;        int y = bounds.y;        int w = bounds.width;        int h = bounds.height;        if (currentSide == TOP) {            g2.setColor(color.topColor);            g2.setStroke(new BasicStroke(border.top, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset));            g2.drawLine(x, y + border.top / 2, x + w - 1, y + border.top / 2);        } else if (currentSide == LEFT) {            g2.setColor(color.leftColor);            g2.setStroke(new BasicStroke(border.left, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0));            g2.drawLine(x + border.left / 2, y, x + border.left / 2, y + h - 1);        } else if (currentSide == RIGHT) {            g2.setColor(color.rightColor);            g2.setStroke(new BasicStroke(border.right, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0));            g2.drawLine(x + w - border.right / 2, y, x + w - border.right / 2, y + h);        } else if (currentSide == BOTTOM) {            g2.setColor(color.bottomColor);            g2.setStroke(new BasicStroke(border.bottom, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset));            g2.drawLine(x, y + h - border.bottom / 2, x + w, y + h - border.bottom / 2);        }        g2.setStroke(old_stroke);        g2.setClip(old_clip);    }