/** * Paints the decoration background on the specified component. The * decoration background is not painted when the <code>force</code> * parameter is <code>false</code> and at least one of the following * conditions holds: * <ul> * <li>The component is in a cell renderer.</li> * <li>The component is not showing on the screen.</li> * <li>The component is in the preview mode.</li> * </ul> * * @param g * Graphics context. * @param c * Component. * @param force * If <code>true</code>, the painting of decoration background is * enforced. */ public static void paintDecorationBackground(Graphics g, Component c, boolean force) { DecorationAreaType decorationType = SubstanceLookAndFeel .getDecorationType(c); paintDecorationBackground(g, c, decorationType, force); }
/** * Paints the decoration background on the specified component. The * decoration background is not painted when the <code>force</code> * parameter is <code>false</code> and at least one of the following * conditions holds: * <ul> * <li>The component is in a cell renderer.</li> * <li>The component is not showing on the screen.</li> * <li>The component is in the preview mode.</li> * </ul> * * @param g * Graphics context. * @param c * Component. * @param force * If <code>true</code>, the painting of decoration background is * enforced. */ public static void paintDecorationBackground(Graphics g, Component c, boolean force) { DecorationAreaType decorationType = SubstanceLookAndFeel .getDecorationType(c); paintDecorationBackground(g, c, decorationType, force); }
public void paint(Graphics2D g, Object jxTitledPanel, int width, int height) { JComponent titledPanel = (JComponent) jxTitledPanel; Graphics2D g2d = (Graphics2D) g.create(); // g2d.translate(10, 10); DecorationAreaType decorationType = SubstanceLookAndFeel .getDecorationType(titledPanel); if ((decorationType != null) && (SubstanceCoreUtilities.getSkin(titledPanel) .isRegisteredAsDecorationArea(decorationType))) { DecorationPainterUtils.paintDecorationBackground(g2d, titledPanel, false); } else { BackgroundPaintingUtils.fillAndWatermark(g2d, titledPanel, SubstanceCoreUtilities.getSkin(titledPanel) .getBackgroundColorScheme(decorationType) .getBackgroundFillColor(), new Rectangle(0, 0, titledPanel.getWidth(), titledPanel .getHeight())); } g2d.dispose(); } };
.paintDecorationBackground(graphics, c, decorationType, force);
.paintDecorationBackground(graphics, c, force);