com.alee.extended.button
Class WebSplitButtonUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.basic.BasicButtonUI
              extended by com.alee.laf.button.WebButtonUI
                  extended by com.alee.extended.button.WebSplitButtonUI
All Implemented Interfaces:
ShapeProvider, BorderMethods, SwingMethods, javax.swing.SwingConstants

public class WebSplitButtonUI
extends WebButtonUI

Custom UI for WebSplitButton component. This UI is based on WebButtonUI and simply adds a few features.

Author:
Mikle Garin

Field Summary
protected  int contentGap
           
protected  javax.swing.ImageIcon splitIcon
          Style settings.
protected  int splitIconGap
           
 
Fields inherited from class com.alee.laf.button.WebButtonUI
ancestorListener, animate, animator, bottomBgColor, bottomSelectedBgColor, button, drawBottom, drawBottomLine, drawFocus, drawLeft, drawLeftLine, drawRight, drawRightLine, drawShade, drawTop, drawTopLine, innerShadeColor, innerShadeWidth, leftRightSpacing, margin, mouseAdapter, mousePoint, moveIconOnPress, oldBorderPainted, oldContentAreaFilled, oldFocusable, oldFocusPainted, painter, propertyChangeListener, rollover, rolloverDarkBorderOnly, rolloverDecoratedOnly, rolloverShadeOnly, rolloverShine, round, selectedForeground, shadeColor, shadeToggleIcon, shadeToggleIconTransparency, shadeWidth, shineColor, showDisabledShade, topBgColor, topSelectedBgColor, transparency, transparentShineColor, undecorated
 
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI
defaultTextIconGap, defaultTextShiftOffset
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
WebSplitButtonUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the WebSplitButtonUI for the specified component.
protected  java.awt.Insets getBorderInsets()
          Returns component border insets used for WebLaF border.
 int getContentGap()
          Returns gap between split part and button content.
 java.awt.Rectangle getSplitButtonBounds(javax.swing.JComponent c)
          Returns bounds of the split button part.
 java.awt.Rectangle getSplitButtonHitbox(javax.swing.JComponent c)
          Returns split button part hitbox.
 javax.swing.ImageIcon getSplitIcon()
          Returns split button icon.
 int getSplitIconGap()
          Returns gap between split icon and split part sides.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          
 void setContentGap(int contentGap)
          Sets gap between split part and button content.
 void setSplitIcon(javax.swing.ImageIcon splitIcon)
          Sets split button icon
 void setSplitIconGap(int splitIconGap)
          Sets gap between split icon and split part sides
 
Methods inherited from class com.alee.laf.button.WebButtonUI
getBottomBgColor, getBottomSelectedBgColor, getButtonShape, getInnerShadeColor, getInnerShadeWidth, getLeftRightSpacing, getMargin, getPainter, getPreferredSize, getRound, getSelectedForeground, getShadeColor, getShadeToggleIconTransparency, getShadeWidth, getShineColor, getTopBgColor, getTopSelectedBgColor, installUI, isAfterEnabledButton, isAnimate, isBeforeEnabledButton, isDrawBottom, isDrawBottomLine, isDrawFocus, isDrawLeft, isDrawLeftLine, isDrawRight, isDrawRightLine, isDrawShade, isDrawTop, isDrawTopLine, isInButtonGroup, isMoveIconOnPress, isRollover, isRolloverDarkBorderOnly, isRolloverDecoratedOnly, isRolloverShadeOnly, isRolloverShine, isShadeToggleIcon, isShowDisabledShade, isUndecorated, paintIcon, paintText, provideShape, setAnimate, setBottomBgColor, setBottomSelectedBgColor, setDrawBottom, setDrawBottomLine, setDrawFocus, setDrawLeft, setDrawLeftLine, setDrawLines, setDrawRight, setDrawRightLine, setDrawShade, setDrawSides, setDrawTop, setDrawTopLine, setInnerShadeColor, setInnerShadeWidth, setLeftRightSpacing, setMargin, setMoveIconOnPress, setPainter, setRolloverDarkBorderOnly, setRolloverDecoratedOnly, setRolloverShadeOnly, setRolloverShine, setRound, setSelectedForeground, setShadeColor, setShadeToggleIcon, setShadeToggleIconTransparency, setShadeWidth, setShineColor, setShowDisabledShade, setTopBgColor, setTopSelectedBgColor, setUndecorated, uninstallUI, updateBorder
 
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI
clearTextShiftOffset, createButtonListener, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPropertyPrefix, getTextShiftOffset, installDefaults, installKeyboardActions, installListeners, paintButtonPressed, paintFocus, paintText, setTextShiftOffset, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

splitIcon

protected javax.swing.ImageIcon splitIcon
Style settings.


splitIconGap

protected int splitIconGap

contentGap

protected int contentGap
Constructor Detail

WebSplitButtonUI

public WebSplitButtonUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Returns an instance of the WebSplitButtonUI 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 WebSplitButtonUI

getSplitIcon

public javax.swing.ImageIcon getSplitIcon()
Returns split button icon.

Returns:
split button icon

setSplitIcon

public void setSplitIcon(javax.swing.ImageIcon splitIcon)
Sets split button icon

Parameters:
splitIcon - new split button icon

getSplitIconGap

public int getSplitIconGap()
Returns gap between split icon and split part sides.

Returns:
gap between split icon and split part sides

setSplitIconGap

public void setSplitIconGap(int splitIconGap)
Sets gap between split icon and split part sides

Parameters:
splitIconGap - gap between split icon and split part sides

getContentGap

public int getContentGap()
Returns gap between split part and button content.

Returns:
gap between split part and button content

setContentGap

public void setContentGap(int contentGap)
Sets gap between split part and button content.

Parameters:
contentGap - gap between split part and button content

getBorderInsets

protected java.awt.Insets getBorderInsets()
Returns component border insets used for WebLaF border.

Overrides:
getBorderInsets in class WebButtonUI
Returns:
component border insets

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)

Overrides:
paint in class WebButtonUI

getSplitButtonBounds

public java.awt.Rectangle getSplitButtonBounds(javax.swing.JComponent c)
Returns bounds of the split button part.

Parameters:
c - split button
Returns:
bounds of the split button part

getSplitButtonHitbox

public java.awt.Rectangle getSplitButtonHitbox(javax.swing.JComponent c)
Returns split button part hitbox.

Parameters:
c - split button
Returns:
split button part hitbox