|
||||||||||
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>
E
- component typepublic abstract class AbstractPainter<E extends javax.swing.JComponent>
This abstract painter provides a few additional useful features atop of the Painter interface. Usually this class is extended by various painters instead of implementing Painter interface directly.
Painter
Field Summary | |
---|---|
protected java.util.List<PainterListener> |
listeners
Painter listeners. |
protected java.awt.Insets |
margin
Visual data margin. |
protected java.lang.Boolean |
opaque
Whether visual data is opaque or not. |
protected java.awt.Dimension |
preferredSize
Visual data preferred size. |
Constructor Summary | |
---|---|
AbstractPainter()
|
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. |
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. |
protected java.awt.Point |
p(int x,
int y)
Returns point for the specified coordinates. |
void |
removePainterListener(PainterListener listener)
Removes painter listener. |
void |
repaint()
Should be called when painter visual representation changes. |
void |
repaint(int x,
int y,
int width,
int height)
Should be called when part of painter visual representation changes. |
void |
repaint(java.awt.Rectangle bounds)
Should be called when part of painter visual representation changes. |
void |
revalidate()
Should be called when painter size or border changes. |
void |
setMargin(java.awt.Insets margin)
Sets margin required for visual data provided by this painter. |
void |
setMargin(int margin)
Sets margin required for visual data provided by this painter. |
void |
setMargin(int top,
int left,
int bottom,
int right)
Sets margin required for visual data provided by this painter. |
void |
setOpaque(java.lang.Boolean opaque)
Sets whether visual data provided by this painter is opaque or not. |
void |
setPreferredSize(java.awt.Dimension preferredSize)
Sets preferred size for visual data provided by this painter. |
void |
uninstall(E c)
Called when painter is intalled into some component. |
void |
updateAll()
Should be called when painter size, border and visual representation changes. |
void |
updateOpacity()
Should be called when painter opacity changes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.alee.extended.painter.Painter |
---|
paint |
Field Detail |
---|
protected java.lang.Boolean opaque
protected java.awt.Dimension preferredSize
protected java.awt.Insets margin
protected java.util.List<PainterListener> listeners
Constructor Detail |
---|
public AbstractPainter()
Method Detail |
---|
public void install(E c)
install
in interface Painter<E extends javax.swing.JComponent>
c
- component to processpublic void uninstall(E c)
uninstall
in interface Painter<E extends javax.swing.JComponent>
c
- component to processpublic java.lang.Boolean isOpaque(E c)
isOpaque
in interface Painter<E extends javax.swing.JComponent>
c
- component to process
public void setOpaque(java.lang.Boolean opaque)
opaque
- whether visual data provided by this painter is opaque or notpublic java.awt.Dimension getPreferredSize(E c)
getPreferredSize
in interface Painter<E extends javax.swing.JComponent>
c
- component to process
public void setPreferredSize(java.awt.Dimension preferredSize)
preferredSize
- preferred size for visual data provided by this painterpublic java.awt.Insets getMargin(E c)
getMargin
in interface Painter<E extends javax.swing.JComponent>
c
- component to process
public void setMargin(java.awt.Insets margin)
margin
- margin required for visual data provided by this painterpublic void setMargin(int top, int left, int bottom, int right)
top
- top margin required for visual data provided by this painterleft
- left margin required for visual data provided by this painterbottom
- bottom margin required for visual data provided by this painterright
- right margin required for visual data provided by this painterpublic void setMargin(int margin)
margin
- margin required for visual data provided by this painterpublic void addPainterListener(PainterListener listener)
addPainterListener
in interface Painter<E extends javax.swing.JComponent>
listener
- painter listener to addpublic void removePainterListener(PainterListener listener)
removePainterListener
in interface Painter<E extends javax.swing.JComponent>
listener
- painter listener to removepublic void repaint()
public void repaint(java.awt.Rectangle bounds)
bounds
- part boundspublic void repaint(int x, int y, int width, int height)
x
- part bounds X coordinatey
- part bounds Y coordinatewidth
- part bounds widthheight
- part bounds heightpublic void revalidate()
public void updateOpacity()
public void updateAll()
protected java.awt.Point p(int x, int y)
x
- X coordinatey
- Y coordinate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |