src/java.desktop/share/classes/java/awt/Font.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 39,49 ****
import java.nio.file.Files;
import java.security.AccessController;
import java.security.PrivilegedExceptionAction;
import java.text.AttributedCharacterIterator.Attribute;
import java.text.CharacterIterator;
- import java.text.StringCharacterIterator;
import java.util.Hashtable;
import java.util.Locale;
import java.util.Map;
import sun.font.StandardGlyphVector;
--- 39,48 ----
*** 237,246 ****
--- 236,250 ----
}
public boolean isCreatedFont(Font font) {
return font.createdFont;
}
+
+ @Override
+ public FontPeer getFontPeer(final Font font) {
+ return font.getFontPeer();
+ }
}
static {
/* ensure that the necessary native libraries are loaded */
Toolkit.loadLibraries();
*** 432,459 ****
* JDK 1.1 serialVersionUID
*/
private static final long serialVersionUID = -4206021311591459213L;
/**
! * Gets the peer of this <code>Font</code>.
! * @return the peer of the <code>Font</code>.
! * @since 1.1
! * @deprecated Font rendering is now platform independent.
*/
- @Deprecated
- public FontPeer getPeer(){
- return getPeer_NoClientCode();
- }
- // NOTE: This method is called by privileged threads.
- // We implement this functionality in a package-private method
- // to insure that it cannot be overridden by client subclasses.
- // DO NOT INVOKE CLIENT CODE ON THIS THREAD!
@SuppressWarnings("deprecation")
! final FontPeer getPeer_NoClientCode() {
if(peer == null) {
Toolkit tk = Toolkit.getDefaultToolkit();
! this.peer = tk.getFontPeer(name, style);
}
return peer;
}
/**
--- 436,454 ----
* JDK 1.1 serialVersionUID
*/
private static final long serialVersionUID = -4206021311591459213L;
/**
! * Gets the peer of this {@code Font}.
! *
! * @return the peer of the {@code Font}.
*/
@SuppressWarnings("deprecation")
! private FontPeer getFontPeer() {
if(peer == null) {
Toolkit tk = Toolkit.getDefaultToolkit();
! peer = tk.getFontPeer(name, style);
}
return peer;
}
/**