| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package org.pushingpixels.substance.swingx; |
| 20 |
|
| 21 |
import java.awt.Graphics2D; |
| 22 |
import java.util.List; |
| 23 |
|
| 24 |
import javax.swing.JComponent; |
| 25 |
import javax.swing.JSeparator; |
| 26 |
|
| 27 |
import org.pushingpixels.substance.api.*; |
| 28 |
import org.pushingpixels.substance.api.painter.overlay.SubstanceOverlayPainter; |
| 29 |
import org.pushingpixels.substance.internal.painter.BackgroundPaintingUtils; |
| 30 |
import org.pushingpixels.substance.internal.painter.SeparatorPainterUtils; |
| 31 |
|
| 32 |
public class SubstanceSwingxFillBackgroundDelegate { |
| 33 |
public void paint(JComponent component, Graphics2D graphics, |
| 34 |
boolean paintSeparator) { |
| 35 |
BackgroundPaintingUtils.updateIfOpaque(graphics, component); |
| 36 |
if (paintSeparator) { |
| 37 |
SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin(component); |
| 38 |
DecorationAreaType decorationAreaType = SubstanceLookAndFeel |
| 39 |
.getDecorationType(component); |
| 40 |
List<SubstanceOverlayPainter> overlayPainters = skin |
| 41 |
.getOverlayPainters(decorationAreaType); |
| 42 |
|
| 43 |
|
| 44 |
if (overlayPainters.size() == 0) { |
| 45 |
|
| 46 |
SeparatorPainterUtils.paintSeparator(component, graphics, |
| 47 |
component.getWidth(), 0, JSeparator.HORIZONTAL, false, |
| 48 |
0); |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
} |