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); }
/** * Paints background of the specified text component. * * @param g * Graphics context. * @param comp * Component. */ public static void paintTextCompBackground(Graphics g, JComponent comp) { Color backgroundFillColor = getTextBackgroundFillColor(comp); paintTextCompBackground(g, comp, backgroundFillColor, SubstanceCoreUtilities.toDrawWatermark(comp) || !comp.isOpaque()); }
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); }
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); }
/** * 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); }
@Override protected void paintBackground(Graphics g) { SubstanceTextUtilities.paintTextCompBackground(g, this.textField); }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); int componentFontSize = SubstanceSizeUtils .getComponentFontSize(this.datePicker); int borderDelta = (int) Math.floor(SubstanceSizeUtils .getBorderStrokeWidth(componentFontSize)); Shape contour = SubstanceOutlineUtilities.getBaseOutline(datePicker .getWidth(), datePicker.getHeight(), Math.max(0, 2.0f * SubstanceSizeUtils .getClassicButtonCornerRadius(componentFontSize) - borderDelta), null, borderDelta); graphics.setColor(SubstanceTextUtilities .getTextBackgroundFillColor(this.datePicker)); graphics.fill(contour); super.paint(g, c); }
paintMenuItemText(g, (JMenuItem) button, textRect, text, mnemonicIndex, stateTransitionTracker.getModelStateInfo(), buttonAlpha); } else { paintText(g, button, textRect, text, mnemonicIndex, stateTransitionTracker.getModelStateInfo(), buttonAlpha);
SubstanceTextUtilities.paintText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionBackground(), new Rectangle(amountFull, y, progressBar.getWidth() - amountFull, height)); SubstanceTextUtilities.paintText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionForeground(), new Rectangle(fillStart, y, amountFull, height)); } else { // VERTICAL SubstanceTextUtilities.paintVerticalText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionBackground(), new Rectangle(x, y, width, progressBar.getHeight() - amountFull), progressBar .getComponentOrientation().isLeftToRight()); SubstanceTextUtilities.paintVerticalText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionForeground(), new Rectangle(x, fillStart,
.getAlpha(monthView, ComponentState.DISABLED_UNSELECTED); fgColor = SubstanceTextUtilities.getForegroundColor( monthView, " ", ComponentState.DISABLED_UNSELECTED, textAlpha); float textAlpha = SubstanceColorSchemeUtilities.getAlpha( monthView, ComponentState.DISABLED_UNSELECTED); result.setForeground(SubstanceTextUtilities.getForegroundColor( monthView, " ", ComponentState.DISABLED_UNSELECTED, textAlpha));
int yOffset = ((height - fm.getHeight()) / 2) + fm.getAscent(); SubstanceTextUtilities.paintTextWithDropShadow(this, graphics, SubstanceColorUtilities.getForegroundColor(scheme), theTitle, width, height, xOffset, yOffset);
/** * 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); }
@Override protected void paintBackground(Graphics g) { SubstanceTextUtilities.paintTextCompBackground(g, this.textArea); }
@Override public void paint(Graphics g, JComponent c) { super.paint(g, c); Graphics2D graphics = (Graphics2D) g.create(); int width = this.spinner.getWidth(); int height = this.spinner.getHeight(); int componentFontSize = SubstanceSizeUtils .getComponentFontSize(this.spinner); int borderDelta = (int) Math.floor(SubstanceSizeUtils .getBorderStrokeWidth(componentFontSize)); Shape contour = SubstanceOutlineUtilities .getBaseOutline( width, height, Math.max( 0, 2.0f * SubstanceSizeUtils .getClassicButtonCornerRadius(componentFontSize) - borderDelta), null, borderDelta); graphics.setColor(SubstanceTextUtilities .getTextBackgroundFillColor(this.spinner)); graphics.fill(contour); graphics.dispose(); }
paintMenuItemText(g, (JMenuItem) button, textRect, text, mnemonicIndex, stateTransitionTracker.getModelStateInfo(), buttonAlpha); } else { paintText(g, button, textRect, text, mnemonicIndex, stateTransitionTracker.getModelStateInfo(), buttonAlpha);
SubstanceTextUtilities.paintText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionBackground(), new Rectangle(amountFull, y, progressBar.getWidth() - amountFull, height)); SubstanceTextUtilities.paintText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionForeground(), new Rectangle(fillStart, y, amountFull, height)); } else { // VERTICAL SubstanceTextUtilities.paintVerticalText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionBackground(), new Rectangle(x, y, width, progressBar.getHeight() - amountFull), progressBar .getComponentOrientation().isLeftToRight()); SubstanceTextUtilities.paintVerticalText(g, this.progressBar, renderRectangle, progressString, -1, progressBar.getFont(), getSelectionForeground(), new Rectangle(x, fillStart,
combo, currState); Color fg = SubstanceTextUtilities .getForegroundColor(combo, ((JLabel) result).getText(), modelStateInfo, comboAlpha); result.setForeground(fg);
int yOffset = ((height - fm.getHeight()) / 2) + fm.getAscent(); SubstanceTextUtilities.paintTextWithDropShadow(this, graphics, SubstanceColorUtilities.getForegroundColor(scheme), theTitle, width, height, xOffset, yOffset);
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); }
/** * 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()); }