/** * Paints a separator. * * @param c * Component. * @param graphics * Graphics context. * @param width * Separator width. * @param height * Separator height. * @param orientation * Separator orientation. */ public static void paintSeparator(Component c, Graphics graphics, int width, int height, int orientation) { paintSeparator(c, graphics, width, height, orientation, true, 10); }
/** * Paints a separator. * * @param c * Component. * @param graphics * Graphics context. * @param width * Separator width. * @param height * Separator height. * @param orientation * Separator orientation. */ public static void paintSeparator(Component c, Graphics graphics, int width, int height, int orientation) { paintSeparator(c, graphics, width, height, orientation, true, 10); }
/** * Paints a separator. * * @param c * Component. * @param graphics * Graphics context. * @param width * Separator width. * @param height * Separator height. * @param orientation * Separator orientation. * @param hasShadow * If <code>true</code>, the separator painting will have shadow. * @param maxGradLength * Specifies the maximum pixel length of "ramp" portions of the * separator. The ramp portions are located on separator ends and * allow providing a faded appearance on those ends. */ public static void paintSeparator(Component c, Graphics graphics, int width, int height, int orientation, boolean hasShadow, int maxGradLength) { paintSeparator(c, graphics, width, height, orientation, hasShadow, maxGradLength, maxGradLength, false); }
/** * Paints a separator. * * @param c * Component. * @param graphics * Graphics context. * @param scheme * Color scheme. * @param width * Separator width. * @param height * Separator height. * @param orientation * Separator orientation. * @param hasShadow * If <code>true</code>, the separator painting will have shadow. * @param maxGradLength * Specifies the maximum pixel length of "ramp" portions of the * separator. The ramp portions are located on separator ends and * allow providing a faded appearance on those ends. */ public static void paintSeparator(Component c, Graphics graphics, int width, int height, int orientation, boolean hasShadow, int maxGradLength) { paintSeparator(c, graphics, width, height, orientation, hasShadow, maxGradLength, maxGradLength, false); }
@Override protected void paintSeparator(Graphics2D g, JXStatusBar bar, int x, int y, int w, int h) { g.translate(x, y); SeparatorPainterUtils.paintSeparator(bar, g, w, h, JSlider.VERTICAL, true, 4); g.translate(-x, -y); }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); SeparatorPainterUtils.paintSeparator(c, graphics, c.getWidth(), c .getHeight(), ((JSeparator) c).getOrientation()); graphics.dispose(); }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); SeparatorPainterUtils.paintSeparator(c, graphics, c.getWidth(), c .getHeight(), ((JSeparator) c).getOrientation()); graphics.dispose(); }
.getColorScheme(c, ColorSchemeAssociationKind.SEPARATOR, ComponentState.ENABLED); paintSeparator(c, g, compScheme, width, height, orientation, hasShadow, maxGradLengthStart, maxGradLengthEnd, toEnforceAlphaColors);
.getColorScheme(c, ColorSchemeAssociationKind.SEPARATOR, ComponentState.ENABLED); paintSeparator(c, g, compScheme, width, height, orientation, hasShadow, maxGradLengthStart, maxGradLengthEnd, toEnforceAlphaColors);
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); } } } }
@Override public void paint(Graphics g, JComponent c) { Component parent = c.getParent(); if (!(parent instanceof JPopupMenu)) { SeparatorPainterUtils.paintSeparator(c, g, c.getWidth(), c .getHeight(), ((JSeparator) c).getOrientation()); return; } Graphics2D graphics = (Graphics2D) g.create(); int xOffset = MenuUtilities.getTextOffset(c, parent); SubstanceMenuBackgroundDelegate.paintBackground(graphics, c, xOffset); Dimension s = c.getSize(); int startX = 0; int width = s.width; if (parent.getComponentOrientation().isLeftToRight()) { startX = xOffset - 2; width = s.width - startX; } else { startX = 0; width = xOffset - 4; } graphics.translate(startX, 0); graphics.setComposite(LafWidgetUtilities.getAlphaComposite(parent)); SeparatorPainterUtils.paintSeparator(c, graphics, width, s.height, ((JSeparator) c).getOrientation(), true, 2); graphics.dispose(); }
@Override public void paint(Graphics g, JComponent c) { Component parent = c.getParent(); if (!(parent instanceof JPopupMenu)) { SeparatorPainterUtils.paintSeparator(c, g, c.getWidth(), c .getHeight(), ((JSeparator) c).getOrientation()); return; } Graphics2D graphics = (Graphics2D) g.create(); int xOffset = MenuUtilities.getTextOffset(c, parent); SubstanceMenuBackgroundDelegate.paintBackground(graphics, c, xOffset); Dimension s = c.getSize(); int startX = 0; int width = s.width; if (parent.getComponentOrientation().isLeftToRight()) { startX = xOffset - 2; width = s.width - startX; } else { startX = 0; width = xOffset - 4; } graphics.translate(startX, 0); graphics.setComposite(LafWidgetUtilities.getAlphaComposite(parent)); SeparatorPainterUtils.paintSeparator(c, graphics, width, s.height, ((JSeparator) c).getOrientation(), true, 2); graphics.dispose(); }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); JSeparator sep = (JSeparator) c; int xOffset = MenuUtilities.getTextOffset(sep, sep.getParent()); SubstanceMenuBackgroundDelegate.paintBackground(graphics, c, xOffset); Dimension s = c.getSize(); int startX = 0; int width = s.width; if (c.getComponentOrientation().isLeftToRight()) { startX = xOffset - 2; width = s.width - startX; } else { startX = 0; if (xOffset > 0) { width = xOffset - 4; } else { width = s.width; } } graphics.translate(startX, 0); graphics.setComposite(LafWidgetUtilities.getAlphaComposite(sep)); SeparatorPainterUtils.paintSeparator(sep, graphics, width, s.height, sep.getOrientation(), true, 2); graphics.dispose(); }
@Override public void paint(Graphics g, JComponent c) { Graphics2D graphics = (Graphics2D) g.create(); JSeparator sep = (JSeparator) c; int xOffset = MenuUtilities.getTextOffset(sep, sep.getParent()); SubstanceMenuBackgroundDelegate.paintBackground(graphics, c, xOffset); Dimension s = c.getSize(); int startX = 0; int width = s.width; if (c.getComponentOrientation().isLeftToRight()) { startX = xOffset - 2; width = s.width - startX; } else { startX = 0; if (xOffset > 0) { width = xOffset - 4; } else { width = s.width; } } graphics.translate(startX, 0); graphics.setComposite(LafWidgetUtilities.getAlphaComposite(sep)); SeparatorPainterUtils.paintSeparator(sep, graphics, width, s.height, sep.getOrientation(), true, 2); graphics.dispose(); }