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