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
Fork of the inactive swingx-all library
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;
}
}