if ((sides & BOTTOM) == BOTTOM) {
else if (currentSide == BOTTOM) {
    private static void paintSolid(final Graphics g, final Rectangle bounds, final Border border, final BorderColor color, final int sides) {        int rightCorner = (((sides & RIGHT) == RIGHT) ? border.right : 1);        int leftCorner = (((sides & LEFT) == LEFT) ? border.left - 1 : 0);//adjust for bug in polygon filling?        int topCorner = (((sides & TOP) == TOP) ? border.top - 1 : 0);        int bottomCorner = (((sides & BOTTOM) == BOTTOM) ? border.bottom : 1);        Polygon poly;        // CLEAN: duplicate, except for color, with paintGoodBevel() for BOTTOM (PWW 25-01-05)        if ((sides & TOP) == TOP) {            // skip 0 border            /* do earlier if (border.top == 0) {                return;            }*/            // set the color            g.setColor(color.topColor);            // draw a 1px border with a line instead of a polygon            if (border.top == 1) {                g.drawLine(bounds.x, bounds.y, bounds.x + bounds.width - 1, bounds.y);                //no, doing all at once return;            } else {                // use polygons for borders over 1px wide                poly = new Polygon();                poly.addPoint(bounds.x, bounds.y);                poly.addPoint(bounds.x + bounds.width - 1, bounds.y);                poly.addPoint(bounds.x + bounds.width - rightCorner, bounds.y + border.top - 1);                poly.addPoint(bounds.x + leftCorner, bounds.y + border.top - 1);                g.fillPolygon(poly);            }            //return;        }        // CLEAN: duplicate, except for color, with paintGoodBevel() for BOTTOM (PWW 25-01-05)        if ((sides & BOTTOM) == BOTTOM) {            /*check earlier if (border.bottom == 0) {                return;            }*/            g.setColor(color.bottomColor);            if (border.bottom == 1) {                g.drawLine(bounds.x, bounds.y + bounds.height - 1,                        bounds.x + bounds.width - 1, bounds.y + bounds.height - 1);                //return;            } else {                poly = new Polygon();                // upper right                poly.addPoint(bounds.x + bounds.width - rightCorner, bounds.y + bounds.height - border.bottom);                // upper left                poly.addPoint(bounds.x + leftCorner, bounds.y + bounds.height - border.bottom);                // lower left                poly.addPoint(bounds.x, bounds.y + bounds.height - 1);                // lower right                poly.addPoint(bounds.x + bounds.width - 1, bounds.y + bounds.height - 1);                g.fillPolygon(poly);            }            //return;        }        // CLEAN: duplicate, except for color, with paintGoodBevel() for BOTTOM (PWW 25-01-05)        if ((sides & RIGHT) == RIGHT) {            /*if (border.right == 0) {                return;            }*/            g.setColor(color.rightColor);            if (border.right == 1) {                g.drawLine(bounds.x + bounds.width - 1, bounds.y,                        bounds.x + bounds.width - 1, bounds.y + bounds.height - 1);                //return;            } else {                poly = new Polygon();                poly.addPoint(bounds.x + bounds.width - 1, bounds.y);                poly.addPoint(bounds.x + bounds.width - border.right, bounds.y + topCorner);                poly.addPoint(bounds.x + bounds.width - border.right, bounds.y + bounds.height - bottomCorner);                poly.addPoint(bounds.x + bounds.width - 1, bounds.y + bounds.height - 1);                g.fillPolygon(poly);            }            //return;        }        // CLEAN: duplicate, except for color, with paintGoodBevel() for BOTTOM (PWW 25-01-05)        if ((sides & LEFT) == LEFT) {            /*if (border.left == 0) {                return;            }*/            g.setColor(color.leftColor);            if (border.left == 1) {                g.drawLine(bounds.x, bounds.y,                        bounds.x, bounds.y + bounds.height - 1);                //return;            } else {                poly = new Polygon();                poly.addPoint(bounds.x, bounds.y);                poly.addPoint(bounds.x + border.left - 1, bounds.y + topCorner);                poly.addPoint(bounds.x + border.left - 1, bounds.y + bounds.height - bottomCorner);                poly.addPoint(bounds.x, bounds.y + bounds.height - 1);                g.fillPolygon(poly);            }            //return;        }    }