|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pushingpixels.substance.internal.utils.SubstanceTextUtilities
public class SubstanceTextUtilities
Text-related utilities. This class if for internal use only.
Field Summary | |
---|---|
static java.lang.String |
ENFORCE_FG_COLOR
|
Constructor Summary | |
---|---|
SubstanceTextUtilities()
|
Method Summary | |
---|---|
static java.awt.Color |
getForegroundColor(javax.swing.JComponent component,
java.lang.String text,
ComponentState state,
float textAlpha)
Returns the foreground color for the specified component. |
static java.awt.Color |
getForegroundColor(javax.swing.JComponent component,
java.lang.String text,
StateTransitionTracker.ModelStateInfo modelStateInfo,
float textAlpha)
Returns the foreground color for the specified component. |
static java.awt.Color |
getMenuComponentForegroundColor(java.awt.Component menuComponent,
java.lang.String text,
StateTransitionTracker.ModelStateInfo modelStateInfo,
float textAlpha)
Returns the foreground color for the specified menu component. |
static java.awt.Color |
getTextBackgroundFillColor(javax.swing.JComponent comp)
|
static void |
paintMenuItemText(java.awt.Graphics g,
javax.swing.JMenuItem menuItem,
java.awt.Rectangle textRect,
java.lang.String text,
int mnemonicIndex,
StateTransitionTracker.ModelStateInfo modelStateInfo,
float textAlpha)
|
static void |
paintText(java.awt.Graphics g,
javax.swing.AbstractButton button,
javax.swing.ButtonModel model,
java.awt.Rectangle textRect,
java.lang.String text,
int mnemonicIndex)
Paints the text of the specified button. |
static void |
paintText(java.awt.Graphics g,
javax.swing.AbstractButton button,
java.awt.Rectangle textRect,
java.lang.String text,
int mnemonicIndex)
Paints the text of the specified button. |
static void |
paintText(java.awt.Graphics g,
javax.swing.JComponent component,
java.awt.Rectangle textRect,
java.lang.String text,
int mnemonicIndex,
ComponentState state,
float textAlpha)
Paints the specified text. |
static void |
paintText(java.awt.Graphics g,
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)
Paints the specified text. |
static void |
paintText(java.awt.Graphics g,
javax.swing.JComponent component,
java.awt.Rectangle textRect,
java.lang.String text,
int mnemonicIndex,
StateTransitionTracker.ModelStateInfo modelStateInfo,
float textAlpha)
|
static void |
paintTextCompBackground(java.awt.Graphics g,
javax.swing.JComponent comp)
Paints background of the specified text component. |
static void |
paintTextWithDropShadow(javax.swing.JComponent c,
java.awt.Graphics g,
java.awt.Color foregroundColor,
java.lang.String text,
int width,
int height,
int xOffset,
int yOffset)
Paints text with drop shadow. |
static void |
paintVerticalText(java.awt.Graphics g,
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)
Paints the specified vertical text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ENFORCE_FG_COLOR
Constructor Detail |
---|
public SubstanceTextUtilities()
Method Detail |
---|
public static void paintTextWithDropShadow(javax.swing.JComponent c, java.awt.Graphics g, java.awt.Color foregroundColor, java.lang.String text, int width, int height, int xOffset, int yOffset)
c
- Component.g
- Graphics context.foregroundColor
- Foreground color.text
- Text to paint.width
- Text rectangle width.height
- Text rectangle height.xOffset
- Text rectangle X offset.yOffset
- Text rectangle Y offset.public static void paintText(java.awt.Graphics g, 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)
g
- Graphics context.comp
- Component.textRect
- Text rectangle.text
- Text to paint.mnemonicIndex
- Mnemonic index.font
- Font to use.color
- Color to use.clip
- Optional clip. Can be null
.public static void paintVerticalText(java.awt.Graphics g, 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)
g
- Graphics context.comp
- Component.textRect
- Text rectangle.text
- Text to paint.mnemonicIndex
- Mnemonic index.font
- Font to use.color
- Color to use.clip
- Optional clip. Can be null
.isFromBottomToTop
- If true
, the text will be painted from bottom to
top, otherwise the text will be painted from top to bottom.public static void paintText(java.awt.Graphics g, javax.swing.AbstractButton button, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex)
g
- Graphic context.button
- ButtontextRect
- Text rectangletext
- Text to paintmnemonicIndex
- Mnemonic index.public static void paintText(java.awt.Graphics g, javax.swing.AbstractButton button, javax.swing.ButtonModel model, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex)
g
- Graphic context.button
- Buttonmodel
- Button model.textRect
- Text rectangletext
- Text to paintmnemonicIndex
- Mnemonic index.public static void paintText(java.awt.Graphics g, javax.swing.JComponent component, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, ComponentState state, float textAlpha)
g
- Graphics context.component
- Component.textRect
- Text rectangle.text
- Text to paint.mnemonicIndex
- Mnemonic index.state
- Component state.textAlpha
- Alpha channel for painting the text.public static void paintText(java.awt.Graphics g, javax.swing.JComponent component, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha)
public static void paintMenuItemText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha)
public static java.awt.Color getForegroundColor(javax.swing.JComponent component, java.lang.String text, ComponentState state, float textAlpha)
component
- Component.text
- Text. If empty or null
, the result is
null
.state
- Component state.textAlpha
- Alpha channel for painting the text. If value is less than
1.0, the result is an opaque color which is an interpolation
between the "real" foreground color and the background color
of the component. This is done to ensure that native text
rasterization will be performed on 6u10+ on Windows.
public static java.awt.Color getForegroundColor(javax.swing.JComponent component, java.lang.String text, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha)
component
- Component.text
- Text. If empty or null
, the result is
null
.textAlpha
- Alpha channel for painting the text. If value is less than
1.0, the result is an opaque color which is an interpolation
between the "real" foreground color and the background color
of the component. This is done to ensure that native text
rasterization will be performed on 6u10 on Windows.
public static java.awt.Color getMenuComponentForegroundColor(java.awt.Component menuComponent, java.lang.String text, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha)
menuComponent
- Menu component.text
- Text. If empty or null
, the result is
null
.modelStateInfo
- Model state info for the specified component.textAlpha
- Alpha channel for painting the text. If value is less than
1.0, the result is an opaque color which is an interpolation
between the "real" foreground color and the background color
of the component. This is done to ensure that native text
rasterization will be performed on 6u10 on Windows.
public static void paintTextCompBackground(java.awt.Graphics g, javax.swing.JComponent comp)
g
- Graphics context.comp
- Component.public static java.awt.Color getTextBackgroundFillColor(javax.swing.JComponent comp)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |