|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.ButtonUI javax.swing.plaf.basic.BasicButtonUI javax.swing.plaf.basic.BasicToggleButtonUI javax.swing.plaf.basic.BasicRadioButtonUI javax.swing.plaf.basic.BasicCheckBoxUI com.alee.laf.checkbox.WebCheckBoxUI
public class WebCheckBoxUI
Custom UI for JCheckBox component.
Nested Class Summary | |
---|---|
protected class |
WebCheckBoxUI.CheckBoxIcon
Custom icon for tristate checkbox. |
Field Summary | |
---|---|
protected boolean |
animated
|
protected int |
bgDarkness
Icon background painting variables. |
protected WebTimer |
bgTimer
|
protected java.awt.Color |
borderColor
Style settings. |
protected java.awt.Stroke |
borderStroke
|
protected java.awt.Color |
bottomBgColor
|
protected java.awt.Color |
bottomSelectedBgColor
|
protected javax.swing.JCheckBox |
checkBox
Checkbox to which this UI is applied. |
protected CheckIcon |
checkIcon
Check icon painting variables. |
protected boolean |
checking
|
protected WebTimer |
checkTimer
|
protected java.awt.Color |
darkBorderColor
|
protected java.awt.Color |
disabledBorderColor
|
protected java.beans.PropertyChangeListener |
enabledStateListener
Checkbox listeners. |
protected static float[] |
fractions
Background gradient fractions. |
protected int |
iconHeight
|
protected java.awt.Rectangle |
iconRect
Last displayed icon rect. |
protected int |
iconWidth
|
protected java.awt.event.ItemListener |
itemListener
|
protected java.awt.Insets |
margin
|
static int |
MAX_DARKNESS
Maximum border/background darkness. |
protected java.beans.PropertyChangeListener |
modelChangeListener
|
protected java.awt.event.MouseAdapter |
mouseAdapter
|
protected boolean |
rollover
|
protected boolean |
rolloverDarkBorderOnly
|
protected int |
round
|
protected int |
shadeWidth
|
protected java.awt.Color |
topBgColor
|
protected java.awt.Color |
topSelectedBgColor
|
static long |
UPDATE_DELAY
Animation updates delay in milliseconds. |
Fields inherited from class javax.swing.plaf.basic.BasicRadioButtonUI |
---|
icon |
Fields inherited from class javax.swing.plaf.basic.BasicButtonUI |
---|
defaultTextIconGap, defaultTextShiftOffset |
Constructor Summary | |
---|---|
WebCheckBoxUI()
|
Method Summary | |
---|---|
protected CheckIcon |
createCheckStateIcon()
Creates check state icon. |
protected javax.swing.Icon |
createIcon()
Creates and returns checkbox icon. |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Returns an instance of the WebCheckBoxUI for the specified component. |
protected java.awt.Color[] |
getBgColors()
Returns background colors. |
protected float |
getBgDarkness()
Returns background darkness. |
java.awt.Color |
getBorderColor()
Returns border color. |
java.awt.Color |
getBottomBgColor()
Returns bottom background color. |
java.awt.Color |
getBottomSelectedBgColor()
Returns bottom selected background color. |
java.awt.Color |
getDarkBorderColor()
Returns dark border color. |
java.awt.Color |
getDisabledBorderColor()
Returns disabled border color. |
int |
getIconHeight()
Returns icon height. |
java.awt.Rectangle |
getIconRect()
Returns icon bounds. |
int |
getIconWidth()
Returns icon width. |
java.awt.Insets |
getMargin()
Returns component margin. |
int |
getRound()
Returns border rounding. |
int |
getShadeWidth()
Returns border shade width. |
java.awt.Color |
getTopBgColor()
Returns top background color. |
java.awt.Color |
getTopSelectedBgColor()
Returns top selected background color. |
protected void |
installEnabledStateListeners()
Installs enabled state listeners. |
protected void |
installRolloverListeners()
Installs rollover listeners. |
protected void |
installStateChangeListeners()
Installs state change listeners. |
void |
installUI(javax.swing.JComponent c)
Installs UI in the specified component. |
boolean |
isAnimated()
Returns whether checkbox is animated or not. |
protected boolean |
isAnimatedByDefault()
Returns whether checkbox should be animated by default or not. |
protected boolean |
isAnimationAllowed()
Returns whether checkbox can be animated or not. |
boolean |
isRolloverDarkBorderOnly()
Returns whether should draw dark border only on rollover or not. |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints checkbox. |
protected void |
paintCheckIcon(java.awt.Graphics2D g2d,
int x,
int y)
Paints checkbox check icon. |
protected void |
paintIcon(java.awt.Graphics2D g2d,
int x,
int y)
Paints checkbox icon. |
protected void |
paintIconBackground(java.awt.Graphics2D g2d,
int x,
int y)
Paints checkbox icon background. |
protected void |
paintText(java.awt.Graphics g,
javax.swing.AbstractButton b,
java.awt.Rectangle textRect,
java.lang.String text)
Paints checkbox text. |
protected void |
performStateChanged()
Performs visual state change. |
java.awt.Shape |
provideShape()
Returns component shape. |
void |
setAnimated(boolean animated)
Sets whether checkbox is animated or not. |
void |
setBorderColor(java.awt.Color borderColor)
Sets border color. |
void |
setBottomBgColor(java.awt.Color bottomBgColor)
Sets bottom background color. |
void |
setBottomSelectedBgColor(java.awt.Color bottomSelectedBgColor)
Sets bottom selected background color. |
void |
setDarkBorderColor(java.awt.Color darkBorderColor)
Sets dark border color. |
void |
setDisabledBorderColor(java.awt.Color disabledBorderColor)
Sets disabled border color. |
void |
setIconHeight(int iconHeight)
Sets icon height. |
void |
setIconWidth(int iconWidth)
Sets icon width. |
void |
setMargin(java.awt.Insets margin)
Sets component margin. |
void |
setRolloverDarkBorderOnly(boolean rolloverDarkBorderOnly)
Sets whether should draw dark border only on rollover or not. |
void |
setRound(int round)
Sets border rounding. |
void |
setShadeWidth(int shadeWidth)
Sets border shade width. |
void |
setTopBgColor(java.awt.Color topBgColor)
Sets top background color. |
void |
setTopSelectedBgColor(java.awt.Color topSelectedBgColor)
Sets top selected background color. |
protected void |
uninstallEnabledStateListeners()
Uninstalls enabled state listeners. |
protected void |
uninstallRolloverListeners()
Uninstalls rollover listeners. |
protected void |
uninstallStateChangeListeners()
Uninstalls state change listeners. |
void |
uninstallUI(javax.swing.JComponent c)
Uninstalls UI from the specified component. |
protected void |
updateBorder()
Updates custom UI border. |
Methods inherited from class javax.swing.plaf.basic.BasicCheckBoxUI |
---|
getPropertyPrefix |
Methods inherited from class javax.swing.plaf.basic.BasicRadioButtonUI |
---|
getDefaultIcon, getPreferredSize, installDefaults, paintFocus, uninstallDefaults |
Methods inherited from class javax.swing.plaf.basic.BasicToggleButtonUI |
---|
getTextShiftOffset, paintIcon |
Methods inherited from class javax.swing.plaf.basic.BasicButtonUI |
---|
clearTextShiftOffset, createButtonListener, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, installKeyboardActions, installListeners, paintButtonPressed, paintFocus, paintIcon, paintText, setTextShiftOffset, 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 |
---|
public static final int MAX_DARKNESS
public static final long UPDATE_DELAY
protected static final float[] fractions
protected java.awt.Color borderColor
protected java.awt.Color darkBorderColor
protected java.awt.Color disabledBorderColor
protected java.awt.Color topBgColor
protected java.awt.Color bottomBgColor
protected java.awt.Color topSelectedBgColor
protected java.awt.Color bottomSelectedBgColor
protected int round
protected int shadeWidth
protected java.awt.Insets margin
protected boolean animated
protected boolean rolloverDarkBorderOnly
protected java.awt.Stroke borderStroke
protected int iconWidth
protected int iconHeight
protected int bgDarkness
protected boolean rollover
protected WebTimer bgTimer
protected CheckIcon checkIcon
protected boolean checking
protected WebTimer checkTimer
protected java.awt.Rectangle iconRect
protected javax.swing.JCheckBox checkBox
protected java.beans.PropertyChangeListener enabledStateListener
protected java.beans.PropertyChangeListener modelChangeListener
protected java.awt.event.MouseAdapter mouseAdapter
protected java.awt.event.ItemListener itemListener
Constructor Detail |
---|
public WebCheckBoxUI()
Method Detail |
---|
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c
- component that will use UI instance
public void installUI(javax.swing.JComponent c)
installUI
in class javax.swing.plaf.basic.BasicButtonUI
c
- component for this UIpublic void uninstallUI(javax.swing.JComponent c)
uninstallUI
in class javax.swing.plaf.basic.BasicButtonUI
c
- component with this UIprotected CheckIcon createCheckStateIcon()
protected void installEnabledStateListeners()
protected void uninstallEnabledStateListeners()
protected void installRolloverListeners()
protected void uninstallRolloverListeners()
protected void installStateChangeListeners()
protected void performStateChanged()
protected void uninstallStateChangeListeners()
public java.awt.Shape provideShape()
provideShape
in interface ShapeProvider
protected boolean isAnimatedByDefault()
protected boolean isAnimationAllowed()
protected void updateBorder()
public java.awt.Insets getMargin()
public void setMargin(java.awt.Insets margin)
margin
- component marginpublic boolean isAnimated()
public void setAnimated(boolean animated)
animated
- whether checkbox is animated or notpublic boolean isRolloverDarkBorderOnly()
public void setRolloverDarkBorderOnly(boolean rolloverDarkBorderOnly)
rolloverDarkBorderOnly
- whether should draw dark border only on rollover or notpublic java.awt.Color getBorderColor()
public void setBorderColor(java.awt.Color borderColor)
borderColor
- border colorpublic java.awt.Color getDarkBorderColor()
public void setDarkBorderColor(java.awt.Color darkBorderColor)
darkBorderColor
- dark border colorpublic java.awt.Color getDisabledBorderColor()
public void setDisabledBorderColor(java.awt.Color disabledBorderColor)
disabledBorderColor
- disabled border colorpublic java.awt.Color getTopBgColor()
public void setTopBgColor(java.awt.Color topBgColor)
topBgColor
- top background colorpublic java.awt.Color getBottomBgColor()
public void setBottomBgColor(java.awt.Color bottomBgColor)
bottomBgColor
- bottom background colorpublic java.awt.Color getTopSelectedBgColor()
public void setTopSelectedBgColor(java.awt.Color topSelectedBgColor)
topSelectedBgColor
- top selected background colorpublic java.awt.Color getBottomSelectedBgColor()
public void setBottomSelectedBgColor(java.awt.Color bottomSelectedBgColor)
bottomSelectedBgColor
- bottom selected background colorpublic int getRound()
public void setRound(int round)
round
- border roundingpublic int getShadeWidth()
public void setShadeWidth(int shadeWidth)
shadeWidth
- border shade widthpublic int getIconWidth()
public void setIconWidth(int iconWidth)
iconWidth
- icon widthpublic int getIconHeight()
public void setIconHeight(int iconHeight)
iconHeight
- icon heightprotected javax.swing.Icon createIcon()
protected java.awt.Color[] getBgColors()
protected float getBgDarkness()
public java.awt.Rectangle getIconRect()
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
paint
in class javax.swing.plaf.basic.BasicRadioButtonUI
g
- graphics contextc
- painted componentprotected void paintIcon(java.awt.Graphics2D g2d, int x, int y)
g2d
- 2D graphics contextx
- icon location X coordinatey
- icon location Y coordinateprotected void paintIconBackground(java.awt.Graphics2D g2d, int x, int y)
g2d
- 2D graphics contextx
- icon location X coordinatey
- icon location Y coordinateprotected void paintCheckIcon(java.awt.Graphics2D g2d, int x, int y)
g2d
- 2D graphics contextx
- icon location X coordinatey
- icon location Y coordinateprotected void paintText(java.awt.Graphics g, javax.swing.AbstractButton b, java.awt.Rectangle textRect, java.lang.String text)
paintText
in class javax.swing.plaf.basic.BasicButtonUI
g
- graphics contextb
- abstract buttontextRect
- text boundstext
- text to be painted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |