use of org.apache.pivot.wtk.Theme in project pivot by apache.
the class TerraAlertSkin method setBorderBackgroundColor.
public final void setBorderBackgroundColor(int borderBackgroundColor) {
Theme theme = currentTheme();
setBorderBackgroundColor(theme.getColor(borderBackgroundColor));
}
use of org.apache.pivot.wtk.Theme in project pivot by apache.
the class TerraAlertSkin method setBorderColor.
public final void setBorderColor(int borderColor) {
Theme theme = currentTheme();
setBorderColor(theme.getColor(borderColor));
}
use of org.apache.pivot.wtk.Theme in project pivot by apache.
the class TerraCalendarButtonSkin method setBackgroundColor.
public final void setBackgroundColor(int backgroundColor) {
Theme theme = currentTheme();
setBackgroundColor(theme.getColor(backgroundColor));
}
use of org.apache.pivot.wtk.Theme in project pivot by apache.
the class TerraCalendarButtonSkin method setDisabledColor.
public final void setDisabledColor(int disabledColor) {
Theme theme = currentTheme();
setDisabledColor(theme.getColor(disabledColor));
}
use of org.apache.pivot.wtk.Theme in project pivot by apache.
the class Localization method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
String language = properties.get(LANGUAGE_KEY);
Locale locale = (language == null) ? Locale.getDefault() : new Locale(language);
Resources resources = new Resources(getClass().getName(), locale);
Theme theme = Theme.getTheme();
Font font = theme.getFont();
// Search for a font that can support the sample string
String sampleResource = (String) resources.get("firstName");
if (font.canDisplayUpTo(sampleResource) != -1) {
Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
for (int i = 0; i < fonts.length; i++) {
if (fonts[i].canDisplayUpTo(sampleResource) == -1) {
theme.setFont(fonts[i].deriveFont(Font.PLAIN, 12));
break;
}
}
}
BXMLSerializer bxmlSerializer = new BXMLSerializer();
window = (Window) bxmlSerializer.readObject(Localization.class.getResource("localization.bxml"), resources);
window.open(display);
}
Aggregations