Class RadianceTextUtilities
java.lang.Object
org.pushingpixels.radiance.theming.internal.utils.RadianceTextUtilities
Text-related utilities. This class is for internal use only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorgetForegroundColor(JComponent component, String text, StateTransitionTracker.ModelStateInfo modelStateInfo, CoreColorTokenUtils.ContainerType inactiveContainerType) Returns the foreground color for the specified component.static ColorgetForegroundColor(JComponent component, ComponentState state, CoreColorTokenUtils.ContainerType inactiveContainerType) Returns the foreground color for the specified component.static ColorgetMenuComponentForegroundColor(JMenuItem menuComponent, String text, StateTransitionTracker.ModelStateInfo modelStateInfo) Returns the foreground color for the specified menu component.static Colorstatic Colorstatic Colorprivate static booleanstatic ColorpaintMenuItemText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo) static voidpaintText(Graphics g, Rectangle textRect, String text, int mnemonicIndex, Font font, Color color, Rectangle clip) Paints the specified text.private static voidpaintText(Graphics g, Rectangle textRect, String text, int mnemonicIndex, Font font, Color color, Rectangle clip, AffineTransform transform) Paints the specified text.static ColorpaintText(Graphics g, AbstractButton button, Rectangle textRect, String text, int mnemonicIndex, CoreColorTokenUtils.ContainerType inactiveContainerType) Paints the text of the specified button.static ColorpaintText(Graphics g, JComponent component, Rectangle textRect, String text, int mnemonicIndex, ComponentState state, CoreColorTokenUtils.ContainerType inactiveContainerType) Paints the specified text.static ColorpaintText(Graphics g, JComponent component, Rectangle textRect, String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, CoreColorTokenUtils.ContainerType inactiveContainerType) static voidpaintTextCompBackground(Graphics g, JComponent comp) Paints background of the specified text component.static voidpaintTextWithDropShadow(JComponent c, Graphics g, Color foregroundColor, Color echoColor, String text, int width, int height, int xOffset, int yOffset) Paints text with drop shadow.static voidpaintVerticalText(Graphics g, Rectangle textRect, String text, int mnemonicIndex, Font font, Color color, Rectangle clip, boolean isFromBottomToTop) Paints the specified vertical text.
-
Constructor Details
-
RadianceTextUtilities
public RadianceTextUtilities()
-
-
Method Details
-
paintTextWithDropShadow
public static void paintTextWithDropShadow(JComponent c, Graphics g, Color foregroundColor, Color echoColor, 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(Graphics g, Rectangle textRect, String text, int mnemonicIndex, Font font, Color color, Rectangle clip, 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(Graphics g, Rectangle textRect, String text, int mnemonicIndex, Font font, Color color, 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(Graphics g, Rectangle textRect, String text, int mnemonicIndex, Font font, Color color, 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 Color paintText(Graphics g, AbstractButton button, Rectangle textRect, 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 Color paintText(Graphics g, JComponent component, Rectangle textRect, 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 Color paintText(Graphics g, JComponent component, Rectangle textRect, String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, CoreColorTokenUtils.ContainerType inactiveContainerType) -
paintMenuItemText
-
getForegroundColor
public static Color getForegroundColor(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 Color getForegroundColor(JComponent component, 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 Color getMenuComponentForegroundColor(JMenuItem menuComponent, 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
-
getTextSelectionBackground
-
getTextSelectionForeground
-
paintTextCompBackground
Paints background of the specified text component.- Parameters:
g- Graphics context.comp- Component.
-
hasRadianceTextBorder
-