PageRenderTime 66ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre3/org/gjt/sp/jedit/gui/JEditMetalTheme.java

#
Java | 72 lines | 43 code | 10 blank | 19 comment | 0 complexity | cfb647be4c1d810e89b4f789440e8c1b MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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 javax.swing.*;
  23. import org.gjt.sp.jedit.jEdit;
  24. public class JEditMetalTheme extends DefaultMetalTheme
  25. {
  26. public String getName()
  27. {
  28. return "jEdit";
  29. }
  30. public ColorUIResource getSystemTextColor()
  31. {
  32. return getBlack();
  33. }
  34. public FontUIResource getControlTextFont()
  35. {
  36. return primaryFont;
  37. }
  38. public FontUIResource getSystemTextFont()
  39. {
  40. return secondaryFont;
  41. }
  42. public FontUIResource getUserTextFont()
  43. {
  44. return secondaryFont;
  45. }
  46. public FontUIResource getMenuTextFont()
  47. {
  48. return primaryFont;
  49. }
  50. public void propertiesChanged()
  51. {
  52. primaryFont = new FontUIResource(
  53. jEdit.getFontProperty("metal.primary.font",
  54. super.getControlTextFont()));
  55. secondaryFont = new FontUIResource(
  56. jEdit.getFontProperty("metal.secondary.font",
  57. super.getSystemTextFont()));
  58. }
  59. // private members
  60. private FontUIResource primaryFont;
  61. private FontUIResource secondaryFont;
  62. }