1. /*
  2. * @(#)BlueprintGraphicsUtils.java 1.5 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.java.swing.plaf.gtk;
  8. import java.awt.*;
  9. import javax.swing.plaf.synth.*;
  10. /**
  11. * @version 1.5 12/19/03
  12. * @author Joshua Outwater
  13. */
  14. class BlueprintGraphicsUtils extends SynthGraphicsUtils {
  15. public void paintText(SynthContext context, Graphics g, String text,
  16. int x, int y, int mnemonicIndex) {
  17. int state = context.getComponentState();
  18. Region region = context.getRegion();
  19. // Paint menu and menu items with shadow defined by blueprint colors.
  20. if (((state & SynthConstants.MOUSE_OVER) == SynthConstants.MOUSE_OVER
  21. && (region == Region.MENU_ITEM ||
  22. region == Region.CHECK_BOX_MENU_ITEM ||
  23. region == Region.RADIO_BUTTON_MENU_ITEM)) ||
  24. ((state & SynthConstants.SELECTED) == SynthConstants.SELECTED
  25. && region == Region.MENU)) {
  26. g.setColor(context.getStyle().getColor(context,
  27. GTKColorType.BLACK));
  28. super.paintText(context, g, text, x + 1, y + 1, mnemonicIndex);
  29. g.setColor(context.getStyle().getColor(context,
  30. GTKColorType.WHITE));
  31. super.paintText(context, g, text, x, y, mnemonicIndex);
  32. } else {
  33. super.paintText(context, g, text, x, y, mnemonicIndex);
  34. }
  35. }
  36. }