|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jvnet.substance.painter.text.AbstractTextPainter
public abstract class AbstractTextPainter
Base implementation of SubstanceTextPainter that provides common
functionality for core text painters.
| Nested Class Summary | |
|---|---|
static class |
AbstractTextPainter.TextLineInfo
Information on a single text line. |
| Nested classes/interfaces inherited from interface org.jvnet.substance.painter.text.SubstanceTextPainter |
|---|
SubstanceTextPainter.BackgroundPaintingCallback, SubstanceTextPainter.ImageBackgroundPaintingCallback |
| Field Summary | |
|---|---|
protected java.util.List<SubstanceTextPainter.BackgroundPaintingCallback> |
callbackList
Attached background painting callbacks. |
protected java.awt.Component |
comp
|
protected java.util.List<AbstractTextPainter.TextLineInfo> |
textLines
Attached texts. |
protected boolean |
toEnforceRenderOnNoTexts
If true, the painter implementation will fill the
background and invoke all callbacks even when there are no attached texts
or all texts are empty. |
| Constructor Summary | |
|---|---|
protected |
AbstractTextPainter()
Creates a new abstract text painter. |
| Method Summary | |
|---|---|
void |
attachCallback(SubstanceTextPainter.BackgroundPaintingCallback backgroundPaintingCallback)
Attaches the specified background painting callback. |
void |
attachText(javax.swing.JComponent comp,
java.awt.Rectangle textRect,
java.lang.String text,
int mnemonicIndex,
java.awt.Font font,
java.awt.Color color,
java.awt.Rectangle clip)
Attaches the specified text to paint. |
void |
init(javax.swing.JComponent comp,
java.awt.Rectangle clip,
boolean toEnforceRenderOnNoTexts)
Re-initializes the contents of this painter. |
protected boolean |
toIgnoreBackgroundFill(java.awt.Component comp)
Checks whether the background fill should be skipped for the specified component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jvnet.substance.painter.text.SubstanceTextPainter |
|---|
attachVerticalText, dispose, getTextBounds, isNative, needsBackgroundImage, renderSurface, setBackgroundFill |
| Field Detail |
|---|
protected java.util.List<SubstanceTextPainter.BackgroundPaintingCallback> callbackList
protected java.util.List<AbstractTextPainter.TextLineInfo> textLines
protected boolean toEnforceRenderOnNoTexts
true, the painter implementation will fill the
background and invoke all callbacks even when there are no attached texts
or all texts are empty.
protected java.awt.Component comp
| Constructor Detail |
|---|
protected AbstractTextPainter()
| Method Detail |
|---|
public void init(javax.swing.JComponent comp,
java.awt.Rectangle clip,
boolean toEnforceRenderOnNoTexts)
SubstanceTextPainter
init in interface SubstanceTextPaintercomp - Component.clip - Clip to apply. The painter implementation should respect this
clip, especially on components such as lists or tables that
use cell renderers. In these components, the specific cell is
usually much smaller than the whole component, and the
painting is done on each visible cell in a loop.toEnforceRenderOnNoTexts - If true, the painter implementation must
fill the background and invoke all callbacks even when there
are no attached texts or all texts are empty.AbstractTextPainterpublic void attachCallback(SubstanceTextPainter.BackgroundPaintingCallback backgroundPaintingCallback)
SubstanceTextPainter
attachCallback in interface SubstanceTextPainterbackgroundPaintingCallback - Background painting callback to attach.
public void attachText(javax.swing.JComponent comp,
java.awt.Rectangle textRect,
java.lang.String text,
int mnemonicIndex,
java.awt.Font font,
java.awt.Color color,
java.awt.Rectangle clip)
SubstanceTextPainter
attachText in interface SubstanceTextPaintercomp - Component.textRect - Text rectangle.text - The text itself.mnemonicIndex - Optional mnemonic index. Can be -1 if no mnemonic.font - Font for this text.color - Color for this text.clip - Clip rectangle for this text.protected boolean toIgnoreBackgroundFill(java.awt.Component comp)
comp - Component.
true if the background fill should be skipped for
the specified component, false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||