/** * Paints all registered overlays on the specified component. Overlay * painters are registered with * {@link SubstanceSkin#addOverlayPainter(SubstanceOverlayPainter, DecorationAreaType...)} * API. * * @param g * Graphics context. * @param c * Component. * @param skin * Component skin. * @param decorationAreaType * Component decoration area type. */ public static void paintOverlays(Graphics g, Component c, SubstanceSkin skin, DecorationAreaType decorationAreaType) { List<SubstanceOverlayPainter> overlayPainters = skin .getOverlayPainters(decorationAreaType); if (overlayPainters.size() == 0) return; for (SubstanceOverlayPainter overlayPainter : overlayPainters) { Graphics2D g2d = (Graphics2D) g.create(); overlayPainter.paintOverlay(g2d, c, decorationAreaType, c .getWidth(), c.getHeight(), skin); g2d.dispose(); } } }
/** * Paints all registered overlays on the specified component. Overlay * painters are registered with * {@link SubstanceSkin#addOverlayPainter(SubstanceOverlayPainter, DecorationAreaType...)} * API. * * @param g * Graphics context. * @param c * Component. * @param skin * Component skin. * @param decorationAreaType * Component decoration area type. */ public static void paintOverlays(Graphics g, Component c, SubstanceSkin skin, DecorationAreaType decorationAreaType) { List<SubstanceOverlayPainter> overlayPainters = skin .getOverlayPainters(decorationAreaType); if (overlayPainters.size() == 0) return; for (SubstanceOverlayPainter overlayPainter : overlayPainters) { Graphics2D g2d = (Graphics2D) g.create(); overlayPainter.paintOverlay(g2d, c, decorationAreaType, c .getWidth(), c.getHeight(), skin); g2d.dispose(); } } }
public void paint(JComponent component, Graphics2D graphics, boolean paintSeparator) { BackgroundPaintingUtils.updateIfOpaque(graphics, component); if (paintSeparator) { SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(component); DecorationAreaType decorationAreaType = SubstanceLookAndFeel .getDecorationType(component); List<SubstanceOverlayPainter> overlayPainters = skin .getOverlayPainters(decorationAreaType); // only if there are no overlays specified on this decoration area // type in the skin if (overlayPainters.size() == 0) { // paint the separator on top. SeparatorPainterUtils.paintSeparator(component, graphics, component.getWidth(), 0, JSeparator.HORIZONTAL, false, 0); } } } }
|| (skin.getOverlayPainters(decorationAreaType).size() > 0); toUseAlphaColors = toUseAlphaColors || toEnforceAlphaColors;
|| (skin.getOverlayPainters(decorationAreaType).size() > 0); toUseAlphaColors = toUseAlphaColors || toEnforceAlphaColors;