E - component typepublic class NinePatchIconPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI> extends AbstractPainter<E,U>
NinePatchIcon,
NinePatchStatePainter,
AbstractPainter,
Painter| Modifier and Type | Field and Description |
|---|---|
protected NinePatchIcon |
icon
9-patch icon to paint.
|
component, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
NinePatchIconPainter()
Constructs new 9-patch icon painter.
|
NinePatchIconPainter(java.awt.image.BufferedImage bufferedImage)
Constructs new 9-patch icon painter.
|
NinePatchIconPainter(java.awt.Image image)
Constructs new 9-patch icon painter.
|
NinePatchIconPainter(javax.swing.ImageIcon imageIcon)
Constructs new 9-patch icon painter.
|
NinePatchIconPainter(NinePatchIcon icon)
Constructs new 9-patch icon painter.
|
NinePatchIconPainter(java.lang.String iconSrc)
Constructs new 9-patch icon painter.
|
NinePatchIconPainter(java.net.URL url)
Constructs new 9-patch icon painter.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Insets |
getBorders()
Returns borders required for visual data provided by this painter.
|
NinePatchIcon |
getNinePatchIcon()
Returns painted 9-patch icon.
|
java.awt.Dimension |
getPreferredSize()
Returns preferred size required for proper painting of visual data provided by this painter.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints visual data using component graphics context.
|
void |
setNinePatchIcon(NinePatchIcon icon)
Sets painted 9-patch icon.
|
addPainterListener, b, borderChange, getCompleteBorder, i, i, i, install, installPropertyChangeListener, isOpaque, isSectionPainter, isSettingsUpdateAllowed, orientationChange, p, propertyChange, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstall, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationprotected NinePatchIcon icon
public NinePatchIconPainter()
public NinePatchIconPainter(java.net.URL url)
url - 9-patch image URLpublic NinePatchIconPainter(java.lang.String iconSrc)
iconSrc - 9-patch image sourcepublic NinePatchIconPainter(javax.swing.ImageIcon imageIcon)
imageIcon - 9-patch imagepublic NinePatchIconPainter(java.awt.Image image)
image - 9-patch imagepublic NinePatchIconPainter(java.awt.image.BufferedImage bufferedImage)
bufferedImage - 9-patch imagepublic NinePatchIconPainter(NinePatchIcon icon)
icon - 9-patch iconpublic NinePatchIcon getNinePatchIcon()
public void setNinePatchIcon(NinePatchIcon icon)
icon - painted 9-patch iconpublic java.awt.Insets getBorders()
Painter
You may pass null in case additional borders aren't needed for this painter.
getBorders in interface Painter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>getBorders in class AbstractPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>null in case those aren't neededpublic 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 UIpublic java.awt.Dimension getPreferredSize()
PaintergetPreferredSize in interface Painter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>getPreferredSize in class AbstractPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>