Search in sources :

Example 1 with Theme

use of org.apache.pivot.wtk.Theme in project pivot by apache.

the class NumberRulerSkin method setBackgroundColor.

public final void setBackgroundColor(int backgroundColor) {
    Theme theme = currentTheme();
    setBackgroundColor(theme.getColor(backgroundColor));
}
Also used : Theme(org.apache.pivot.wtk.Theme)

Example 2 with Theme

use of org.apache.pivot.wtk.Theme in project pivot by apache.

the class NumberRulerSkin method setColor.

public final void setColor(int color) {
    Theme theme = currentTheme();
    setColor(theme.getColor(color));
}
Also used : Theme(org.apache.pivot.wtk.Theme)

Example 3 with Theme

use of org.apache.pivot.wtk.Theme in project pivot by apache.

the class ContainerSkin method setBackgroundColor.

/**
 * Sets the background of the container to one of the theme colors.
 *
 * @param backgroundColor An index into the theme's color palette.
 */
public final void setBackgroundColor(int backgroundColor) {
    Theme theme = currentTheme();
    setBackgroundColor(theme.getColor(backgroundColor));
}
Also used : Theme(org.apache.pivot.wtk.Theme)

Example 4 with Theme

use of org.apache.pivot.wtk.Theme in project pivot by apache.

the class SeparatorSkin method install.

@Override
public void install(Component component) {
    super.install(component);
    Theme theme = currentTheme();
    theme.setDefaultStyles(this);
    Separator separator = (Separator) component;
    separator.getSeparatorListeners().add(this);
}
Also used : Theme(org.apache.pivot.wtk.Theme) Separator(org.apache.pivot.wtk.Separator)

Example 5 with Theme

use of org.apache.pivot.wtk.Theme in project pivot by apache.

the class ColorSchemeBuilderWindow method createColorPaletteCell.

private static Component createColorPaletteCell(int index) {
    Border border = new Border();
    border.getStyles().put(Style.backgroundColor, index);
    Theme theme = Theme.getTheme();
    Label label = new Label();
    label.setText(Integer.toString(index));
    label.getStyles().put(Style.font, "{size:'80%'}");
    label.getStyles().put(Style.backgroundColor, 4);
    label.getStyles().put(Style.padding, 1);
    BoxPane boxPane = new BoxPane();
    boxPane.getStyles().put(Style.padding, 2);
    boxPane.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.CENTER);
    boxPane.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
    boxPane.add(new Border(label));
    border.setContent(boxPane);
    return border;
}
Also used : BoxPane(org.apache.pivot.wtk.BoxPane) Label(org.apache.pivot.wtk.Label) Theme(org.apache.pivot.wtk.Theme) Border(org.apache.pivot.wtk.Border)

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