boolean vertical = ((JSeparator)c).getOrientation() == SwingConstants.VERTICAL;
Dimension size = c.getSize();
XPStyle xp = XPStyle.getXP();
if (xp != null) {
String category = vertical ? "toolbar.separator" : "toolbar.separatorvert";
XPStyle.Skin skin = xp.getSkin(category);
int dx = vertical ? (size.width - skin.getWidth()) / 2 : 0;
int dy = vertical ? 0 : (size.height - skin.getHeight()) / 2;
int dw = vertical ? skin.getWidth() : size.width;
int dh = vertical ? size.height : skin.getHeight();
skin.paintSkin(g, dx, dy, dw, dh, 0);
} else {
Color temp = g.getColor();
UIDefaults table = UIManager.getLookAndFeelDefaults();
Color shadow = table.getColor("ToolBar.shadow");
Color highlight = table.getColor("ToolBar.highlight");
if (vertical) {
int x = (size.width / 2) - 1;
g.setColor(shadow);
g.drawLine(x, 2, x, size.height - 2);
g.setColor(highlight);
g.drawLine(x + 1, 2, x + 1, size.height - 2);
} else {
int y = (size.height / 2) - 1;
g.setColor(shadow);
g.drawLine(2, y, size.width - 2, y);
g.setColor(highlight);
g.drawLine(2, y + 1, size.width - 2, y + 1);
}
g.setColor(temp);
}