src/share/classes/com/sun/java/swing/plaf/windows/WindowsPopupMenuSeparatorUI.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2014, 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
@@ -48,11 +48,12 @@
return new WindowsPopupMenuSeparatorUI();
}
public void paint(Graphics g, JComponent c) {
Dimension s = c.getSize();
- if (WindowsMenuItemUI.isVistaPainting()) {
+ XPStyle xp = XPStyle.getXP();
+ if (WindowsMenuItemUI.isVistaPainting(xp)) {
int x = 1;
Component parent = c.getParent();
if (parent instanceof JComponent) {
Object gutterOffsetObject =
((JComponent) parent).getClientProperty(
@@ -65,11 +66,11 @@
*/
x = ((Integer) gutterOffsetObject).intValue() - c.getX();
x += WindowsPopupMenuUI.getGutterWidth();
}
}
- Skin skin = XPStyle.getXP().getSkin(c, Part.MP_POPUPSEPARATOR);
+ Skin skin = xp.getSkin(c, Part.MP_POPUPSEPARATOR);
int skinHeight = skin.getHeight();
int y = (s.height - skinHeight) / 2;
skin.paintSkin(g, x, y, s.width - x - 1, skinHeight, State.NORMAL);
} else {
int y = s.height / 2;