E - component typepublic class ColorPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI> extends AbstractPainter<E,U>
AbstractPainter,
Painter| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Color |
color
Color to fill component with.
|
component, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
ColorPainter()
Constructs color painter that uses background color.
|
ColorPainter(java.awt.Color color)
Constructs color painter with specified fill color.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getColor()
Returns color to fill component with.
|
protected java.awt.Color |
getCurrentColor()
Returns currently used color.
|
java.lang.Boolean |
isOpaque()
Returns whether visual data provided by this painter is opaque or not.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints visual data using component graphics context.
|
void |
setColor(java.awt.Color color)
Sets color to fill component with.
|
addPainterListener, b, borderChange, getBorders, getCompleteBorder, getPreferredSize, i, i, i, install, installPropertyChangeListener, isSectionPainter, isSettingsUpdateAllowed, orientationChange, p, propertyChange, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstall, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationpublic ColorPainter()
public ColorPainter(java.awt.Color color)
color - color to fill component withpublic java.awt.Color getColor()
public void setColor(java.awt.Color color)
color - new color to fill component withpublic java.lang.Boolean isOpaque()
PainterisOpaque in interface Painter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>isOpaque in class AbstractPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>public void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
PainterIt is highly recommended to honor provided painting bounds to avoid painting issues. These bounds might be representing full component size or contain just a small portion of the component.
g2d - graphics contextbounds - painting boundsc - painted componentui - painted component UIprotected java.awt.Color getCurrentColor()