1 16 package swingwtx.swing.plaf.metal; 17 18 import swingwtx.swing.plaf.*; 19 import java.util.HashMap ; 20 21 public abstract class MetalTheme { 22 23 static final int CONTROL_TEXT_FONT = 0; 24 static final int SYSTEM_TEXT_FONT = 1; 25 static final int USER_TEXT_FONT = 2; 26 static final int MENU_TEXT_FONT = 3; 27 static final int WINDOW_TITLE_FONT = 4; 28 static final int SUB_TEXT_FONT = 5; 29 30 private static ColorUIResource white = new ColorUIResource( 255, 255, 255 ); 31 private static ColorUIResource black = new ColorUIResource( 0, 0, 0 ); 32 33 public abstract String getName(); 34 35 protected abstract ColorUIResource getPrimary1(); protected abstract ColorUIResource getPrimary2(); 37 protected abstract ColorUIResource getPrimary3(); 38 39 protected abstract ColorUIResource getSecondary1(); protected abstract ColorUIResource getSecondary2(); 41 protected abstract ColorUIResource getSecondary3(); 42 43 public abstract FontUIResource getControlTextFont(); 44 public abstract FontUIResource getSystemTextFont(); 45 public abstract FontUIResource getUserTextFont(); 46 public abstract FontUIResource getMenuTextFont(); 47 public abstract FontUIResource getWindowTitleFont(); 48 public abstract FontUIResource getSubTextFont(); 49 50 protected ColorUIResource getWhite() { return white; } 51 protected ColorUIResource getBlack() { return black; } 52 53 public ColorUIResource getFocusColor() { return getPrimary2(); } 54 55 public ColorUIResource getDesktopColor() { return getPrimary2(); } 56 57 public ColorUIResource getControl() { return getSecondary3(); } 58 public ColorUIResource getControlShadow() { return getSecondary2(); } 59 public ColorUIResource getControlDarkShadow() { return getSecondary1(); } 60 public ColorUIResource getControlInfo() { return getBlack(); } 61 public ColorUIResource getControlHighlight() { return getWhite(); } 62 public ColorUIResource getControlDisabled() { return getSecondary2(); } 63 64 public ColorUIResource getPrimaryControl() { return getPrimary3(); } 65 public ColorUIResource getPrimaryControlShadow() { return getPrimary2(); } 66 public ColorUIResource getPrimaryControlDarkShadow() { return getPrimary1(); } 67 public ColorUIResource getPrimaryControlInfo() { return getBlack(); } 68 public ColorUIResource getPrimaryControlHighlight() { return getWhite(); } 69 70 74 public ColorUIResource getSystemTextColor() { return getBlack(); } 75 public ColorUIResource getControlTextColor() { return getControlInfo(); } 76 public ColorUIResource getInactiveControlTextColor() { return getControlDisabled(); } 77 public ColorUIResource getInactiveSystemTextColor() { return getSecondary2(); } 78 public ColorUIResource getUserTextColor() { return getBlack(); } 79 public ColorUIResource getTextHighlightColor() { return getPrimary3(); } 80 public ColorUIResource getHighlightedTextColor() { return getControlTextColor(); } 81 82 public ColorUIResource getWindowBackground() { return getWhite(); } 83 public ColorUIResource getWindowTitleBackground() { return getPrimary3(); } 84 public ColorUIResource getWindowTitleForeground() { return getBlack(); } 85 public ColorUIResource getWindowTitleInactiveBackground() { return getSecondary3(); } 86 public ColorUIResource getWindowTitleInactiveForeground() { return getBlack(); } 87 88 public ColorUIResource getMenuBackground() { return getSecondary3(); } 89 public ColorUIResource getMenuForeground() { return getBlack(); } 90 public ColorUIResource getMenuSelectedBackground() { return getPrimary2(); } 91 public ColorUIResource getMenuSelectedForeground() { return getBlack(); } 92 public ColorUIResource getMenuDisabledForeground() { return getSecondary2(); } 93 public ColorUIResource getSeparatorBackground() { return getWhite(); } 94 public ColorUIResource getSeparatorForeground() { return getPrimary1(); } 95 public ColorUIResource getAcceleratorForeground() { return getPrimary1(); } 96 public ColorUIResource getAcceleratorSelectedForeground() { return getBlack(); } 97 98 public void addCustomEntriesToTable(HashMap table) {} 99 100 void install() { 101 } 102 103 boolean isSystemTheme() { 104 return false; 105 } 106 } 107 | Popular Tags |