Search in sources :

Example 86 with Theme

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));
}
Also used : Theme(org.apache.pivot.wtk.Theme)

Example 87 with Theme

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));
}
Also used : Theme(org.apache.pivot.wtk.Theme)

Example 88 with Theme

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));
}
Also used : Theme(org.apache.pivot.wtk.Theme)

Example 89 with Theme

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));
}
Also used : Theme(org.apache.pivot.wtk.Theme)

Example 90 with Theme

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);
}
Also used : Locale(java.util.Locale) Theme(org.apache.pivot.wtk.Theme) Resources(org.apache.pivot.util.Resources) Font(java.awt.Font) BXMLSerializer(org.apache.pivot.beans.BXMLSerializer)

Aggregations

Theme (org.apache.pivot.wtk.Theme)176 Color (java.awt.Color)2 Font (java.awt.Font)2 Border (org.apache.pivot.wtk.Border)2 BoxPane (org.apache.pivot.wtk.BoxPane)2 TablePane (org.apache.pivot.wtk.TablePane)2 GradientPaint (java.awt.GradientPaint)1 Locale (java.util.Locale)1 BXMLSerializer (org.apache.pivot.beans.BXMLSerializer)1 Resources (org.apache.pivot.util.Resources)1 Button (org.apache.pivot.wtk.Button)1 ButtonPressListener (org.apache.pivot.wtk.ButtonPressListener)1 ColorChooserButton (org.apache.pivot.wtk.ColorChooserButton)1 ColorChooserButtonSelectionListener (org.apache.pivot.wtk.ColorChooserButtonSelectionListener)1 Component (org.apache.pivot.wtk.Component)1 Expander (org.apache.pivot.wtk.Expander)1 Insets (org.apache.pivot.wtk.Insets)1 Label (org.apache.pivot.wtk.Label)1 NumberRuler (org.apache.pivot.wtk.NumberRuler)1 PushButton (org.apache.pivot.wtk.PushButton)1