/** * Paints the specified text. * * @param g * Graphics context. * @param comp * Component. * @param textRect * Text rectangle. * @param text * Text to paint. * @param mnemonicIndex * Mnemonic index. * @param font * Font to use. * @param color * Color to use. * @param clip * Optional clip. Can be <code>null</code>. */ public static void paintText(Graphics g, JComponent comp, Rectangle textRect, String text, int mnemonicIndex, java.awt.Font font, java.awt.Color color, java.awt.Rectangle clip) { SubstanceTextUtilities.paintText(g, comp, textRect, text, mnemonicIndex, font, color, clip, null); }
/** * Paints the specified text. * * @param g * Graphics context. * @param comp * Component. * @param textRect * Text rectangle. * @param text * Text to paint. * @param mnemonicIndex * Mnemonic index. * @param font * Font to use. * @param color * Color to use. * @param clip * Optional clip. Can be <code>null</code>. */ public static void paintText(Graphics g, JComponent comp, Rectangle textRect, String text, int mnemonicIndex, java.awt.Font font, java.awt.Color color, java.awt.Rectangle clip) { SubstanceTextUtilities.paintText(g, comp, textRect, text, mnemonicIndex, font, color, clip, null); }
/** * Paints the text. * * @param g * Graphic context * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint */ protected void paintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) { SubstanceTextUtilities.paintText(g, button, textRect, text, (button) .getDisplayedMnemonicIndex()); }
/** * Paints the text of the specified button. * * @param g * Graphic context. * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint * @param mnemonicIndex * Mnemonic index. */ public static void paintText(Graphics g, AbstractButton button, Rectangle textRect, String text, int mnemonicIndex) { paintText(g, button, button.getModel(), textRect, text, mnemonicIndex); }
/** * Paints the text. * * @param g * Graphic context * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint */ protected void paintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) { SubstanceTextUtilities.paintText(g, button, textRect, text, button .getDisplayedMnemonicIndex()); }
/** * Paints the text. * * @param g * Graphic context * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint */ protected void paintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) { SubstanceTextUtilities.paintText(g, button, textRect, text, button .getDisplayedMnemonicIndex()); }
/** * Paints the text. * * @param g * Graphic context * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint */ protected void paintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) { SubstanceTextUtilities.paintText(g, button, textRect, text, button .getDisplayedMnemonicIndex()); }
/** * Paints the text of the specified button. * * @param g * Graphic context. * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint * @param mnemonicIndex * Mnemonic index. */ public static void paintText(Graphics g, AbstractButton button, Rectangle textRect, String text, int mnemonicIndex) { paintText(g, button, button.getModel(), textRect, text, mnemonicIndex); }
/** * Paints the text. * * @param g * Graphic context * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint */ protected void paintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) { SubstanceTextUtilities.paintText(g, button, textRect, text, button .getDisplayedMnemonicIndex()); }
/** * Paints the text. * * @param g * Graphic context * @param button * Button * @param textRect * Text rectangle * @param text * Text to paint */ protected void paintButtonText(Graphics g, AbstractButton button, Rectangle textRect, String text) { SubstanceTextUtilities.paintText(g, button, textRect, text, (button) .getDisplayedMnemonicIndex()); }
public static void paintMenuItemText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha) { Color fgColor = getMenuItemForegroundColor(menuItem, text, modelStateInfo, textAlpha); SubstanceTextUtilities.paintText(g, menuItem, textRect, text, mnemonicIndex, menuItem.getFont(), fgColor, null); }
public static void paintText(Graphics g, JComponent component, Rectangle textRect, String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha) { Color fgColor = getForegroundColor(component, text, modelStateInfo, textAlpha); SubstanceTextUtilities.paintText(g, component, textRect, text, mnemonicIndex, component.getFont(), fgColor, null); }
public static void paintText(Graphics g, JComponent component, Rectangle textRect, String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha) { Color fgColor = getForegroundColor(component, text, modelStateInfo, textAlpha); SubstanceTextUtilities.paintText(g, component, textRect, text, mnemonicIndex, component.getFont(), fgColor, null); }
public static void paintMenuItemText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text, int mnemonicIndex, StateTransitionTracker.ModelStateInfo modelStateInfo, float textAlpha) { Color fgColor = getMenuComponentForegroundColor(menuItem, text, modelStateInfo, textAlpha); SubstanceTextUtilities.paintText(g, menuItem, textRect, text, mnemonicIndex, menuItem.getFont(), fgColor, null); }
/** * Paints the specified text. * * @param g * Graphics context. * @param component * Component. * @param textRect * Text rectangle. * @param text * Text to paint. * @param mnemonicIndex * Mnemonic index. * @param state * Component state. * @param textAlpha * Alpha channel for painting the text. */ public static void paintText(Graphics g, JComponent component, Rectangle textRect, String text, int mnemonicIndex, ComponentState state, float textAlpha) { Color fgColor = getForegroundColor(component, text, state, textAlpha); SubstanceTextUtilities.paintText(g, component, textRect, text, mnemonicIndex, component.getFont(), fgColor, null); }
/** * Paints the specified text. * * @param g * Graphics context. * @param component * Component. * @param textRect * Text rectangle. * @param text * Text to paint. * @param mnemonicIndex * Mnemonic index. * @param state * Component state. * @param prevState * Component previous state. * @param textAlpha * Alpha channel for painting the text. */ public static void paintText(Graphics g, JComponent component, Rectangle textRect, String text, int mnemonicIndex, ComponentState state, float textAlpha) { Color fgColor = getForegroundColor(component, text, state, textAlpha); SubstanceTextUtilities.paintText(g, component, textRect, text, mnemonicIndex, component.getFont(), fgColor, null); }
@Override public void paint(Graphics g, JComponent c) { Font font = c.getFont(); // FontMetrics metrics = c.getFontMetrics(font); Dimension size = c.getSize(); if (c.isOpaque()) { g.setColor(c.getBackground()); g.fillRect(0, 0, size.width, size.height); } g.setColor(c.getForeground()); g.setFont(font); // fix for bug 4153892 String tipText = ((JToolTip) c).getTipText(); if (tipText == null) { tipText = ""; } Insets insets = c.getInsets(); Rectangle paintTextR = new Rectangle(insets.left + 3, insets.top, size.width - (insets.left + insets.right + 6), size.height - (insets.top + insets.bottom + 2)); View v = (View) c.getClientProperty(BasicHTML.propertyKey); if (v != null) { v.paint(g, paintTextR); } else { SubstanceTextUtilities.paintText(g, c, paintTextR, tipText, -1, font, c.getForeground(), null); } }
@Override public void paint(Graphics g, JComponent c) { Font font = c.getFont(); // FontMetrics metrics = c.getFontMetrics(font); Dimension size = c.getSize(); if (c.isOpaque()) { g.setColor(c.getBackground()); g.fillRect(0, 0, size.width, size.height); } g.setColor(c.getForeground()); g.setFont(font); // fix for bug 4153892 String tipText = ((JToolTip) c).getTipText(); if (tipText == null) { tipText = ""; } Insets insets = c.getInsets(); Rectangle paintTextR = new Rectangle(insets.left + 3, insets.top, size.width - (insets.left + insets.right + 6), size.height - (insets.top + insets.bottom + 2)); View v = (View) c.getClientProperty(BasicHTML.propertyKey); if (v != null) { v.paint(g, paintTextR); } else { SubstanceTextUtilities.paintText(g, c, paintTextR, tipText, -1, font, c.getForeground(), null); } }
buttonAlpha); } else { paintText(g, button, textRect, text, mnemonicIndex, stateTransitionTracker.getModelStateInfo(), buttonAlpha);
buttonAlpha); } else { paintText(g, button, textRect, text, mnemonicIndex, stateTransitionTracker.getModelStateInfo(), buttonAlpha);