|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jvnet.substance.painter.text.AbstractTextPainter
org.jvnet.substance.painter.text.DefaultTextPainter
public class DefaultTextPainter
The default core implementation of SubstanceTextPainter.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jvnet.substance.painter.text.AbstractTextPainter |
|---|
AbstractTextPainter.TextLineInfo |
| Nested classes/interfaces inherited from interface org.jvnet.substance.painter.text.SubstanceTextPainter |
|---|
SubstanceTextPainter.BackgroundPaintingCallback, SubstanceTextPainter.ImageBackgroundPaintingCallback |
| Field Summary |
|---|
| Fields inherited from class org.jvnet.substance.painter.text.AbstractTextPainter |
|---|
callbackList, comp, textLines, toEnforceRenderOnNoTexts |
| Constructor Summary | |
|---|---|
DefaultTextPainter()
|
|
| Method Summary | |
|---|---|
void |
attachVerticalText(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,
boolean isFromBottomToTop)
Attaches the specified vertical text to paint. |
void |
dispose()
Disposes the resources allocated by this text painter. |
java.awt.Dimension |
getTextBounds(java.awt.Component comp,
java.awt.Font font,
java.lang.String text)
|
boolean |
isNative()
Returns true if this text painter uses native font
rendering. |
boolean |
needsBackgroundImage()
Returns indication whether this painter requires background to be fully set before painting the text (with SubstanceTextPainter.renderSurface(Graphics)). |
void |
renderSurface(java.awt.Graphics g)
Paints the surface. |
void |
setBackgroundFill(javax.swing.JComponent comp,
java.awt.Color backgroundFillColor,
boolean toOverlayWatermark,
int watermarkOffsetX,
int watermarkOffsetY)
Sets the fill color of the background. |
| Methods inherited from class org.jvnet.substance.painter.text.AbstractTextPainter |
|---|
attachCallback, attachText, init, toIgnoreBackgroundFill |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultTextPainter()
| Method Detail |
|---|
public boolean needsBackgroundImage()
SubstanceTextPainterSubstanceTextPainter.renderSurface(Graphics)).
true if this painter requires background to be
fully set before painting the text, false
otherwise.
public void setBackgroundFill(javax.swing.JComponent comp,
java.awt.Color backgroundFillColor,
boolean toOverlayWatermark,
int watermarkOffsetX,
int watermarkOffsetY)
SubstanceTextPainter
comp - Component.backgroundFillColor - Fill color for the background.toOverlayWatermark - If true, the background fill should be
overlayed with the current watermark.watermarkOffsetX - The X offset for the watermark relative to the screen position
of the component. This is relevant for cell-based components
such as lists, tables and trees.watermarkOffsetY - The Y offset for the watermark relative to the screen position
of the component. This is relevant for cell-based components
such as lists, tables and trees.public void renderSurface(java.awt.Graphics g)
SubstanceTextPainter#init(JComponent, Rectangle), background fill set in
SubstanceTextPainter.setBackgroundFill(JComponent, Color, boolean, int, int), invoke
the background callbacks added with
SubstanceTextPainter.attachCallback(BackgroundPaintingCallback) and paint all the
texts added with
#attachText(JComponent, Rectangle, String, int, Font, Color).
g - Graphic context.
public void attachVerticalText(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,
boolean isFromBottomToTop)
SubstanceTextPainter
comp - 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.isFromBottomToTop - If true, the text will be painted from bottom
to top (so that the top of the letters is on the left). If
false, the text will be painted from top to
bottom (so that the top of the letters is on the right).public boolean isNative()
SubstanceTextPaintertrue if this text painter uses native font
rendering.
true if this text painter uses native font
rendering.public void dispose()
SubstanceTextPainter
public java.awt.Dimension getTextBounds(java.awt.Component comp,
java.awt.Font font,
java.lang.String text)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||