/jEdit/tags/jedit-4-2-pre14/org/gjt/sp/jedit/gui/JEditMetalTheme.java

# · Java · 71 lines · 42 code · 10 blank · 19 comment · 0 complexity · 85915c6c0426727a308d62afd61e82c6 MD5 · raw file

  1. /*
  2. * JEditMetalTheme.java - Minor Metal L&F tweaks for jEdit
  3. * Copyright (C) 2001 Slava Pestov
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. package org.gjt.sp.jedit.gui;
  20. import javax.swing.plaf.metal.*;
  21. import javax.swing.plaf.*;
  22. import org.gjt.sp.jedit.jEdit;
  23. public class JEditMetalTheme extends DefaultMetalTheme
  24. {
  25. public String getName()
  26. {
  27. return "jEdit";
  28. }
  29. public ColorUIResource getSystemTextColor()
  30. {
  31. return getBlack();
  32. }
  33. public FontUIResource getControlTextFont()
  34. {
  35. return primaryFont;
  36. }
  37. public FontUIResource getSystemTextFont()
  38. {
  39. return secondaryFont;
  40. }
  41. public FontUIResource getUserTextFont()
  42. {
  43. return secondaryFont;
  44. }
  45. public FontUIResource getMenuTextFont()
  46. {
  47. return primaryFont;
  48. }
  49. public void propertiesChanged()
  50. {
  51. primaryFont = new FontUIResource(
  52. jEdit.getFontProperty("metal.primary.font",
  53. super.getControlTextFont()));
  54. secondaryFont = new FontUIResource(
  55. jEdit.getFontProperty("metal.secondary.font",
  56. super.getSystemTextFont()));
  57. }
  58. // private members
  59. private FontUIResource primaryFont;
  60. private FontUIResource secondaryFont;
  61. }