1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
package com.explodingpixels.macwidgets;
import java.awt.Color;
import java.awt.Component;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import com.explodingpixels.macwidgets.plaf.EmphasizedLabelUI;
import com.explodingpixels.painter.GradientWithBorderPainter;
import com.explodingpixels.painter.MacWidgetsPainter;
/**
* A {@link WidgetColorScheme} that provides {@link Painter}s and colors
*
*/
public class WidgetStandardColorScheme implements WidgetColorScheme {
private static Color ACTIVE_BACKGROUND_COLOR = new Color(0xd6dde5);
private static Color INACTIVE_BACKGROUND_COLOR = new Color(0xe8e8e8);
private static final Color CATEGORY_FONT_COLOR = Color.BLACK;
private static final Color CATEGORY_FONT_SHADOW_COLOR = EmphasizedLabelUI.DEFAULT_EMPHASIS_COLOR;
private static final Color ITEM_FONT_COLOR = Color.BLACK;
private static final Color SELECTED_ITEM_FONT_COLOR = Color.WHITE;
private static final Color SELECTED_ITEM_FONT_SHADOW_COLOR = new Color(0, 0, 0, 110);
private static Color BADGE_SELECTED_COLOR = Color.WHITE;
private static Color BADGE_ACTIVE_UNSELECTED_COLOR = new Color(0x8899bc);
private static Color BADGE_INACTIVE_UNSELECTED_COLOR = new Color(0x9a9a9a);
private static Color BADGE_TEXT_COLOR = BADGE_SELECTED_COLOR;
private static final Color ACTIVE_FOCUSED_SELECTION_TOPLINE_COLOR = new Color(0x4580c8);
private static final Color ACTIVE_FOCUSED_SELECTION_TOP_COLOR = new Color(0x5d94d6);
private static final Color ACTIVE_FOCUSED_SELECTION_BOTTOM_COLOR = new Color(0x1956ad);
private static final Color ACTIVE_UNFOCUSED_SELECTION_TOPLINE_COLOR = new Color(0x91a0c0);
private static final Color ACTIVE_UNFOCUSED_SELECTION_TOP_COLOR = new Color(0xa1b0cf);
private static final Color ACTIVE_UNFOCUSED_SELECTION_BOTTOM_COLOR = new Color(0x7185ab);
private static final Color INACTIVE_SELECTION_TOPLINE_COLOR = new Color(0x979797);
private static final Color INACTIVE_SELECTION_TOP_COLOR = new Color(0xb4b4b4);
private static final Color INACTIVE_SELECTION_BOTTOM_COLOR = new Color(0x8a8a8a);
public static final Icon UNSELECTED_COLLAPSED_ICON = new ImageIcon(
SourceList.class.getResource(
"/com/explodingpixels/macwidgets/images/source_list_right_arrow.png"));
private static final Icon UNSELECTED_EXPANDED_ICON = new ImageIcon(
SourceList.class.getResource(
"/com/explodingpixels/macwidgets/images/source_list_down_arrow.png"));
private static final Icon SELECTED_COLLAPSED_ICON = new ImageIcon(
SourceList.class.getResource(
"/com/explodingpixels/macwidgets/images/source_list_white_right_arrow.png"));
private static final Icon SELECTED_EXPANDED_ICON = new ImageIcon(
SourceList.class.getResource(
"/com/explodingpixels/macwidgets/images/source_list_white_down_arrow.png"));
private static final MacWidgetsPainter<Component> ACTIVE_FOCUSED_SELECTION_PAINTER =
createSourceListActiveFocusedSelectionPainter();
private static final MacWidgetsPainter<Component> ACTIVE_UNFOCUSED_SELECTION_PAINTER =
createSourceListActiveUnfocusedSelectionPainter();
private static final MacWidgetsPainter<Component> INACTIVE_FOCUSED_SELECTION_PAINTER =
createSourceListInactiveSelectionPainter();
public MacWidgetsPainter<Component> getActiveFocusedSelectedItemPainter() {
return ACTIVE_FOCUSED_SELECTION_PAINTER;
}
public MacWidgetsPainter<Component> getActiveUnfocusedSelectedItemPainter() {
return ACTIVE_UNFOCUSED_SELECTION_PAINTER;
}
public MacWidgetsPainter<Component> getInactiveSelectedItemPainter() {
return INACTIVE_FOCUSED_SELECTION_PAINTER;
}
public Color getCategoryTextColor() {
return CATEGORY_FONT_COLOR;
}
public Color getCategoryTextShadowColor() {
return CATEGORY_FONT_SHADOW_COLOR;
}
public Color getUnselectedItemTextColor() {
return ITEM_FONT_COLOR;
}
public Color getSelectedItemTextColor() {
return SELECTED_ITEM_FONT_COLOR;
}
public Color getSelectedItemFontShadowColor() {
return SELECTED_ITEM_FONT_SHADOW_COLOR;
}
public Color getActiveBackgroundColor() {
return ACTIVE_BACKGROUND_COLOR;
}
public Color getInactiveBackgroundColor() {
return INACTIVE_BACKGROUND_COLOR;
}
public Icon getUnselectedCollapsedIcon() {
return UNSELECTED_COLLAPSED_ICON;
}
public Icon getUnselectedExpandedIcon() {
return UNSELECTED_EXPANDED_ICON;
}
public Icon getSelectedCollapsedIcon() {
return SELECTED_COLLAPSED_ICON;
}
public Icon getSelectedExpandedIcon() {
return SELECTED_EXPANDED_ICON;
}
public Color getBadgeTextColor() {
return BADGE_TEXT_COLOR;
}
public Color getSelectedBadgeColor() {
return BADGE_SELECTED_COLOR;
}
public Color getActiveUnselectedBadgeColor() {
return BADGE_ACTIVE_UNSELECTED_COLOR;
}
public Color getInativeUnselectedBadgeColor() {
return BADGE_INACTIVE_UNSELECTED_COLOR;
}
private static MacWidgetsPainter<Component> createSourceListActiveFocusedSelectionPainter() {
Color topLineColor = new Color(0x4580c8);
Color topColor = new Color(0x5d94d6);
Color bottomColor = new Color(0x1956ad);
return new GradientWithBorderPainter(topLineColor, bottomColor, topColor, bottomColor);
}
private static MacWidgetsPainter<Component> createSourceListActiveUnfocusedSelectionPainter() {
Color topLineColor = new Color(0x91a0c0);
Color topColor = new Color(0xa1b0cf);
Color bottomColor = new Color(0x7185ab);
return new GradientWithBorderPainter(topLineColor, bottomColor, topColor, bottomColor);
}
private static MacWidgetsPainter<Component> createSourceListInactiveSelectionPainter() {
Color topLineColor = new Color(0x979797);
Color topColor = new Color(0xb4b4b4);
Color bottomColor = new Color(0x8a8a8a);
return new GradientWithBorderPainter(topLineColor, bottomColor, topColor, bottomColor);
}
@Override
public Color getActiveFocusedSelectedItemBackgroundColor() {
return ACTIVE_FOCUSED_SELECTION_TOP_COLOR;
}
@Override
public Color getActiveUnfocusedSelectedItemBackgroundColor() {
return ACTIVE_UNFOCUSED_SELECTION_TOP_COLOR;
}
@Override
public Color getInactiveSelectedItemBackgroundColor() {
return INACTIVE_SELECTION_TOP_COLOR;
}
}
|