com.alee.extended.painter
Class InnerShadePainter<E extends javax.swing.JComponent>

java.lang.Object
  extended by com.alee.extended.painter.AbstractPainter<E>
      extended by com.alee.extended.painter.NinePatchIconPainter<E>
          extended by com.alee.extended.painter.InnerShadePainter<E>
All Implemented Interfaces:
Painter<E>

public class InnerShadePainter<E extends javax.swing.JComponent>
extends NinePatchIconPainter<E>

Author:
Mikle Garin

Field Summary
protected  int cachedRound
           
protected  float cachedShadeOpacity
           
protected  int cachedShadeWidth
           
protected  boolean drawBottom
           
protected  boolean drawLeft
           
protected  boolean drawRight
           
protected  boolean drawTop
           
protected  int round
           
protected  float shadeOpacity
           
protected  int shadeWidth
           
 
Fields inherited from class com.alee.extended.painter.NinePatchIconPainter
icon
 
Fields inherited from class com.alee.extended.painter.AbstractPainter
listeners, margin, opaque, preferredSize
 
Constructor Summary
InnerShadePainter()
           
InnerShadePainter(boolean drawTop, boolean drawLeft, boolean drawBottom, boolean drawRight)
           
InnerShadePainter(int shadeWidth, int round, float shadeOpacity)
           
 
Method Summary
 java.awt.Insets getMargin(E c)
          Returns margin required for visual data provided by this painter.
 int getRound()
           
 float getShadeOpacity()
           
 int getShadeWidth()
           
 boolean isDrawBottom()
           
 boolean isDrawLeft()
           
 boolean isDrawRight()
           
 boolean isDrawTop()
           
 void paint(java.awt.Graphics2D g2d, java.awt.Rectangle bounds, E c)
          Paints visual data onto the component graphics.
 InnerShadePainter<E> setDrawBottom(boolean drawBottom)
           
 InnerShadePainter<E> setDrawLeft(boolean drawLeft)
           
 InnerShadePainter<E> setDrawRight(boolean drawRight)
           
 InnerShadePainter<E> setDrawSides(boolean drawTop, boolean drawLeft, boolean drawBottom, boolean drawRight)
           
 InnerShadePainter<E> setDrawTop(boolean drawTop)
           
 InnerShadePainter<E> setRound(int round)
           
 InnerShadePainter<E> setShadeOpacity(float shadeOpacity)
           
 InnerShadePainter<E> setShadeWidth(int shadeWidth)
           
protected  void updateNinePatchIcon()
           
 
Methods inherited from class com.alee.extended.painter.NinePatchIconPainter
getNinePatchIcon, getPreferredSize, setNinePatchIcon
 
Methods inherited from class com.alee.extended.painter.AbstractPainter
addPainterListener, 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

shadeWidth

protected int shadeWidth

round

protected int round

shadeOpacity

protected float shadeOpacity

drawTop

protected boolean drawTop

drawLeft

protected boolean drawLeft

drawBottom

protected boolean drawBottom

drawRight

protected boolean drawRight

cachedShadeWidth

protected int cachedShadeWidth

cachedRound

protected int cachedRound

cachedShadeOpacity

protected float cachedShadeOpacity
Constructor Detail

InnerShadePainter

public InnerShadePainter()

InnerShadePainter

public InnerShadePainter(int shadeWidth,
                         int round,
                         float shadeOpacity)

InnerShadePainter

public InnerShadePainter(boolean drawTop,
                         boolean drawLeft,
                         boolean drawBottom,
                         boolean drawRight)
Method Detail

updateNinePatchIcon

protected void updateNinePatchIcon()

getShadeWidth

public int getShadeWidth()

setShadeWidth

public InnerShadePainter<E> setShadeWidth(int shadeWidth)

getRound

public int getRound()

setRound

public InnerShadePainter<E> setRound(int round)

getShadeOpacity

public float getShadeOpacity()

setShadeOpacity

public InnerShadePainter<E> setShadeOpacity(float shadeOpacity)

isDrawTop

public boolean isDrawTop()

setDrawTop

public InnerShadePainter<E> setDrawTop(boolean drawTop)

isDrawLeft

public boolean isDrawLeft()

setDrawLeft

public InnerShadePainter<E> setDrawLeft(boolean drawLeft)

isDrawBottom

public boolean isDrawBottom()

setDrawBottom

public InnerShadePainter<E> setDrawBottom(boolean drawBottom)

isDrawRight

public boolean isDrawRight()

setDrawRight

public InnerShadePainter<E> setDrawRight(boolean drawRight)

setDrawSides

public InnerShadePainter<E> setDrawSides(boolean drawTop,
                                         boolean drawLeft,
                                         boolean drawBottom,
                                         boolean drawRight)

getMargin

public java.awt.Insets getMargin(E c)
Returns margin required for visual data provided by this painter. This margin is usually added to component's margin when the final component border is calculated. You may pass null instead of zero margin - it will simply be ignored in that case.

Specified by:
getMargin in interface Painter<E extends javax.swing.JComponent>
Overrides:
getMargin in class NinePatchIconPainter<E extends javax.swing.JComponent>
Parameters:
c - component to process
Returns:
margin required for visual data provided by this painter or null for zero margin

paint

public void paint(java.awt.Graphics2D g2d,
                  java.awt.Rectangle bounds,
                  E 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.

Specified by:
paint in interface Painter<E extends javax.swing.JComponent>
Overrides:
paint in class NinePatchIconPainter<E extends javax.swing.JComponent>
Parameters:
g2d - component graphics
bounds - bounds for painter visual data
c - component to process