com.alee.examples.groups.button
Class ButtonPaintersExample.SeaGlassButtonPainter

java.lang.Object
  extended by com.alee.extended.painter.AbstractPainter<javax.swing.AbstractButton>
      extended by com.alee.examples.groups.button.ButtonPaintersExample.SeaGlassButtonPainter
All Implemented Interfaces:
Painter<javax.swing.AbstractButton>
Enclosing class:
ButtonPaintersExample

public static class ButtonPaintersExample.SeaGlassButtonPainter
extends AbstractPainter<javax.swing.AbstractButton>

Custom SeaGlass button painter.


Field Summary
protected  float[] bgFractions
           
protected  float[] borderFractions
           
protected  java.awt.Color bottomBorder
           
protected  java.awt.Color bottomDisabledBorder
           
protected  java.awt.Color bottomPressedBorder
           
protected  java.awt.Color focus
          Focus color.
protected  java.awt.Color middleBg
           
protected  java.awt.Color middleDisabledBg
           
protected  java.awt.Color middlePressedBg
           
protected  java.awt.Color middleSelectedBg
           
protected  java.awt.Color sideBg
          Background colors.
protected  java.awt.Color sideDisabledBg
           
protected  java.awt.Color sidePressedBg
           
protected  java.awt.Color sideSelectedBg
           
protected  java.awt.Color topBorder
          Border colors.
protected  java.awt.Color topDisabledBorder
           
protected  java.awt.Color topPressedBorder
           
 
Fields inherited from class com.alee.extended.painter.AbstractPainter
listeners, margin, opaque, preferredSize
 
Constructor Summary
ButtonPaintersExample.SeaGlassButtonPainter()
          Constructs new SeaGlass button painter.
 
Method Summary
protected  java.awt.Paint getBackgroundPaint(javax.swing.AbstractButton button, javax.swing.ButtonModel model)
          Returns background paint.
protected  java.awt.Paint getBorderPaint(javax.swing.AbstractButton button, javax.swing.ButtonModel model)
          Returns border paint.
 void paint(java.awt.Graphics2D g2d, java.awt.Rectangle bounds, javax.swing.AbstractButton c)
          Paints visual data onto the component graphics.
 
Methods inherited from class com.alee.extended.painter.AbstractPainter
addPainterListener, getMargin, getPreferredSize, install, isOpaque, p, removePainterListener, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, uninstall, updateAll, updateOpacity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

topBorder

protected java.awt.Color topBorder
Border colors.


bottomBorder

protected java.awt.Color bottomBorder

topPressedBorder

protected java.awt.Color topPressedBorder

bottomPressedBorder

protected java.awt.Color bottomPressedBorder

topDisabledBorder

protected java.awt.Color topDisabledBorder

bottomDisabledBorder

protected java.awt.Color bottomDisabledBorder

borderFractions

protected float[] borderFractions

sideBg

protected java.awt.Color sideBg
Background colors.


middleBg

protected java.awt.Color middleBg

sidePressedBg

protected java.awt.Color sidePressedBg

middlePressedBg

protected java.awt.Color middlePressedBg

sideSelectedBg

protected java.awt.Color sideSelectedBg

middleSelectedBg

protected java.awt.Color middleSelectedBg

sideDisabledBg

protected java.awt.Color sideDisabledBg

middleDisabledBg

protected java.awt.Color middleDisabledBg

bgFractions

protected float[] bgFractions

focus

protected java.awt.Color focus
Focus color.

Constructor Detail

ButtonPaintersExample.SeaGlassButtonPainter

public ButtonPaintersExample.SeaGlassButtonPainter()
Constructs new SeaGlass button painter.

Method Detail

paint

public void paint(java.awt.Graphics2D g2d,
                  java.awt.Rectangle bounds,
                  javax.swing.AbstractButton c)
Paints visual data onto the component graphics. Provided graphics and component are taken directly from component UI paint method. Provided bounds are usually fake (zero location, component size) but in some cases it might be specified by componentUI.

Parameters:
g2d - component graphics
bounds - bounds for painter visual data
c - component to process

getBackgroundPaint

protected java.awt.Paint getBackgroundPaint(javax.swing.AbstractButton button,
                                            javax.swing.ButtonModel model)
Returns background paint.

Parameters:
button - button
model - button model
Returns:
background paint

getBorderPaint

protected java.awt.Paint getBorderPaint(javax.swing.AbstractButton button,
                                        javax.swing.ButtonModel model)
Returns border paint.

Parameters:
button - button
model - button model
Returns:
border paint