public class SynthMenuUI extends BasicMenuUIimplements PropertyChangeListener , SynthUI
JMenu.
BasicMenuUI.ChangeHandler , BasicMenuUI.MouseInputHandler changeListener, menuListeneracceleratorDelimiter, acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForegroundDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED| Constructor and Description |
|---|
SynthMenuUI()
|
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent
Creates a new UI object for the given component.
|
SynthContext |
getContext(JComponent
Returns the Context for the specified component.
|
protected Dimension |
getPreferredMenuItemSize(JComponent
|
protected void |
installDefaults()
|
protected void |
installListeners()
|
void |
paint(Graphics
Paints the specified component according to the Look and Feel.
|
protected void |
paint(SynthContext
Paints the specified component.
|
void |
paintBorder(SynthContext
Paints the border.
|
void |
propertyChange(PropertyChangeEvent
This method gets called when a bound property is changed.
|
protected void |
uninstallDefaults()
|
protected void |
uninstallListeners()
|
void |
uninstallUI(JComponent
Reverses configuration which was done on the specified component during
installUI.
|
void |
update(Graphics
Notifies this UI delegate to repaint the specified component.
|
createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createMouseInputListener, createPropertyChangeListener, getMaximumSize, getPropertyPrefix, installKeyboardActions, setupPostTimer, uninstallKeyboardActionsdoClick, getMinimumSize, getPath, getPreferredSize, installComponents, installUI, paintBackground, paintMenuItem, paintText, uninstallComponentscontains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehaviorpublic static ComponentUIcreateUI(JComponent x)
x - component to create UI object for
protected void installDefaults()
protected void installListeners()
public void uninstallUI(JComponentc)
installUI. This method is invoked when this
UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in
installUI, being careful to leave the
JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:
uninstallUI in class
BasicMenuItemUI
c - the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
ComponentUI.installUI(javax.swing.JComponent) ,
JComponent.updateUI()
protected void uninstallDefaults()
protected void uninstallListeners()
public SynthContextgetContext(JComponent c)
getContext in interface
SynthUI
c - Component requesting SynthContext.
protected DimensiongetPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
public void update(Graphicsg, JComponent c)
paint(SynthContext,Graphics) method.
In general, this method does not need to be overridden by subclasses. All Look and Feel rendering code should reside in the paint method.
update in class
BasicMenuItemUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
public void paint(Graphicsg, JComponent c)
This method is not used by Synth Look and Feel. Painting is handled by the paint(SynthContext,Graphics) method.
paint in class
BasicMenuItemUI
g - the
Graphics object used for painting
c - the component being painted
paint(SynthContext,Graphics)
protected void paint(SynthContextcontext, Graphics g)
context - context for the component being painted
g - the
Graphics object used for painting
update(Graphics,JComponent)
public void paintBorder(SynthContextcontext, Graphics g, int x, int y, int w, int h)
paintBorder in interface
SynthUI
context - a component context
g -
Graphics to paint on
x - the X coordinate
y - the Y coordinate
w - width of the border
h - height of the border
public void propertyChange(PropertyChangeEvente)
propertyChange in interface
PropertyChangeListener
e - A PropertyChangeEvent object describing the event source and the property that has changed.