APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.plaf.synth

pack-priv Class SynthMenuItemLayoutHelper

extends MenuItemLayoutHelper
Class Inheritance
Imports
sun.swing.StringUIClientPropertyKey, .MenuItemLayoutHelper, javax.swing.*, javax.swing.text.View, java.awt.*

Calculates preferred size and layouts synth menu items. All JMenuItems (and JMenus) include enough space for the insets plus one or more elements. When we say "label" below, we mean "icon and/or text." Cases to consider for SynthMenuItemUI (visualized here in a LTR orientation; the RTL case would be reversed): label check icon + label check icon + label + accelerator label + accelerator Cases to consider for SynthMenuUI (again visualized here in a LTR orientation): label + arrow Note that in the above scenarios, accelerator and arrow icon are mutually exclusive. This means that if a popup menu contains a mix of JMenus and JMenuItems, we only need to allow enough space for max(maxAccelerator, maxArrow), and both accelerators and arrow icons can occupy the same "column" of space in the menu.

Field Summary

Modifier and TypeField and Description
private SynthContext
private SynthGraphicsUtils
private SynthStyle
private boolean
private SynthContext
private SynthGraphicsUtils
public static final MenuItemLayoutHelper.ColumnAlignment
public static final MenuItemLayoutHelper.ColumnAlignment
public static final StringUIClientPropertyKey
private int
public static final MenuItemLayoutHelper.ColumnAlignment
public static final MenuItemLayoutHelper.ColumnAlignment
private SynthStyle
Inherited from sun.swing.MenuItemLayoutHelper:
MAX_ACC_WIDTHMAX_ARROW_WIDTHMAX_CHECK_WIDTHMAX_ICON_WIDTHMAX_LABEL_WIDTHMAX_TEXT_WIDTH

Constructor Summary

AccessConstructor and Description
public
SynthMenuItemLayoutHelper(SynthContext context, SynthContext accContext, JMenuItem mi, Icon checkIcon, Icon arrowIcon, Rectangle viewRect, int gap, String accDelimiter, boolean isLeftToRight, boolean useCheckAndArrow, String propertyPrefix)

Method Summary

Modifier and TypeMethod and Description
public boolean
protected void
protected void
public SynthContext
public SynthGraphicsUtils
public SynthStyle
private boolean
public SynthContext
public SynthGraphicsUtils
public MenuItemLayoutHelper.ColumnAlignment
public int
public MenuItemLayoutHelper.ColumnAlignment
public SynthStyle
protected void
protected void
Inherited from sun.swing.MenuItemLayoutHelper:
addMaxWidthaddWidthcalcMaxValuecalcMaxWidthclearUsedClientPropertiesclearUsedParentClientPropertiescreateMaxRectgetAccFontgetAccFontMetricsgetAccSizegetAccTextgetAfterCheckIconGapgetArrowIcongetArrowSizegetCheckIcongetCheckSizegetFontgetFontMetricsgetGapgetHorizontalAlignmentgetHorizontalTextPositiongetHtmlViewgetIcongetIconSizegetLabelSizegetLeadingGapgetLeftTextExtraWidthgetMenuItemgetMenuItemParentgetMenuItemParentgetMinTextOffsetgetParentIntPropertygetTextgetTextSizegetVerticalAlignmentgetVerticalTextPositiongetViewRectisColumnLayoutisColumnLayoutisColumnLayoutisLeftToRightisTopLevelMenulayoutMenuItemmaxresetsetAccFontsetAccFontMetricssetAccSizesetAccTextsetAfterCheckIconGapsetArrowIconsetArrowSizesetCheckIconsetCheckSizesetColumnLayoutsetFontsetFontMetricssetGapsetHorizontalAlignmentsetHorizontalTextPositionsetHtmlViewsetIconsetIconSizesetLabelSizesetLeadingGapsetLeftToRightsetMenuItemsetMenuItemParentsetMinTextOffsetsetTextsetTextSizesetTopLevelMenusetUseCheckAndArrowsetVerticalAlignmentsetVerticalTextPositionsetViewRectuseCheckAndArrowuseCheckAndArrow

Field Detail

accContextback to summary
private SynthContext accContext
accGuback to summary
private SynthGraphicsUtils accGu
accStyleback to summary
private SynthStyle accStyle
alignAcceleratorTextback to summary
private boolean alignAcceleratorText
contextback to summary
private SynthContext context
guback to summary
private SynthGraphicsUtils gu
LTR_ALIGNMENT_1back to summary
public static final MenuItemLayoutHelper.ColumnAlignment LTR_ALIGNMENT_1
LTR_ALIGNMENT_2back to summary
public static final MenuItemLayoutHelper.ColumnAlignment LTR_ALIGNMENT_2
MAX_ACC_OR_ARROW_WIDTHback to summary
public static final StringUIClientPropertyKey MAX_ACC_OR_ARROW_WIDTH
maxAccOrArrowWidthback to summary
private int maxAccOrArrowWidth
RTL_ALIGNMENT_1back to summary
public static final MenuItemLayoutHelper.ColumnAlignment RTL_ALIGNMENT_1
RTL_ALIGNMENT_2back to summary
public static final MenuItemLayoutHelper.ColumnAlignment RTL_ALIGNMENT_2
styleback to summary
private SynthStyle style

Constructor Detail

SynthMenuItemLayoutHelperback to summary
public SynthMenuItemLayoutHelper(SynthContext context, SynthContext accContext, JMenuItem mi, Icon checkIcon, Icon arrowIcon, Rectangle viewRect, int gap, String accDelimiter, boolean isLeftToRight, boolean useCheckAndArrow, String propertyPrefix)

Method Detail

alignAcceleratorTextback to summary
public boolean alignAcceleratorText()
calcMaxWidthsback to summary
protected void calcMaxWidths()

Overrides sun.swing.MenuItemLayoutHelper.calcMaxWidths.

calcWidthsAndHeightsback to summary
protected void calcWidthsAndHeights()

Overrides sun.swing.MenuItemLayoutHelper.calcWidthsAndHeights.

getAccContextback to summary
public SynthContext getAccContext()
getAccGraphicsUtilsback to summary
public SynthGraphicsUtils getAccGraphicsUtils()
getAccStyleback to summary
public SynthStyle getAccStyle()
getAlignAcceleratorTextback to summary
private boolean getAlignAcceleratorText(String propertyPrefix)
getContextback to summary
public SynthContext getContext()
getGraphicsUtilsback to summary
public SynthGraphicsUtils getGraphicsUtils()
getLTRColumnAlignmentback to summary
public MenuItemLayoutHelper.ColumnAlignment getLTRColumnAlignment()

Overrides sun.swing.MenuItemLayoutHelper.getLTRColumnAlignment.

getMaxAccOrArrowWidthback to summary
public int getMaxAccOrArrowWidth()
getRTLColumnAlignmentback to summary
public MenuItemLayoutHelper.ColumnAlignment getRTLColumnAlignment()

Overrides sun.swing.MenuItemLayoutHelper.getRTLColumnAlignment.

getStyleback to summary
public SynthStyle getStyle()
layoutIconAndTextInLabelRectback to summary
protected void layoutIconAndTextInLabelRect(MenuItemLayoutHelper.LayoutResult lr)

Overrides sun.swing.MenuItemLayoutHelper.layoutIconAndTextInLabelRect.

prepareForLayoutback to summary
protected void prepareForLayout(MenuItemLayoutHelper.LayoutResult lr)

Overrides sun.swing.MenuItemLayoutHelper.prepareForLayout.