com.alee.laf.menu
Class WebPopupMenuSeparatorUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.SeparatorUI
          extended by javax.swing.plaf.basic.BasicSeparatorUI
              extended by javax.swing.plaf.basic.BasicPopupMenuSeparatorUI
                  extended by com.alee.laf.menu.WebPopupMenuSeparatorUI

public class WebPopupMenuSeparatorUI
extends javax.swing.plaf.basic.BasicPopupMenuSeparatorUI

Custom UI for JPopupMenu.Separator component.

Author:
Mikle Garin

Field Summary
protected  java.awt.Color color
          Style settings.
protected  int sideSpacing
           
protected  int spacing
           
protected  java.awt.Stroke stroke
           
 
Fields inherited from class javax.swing.plaf.basic.BasicSeparatorUI
highlight, shadow
 
Constructor Summary
WebPopupMenuSeparatorUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the WebPopupMenuSeparatorUI for the specified component.
 java.awt.Color getColor()
          Returns separator color.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
          Returns preferred separator size.
 int getSideSpacing()
          Returns separator side spacing.
 int getSpacing()
          Returns separator upper and lower spacing.
 java.awt.Stroke getStroke()
          Returns separator stroke.
 void installUI(javax.swing.JComponent c)
          Installs UI in the specified component.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paints popup menu separator.
 void setColor(java.awt.Color color)
          Sets separator color.
 void setSideSpacing(int sideSpacing)
          Sets separator side spacing.
 void setSpacing(int spacing)
          Sets separator upper and lower spacing.
 void setStroke(java.awt.Stroke stroke)
          Sets separator stroke.
 
Methods inherited from class javax.swing.plaf.basic.BasicSeparatorUI
getMaximumSize, getMinimumSize, installDefaults, installListeners, uninstallDefaults, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

color

protected java.awt.Color color
Style settings.


stroke

protected java.awt.Stroke stroke

spacing

protected int spacing

sideSpacing

protected int sideSpacing
Constructor Detail

WebPopupMenuSeparatorUI

public WebPopupMenuSeparatorUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Returns an instance of the WebPopupMenuSeparatorUI for the specified component. This tricky method is used by UIManager to create component UIs when needed.

Parameters:
c - component that will use UI instance
Returns:
instance of the WebPopupMenuSeparatorUI

installUI

public void installUI(javax.swing.JComponent c)
Installs UI in the specified component.

Overrides:
installUI in class javax.swing.plaf.basic.BasicSeparatorUI
Parameters:
c - component for this UI

getColor

public java.awt.Color getColor()
Returns separator color.

Returns:
separator color

setColor

public void setColor(java.awt.Color color)
Sets separator color.

Parameters:
color - new separator color

getStroke

public java.awt.Stroke getStroke()
Returns separator stroke.

Returns:
separator stroke

setStroke

public void setStroke(java.awt.Stroke stroke)
Sets separator stroke.

Parameters:
stroke - new separator stroke

getSpacing

public int getSpacing()
Returns separator upper and lower spacing.

Returns:
separator upper and lower spacing

setSpacing

public void setSpacing(int spacing)
Sets separator upper and lower spacing.

Parameters:
spacing - new separator upper and lower spacing

getSideSpacing

public int getSideSpacing()
Returns separator side spacing.

Returns:
separator side spacing

setSideSpacing

public void setSideSpacing(int sideSpacing)
Sets separator side spacing.

Parameters:
sideSpacing - new separator side spacing

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Paints popup menu separator.

Overrides:
paint in class javax.swing.plaf.basic.BasicPopupMenuSeparatorUI
Parameters:
g - graphics context
c - separator component

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
Returns preferred separator size.

Overrides:
getPreferredSize in class javax.swing.plaf.basic.BasicPopupMenuSeparatorUI
Parameters:
c - separator component
Returns:
preferred separator size