|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.extended.painter.AbstractPainter<E> com.alee.extended.painter.AdaptivePainter<E>
public abstract class AdaptivePainter<E extends javax.swing.JComponent>
Special painter made to adapts any kind of painters to fit custom painters within the specific UIs. To use it properly you should extend this class and implement UI painter interface methods. In general cases those methods might have no effect since general-type painters do not know anything about component specifics.
Field Summary |
---|
Fields inherited from class com.alee.extended.painter.AbstractPainter |
---|
listeners, margin, opaque, preferredSize |
Constructor Summary | |
---|---|
AdaptivePainter(Painter painter)
Constructs new AdaptivePainter to adapt specified painter. |
Method Summary | |
---|---|
void |
addPainterListener(PainterListener listener)
Adds new painter listener. |
java.awt.Insets |
getMargin(E c)
Returns margin required for visual data provided by this painter. |
Painter |
getPainter()
Returns adapted painter. |
java.awt.Dimension |
getPreferredSize(E c)
Returns preferred size required for proper painting of visual data provided by this painter. |
void |
install(E c)
Called when painter is intalled into some component. |
java.lang.Boolean |
isOpaque(E c)
Returns whether visual data provided by this painter is opaque or not. |
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c)
Paints visual data onto the component graphics. |
void |
removePainterListener(PainterListener listener)
Removes painter listener. |
void |
uninstall(E c)
Called when painter is intalled into some component. |
Methods inherited from class com.alee.extended.painter.AbstractPainter |
---|
p, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, updateAll, updateOpacity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdaptivePainter(Painter painter)
painter
- painter to adaptMethod Detail |
---|
public Painter getPainter()
public void install(E c)
install
in interface Painter<E extends javax.swing.JComponent>
install
in class AbstractPainter<E extends javax.swing.JComponent>
c
- component to processpublic void uninstall(E c)
uninstall
in interface Painter<E extends javax.swing.JComponent>
uninstall
in class AbstractPainter<E extends javax.swing.JComponent>
c
- component to processpublic java.lang.Boolean isOpaque(E c)
isOpaque
in interface Painter<E extends javax.swing.JComponent>
isOpaque
in class AbstractPainter<E extends javax.swing.JComponent>
c
- component to process
public java.awt.Dimension getPreferredSize(E c)
getPreferredSize
in interface Painter<E extends javax.swing.JComponent>
getPreferredSize
in class AbstractPainter<E extends javax.swing.JComponent>
c
- component to process
public java.awt.Insets getMargin(E c)
getMargin
in interface Painter<E extends javax.swing.JComponent>
getMargin
in class AbstractPainter<E extends javax.swing.JComponent>
c
- component to process
public void addPainterListener(PainterListener listener)
addPainterListener
in interface Painter<E extends javax.swing.JComponent>
addPainterListener
in class AbstractPainter<E extends javax.swing.JComponent>
listener
- painter listener to addpublic void removePainterListener(PainterListener listener)
removePainterListener
in interface Painter<E extends javax.swing.JComponent>
removePainterListener
in class AbstractPainter<E extends javax.swing.JComponent>
listener
- painter listener to removepublic void paint(java.awt.Graphics2D g2d, java.awt.Rectangle bounds, E c)
g2d
- component graphicsbounds
- bounds for painter visual datac
- component to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |