1. /*
  2. * @(#)MetalTheme.java 1.15 00/02/02
  3. *
  4. * Copyright 1998-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package javax.swing.plaf.metal;
  11. import javax.swing.plaf.*;
  12. import javax.swing.*;
  13. /**
  14. * This interface acts as a generic way to describe the colors
  15. * used by Metal. Classes which implement this interface can
  16. * be used to swap the colors in a Metal application.
  17. *
  18. * @version 1.15 02/02/00
  19. * @author Steve Wilson
  20. */
  21. public abstract class MetalTheme {
  22. private static ColorUIResource white = new ColorUIResource( 255, 255, 255 );
  23. private static ColorUIResource black = new ColorUIResource( 0, 0, 0 );
  24. public abstract String getName();
  25. protected abstract ColorUIResource getPrimary1(); // these are blue in Metal Default Theme
  26. protected abstract ColorUIResource getPrimary2();
  27. protected abstract ColorUIResource getPrimary3();
  28. protected abstract ColorUIResource getSecondary1(); // these are gray in Metal Default Theme
  29. protected abstract ColorUIResource getSecondary2();
  30. protected abstract ColorUIResource getSecondary3();
  31. public abstract FontUIResource getControlTextFont();
  32. public abstract FontUIResource getSystemTextFont();
  33. public abstract FontUIResource getUserTextFont();
  34. public abstract FontUIResource getMenuTextFont();
  35. public abstract FontUIResource getWindowTitleFont();
  36. public abstract FontUIResource getSubTextFont();
  37. protected ColorUIResource getWhite() { return white; }
  38. protected ColorUIResource getBlack() { return black; }
  39. public ColorUIResource getFocusColor() { return getPrimary2(); }
  40. public ColorUIResource getDesktopColor() { return getPrimary2(); }
  41. public ColorUIResource getControl() { return getSecondary3(); }
  42. public ColorUIResource getControlShadow() { return getSecondary2(); }
  43. public ColorUIResource getControlDarkShadow() { return getSecondary1(); }
  44. public ColorUIResource getControlInfo() { return getBlack(); }
  45. public ColorUIResource getControlHighlight() { return getWhite(); }
  46. public ColorUIResource getControlDisabled() { return getSecondary2(); }
  47. public ColorUIResource getPrimaryControl() { return getPrimary3(); }
  48. public ColorUIResource getPrimaryControlShadow() { return getPrimary2(); }
  49. public ColorUIResource getPrimaryControlDarkShadow() { return getPrimary1(); }
  50. public ColorUIResource getPrimaryControlInfo() { return getBlack(); }
  51. public ColorUIResource getPrimaryControlHighlight() { return getWhite(); }
  52. public ColorUIResource getSystemTextColor() { return getPrimary1(); }
  53. public ColorUIResource getControlTextColor() { return getControlInfo(); }
  54. public ColorUIResource getInactiveControlTextColor() { return getControlDisabled(); }
  55. public ColorUIResource getInactiveSystemTextColor() { return getSecondary2(); }
  56. public ColorUIResource getUserTextColor() { return getBlack(); }
  57. public ColorUIResource getTextHighlightColor() { return getPrimary3(); }
  58. public ColorUIResource getHighlightedTextColor() { return getControlTextColor(); }
  59. public ColorUIResource getWindowBackground() { return getWhite(); }
  60. public ColorUIResource getWindowTitleBackground() { return getPrimary3(); }
  61. public ColorUIResource getWindowTitleForeground() { return getBlack(); }
  62. public ColorUIResource getWindowTitleInactiveBackground() { return getSecondary3(); }
  63. public ColorUIResource getWindowTitleInactiveForeground() { return getBlack(); }
  64. public ColorUIResource getMenuBackground() { return getSecondary3(); }
  65. public ColorUIResource getMenuForeground() { return getBlack(); }
  66. public ColorUIResource getMenuSelectedBackground() { return getPrimary2(); }
  67. public ColorUIResource getMenuSelectedForeground() { return getBlack(); }
  68. public ColorUIResource getMenuDisabledForeground() { return getSecondary2(); }
  69. public ColorUIResource getSeparatorBackground() { return getWhite(); }
  70. public ColorUIResource getSeparatorForeground() { return getPrimary1(); }
  71. public ColorUIResource getAcceleratorForeground() { return getPrimary1(); }
  72. public ColorUIResource getAcceleratorSelectedForeground() { return getBlack(); }
  73. public void addCustomEntriesToTable(UIDefaults table) {}
  74. }