Methods Summary |
---|
int | adjustAcceleratorWidth(int width)Adjusts the width needed to display the maximum accelerator.
maxAcceleratorWidth = Math.max(maxAcceleratorWidth, width);
return maxAcceleratorWidth;
|
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 | resetAcceleratorWidths()Resets the max text and accerator widths.
maxTextWidth = maxAcceleratorWidth = 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();
|