|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.fr.design.gui.imenu; |
|
|
|
package com.fr.design.gui.imenu; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.i18n.BidiUtils; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.stable.Constants; |
|
|
|
import com.fr.design.utils.gui.GUIPaintUtils; |
|
|
|
import com.fr.design.utils.gui.GUIPaintUtils; |
|
|
@ -17,11 +18,12 @@ public class UIMenuUI extends BasicMenuUI { |
|
|
|
Color oldColor = g.getColor(); |
|
|
|
Color oldColor = g.getColor(); |
|
|
|
int menuWidth = menuItem.getWidth(); |
|
|
|
int menuWidth = menuItem.getWidth(); |
|
|
|
int menuHeight = menuItem.getHeight(); |
|
|
|
int menuHeight = menuItem.getHeight(); |
|
|
|
|
|
|
|
int bidiX = BidiUtils.rtl() ? 5 : 30; |
|
|
|
if (menuItem.isOpaque()) { |
|
|
|
if (menuItem.isOpaque()) { |
|
|
|
if (menuItem.getParent() instanceof JPopupMenu && model.isSelected()) { |
|
|
|
if (menuItem.getParent() instanceof JPopupMenu && model.isSelected()) { |
|
|
|
g.setColor(UIConstants.UI_MENU_BACKGOURND); |
|
|
|
g.setColor(UIConstants.UI_MENU_BACKGOURND); |
|
|
|
g.fillRect(0, 0, menuWidth, menuHeight); |
|
|
|
g.fillRect(0, 0, menuWidth, menuHeight); |
|
|
|
GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
|
|
|
GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); |
|
|
|
} else if (model.isSelected()) { |
|
|
|
} else if (model.isSelected()) { |
|
|
|
paintPressed(g, menuWidth, menuHeight); |
|
|
|
paintPressed(g, menuWidth, menuHeight); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -54,7 +56,7 @@ public class UIMenuUI extends BasicMenuUI { |
|
|
|
ButtonModel model = menuItem.getModel(); |
|
|
|
ButtonModel model = menuItem.getModel(); |
|
|
|
FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); |
|
|
|
FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); |
|
|
|
int mnemIndex = -1; |
|
|
|
int mnemIndex = -1; |
|
|
|
|
|
|
|
BidiUtils.applyOrientationByLocale(menuItem); |
|
|
|
if (!model.isEnabled()) { |
|
|
|
if (!model.isEnabled()) { |
|
|
|
// *** paint the text disabled
|
|
|
|
// *** paint the text disabled
|
|
|
|
if (UIManager.get("MenuItem.disabledForeground") instanceof Color) { |
|
|
|
if (UIManager.get("MenuItem.disabledForeground") instanceof Color) { |
|
|
|