| org.jvnet.substance.painter.text.SubstanceTextPainter
All known Subclasses: org.jvnet.substance.painter.text.AbstractTextPainter,
SubstanceTextPainter | public interface SubstanceTextPainter (Code) | | Base interface for Substance text painters.
author: Kirill Grouchnikov since: version 4.2 |
Inner Class :public static interface BackgroundPaintingCallback | |
Inner Class :public static class ImageBackgroundPaintingCallback implements BackgroundPaintingCallback | |
Method Summary | |
public void | attachCallback(BackgroundPaintingCallback backgroundPaintingCallback) Attaches the specified background painting callback. | public void | attachText(JComponent comp, Rectangle textRect, String text, int mnemonicIndex, java.awt.Font font, java.awt.Color color, java.awt.Rectangle clip) Attaches the specified text to paint.
Parameters: comp - Component. Parameters: textRect - Text rectangle. Parameters: text - The text itself. Parameters: mnemonicIndex - Optional mnemonic index. | public void | attachVerticalText(JComponent comp, Rectangle textRect, 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.
Parameters: comp - Component. Parameters: textRect - Text rectangle. Parameters: text - The text itself. Parameters: mnemonicIndex - Optional mnemonic index. | public void | dispose() Disposes the resources allocated by this text painter. | public java.awt.Dimension | getTextBounds(Component comp, java.awt.Font font, String text) | public void | init(JComponent comp, Rectangle clip, boolean toEnforceRenderOnNoTexts) Re-initializes the contents of this painter. | public boolean | isNative() Returns true if this text painter uses native font
rendering. | public boolean | needsBackgroundImage() Returns indication whether this painter requires background to be fully
set before painting the text (with
SubstanceTextPainter.renderSurface(Graphics) ). | public void | renderSurface(Graphics g) Paints the surface. | public void | setBackgroundFill(JComponent comp, Color backgroundFillColor, boolean toOverlayWatermark, int watermarkOffsetX, int watermarkOffsetY) Sets the fill color of the background.
Parameters: comp - Component. Parameters: backgroundFillColor - Fill color for the background. Parameters: toOverlayWatermark - If true , the background fill should beoverlayed with the current watermark. Parameters: watermarkOffsetX - The X offset for the watermark relative to the screen positionof the component. |
attachCallback | public void attachCallback(BackgroundPaintingCallback backgroundPaintingCallback)(Code) | | Attaches the specified background painting callback.
Parameters: backgroundPaintingCallback - Background painting callback to attach. |
attachText | public void attachText(JComponent comp, Rectangle textRect, String text, int mnemonicIndex, java.awt.Font font, java.awt.Color color, java.awt.Rectangle clip)(Code) | | Attaches the specified text to paint.
Parameters: comp - Component. Parameters: textRect - Text rectangle. Parameters: text - The text itself. Parameters: mnemonicIndex - Optional mnemonic index. Can be -1 if no mnemonic. Parameters: font - Font for this text. Parameters: color - Color for this text. Parameters: clip - Clip rectangle for this text. |
attachVerticalText | public void attachVerticalText(JComponent comp, Rectangle textRect, String text, int mnemonicIndex, java.awt.Font font, java.awt.Color color, java.awt.Rectangle clip, boolean isFromBottomToTop)(Code) | | Attaches the specified vertical text to paint.
Parameters: comp - Component. Parameters: textRect - Text rectangle. Parameters: text - The text itself. Parameters: mnemonicIndex - Optional mnemonic index. Can be -1 if no mnemonic. Parameters: font - Font for this text. Parameters: color - Color for this text. Parameters: clip - Clip rectangle for this text. Parameters: isFromBottomToTop - If true , the text will be painted from bottomto top (so that the top of the letters is on the left). Iffalse , the text will be painted from top tobottom (so that the top of the letters is on the right). |
dispose | public void dispose()(Code) | | Disposes the resources allocated by this text painter.
|
init | public void init(JComponent comp, Rectangle clip, boolean toEnforceRenderOnNoTexts)(Code) | | Re-initializes the contents of this painter. Is usually called at the
beginning of the component painting cycle. The painter implementation is
expected to remove all registered callbacks.
Parameters: comp - Component. Parameters: clip - Clip to apply. The painter implementation should respect thisclip, especially on components such as lists or tables thatuse cell renderers. In these components, the specific cell isusually much smaller than the whole component, and thepainting is done on each visible cell in a loop. Parameters: toEnforceRenderOnNoTexts - If true , the painter implementation mustfill the background and invoke all callbacks even when thereare no attached texts or all texts are empty. See Also: AbstractTextPainter |
isNative | public boolean isNative()(Code) | | Returns true if this text painter uses native font
rendering.
true if this text painter uses native fontrendering. |
needsBackgroundImage | public boolean needsBackgroundImage()(Code) | | Returns indication whether this painter requires background to be fully
set before painting the text (with
SubstanceTextPainter.renderSurface(Graphics) ).
true if this painter requires background to befully set before painting the text, false otherwise. |
renderSurface | public void renderSurface(Graphics g)(Code) | | Paints the surface. The painter implementation should respect the clip
set in
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
SubstanceTextPainter.attachText(JComponent,Rectangle,String,int,Font,Color) .
Parameters: g - Graphic context. |
setBackgroundFill | public void setBackgroundFill(JComponent comp, Color backgroundFillColor, boolean toOverlayWatermark, int watermarkOffsetX, int watermarkOffsetY)(Code) | | Sets the fill color of the background.
Parameters: comp - Component. Parameters: backgroundFillColor - Fill color for the background. Parameters: toOverlayWatermark - If true , the background fill should beoverlayed with the current watermark. Parameters: watermarkOffsetX - The X offset for the watermark relative to the screen positionof the component. This is relevant for cell-based componentssuch as lists, tables and trees. Parameters: watermarkOffsetY - The Y offset for the watermark relative to the screen positionof the component. This is relevant for cell-based componentssuch as lists, tables and trees. |
|
|