package javax.swing.plaf.synth;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.border.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import sun.swing.plaf.synth.SynthUI;
class extends BasicMenuBarUI implements PropertyChangeListener,
SynthUI {
private SynthStyle ;
public static ComponentUI (JComponent x) {
return new SynthMenuBarUI();
}
protected void () {
if (menuBar.getLayout() == null ||
menuBar.getLayout() instanceof UIResource) {
menuBar.setLayout(new DefaultMenuLayout(menuBar,BoxLayout.LINE_AXIS));
}
updateStyle(menuBar);
}
protected void () {
super.installListeners();
menuBar.addPropertyChangeListener(this);
}
private void (JMenuBar c) {
SynthContext context = getContext(c, ENABLED);
SynthStyle oldStyle = style;
style = SynthLookAndFeel.updateStyle(context, this);
if (style != oldStyle) {
if (oldStyle != null) {
uninstallKeyboardActions();
installKeyboardActions();
}
}
context.dispose();
}
protected void () {
SynthContext context = getContext(menuBar, ENABLED);
style.uninstallDefaults(context);
context.dispose();
style = null;
}
protected void () {
super.uninstallListeners();
menuBar.removePropertyChangeListener(this);
}
public SynthContext (JComponent c) {
return getContext(c, getComponentState(c));
}
private SynthContext (JComponent c, int state) {
return SynthContext.getContext(SynthContext.class, c,
SynthLookAndFeel.getRegion(c), style, state);
}
private Region (JComponent c) {
return SynthLookAndFeel.getRegion(c);
}
private int (JComponent c) {
return SynthLookAndFeel.getComponentState(c);
}
public void (Graphics g, JComponent c) {
SynthContext context = getContext(c);
SynthLookAndFeel.update(context, g);
context.getPainter().paintMenuBarBackground(context,
g, 0, 0, c.getWidth(), c.getHeight());
paint(context, g);
context.dispose();
}
public void (Graphics g, JComponent c) {
SynthContext context = getContext(c);
paint(context, g);
context.dispose();
}
protected void (SynthContext context, Graphics g) {
}
public void (SynthContext context, Graphics g, int x,
int y, int w, int h) {
context.getPainter().paintMenuBarBorder(context, g, x, y, w, h);
}
public void (PropertyChangeEvent e) {
if (SynthLookAndFeel.shouldUpdateStyle(e)) {
updateStyle((JMenuBar)e.getSource());
}
}
}