295 |
* Returns preferred size for the given menu item. |
* Returns preferred size for the given menu item. |
296 |
* |
* |
297 |
* @param c menu item for which to get preferred size |
* @param c menu item for which to get preferred size |
298 |
* @param checkIcon chech icon displayed in the given menu item |
* @param checkIcon check icon displayed in the given menu item |
299 |
* @param arrowIcon arrow icon displayed in the given menu item |
* @param arrowIcon arrow icon displayed in the given menu item |
300 |
* @param defaultTextIconGap space between icon and text in the given menuItem |
* @param defaultTextIconGap space between icon and text in the given menuItem |
301 |
* |
* |
533 |
SwingUtilities.layoutCompoundLabel(m, fm, null, checkIcon, vertAlign, |
SwingUtilities.layoutCompoundLabel(m, fm, null, checkIcon, vertAlign, |
534 |
horAlign, vertTextPos, horTextPos, |
horAlign, vertTextPos, horTextPos, |
535 |
vr, cr, tr, defaultTextIconGap); |
vr, cr, tr, defaultTextIconGap); |
536 |
if (m.isSelected()) |
checkIcon.paintIcon(m, g, cr.x, cr.y); |
|
checkIcon.paintIcon(m, g, cr.x, cr.y); |
|
|
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
|
|
defaults.getBorder("CheckBox.border").paintBorder(m, g, cr.x, cr.y, |
|
|
cr.width, cr.height); |
|
|
|
|
537 |
// We need to calculate position of the menu text and position of |
// We need to calculate position of the menu text and position of |
538 |
// user menu icon if there exists one relative to the check icon. |
// user menu icon if there exists one relative to the check icon. |
539 |
// So we need to adjust view rectangle s.t. its starting point is at |
// So we need to adjust view rectangle s.t. its starting point is at |
562 |
defaultTextIconGap); |
defaultTextIconGap); |
563 |
if (i != null) |
if (i != null) |
564 |
i.paintIcon(c, g, ir.x, ir.y); |
i.paintIcon(c, g, ir.x, ir.y); |
|
|
|
565 |
paintText(g, m, tr, m.getText()); |
paintText(g, m, tr, m.getText()); |
566 |
|
|
567 |
// paint accelerator |
// paint accelerator |