663 @Override
664 public void setForeground(Color c) {
665 if (log.isLoggable(PlatformLogger.Level.FINE)) {
666 log.fine("Set foreground to " + c);
667 }
668 synchronized (getStateLock()) {
669 if (Objects.equals(foreground, c)) {
670 return;
671 }
672 foreground = c;
673 }
674 repaint();
675 }
676
677 /**
678 * Gets the font metrics for the specified font.
679 * @param font the font for which font metrics is to be
680 * obtained
681 * @return the font metrics for <code>font</code>
682 * @see #getFont
683 * @see #getPeer
684 * @see java.awt.peer.ComponentPeer#getFontMetrics(Font)
685 * @see Toolkit#getFontMetrics(Font)
686 * @since 1.0
687 */
688 public FontMetrics getFontMetrics(Font font) {
689 if (fontLog.isLoggable(PlatformLogger.Level.FINE)) {
690 fontLog.fine("Getting font metrics for " + font);
691 }
692 return sun.font.FontDesignMetrics.getMetrics(font);
693 }
694
695 @Override
696 public void setFont(Font f) {
697 if (f == null) {
698 f = XWindow.getDefaultFont();
699 }
700 synchronized (getStateLock()) {
701 if (f.equals(font)) {
702 return;
703 }
|
663 @Override
664 public void setForeground(Color c) {
665 if (log.isLoggable(PlatformLogger.Level.FINE)) {
666 log.fine("Set foreground to " + c);
667 }
668 synchronized (getStateLock()) {
669 if (Objects.equals(foreground, c)) {
670 return;
671 }
672 foreground = c;
673 }
674 repaint();
675 }
676
677 /**
678 * Gets the font metrics for the specified font.
679 * @param font the font for which font metrics is to be
680 * obtained
681 * @return the font metrics for <code>font</code>
682 * @see #getFont
683 * @see java.awt.peer.ComponentPeer#getFontMetrics(Font)
684 * @see Toolkit#getFontMetrics(Font)
685 * @since 1.0
686 */
687 public FontMetrics getFontMetrics(Font font) {
688 if (fontLog.isLoggable(PlatformLogger.Level.FINE)) {
689 fontLog.fine("Getting font metrics for " + font);
690 }
691 return sun.font.FontDesignMetrics.getMetrics(font);
692 }
693
694 @Override
695 public void setFont(Font f) {
696 if (f == null) {
697 f = XWindow.getDefaultFont();
698 }
699 synchronized (getStateLock()) {
700 if (f.equals(font)) {
701 return;
702 }
|