com.alee.extended.painter
Class WebStylePainter<E extends javax.swing.JComponent>
java.lang.Object
com.alee.extended.painter.AbstractPainter<E>
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
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 |
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
WebStylePainter
public WebStylePainter()
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 graphicsbounds
- bounds for painter visual datac
- component to process