org.jdesktop.swingx.painter.PainterUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swingx-all Show documentation
Show all versions of swingx-all Show documentation
A Maven project to aggregate all modules into a single artifact.
package org.jdesktop.swingx.painter;
import java.awt.Component;
import java.awt.Font;
import java.awt.Paint;
final class PainterUtils {
private PainterUtils() {
//prevent instantiation
}
static Paint getForegroundPaint(Paint current, Object o) {
if (current == null) {
if (o instanceof Component) {
return ((Component) o).getForeground();
}
}
return current;
}
static Paint getBackgroundPaint(Paint current, Object o) {
if (current == null) {
if (o instanceof Component) {
return ((Component) o).getBackground();
}
}
return current;
}
static Font getComponentFont(Font current, Object o) {
if (current == null) {
if (o instanceof Component) {
return ((Component) o).getFont();
}
}
return current;
}
}