Class RadianceTextUtilities
- java.lang.Object
-
- org.pushingpixels.radiance.theming.internal.utils.RadianceTextUtilities
-
public class RadianceTextUtilities extends java.lang.ObjectText-related utilities. This class is for internal use only.
-
-
Constructor Summary
Constructors Constructor Description RadianceTextUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.ColorgetForegroundColor(javax.swing.JComponent component, java.lang.String text, StateTransitionTracker.ModelStateInfo modelStateInfo, CoreColorTokenUtils.ContainerType inactiveContainerType)Returns the foreground color for the specified component.static java.awt.ColorgetForegroundColor(javax.swing.JComponent component, ComponentState state, CoreColorTokenUtils.ContainerType inactiveContainerType)Returns the foreground color for the specified component.static java.awt.ColorgetMenuComponentForegroundColor(javax.swing.JMenuItem menuComponent, java.lang.String text, StateTransitionTracker.ModelStateInfo modelStateInfo)Returns the foreground color for the specified menu component.static java.awt.ColorgetTextBackgroundFillColor(javax.swing.JComponent comp)static java.awt.ColorgetTextSelectionBackground(javax.swing.text.JTextComponent comp)static java.awt.ColorgetTextSelectionForeground(javax.swing.text.JTextComponent comp)private static booleanhasRadianceTextBorder(javax.swing.JComponent comp)static java.awt.ColorpaintMenuItemText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo)static voidpaintText(java.awt.Graphics g, 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.private static voidpaintText(java.awt.Graphics g, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, java.awt.Font font, java.awt.Color color, java.awt.Rectangle clip, java.awt.geom.AffineTransform transform)Paints the specified text.static java.awt.ColorpaintText(java.awt.Graphics g, javax.swing.AbstractButton button, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, CoreColorTokenUtils.ContainerType inactiveContainerType)Paints the text of the specified button.static java.awt.ColorpaintText(java.awt.Graphics g, javax.swing.JComponent component, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, ComponentState state, CoreColorTokenUtils.ContainerType inactiveContainerType)Paints the specified text.static java.awt.ColorpaintText(java.awt.Graphics g, javax.swing.JComponent component, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, CoreColorTokenUtils.ContainerType inactiveContainerType)static voidpaintTextCompBackground(java.awt.Graphics g, javax.swing.JComponent comp)Paints background of the specified text component.static voidpaintTextWithDropShadow(javax.swing.JComponent c, java.awt.Graphics g, java.awt.Color foregroundColor, java.awt.Color echoColor, java.lang.String text, int width, int height, int xOffset, int yOffset)Paints text with drop shadow.static voidpaintVerticalText(java.awt.Graphics g, 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.
-
-
-
Method Detail
-
paintTextWithDropShadow
public static void paintTextWithDropShadow(javax.swing.JComponent c, java.awt.Graphics g, java.awt.Color foregroundColor, java.awt.Color echoColor, java.lang.String text, int width, int height, int xOffset, int yOffset)Paints text with drop shadow.- Parameters:
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.
-
paintText
private static void paintText(java.awt.Graphics g, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, java.awt.Font font, java.awt.Color color, java.awt.Rectangle clip, java.awt.geom.AffineTransform transform)Paints the specified text.- Parameters:
g- Graphics context.textRect- Text rectangle.text- Text to paint.mnemonicIndex- Mnemonic index.font- Font to use.color- Color to use.clip- Optional clip. Can benull.transform- Optional transform to apply. Can benull.
-
paintText
public static void paintText(java.awt.Graphics g, 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.- Parameters:
g- Graphics context.textRect- Text rectangle.text- Text to paint.mnemonicIndex- Mnemonic index.font- Font to use.color- Color to use.clip- Optional clip. Can benull.
-
paintVerticalText
public static void paintVerticalText(java.awt.Graphics g, 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.- Parameters:
g- Graphics context.textRect- Text rectangle.text- Text to paint.mnemonicIndex- Mnemonic index.font- Font to use.color- Color to use.clip- Optional clip. Can benull.isFromBottomToTop- Iftrue, the text will be painted from bottom to top, otherwise the text will be painted from top to bottom.
-
paintText
public static java.awt.Color paintText(java.awt.Graphics g, javax.swing.AbstractButton button, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, CoreColorTokenUtils.ContainerType inactiveContainerType)Paints the text of the specified button.- Parameters:
g- Graphic context.button- ButtontextRect- Text rectangletext- Text to paintmnemonicIndex- Mnemonic index.
-
paintText
public static java.awt.Color paintText(java.awt.Graphics g, javax.swing.JComponent component, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, ComponentState state, CoreColorTokenUtils.ContainerType inactiveContainerType)Paints the specified text.- Parameters:
g- Graphics context.component- Component.textRect- Text rectangle.text- Text to paint.mnemonicIndex- Mnemonic index.state- Component state.
-
paintText
public static java.awt.Color paintText(java.awt.Graphics g, javax.swing.JComponent component, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, CoreColorTokenUtils.ContainerType inactiveContainerType)
-
paintMenuItemText
public static java.awt.Color paintMenuItemText(java.awt.Graphics g, javax.swing.JMenuItem menuItem, java.awt.Rectangle textRect, java.lang.String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo)
-
getForegroundColor
public static java.awt.Color getForegroundColor(javax.swing.JComponent component, ComponentState state, CoreColorTokenUtils.ContainerType inactiveContainerType)Returns the foreground color for the specified component.- Parameters:
component- Component.state- Component state.- Returns:
- The foreground color for the specified component.
-
getForegroundColor
public static java.awt.Color getForegroundColor(javax.swing.JComponent component, java.lang.String text, StateTransitionTracker.ModelStateInfo modelStateInfo, CoreColorTokenUtils.ContainerType inactiveContainerType)Returns the foreground color for the specified component.- Parameters:
component- Component.text- Text. If empty ornull, the result isnull.- Returns:
- The foreground color for the specified component.
-
getMenuComponentForegroundColor
public static java.awt.Color getMenuComponentForegroundColor(javax.swing.JMenuItem menuComponent, java.lang.String text, StateTransitionTracker.ModelStateInfo modelStateInfo)Returns the foreground color for the specified menu component.- Parameters:
menuComponent- Menu component.text- Text. If empty ornull, the result isnull.modelStateInfo- Model state info for the specified component.- Returns:
- The foreground color for the specified menu component.
-
getTextBackgroundFillColor
public static java.awt.Color getTextBackgroundFillColor(javax.swing.JComponent comp)
-
getTextSelectionBackground
public static java.awt.Color getTextSelectionBackground(javax.swing.text.JTextComponent comp)
-
getTextSelectionForeground
public static java.awt.Color getTextSelectionForeground(javax.swing.text.JTextComponent comp)
-
paintTextCompBackground
public static void paintTextCompBackground(java.awt.Graphics g, javax.swing.JComponent comp)Paints background of the specified text component.- Parameters:
g- Graphics context.comp- Component.
-
hasRadianceTextBorder
private static boolean hasRadianceTextBorder(javax.swing.JComponent comp)
-
-