Methods Summary |
---|
int | adjustAcceleratorWidth(int width)Adjusts the width needed to display the maximum accelerator.
maxAcceleratorWidth = Math.max(maxAcceleratorWidth, width);
return maxAcceleratorWidth;
|
int | adjustIconOffset(int offset)Adjusts the icon offset needed to align icons horizontally
maxIconOffset = Math.max(maxIconOffset, offset);
return maxIconOffset;
|
int | adjustTextOffset(int offset)Adjusts the text offset needed to align text horizontally.
maxTextOffset = Math.max(maxTextOffset, offset);
return maxTextOffset;
|
int | adjustTextWidth(int width)Adjusts the width needed to display the maximum menu item string.
maxTextWidth = Math.max(maxTextWidth, width);
return maxTextWidth;
|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent x)
return new SynthPopupMenuUI();
|
private int | getComponentState(javax.swing.JComponent c)
return SynthLookAndFeel.getComponentState(c);
|
public javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c)
return getContext(c, getComponentState(c));
|
private javax.swing.plaf.synth.SynthContext | getContext(javax.swing.JComponent c, int state)
return SynthContext.getContext(SynthContext.class, c,
SynthLookAndFeel.getRegion(c), style, state);
|
int | getMaxAcceleratorWidth()Maximum size needed to display accelerators of children menu items.
return maxAcceleratorWidth;
|
int | getMaxTextWidth()Maximum size to display text of children menu items.
return maxTextWidth;
|
private javax.swing.plaf.synth.Region | getRegion(javax.swing.JComponent c)
return SynthLookAndFeel.getRegion(c);
|
public void | installDefaults()
if (popupMenu.getLayout() == null ||
popupMenu.getLayout() instanceof UIResource) {
popupMenu.setLayout(new DefaultMenuLayout(
popupMenu, BoxLayout.Y_AXIS));
}
updateStyle(popupMenu);
|
protected void | installListeners()
super.installListeners();
popupMenu.addPropertyChangeListener(this);
|
public void | paint(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
paint(context, g);
context.dispose();
|
protected void | paint(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g)
|
public void | paintBorder(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, int x, int y, int w, int h)
context.getPainter().paintPopupMenuBorder(context, g, x, y, w, h);
|
public void | propertyChange(java.beans.PropertyChangeEvent e)
if (SynthLookAndFeel.shouldUpdateStyle(e)) {
updateStyle(popupMenu);
}
|
void | resetAlignmentHints()Resets the max text and accerator widths,
text and icon offsets.
maxTextWidth = maxAcceleratorWidth
= maxTextOffset = maxIconOffset = 0;
|
protected void | uninstallDefaults()
SynthContext context = getContext(popupMenu, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
if (popupMenu.getLayout() instanceof UIResource) {
popupMenu.setLayout(null);
}
|
protected void | uninstallListeners()
super.uninstallListeners();
popupMenu.removePropertyChangeListener(this);
|
public void | update(java.awt.Graphics g, javax.swing.JComponent c)
SynthContext context = getContext(c);
SynthLookAndFeel.update(context, g);
context.getPainter().paintPopupMenuBackground(context,
g, 0, 0, c.getWidth(), c.getHeight());
paint(context, g);
context.dispose();
|
private void | updateStyle(javax.swing.JComponent c)
SynthContext context = getContext(c, ENABLED);
SynthStyle oldStyle = style;
style = SynthLookAndFeel.updateStyle(context, this);
if (style != oldStyle) {
if (oldStyle != null) {
uninstallKeyboardActions();
installKeyboardActions();
}
}
context.dispose();
|