g2.drawLine(x, y + h - (int) (border.bottom() / 2), x + w, y + h - (int) (border.bottom() / 2));
int offset = (int)(border.bottom() / 2); if (border.bottom() % 2 == 1) { offset += 1; } g2.drawLine(x, y + h - offset, x + w, y + h - offset);
    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) {        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((int) border.top(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset));            g2.drawLine(x, y + (int) (border.top() / 2), x + w - 1, y + (int) (border.top() / 2));        } else if (currentSide == LEFT) {            g2.setColor(color.leftColor());            g2.setStroke(new BasicStroke((int) border.left(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0));            g2.drawLine(x + (int) (border.left() / 2), y, x + (int) (border.left() / 2), y + h - 1);        } else if (currentSide == RIGHT) {            g2.setColor(color.rightColor());            g2.setStroke(new BasicStroke((int) border.right(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, 0));            g2.drawLine(x + w - (int) (border.right() / 2), y, x + w - (int) (border.right() / 2), y + h);        } else if (currentSide == BOTTOM) {            g2.setColor(color.bottomColor());            g2.setStroke(new BasicStroke((int) border.bottom(), BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, pattern, xOffset));            g2.drawLine(x, y + h - (int) (border.bottom() / 2), x + w, y + h - (int) (border.bottom() / 2));        }        g2.setStroke(old_stroke);        g2.setClip(old_clip);    }