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

java.lang.Object
  extended by com.alee.extended.painter.AbstractPainter<E>
      extended by com.alee.extended.painter.WebStylePainter<E>
Type Parameters:
E - component type
All Implemented Interfaces:
Painter<E>

public class WebStylePainter<E extends javax.swing.JComponent>
extends AbstractPainter<E>

Custom web-style painter for basic elements like panels, buttons e.t.c.

Author:
Mikle Garin
See Also:
AbstractPainter, Painter

Field Summary
protected  boolean drawBackground
          todo 1.
protected  boolean drawFocus
           
protected  boolean fillBackground
           
protected  int round
           
protected  int shadeWidth
           
protected  boolean webColored
           
 
Fields inherited from class com.alee.extended.painter.AbstractPainter
listeners, margin, opaque, preferredSize
 
Constructor Summary
WebStylePainter()
           
 
Method Summary
 java.awt.Insets getMargin(E c)
          Returns margin required for visual data provided by this painter.
 int getRound()
           
 int getShadeWidth()
           
 boolean isDrawBackground()
           
 boolean isDrawFocus()
           
 boolean isFillBackground()
           
 boolean isWebColored()
           
 void paint(java.awt.Graphics2D g2d, java.awt.Rectangle bounds, E c)
          Paints visual data onto the component graphics.
 void setDrawBackground(boolean drawBackground)
           
 void setDrawFocus(boolean drawFocus)
           
 void setFillBackground(boolean fillBackground)
           
 void setRound(int round)
           
 void setShadeWidth(int shadeWidth)
           
 void setWebColored(boolean webColored)
           
 
Methods inherited from class com.alee.extended.painter.AbstractPainter
addPainterListener, 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

drawBackground

protected boolean drawBackground
todo 1. Implement all required methods (for e.g. - side hiding)


round

protected int round

drawFocus

protected boolean drawFocus

shadeWidth

protected int shadeWidth

fillBackground

protected boolean fillBackground

webColored

protected boolean webColored
Constructor Detail

WebStylePainter

public WebStylePainter()
Method Detail

isDrawBackground

public boolean isDrawBackground()

setDrawBackground

public void setDrawBackground(boolean drawBackground)

getRound

public int getRound()

setRound

public void setRound(int round)

isDrawFocus

public boolean isDrawFocus()

setDrawFocus

public void setDrawFocus(boolean drawFocus)

getShadeWidth

public int getShadeWidth()

setShadeWidth

public void setShadeWidth(int shadeWidth)

isFillBackground

public boolean isFillBackground()

setFillBackground

public void setFillBackground(boolean fillBackground)

isWebColored

public boolean isWebColored()

setWebColored

public void setWebColored(boolean webColored)

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 AbstractPainter<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.

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