提交 b8065ea0 编写于 作者: J jgodinez

Merge

#
# Copyright 2000-2009 Sun Microsystems, Inc. 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. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
# FILES_export definitions for Win32
FILES_export = \
java/awt/AlphaComposite.java \
java/awt/MouseInfo.java \
java/awt/Graphics.java \
java/awt/Color.java \
java/awt/Image.java \
java/awt/Rectangle.java \
java/awt/Event.java \
java/awt/Font.java \
java/awt/FontMetrics.java \
java/awt/Toolkit.java \
java/awt/Component.java \
java/awt/Container.java \
java/awt/Canvas.java \
java/awt/Button.java \
java/awt/List.java \
java/awt/Adjustable.java \
java/awt/Scrollbar.java \
java/awt/ScrollPane.java \
java/awt/ScrollPaneAdjustable.java \
java/awt/Transparency.java \
java/awt/Window.java \
java/awt/TextField.java \
java/awt/Label.java \
java/awt/Choice.java \
java/awt/TextComponent.java \
java/awt/TextArea.java \
java/awt/MenuBar.java \
java/awt/Menu.java \
java/awt/Dialog.java \
java/awt/FileDialog.java \
java/awt/MenuItem.java \
java/awt/MenuComponent.java \
java/awt/Checkbox.java \
java/awt/CheckboxGroup.java \
java/awt/CheckboxMenuItem.java \
java/awt/Frame.java \
java/awt/Insets.java \
java/awt/Cursor.java \
java/awt/Dimension.java \
java/awt/PopupMenu.java \
java/awt/AWTEvent.java \
java/awt/AWTException.java \
java/awt/AWTKeyStroke.java \
java/awt/KeyboardFocusManager.java \
java/awt/DisplayMode.java \
java/awt/TrayIcon.java \
java/awt/datatransfer/StringSelection.java \
java/awt/datatransfer/Transferable.java \
java/awt/dnd/DnDConstants.java \
java/awt/event/ActionEvent.java \
java/awt/event/AdjustmentEvent.java \
java/awt/event/ComponentEvent.java \
java/awt/event/FocusEvent.java \
java/awt/event/ItemEvent.java \
java/awt/event/InputEvent.java \
java/awt/event/InvocationEvent.java \
java/awt/event/KeyEvent.java \
java/awt/event/MouseEvent.java \
java/awt/event/MouseWheelEvent.java \
java/awt/event/WindowEvent.java \
java/awt/event/InputMethodEvent.java \
java/awt/im/InputMethodHighlight.java \
java/awt/im/spi/InputMethod.java \
java/awt/font/TextHitInfo.java \
java/text/AttributedCharacterIterator.java \
java/text/AttributedString.java \
java/awt/geom/PathIterator.java \
java/awt/image/AffineTransformOp.java \
java/awt/image/ImageConsumer.java \
java/awt/image/ImageObserver.java \
java/awt/image/BufferedImage.java \
java/awt/image/ColorModel.java \
java/awt/image/ConvolveOp.java \
java/awt/image/DirectColorModel.java \
java/awt/image/IndexColorModel.java \
java/awt/image/Raster.java \
java/awt/color/ColorSpace.java \
java/awt/color/ICC_Profile.java \
java/awt/peer/ComponentPeer.java \
java/awt/peer/MenuComponentPeer.java \
java/io/InputStream.java
FILES_export2 = \
sun/awt/im/InputMethodContext.java \
sun/awt/EmbeddedFrame.java \
sun/awt/KeyboardFocusManagerPeerImpl.java \
sun/awt/windows/WEmbeddedFrame.java \
sun/awt/windows/WEmbeddedFramePeer.java \
sun/awt/Win32GraphicsEnvironment.java \
sun/awt/Win32GraphicsDevice.java \
sun/awt/Win32GraphicsConfig.java \
sun/java2d/SunGraphicsEnvironment.java \
sun/java2d/SunGraphics2D.java \
sun/java2d/SurfaceData.java \
sun/awt/image/IntegerComponentRaster.java \
sun/awt/image/ImagingLib.java \
sun/awt/image/BufImgSurfaceData.java \
sun/awt/image/DataBufferNative.java \
sun/awt/shell/Win32ShellFolder2.java \
sun/java2d/windows/GDIBlitLoops.java \
sun/java2d/windows/GDIRenderer.java \
sun/java2d/windows/GDIWindowSurfaceData.java \
sun/java2d/windows/WindowsFlags.java \
sun/java2d/loops/Blit.java \
sun/java2d/loops/BlitBg.java \
sun/java2d/loops/ScaledBlit.java \
sun/java2d/loops/FillRect.java \
sun/java2d/loops/FillSpans.java \
sun/java2d/loops/DrawGlyphList.java \
sun/java2d/loops/DrawGlyphListAA.java \
sun/java2d/loops/DrawGlyphListLCD.java \
sun/java2d/loops/DrawLine.java \
sun/java2d/loops/DrawRect.java \
sun/java2d/loops/DrawPolygons.java \
sun/java2d/loops/DrawPath.java \
sun/java2d/loops/FillPath.java \
sun/java2d/loops/MaskBlit.java \
sun/java2d/loops/MaskFill.java \
sun/java2d/loops/TransformHelper.java \
sun/java2d/loops/GraphicsPrimitiveMgr.java \
sun/java2d/loops/GraphicsPrimitive.java \
sun/java2d/cmm/CMSManager.java \
sun/java2d/cmm/PCMM.java \
sun/java2d/cmm/ColorTransform.java \
sun/awt/ScrollPaneWheelScroller.java \
sun/awt/datatransfer/DataTransferer.java \
sun/awt/datatransfer/SunClipboard.java \
sun/awt/dnd/SunDragSourceContextPeer.java \
sun/awt/windows/WToolkitThreadBlockedHandler.java
FILES_export3 = \
java/awt/CheckboxMenuItem.java \
java/awt/Menu.java \
java/awt/MenuBar.java \
java/awt/MenuComponent.java \
java/awt/MenuItem.java \
sun/awt/PlatformFont.java \
sun/awt/FontDescriptor.java \
sun/awt/CharsetString.java \
java/awt/image/DataBuffer.java \
sun/awt/image/GifImageDecoder.java \
sun/awt/image/ImageRepresentation.java \
sun/awt/windows/WCustomCursor.java \
sun/awt/windows/WDefaultFontCharset.java \
sun/awt/windows/WButtonPeer.java \
sun/awt/windows/WCanvasPeer.java \
sun/awt/windows/WCheckboxPeer.java \
sun/awt/windows/WCheckboxMenuItemPeer.java \
sun/awt/windows/WChoicePeer.java \
sun/awt/windows/WClipboard.java \
sun/awt/windows/WColor.java \
sun/awt/windows/WDataTransferer.java \
sun/awt/windows/WDesktopPeer.java \
sun/awt/windows/WDesktopProperties.java \
sun/awt/windows/WDialogPeer.java \
sun/awt/windows/WDragSourceContextPeer.java \
sun/awt/windows/WDropTargetContextPeer.java \
sun/awt/windows/WFileDialogPeer.java \
sun/awt/windows/WFontPeer.java \
sun/awt/windows/WFontMetrics.java \
sun/awt/windows/WFramePeer.java \
sun/awt/windows/WGlobalCursorManager.java \
sun/awt/windows/WInputMethod.java \
sun/awt/windows/WInputMethodDescriptor.java \
sun/awt/windows/WComponentPeer.java \
sun/awt/windows/WLabelPeer.java \
sun/awt/windows/WListPeer.java \
sun/awt/windows/WMenuBarPeer.java \
sun/awt/windows/WMenuItemPeer.java \
sun/awt/windows/WMenuPeer.java \
sun/awt/windows/WObjectPeer.java \
sun/awt/windows/WPopupMenuPeer.java \
sun/awt/windows/WPrintDialog.java \
sun/awt/windows/WPrintDialogPeer.java \
sun/awt/windows/WPrinterJob.java \
sun/awt/windows/WRobotPeer.java \
sun/awt/windows/WScrollbarPeer.java \
sun/awt/windows/WScrollPanePeer.java \
sun/awt/windows/WTextAreaPeer.java \
sun/awt/windows/WTextComponentPeer.java \
sun/awt/windows/WTextFieldPeer.java \
sun/awt/windows/WPanelPeer.java \
sun/awt/windows/WToolkit.java \
sun/awt/windows/WWindowPeer.java \
sun/awt/windows/ThemeReader.java \
sun/awt/windows/WBufferStrategy.java \
sun/awt/windows/WTrayIconPeer.java \
sun/awt/image/ImagingLib.java \
sun/awt/ExtendedKeyCodes.java \
sun/java2d/pipe/hw/AccelSurface.java \
sun/java2d/pipe/hw/AccelDeviceEventNotifier.java \
sun/java2d/pipe/hw/ContextCapabilities.java \
sun/java2d/pipe/BufferedContext.java \
sun/java2d/pipe/BufferedMaskBlit.java \
sun/java2d/pipe/BufferedOpCodes.java \
sun/java2d/pipe/BufferedPaints.java \
sun/java2d/pipe/BufferedRenderPipe.java \
sun/java2d/pipe/BufferedTextPipe.java \
sun/java2d/pipe/RenderBuffer.java \
sun/java2d/pipe/ShapeSpanIterator.java \
sun/java2d/pipe/SpanClipRenderer.java \
sun/java2d/pipe/RegionIterator.java \
sun/java2d/opengl/OGLBlitLoops.java \
sun/java2d/opengl/OGLContext.java \
sun/java2d/opengl/OGLMaskFill.java \
sun/java2d/opengl/OGLPaints.java \
sun/java2d/opengl/OGLRenderQueue.java \
sun/java2d/opengl/OGLRenderer.java \
sun/java2d/opengl/OGLSurfaceData.java \
sun/java2d/opengl/OGLTextRenderer.java \
sun/java2d/opengl/WGLGraphicsConfig.java \
sun/java2d/opengl/WGLSurfaceData.java \
sun/java2d/d3d/D3DBlitLoops.java \
sun/java2d/d3d/D3DGraphicsDevice.java \
sun/java2d/d3d/D3DSurfaceData.java \
sun/java2d/d3d/D3DMaskFill.java \
sun/java2d/d3d/D3DPaints.java \
sun/java2d/d3d/D3DRenderQueue.java \
sun/java2d/d3d/D3DRenderer.java \
sun/java2d/d3d/D3DTextRenderer.java \
sun/java2d/d3d/D3DContext.java
#
# Copyright 2000-2009 Sun Microsystems, Inc. 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. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
# FILES_export definitions for Win32
FILES_export = \
java/awt/AlphaComposite.java \
java/awt/MouseInfo.java \
java/awt/Graphics.java \
java/awt/Color.java \
java/awt/Image.java \
java/awt/Rectangle.java \
java/awt/Event.java \
java/awt/Font.java \
java/awt/FontMetrics.java \
java/awt/Toolkit.java \
java/awt/Component.java \
java/awt/Container.java \
java/awt/Canvas.java \
java/awt/Button.java \
java/awt/List.java \
java/awt/Adjustable.java \
java/awt/Scrollbar.java \
java/awt/ScrollPane.java \
java/awt/ScrollPaneAdjustable.java \
java/awt/Transparency.java \
java/awt/Window.java \
java/awt/TextField.java \
java/awt/Label.java \
java/awt/Choice.java \
java/awt/TextComponent.java \
java/awt/TextArea.java \
java/awt/MenuBar.java \
java/awt/Menu.java \
java/awt/Dialog.java \
java/awt/FileDialog.java \
java/awt/MenuItem.java \
java/awt/MenuComponent.java \
java/awt/Checkbox.java \
java/awt/CheckboxGroup.java \
java/awt/CheckboxMenuItem.java \
java/awt/Frame.java \
java/awt/Insets.java \
java/awt/Cursor.java \
java/awt/Dimension.java \
java/awt/PopupMenu.java \
java/awt/AWTEvent.java \
java/awt/AWTException.java \
java/awt/AWTKeyStroke.java \
java/awt/KeyboardFocusManager.java \
java/awt/DisplayMode.java \
java/awt/TrayIcon.java \
java/awt/datatransfer/StringSelection.java \
java/awt/datatransfer/Transferable.java \
java/awt/dnd/DnDConstants.java \
java/awt/event/ActionEvent.java \
java/awt/event/AdjustmentEvent.java \
java/awt/event/ComponentEvent.java \
java/awt/event/FocusEvent.java \
java/awt/event/ItemEvent.java \
java/awt/event/InputEvent.java \
java/awt/event/InvocationEvent.java \
java/awt/event/KeyEvent.java \
java/awt/event/MouseEvent.java \
java/awt/event/MouseWheelEvent.java \
java/awt/event/WindowEvent.java \
java/awt/event/InputMethodEvent.java \
java/awt/im/InputMethodHighlight.java \
java/awt/im/spi/InputMethod.java \
java/awt/font/TextHitInfo.java \
java/text/AttributedCharacterIterator.java \
java/text/AttributedString.java \
java/awt/geom/PathIterator.java \
java/awt/image/AffineTransformOp.java \
java/awt/image/ImageConsumer.java \
java/awt/image/ImageObserver.java \
java/awt/image/BufferedImage.java \
java/awt/image/ColorModel.java \
java/awt/image/ConvolveOp.java \
java/awt/image/DirectColorModel.java \
java/awt/image/IndexColorModel.java \
java/awt/image/Raster.java \
java/awt/color/ColorSpace.java \
java/awt/color/ICC_Profile.java \
java/awt/peer/ComponentPeer.java \
java/awt/peer/MenuComponentPeer.java \
java/io/InputStream.java
FILES_export2 = \
sun/awt/im/InputMethodContext.java \
sun/awt/EmbeddedFrame.java \
sun/awt/KeyboardFocusManagerPeerImpl.java \
sun/awt/windows/WEmbeddedFrame.java \
sun/awt/windows/WEmbeddedFramePeer.java \
sun/awt/Win32FontManager.java \
sun/awt/Win32GraphicsEnvironment.java \
sun/awt/Win32GraphicsDevice.java \
sun/awt/Win32GraphicsConfig.java \
sun/java2d/SunGraphicsEnvironment.java \
sun/java2d/SunGraphics2D.java \
sun/java2d/SurfaceData.java \
sun/awt/image/IntegerComponentRaster.java \
sun/awt/image/ImagingLib.java \
sun/awt/image/BufImgSurfaceData.java \
sun/awt/image/DataBufferNative.java \
sun/awt/shell/Win32ShellFolder2.java \
sun/java2d/windows/GDIBlitLoops.java \
sun/java2d/windows/GDIRenderer.java \
sun/java2d/windows/GDIWindowSurfaceData.java \
sun/java2d/windows/WindowsFlags.java \
sun/java2d/loops/Blit.java \
sun/java2d/loops/BlitBg.java \
sun/java2d/loops/ScaledBlit.java \
sun/java2d/loops/FillRect.java \
sun/java2d/loops/FillSpans.java \
sun/java2d/loops/DrawGlyphList.java \
sun/java2d/loops/DrawGlyphListAA.java \
sun/java2d/loops/DrawGlyphListLCD.java \
sun/java2d/loops/DrawLine.java \
sun/java2d/loops/DrawRect.java \
sun/java2d/loops/DrawPolygons.java \
sun/java2d/loops/DrawPath.java \
sun/java2d/loops/FillPath.java \
sun/java2d/loops/MaskBlit.java \
sun/java2d/loops/MaskFill.java \
sun/java2d/loops/TransformHelper.java \
sun/java2d/loops/GraphicsPrimitiveMgr.java \
sun/java2d/loops/GraphicsPrimitive.java \
sun/java2d/cmm/CMSManager.java \
sun/java2d/cmm/PCMM.java \
sun/java2d/cmm/ColorTransform.java \
sun/awt/ScrollPaneWheelScroller.java \
sun/awt/datatransfer/DataTransferer.java \
sun/awt/datatransfer/SunClipboard.java \
sun/awt/dnd/SunDragSourceContextPeer.java \
sun/awt/windows/WToolkitThreadBlockedHandler.java
FILES_export3 = \
java/awt/CheckboxMenuItem.java \
java/awt/Menu.java \
java/awt/MenuBar.java \
java/awt/MenuComponent.java \
java/awt/MenuItem.java \
sun/awt/PlatformFont.java \
sun/awt/FontDescriptor.java \
sun/awt/CharsetString.java \
java/awt/image/DataBuffer.java \
sun/awt/image/GifImageDecoder.java \
sun/awt/image/ImageRepresentation.java \
sun/awt/windows/WCustomCursor.java \
sun/awt/windows/WDefaultFontCharset.java \
sun/awt/windows/WButtonPeer.java \
sun/awt/windows/WCanvasPeer.java \
sun/awt/windows/WCheckboxPeer.java \
sun/awt/windows/WCheckboxMenuItemPeer.java \
sun/awt/windows/WChoicePeer.java \
sun/awt/windows/WClipboard.java \
sun/awt/windows/WColor.java \
sun/awt/windows/WDataTransferer.java \
sun/awt/windows/WDesktopPeer.java \
sun/awt/windows/WDesktopProperties.java \
sun/awt/windows/WDialogPeer.java \
sun/awt/windows/WDragSourceContextPeer.java \
sun/awt/windows/WDropTargetContextPeer.java \
sun/awt/windows/WFileDialogPeer.java \
sun/awt/windows/WFontPeer.java \
sun/awt/windows/WFontMetrics.java \
sun/awt/windows/WFramePeer.java \
sun/awt/windows/WGlobalCursorManager.java \
sun/awt/windows/WInputMethod.java \
sun/awt/windows/WInputMethodDescriptor.java \
sun/awt/windows/WComponentPeer.java \
sun/awt/windows/WLabelPeer.java \
sun/awt/windows/WListPeer.java \
sun/awt/windows/WMenuBarPeer.java \
sun/awt/windows/WMenuItemPeer.java \
sun/awt/windows/WMenuPeer.java \
sun/awt/windows/WObjectPeer.java \
sun/awt/windows/WPopupMenuPeer.java \
sun/awt/windows/WPrintDialog.java \
sun/awt/windows/WPrintDialogPeer.java \
sun/awt/windows/WPrinterJob.java \
sun/awt/windows/WRobotPeer.java \
sun/awt/windows/WScrollbarPeer.java \
sun/awt/windows/WScrollPanePeer.java \
sun/awt/windows/WTextAreaPeer.java \
sun/awt/windows/WTextComponentPeer.java \
sun/awt/windows/WTextFieldPeer.java \
sun/awt/windows/WPanelPeer.java \
sun/awt/windows/WToolkit.java \
sun/awt/windows/WWindowPeer.java \
sun/awt/windows/ThemeReader.java \
sun/awt/windows/WBufferStrategy.java \
sun/awt/windows/WTrayIconPeer.java \
sun/awt/image/ImagingLib.java \
sun/awt/ExtendedKeyCodes.java \
sun/java2d/pipe/hw/AccelSurface.java \
sun/java2d/pipe/hw/AccelDeviceEventNotifier.java \
sun/java2d/pipe/hw/ContextCapabilities.java \
sun/java2d/pipe/BufferedContext.java \
sun/java2d/pipe/BufferedMaskBlit.java \
sun/java2d/pipe/BufferedOpCodes.java \
sun/java2d/pipe/BufferedPaints.java \
sun/java2d/pipe/BufferedRenderPipe.java \
sun/java2d/pipe/BufferedTextPipe.java \
sun/java2d/pipe/RenderBuffer.java \
sun/java2d/pipe/ShapeSpanIterator.java \
sun/java2d/pipe/SpanClipRenderer.java \
sun/java2d/pipe/RegionIterator.java \
sun/java2d/opengl/OGLBlitLoops.java \
sun/java2d/opengl/OGLContext.java \
sun/java2d/opengl/OGLMaskFill.java \
sun/java2d/opengl/OGLPaints.java \
sun/java2d/opengl/OGLRenderQueue.java \
sun/java2d/opengl/OGLRenderer.java \
sun/java2d/opengl/OGLSurfaceData.java \
sun/java2d/opengl/OGLTextRenderer.java \
sun/java2d/opengl/WGLGraphicsConfig.java \
sun/java2d/opengl/WGLSurfaceData.java \
sun/java2d/d3d/D3DBlitLoops.java \
sun/java2d/d3d/D3DGraphicsDevice.java \
sun/java2d/d3d/D3DSurfaceData.java \
sun/java2d/d3d/D3DMaskFill.java \
sun/java2d/d3d/D3DPaints.java \
sun/java2d/d3d/D3DRenderQueue.java \
sun/java2d/d3d/D3DRenderer.java \
sun/java2d/d3d/D3DTextRenderer.java \
sun/java2d/d3d/D3DContext.java
此差异已折叠。
......@@ -477,11 +477,11 @@ SUNWprivate_1.1 {
X11SurfaceData_GetOps;
getDefaultConfig;
Java_sun_font_FontManager_getFontConfig;
Java_sun_font_FontManager_getFontConfigAASettings;
Java_sun_font_FontManager_getFontPath;
Java_sun_font_FontManager_setNativeFontPath;
Java_sun_font_FontManager_populateFontFileNameMap;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_awt_X11FontManager_getFontPath;
Java_sun_awt_X11FontManager_setNativeFontPath;
Java_sun_font_SunFontManager_populateFontFileNameMap;
# CDE private entry point
Java_sun_awt_motif_XsessionWMcommand;
......
......@@ -533,11 +533,11 @@ SUNWprivate_1.1 {
X11SurfaceData_GetOps;
getDefaultConfig;
Java_sun_font_FontManager_getFontConfig;
Java_sun_font_FontManager_getFontConfigAASettings;
Java_sun_font_FontManager_getFontPath;
Java_sun_font_FontManager_setNativeFontPath;
Java_sun_font_FontManager_populateFontFileNameMap;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_awt_X11FontManager_getFontPath;
Java_sun_awt_X11FontManager_setNativeFontPath;
Java_sun_font_SunFontManager_populateFontFileNameMap;
# CDE private entry point
Java_sun_awt_motif_XsessionWMcommand;
......
......@@ -199,3 +199,7 @@ ifeq ($(PLATFORM), windows)
CPPFLAGS += -I$(PLATFORM_SRC)/native/sun/windows
endif
# Make the Layout Engine build standalone
CPPFLAGS += -DLE_STANDALONE
......@@ -33,12 +33,7 @@ SUNWprivate_1.1 {
isNullScalerContext;
Java_sun_font_NullFontScaler_getNullScalerContext;
Java_sun_font_NullFontScaler_getGlyphImage;
Java_sun_font_FontManager_getPlatformFontVar;
Java_sun_font_FontManager_initIDs;
Java_sun_font_FontManager_getFont2D;
Java_sun_font_FontManager_setFont2D;
Java_sun_font_FontManager_isCreatedFont;
Java_sun_font_FontManager_setCreatedFont;
Java_sun_font_SunFontManager_initIDs;
Java_sun_font_StrikeCache_getGlyphCacheDescription;
Java_sun_font_StrikeCache_freeIntPointer;
Java_sun_font_StrikeCache_freeLongPointer;
......
......@@ -35,12 +35,7 @@ SUNWprivate_1.1 {
isNullScalerContext;
Java_sun_font_NullFontScaler_getNullScalerContext;
Java_sun_font_NullFontScaler_getGlyphImage;
Java_sun_font_FontManager_getPlatformFontVar;
Java_sun_font_FontManager_initIDs;
Java_sun_font_FontManager_getFont2D;
Java_sun_font_FontManager_setFont2D;
Java_sun_font_FontManager_isCreatedFont;
Java_sun_font_FontManager_setCreatedFont;
Java_sun_font_SunFontManager_initIDs;
Java_sun_font_StrikeCache_getGlyphCacheDescription;
Java_sun_font_StrikeCache_freeIntPointer;
Java_sun_font_StrikeCache_freeLongPointer;
......
......@@ -59,12 +59,10 @@ SUNWprivate_1.1 {
X11SurfaceData_GetOps;
Java_java_awt_Font_initIDs;
Java_sun_font_FontManager_getFontConfig;
Java_sun_font_FontManager_getFontConfigVersion;
Java_sun_font_FontManager_getFontConfigAASettings;
Java_sun_font_FontManager_getFontPath;
Java_sun_font_FontManager_setNativeFontPath;
Java_sun_font_FontManager_populateFontFileNameMap;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigVersion;
Java_sun_awt_X11FontManager_getFontPath;
Java_sun_awt_FontDescriptor_initIDs;
Java_sun_awt_PlatformFont_initIDs;
......
......@@ -182,12 +182,11 @@ SUNWprivate_1.1 {
Java_java_awt_ScrollPane_initIDs;
Java_java_awt_TextField_initIDs;
Java_java_awt_TrayIcon_initIDs;
Java_sun_font_FontManager_getFontConfig;
Java_sun_font_FontManager_getFontConfigVersion;
Java_sun_font_FontManager_getFontConfigAASettings;
Java_sun_font_FontManager_getFontPath;
Java_sun_font_FontManager_setNativeFontPath;
Java_sun_font_FontManager_populateFontFileNameMap;
Java_sun_font_FontConfigManager_getFontConfig;
Java_sun_font_FontConfigManager_getFontConfigAASettings;
Java_sun_font_FontConfigManager_getFontConfigVersion;
Java_sun_awt_X11FontManager_getFontPath;
Java_sun_font_X11FontManager_setNativeFontPath;
Java_sun_awt_X11GraphicsEnvironment_initDisplay;
Java_sun_awt_X11GraphicsEnvironment_initGLX;
Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
......
......@@ -29,7 +29,9 @@ import java.awt.*;
import java.awt.geom.AffineTransform;
import javax.swing.plaf.FontUIResource;
import java.util.StringTokenizer;
import sun.font.FontManager;
import sun.font.FontConfigManager;
import sun.font.FontUtilities;
/**
* @author Shannon Hickey
......@@ -193,13 +195,13 @@ class PangoFonts {
}
String fcFamilyLC = family.toLowerCase();
if (FontManager.mapFcName(fcFamilyLC) != null) {
if (FontUtilities.mapFcName(fcFamilyLC) != null) {
/* family is a Fc/Pango logical font which we need to expand. */
return FontManager.getFontConfigFUIR(fcFamilyLC, style, size);
return FontUtilities.getFontConfigFUIR(fcFamilyLC, style, size);
} else {
/* It's a physical font which we will create with a fallback */
Font font = new FontUIResource(family, style, size);
return FontManager.getCompositeFontUIResource(font);
return FontUtilities.getCompositeFontUIResource(font);
}
}
......
......@@ -63,7 +63,7 @@ import java.security.AccessController;
import sun.awt.SunToolkit;
import sun.awt.OSInfo;
import sun.awt.shell.ShellFolder;
import sun.font.FontManager;
import sun.font.FontUtilities;
import sun.security.action.GetPropertyAction;
import sun.swing.DefaultLayoutStyle;
......@@ -2289,13 +2289,14 @@ public class WindowsLookAndFeel extends BasicLookAndFeel
font.getStyle(), size);
}
}
if (FontManager.fontSupportsDefaultEncoding(font)) {
if (FontUtilities.fontSupportsDefaultEncoding(font)) {
if (!(font instanceof UIResource)) {
font = new FontUIResource(font);
}
}
else {
font = FontManager.getCompositeFontUIResource(font);
font = FontUtilities.getCompositeFontUIResource(font);
}
return font;
......
......@@ -30,9 +30,8 @@ import java.awt.event.*;
import java.awt.peer.ComponentPeer;
import java.awt.peer.LightweightPeer;
import java.lang.reflect.Field;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.awt.AWTAccessor;
import sun.util.logging.PlatformLogger;
/**
* The root event class for all AWT events.
......@@ -76,7 +75,7 @@ import sun.awt.AWTAccessor;
* @since 1.1
*/
public abstract class AWTEvent extends EventObject {
private static final Logger log = Logger.getLogger("java.awt.AWTEvent");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.AWTEvent");
private byte bdata[];
/**
......@@ -252,12 +251,12 @@ public abstract class AWTEvent extends EventObject {
field.setAccessible(true);
return field;
} catch (SecurityException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.get_InputEvent_CanAccessSystemClipboard() got SecurityException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got SecurityException ", e);
}
} catch (NoSuchFieldException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.get_InputEvent_CanAccessSystemClipboard() got NoSuchFieldException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.get_InputEvent_CanAccessSystemClipboard() got NoSuchFieldException ", e);
}
}
return null;
......@@ -549,8 +548,8 @@ public abstract class AWTEvent extends EventObject {
boolean b = field.getBoolean(this);
field.setBoolean(that, b);
} catch(IllegalAccessException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.copyPrivateDataInto() got IllegalAccessException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.copyPrivateDataInto() got IllegalAccessException ", e);
}
}
}
......@@ -564,8 +563,8 @@ public abstract class AWTEvent extends EventObject {
try {
field.setBoolean(this, false);
} catch(IllegalAccessException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "AWTEvent.dispatched() got IllegalAccessException ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("AWTEvent.dispatched() got IllegalAccessException ", e);
}
}
}
......
......@@ -25,21 +25,21 @@
package java.awt;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
abstract class AttributeValue {
private static final Logger log = Logger.getLogger("java.awt.AttributeValue");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.AttributeValue");
private final int value;
private final String[] names;
protected AttributeValue(int value, String[] names) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "value = " + value + ", names = " + names);
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("value = " + value + ", names = " + names);
}
if (log.isLoggable(Level.FINER)) {
if (log.isLoggable(PlatformLogger.FINER)) {
if ((value < 0) || (names == null) || (value >= names.length)) {
log.log(Level.FINER, "Assertion failed");
log.finer("Assertion failed");
}
}
this.value = value;
......
......@@ -46,10 +46,10 @@ import java.util.EventListener;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.*;
import javax.accessibility.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.CausedFocusEvent;
import sun.awt.PeerEvent;
......@@ -85,8 +85,8 @@ import sun.java2d.pipe.Region;
*/
public class Container extends Component {
private static final Logger log = Logger.getLogger("java.awt.Container");
private static final Logger eventLog = Logger.getLogger("java.awt.event.Container");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Container");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Container");
private static final Component[] EMPTY_ARRAY = new Component[0];
......@@ -201,7 +201,7 @@ public class Container extends Component {
private transient int numOfHWComponents = 0;
private transient int numOfLWComponents = 0;
private static final Logger mixingLog = Logger.getLogger("java.awt.mixing.Container");
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Container");
/**
* @serialField ncomponents int
......@@ -1287,33 +1287,33 @@ public class Container extends Component {
int superListening = super.numListening(mask);
if (mask == AWTEvent.HIERARCHY_EVENT_MASK) {
if (eventLog.isLoggable(Level.FINE)) {
if (eventLog.isLoggable(PlatformLogger.FINE)) {
// Verify listeningChildren is correct
int sum = 0;
for (Component comp : component) {
sum += comp.numListening(mask);
}
if (listeningChildren != sum) {
eventLog.log(Level.FINE, "Assertion (listeningChildren == sum) failed");
eventLog.fine("Assertion (listeningChildren == sum) failed");
}
}
return listeningChildren + superListening;
} else if (mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK) {
if (eventLog.isLoggable(Level.FINE)) {
if (eventLog.isLoggable(PlatformLogger.FINE)) {
// Verify listeningBoundsChildren is correct
int sum = 0;
for (Component comp : component) {
sum += comp.numListening(mask);
}
if (listeningBoundsChildren != sum) {
eventLog.log(Level.FINE, "Assertion (listeningBoundsChildren == sum) failed");
eventLog.fine("Assertion (listeningBoundsChildren == sum) failed");
}
}
return listeningBoundsChildren + superListening;
} else {
// assert false;
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "This code must never be reached");
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("This code must never be reached");
}
return superListening;
}
......@@ -1321,13 +1321,13 @@ public class Container extends Component {
// Should only be called while holding tree lock
void adjustListeningChildren(long mask, int num) {
if (eventLog.isLoggable(Level.FINE)) {
if (eventLog.isLoggable(PlatformLogger.FINE)) {
boolean toAssert = (mask == AWTEvent.HIERARCHY_EVENT_MASK ||
mask == AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK ||
mask == (AWTEvent.HIERARCHY_EVENT_MASK |
AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK));
if (!toAssert) {
eventLog.log(Level.FINE, "Assertion failed");
eventLog.fine("Assertion failed");
}
}
......@@ -1362,14 +1362,14 @@ public class Container extends Component {
// Should only be called while holding tree lock
int countHierarchyMembers() {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
// Verify descendantsCount is correct
int sum = 0;
for (Component comp : component) {
sum += comp.countHierarchyMembers();
}
if (descendantsCount != sum) {
log.log(Level.FINE, "Assertion (descendantsCount == sum) failed");
log.fine("Assertion (descendantsCount == sum) failed");
}
}
return descendantsCount + 1;
......@@ -3924,7 +3924,7 @@ public class Container extends Component {
final void recursiveSubtractAndApplyShape(Region shape, int fromZorder, int toZorder) {
checkTreeLock();
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; shape=" + shape + "; fromZ=" + fromZorder + "; toZ=" + toZorder);
}
......@@ -3961,7 +3961,7 @@ public class Container extends Component {
final void recursiveApplyCurrentShape(int fromZorder, int toZorder) {
checkTreeLock();
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; fromZ=" + fromZorder + "; toZ=" + toZorder);
}
......@@ -4065,7 +4065,7 @@ public class Container extends Component {
@Override
void mixOnShowing() {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
......@@ -4090,7 +4090,7 @@ public class Container extends Component {
@Override
void mixOnHiding(boolean isLightweight) {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; isLightweight=" + isLightweight);
}
......@@ -4104,7 +4104,7 @@ public class Container extends Component {
@Override
void mixOnReshaping() {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
......@@ -4139,7 +4139,7 @@ public class Container extends Component {
@Override
void mixOnZOrderChanging(int oldZorder, int newZorder) {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this +
"; oldZ=" + oldZorder + "; newZ=" + newZorder);
}
......@@ -4160,7 +4160,7 @@ public class Container extends Component {
@Override
void mixOnValidating() {
synchronized (getTreeLock()) {
if (mixingLog.isLoggable(Level.FINE)) {
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
mixingLog.fine("this = " + this);
}
......@@ -4206,7 +4206,7 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
*/
private static final int LWD_MOUSE_DRAGGED_OVER = 1500;
private static final Logger eventLog = Logger.getLogger("java.awt.event.LightweightDispatcher");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.LightweightDispatcher");
LightweightDispatcher(Container nativeContainer) {
this.nativeContainer = nativeContainer;
......@@ -4348,10 +4348,10 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
// This may send it somewhere that doesn't have MouseWheelEvents
// enabled. In this case, Component.dispatchEventImpl() will
// retarget the event to a parent that DOES have the events enabled.
if (eventLog.isLoggable(Level.FINEST) && (mouseOver != null)) {
eventLog.log(Level.FINEST, "retargeting mouse wheel to " +
mouseOver.getName() + ", " +
mouseOver.getClass());
if (eventLog.isLoggable(PlatformLogger.FINEST) && (mouseOver != null)) {
eventLog.finest("retargeting mouse wheel to " +
mouseOver.getName() + ", " +
mouseOver.getClass());
}
retargetMouseEvent(mouseOver, id, e);
break;
......
......@@ -24,9 +24,9 @@
*/
package java.awt;
import java.util.logging.*;
import java.util.List;
import java.util.ArrayList;
import sun.util.logging.PlatformLogger;
/**
* A FocusTraversalPolicy that determines traversal order based on the order
......@@ -60,7 +60,7 @@ import java.util.ArrayList;
public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
implements java.io.Serializable
{
private static final Logger log = Logger.getLogger("java.awt.ContainerOrderFocusTraversalPolicy");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.ContainerOrderFocusTraversalPolicy");
final private int FORWARD_TRAVERSAL = 0;
final private int BACKWARD_TRAVERSAL = 1;
......@@ -165,7 +165,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
if (getImplicitDownCycleTraversal()) {
retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont);
if (retComp != null && log.isLoggable(Level.FINE)) {
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Transfered focus down-cycle to " + retComp +
" in the focus cycle root " + cont);
}
......@@ -177,7 +177,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
cont.getFocusTraversalPolicy().getDefaultComponent(cont) :
cont.getFocusTraversalPolicy().getLastComponent(cont));
if (retComp != null && log.isLoggable(Level.FINE)) {
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont);
}
}
......@@ -208,7 +208,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
* aComponent is null
*/
public Component getComponentAfter(Container aContainer, Component aComponent) {
if (log.isLoggable(Level.FINE)) log.fine("### Searching in " + aContainer + " for component after " + aComponent);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Searching in " + aContainer + " for component after " + aComponent);
if (aContainer == null || aComponent == null) {
throw new IllegalArgumentException("aContainer and aComponent cannot be null");
......@@ -236,7 +236,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
// See if the component is inside of policy provider.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
}
......@@ -247,7 +247,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
// Null result means that we overstepped the limit of the FTP's cycle.
// In that case we must quit the cycle, otherwise return the component found.
if (afterComp != null) {
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + afterComp);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp);
return afterComp;
}
aComponent = provider;
......@@ -255,12 +255,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
List<Component> cycle = getFocusTraversalCycle(aContainer);
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
int index = getComponentIndex(cycle, aComponent);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getFirstComponent(aContainer);
......@@ -325,7 +325,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
// See if the component is inside of policy provider.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
}
......@@ -336,7 +336,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
// Null result means that we overstepped the limit of the FTP's cycle.
// In that case we must quit the cycle, otherwise return the component found.
if (beforeComp != null) {
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + beforeComp);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp);
return beforeComp;
}
aComponent = provider;
......@@ -349,12 +349,12 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
List<Component> cycle = getFocusTraversalCycle(aContainer);
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
int index = getComponentIndex(cycle, aComponent);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getLastComponent(aContainer);
......@@ -401,7 +401,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
public Component getFirstComponent(Container aContainer) {
List<Component> cycle;
if (log.isLoggable(Level.FINE)) log.fine("### Getting first component in " + aContainer);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer);
if (aContainer == null) {
throw new IllegalArgumentException("aContainer cannot be null");
......@@ -420,10 +420,10 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
}
if (cycle.size() == 0) {
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
return null;
}
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
for (Component comp : cycle) {
if (accept(comp)) {
......@@ -451,7 +451,7 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
*/
public Component getLastComponent(Container aContainer) {
List<Component> cycle;
if (log.isLoggable(Level.FINE)) log.fine("### Getting last component in " + aContainer);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer);
if (aContainer == null) {
throw new IllegalArgumentException("aContainer cannot be null");
......@@ -470,10 +470,10 @@ public class ContainerOrderFocusTraversalPolicy extends FocusTraversalPolicy
}
if (cycle.size() == 0) {
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
return null;
}
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
for (int i= cycle.size() - 1; i >= 0; i--) {
Component comp = cycle.get(i);
......
......@@ -36,10 +36,10 @@ import java.util.Hashtable;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.logging.*;
import java.security.AccessController;
import sun.util.logging.PlatformLogger;
/**
* A class to encapsulate the bitmap representation of the mouse cursor.
*
......@@ -191,7 +191,7 @@ public class Cursor implements java.io.Serializable {
*/
private static final long serialVersionUID = 8028237497568985504L;
private static final Logger log = Logger.getLogger("java.awt.Cursor");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Cursor");
static {
/* ensure that the necessary native libraries are loaded */
......@@ -298,8 +298,8 @@ public class Cursor implements java.io.Serializable {
String key = prefix + DotFileSuffix;
if (!systemCustomCursorProperties.containsKey(key)) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Cursor.getSystemCustomCursor(" + name + ") returned null");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null");
}
return null;
}
......@@ -353,8 +353,8 @@ public class Cursor implements java.io.Serializable {
}
if (cursor == null) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Cursor.getSystemCustomCursor(" + name + ") returned null");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Cursor.getSystemCustomCursor(" + name + ") returned null");
}
} else {
systemCustomCursors.put(name, cursor);
......
......@@ -35,8 +35,7 @@ import java.util.Iterator;
import java.util.ListIterator;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
......@@ -62,7 +61,7 @@ import sun.awt.CausedFocusEvent;
* @since 1.4
*/
public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
private static final Logger focusLog = Logger.getLogger("java.awt.focus.DefaultKeyboardFocusManager");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.DefaultKeyboardFocusManager");
// null weak references to not create too many objects
private static final WeakReference<Window> NULL_WINDOW_WR =
......@@ -275,7 +274,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
* <code>false</code> otherwise
*/
public boolean dispatchEvent(AWTEvent e) {
if (focusLog.isLoggable(Level.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) focusLog.fine("" + e);
if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) focusLog.fine("" + e);
switch (e.getID()) {
case WindowEvent.WINDOW_GAINED_FOCUS: {
WindowEvent we = (WindowEvent)e;
......@@ -378,9 +377,9 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
// The component which last has the focus when this window was focused
// should receive focus first
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "tempLost {0}, toFocus {1}",
new Object[]{tempLost, toFocus});
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("tempLost {0}, toFocus {1}",
tempLost, toFocus);
}
if (tempLost != null) {
tempLost.requestFocusInWindow(CausedFocusEvent.Cause.ACTIVATION);
......@@ -447,8 +446,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
Component oldFocusOwner = getGlobalFocusOwner();
Component newFocusOwner = fe.getComponent();
if (oldFocusOwner == newFocusOwner) {
if (focusLog.isLoggable(Level.FINE)) {
focusLog.log(Level.FINE, "Skipping {0} because focus owner is the same", new Object[] {e});
if (focusLog.isLoggable(PlatformLogger.FINE)) {
focusLog.fine("Skipping {0} because focus owner is the same", e);
}
// We can't just drop the event - there could be
// type-ahead markers associated with it.
......@@ -565,16 +564,16 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
FocusEvent fe = (FocusEvent)e;
Component currentFocusOwner = getGlobalFocusOwner();
if (currentFocusOwner == null) {
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Skipping {0} because focus owner is null",
new Object[] {e});
if (focusLog.isLoggable(PlatformLogger.FINE))
focusLog.fine("Skipping {0} because focus owner is null", e);
break;
}
// Ignore cases where a Component loses focus to itself.
// If we make a mistake because of retargeting, then the
// FOCUS_GAINED handler will correct it.
if (currentFocusOwner == fe.getOppositeComponent()) {
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Skipping {0} because current focus owner is equal to opposite",
new Object[] {e});
if (focusLog.isLoggable(PlatformLogger.FINE))
focusLog.fine("Skipping {0} because current focus owner is equal to opposite", e);
break;
}
......@@ -642,9 +641,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
Window losingFocusWindow = we.getWindow();
Window activeWindow = getGlobalActiveWindow();
Window oppositeWindow = we.getOppositeWindow();
if (focusLog.isLoggable(Level.FINE)) focusLog.log(Level.FINE, "Active {0}, Current focused {1}, losing focus {2} opposite {3}",
new Object[] {activeWindow, currentFocusedWindow,
losingFocusWindow, oppositeWindow});
if (focusLog.isLoggable(PlatformLogger.FINE))
focusLog.fine("Active {0}, Current focused {1}, losing focus {2} opposite {3}",
activeWindow, currentFocusedWindow,
losingFocusWindow, oppositeWindow);
if (currentFocusedWindow == null) {
break;
}
......@@ -828,7 +828,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
}
}
if (ke != null) {
focusLog.log(Level.FINER, "Pumping approved event {0}", new Object[] {ke});
focusLog.finer("Pumping approved event {0}", ke);
enqueuedKeyEvents.removeFirst();
}
}
......@@ -843,14 +843,14 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
* Dumps the list of type-ahead queue markers to stderr
*/
void dumpMarkers() {
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, ">>> Markers dump, time: {0}", System.currentTimeMillis());
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest(">>> Markers dump, time: {0}", System.currentTimeMillis());
synchronized (this) {
if (typeAheadMarkers.size() != 0) {
Iterator iter = typeAheadMarkers.iterator();
while (iter.hasNext()) {
TypeAheadMarker marker = (TypeAheadMarker)iter.next();
focusLog.log(Level.FINEST, " {0}", marker);
focusLog.finest(" {0}", marker);
}
}
}
......@@ -878,7 +878,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
// The fix is rolled out.
if (ke.getWhen() > marker.after) {
focusLog.log(Level.FINER, "Storing event {0} because of marker {1}", new Object[] {ke, marker});
focusLog.finer("Storing event {0} because of marker {1}", ke, marker);
enqueuedKeyEvents.addLast(ke);
return true;
}
......@@ -890,7 +890,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
}
case FocusEvent.FOCUS_GAINED:
focusLog.log(Level.FINEST, "Markers before FOCUS_GAINED on {0}", new Object[] {target});
focusLog.finest("Markers before FOCUS_GAINED on {0}", target);
dumpMarkers();
// Search the marker list for the first marker tied to
// the Component which just gained focus. Then remove
......@@ -919,10 +919,10 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
}
} else {
// Exception condition - event without marker
focusLog.log(Level.FINER, "Event without marker {0}", e);
focusLog.finer("Event without marker {0}", e);
}
}
focusLog.log(Level.FINEST, "Markers after FOCUS_GAINED");
focusLog.finest("Markers after FOCUS_GAINED");
dumpMarkers();
redispatchEvent(target, e);
......@@ -1159,8 +1159,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
return;
}
focusLog.log(Level.FINER, "Enqueue at {0} for {1}",
new Object[] {after, untilFocused});
focusLog.finer("Enqueue at {0} for {1}",
after, untilFocused);
int insertionIndex = 0,
i = typeAheadMarkers.size();
......@@ -1199,8 +1199,8 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
return;
}
focusLog.log(Level.FINER, "Dequeue at {0} for {1}",
new Object[] {after, untilFocused});
focusLog.finer("Dequeue at {0} for {1}",
after, untilFocused);
TypeAheadMarker marker;
ListIterator iter = typeAheadMarkers.listIterator
......
......@@ -36,7 +36,7 @@ import sun.awt.AWTAutoShutdown;
import sun.awt.SunToolkit;
import java.util.Vector;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.dnd.SunDragSourceContextPeer;
import sun.awt.EventQueueDelegate;
......@@ -61,7 +61,7 @@ import sun.awt.EventQueueDelegate;
* @since 1.1
*/
class EventDispatchThread extends Thread {
private static final Logger eventLog = Logger.getLogger("java.awt.event.EventDispatchThread");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventDispatchThread");
private EventQueue theQueue;
private boolean doDispatch = true;
......@@ -275,8 +275,8 @@ class EventDispatchThread extends Thread {
}
while (eventOK == false);
if (eventLog.isLoggable(Level.FINEST)) {
eventLog.log(Level.FINEST, "Dispatching: " + event);
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
eventLog.finest("Dispatching: " + event);
}
Object handle = null;
......@@ -308,8 +308,8 @@ class EventDispatchThread extends Thread {
}
private void processException(Throwable e) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "Processing exception: " + e);
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("Processing exception: " + e);
}
getUncaughtExceptionHandler().uncaughtException(this, e);
// don't rethrow the exception to avoid EDT recreation
......
......@@ -36,7 +36,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.EmptyStackException;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.AWTAutoShutdown;
......@@ -153,7 +153,7 @@ public class EventQueue {
private final String name = "AWT-EventQueue-" + nextThreadNum();
private static final Logger eventLog = Logger.getLogger("java.awt.event.EventQueue");
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
static {
AWTAccessor.setEventQueueAccessor(
......@@ -707,8 +707,8 @@ public class EventQueue {
* @since 1.2
*/
public synchronized void push(EventQueue newEventQueue) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "EventQueue.push(" + newEventQueue + ")");
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("EventQueue.push(" + newEventQueue + ")");
}
if (nextQueue != null) {
......@@ -722,8 +722,8 @@ public class EventQueue {
try {
newEventQueue.postEventPrivate(getNextEvent());
} catch (InterruptedException ie) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "Interrupted push", ie);
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("Interrupted push", ie);
}
}
}
......@@ -766,8 +766,8 @@ public class EventQueue {
* @since 1.2
*/
protected void pop() throws EmptyStackException {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "EventQueue.pop(" + this + ")");
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("EventQueue.pop(" + this + ")");
}
// To prevent deadlock, we lock on the previous EventQueue before
......@@ -790,8 +790,8 @@ public class EventQueue {
try {
previousQueue.postEventPrivate(getNextEvent());
} catch (InterruptedException ie) {
if (eventLog.isLoggable(Level.FINE)) {
eventLog.log(Level.FINE, "Interrupted pop", ie);
if (eventLog.isLoggable(PlatformLogger.FINE)) {
eventLog.fine("Interrupted pop", ie);
}
}
}
......
......@@ -30,7 +30,6 @@ import java.awt.font.GlyphVector;
import java.awt.font.LineMetrics;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.font.TransformAttribute;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
......@@ -42,21 +41,21 @@ import java.security.PrivilegedExceptionAction;
import java.text.AttributedCharacterIterator.Attribute;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Locale;
import java.util.Map;
import sun.font.StandardGlyphVector;
import sun.java2d.FontSupport;
import sun.font.AttributeMap;
import sun.font.AttributeValues;
import sun.font.EAttribute;
import sun.font.CompositeFont;
import sun.font.CreatedFontTracker;
import sun.font.Font2D;
import sun.font.Font2DHandle;
import sun.font.FontAccess;
import sun.font.FontManager;
import sun.font.FontManagerFactory;
import sun.font.FontUtilities;
import sun.font.GlyphLayout;
import sun.font.FontLineMetrics;
import sun.font.CoreMetrics;
......@@ -223,10 +222,29 @@ import static sun.font.EAttribute.*;
*/
public class Font implements java.io.Serializable
{
private static class FontAccessImpl extends FontAccess {
public Font2D getFont2D(Font font) {
return font.getFont2D();
}
public void setFont2D(Font font, Font2DHandle handle) {
font.font2DHandle = handle;
}
public void setCreatedFont(Font font) {
font.createdFont = true;
}
public boolean isCreatedFont(Font font) {
return font.createdFont;
}
}
static {
/* ensure that the necessary native libraries are loaded */
Toolkit.loadLibraries();
initIDs();
FontAccess.setFontAccess(new FontAccessImpl());
}
/**
......@@ -464,16 +482,17 @@ public class Font implements java.io.Serializable
}
private Font2D getFont2D() {
if (FontManager.usingPerAppContextComposites &&
FontManager fm = FontManagerFactory.getInstance();
if (fm.usingPerAppContextComposites() &&
font2DHandle != null &&
font2DHandle.font2D instanceof CompositeFont &&
((CompositeFont)(font2DHandle.font2D)).isStdComposite()) {
return FontManager.findFont2D(name, style,
return fm.findFont2D(name, style,
FontManager.LOGICAL_FALLBACK);
} else if (font2DHandle == null) {
font2DHandle =
FontManager.findFont2D(name, style,
FontManager.LOGICAL_FALLBACK).handle;
fm.findFont2D(name, style,
FontManager.LOGICAL_FALLBACK).handle;
}
/* Do not cache the de-referenced font2D. It must be explicitly
* de-referenced to pick up a valid font in the event that the
......@@ -570,8 +589,8 @@ public class Font implements java.io.Serializable
if (created) {
if (handle.font2D instanceof CompositeFont &&
handle.font2D.getStyle() != style) {
this.font2DHandle =
FontManager.getNewComposite(null, style, handle);
FontManager fm = FontManagerFactory.getInstance();
this.font2DHandle = fm.getNewComposite(null, style, handle);
} else {
this.font2DHandle = handle;
}
......@@ -586,9 +605,9 @@ public class Font implements java.io.Serializable
/* Font2D instances created by this method track their font file
* so that when the Font2D is GC'd it can also remove the file.
*/
this.font2DHandle =
FontManager.createFont2D(fontFile, fontFormat,
isCopy, tracker).handle;
FontManager fm = FontManagerFactory.getInstance();
this.font2DHandle = fm.createFont2D(fontFile, fontFormat, isCopy,
tracker).handle;
this.name = this.font2DHandle.font2D.getFontName(Locale.getDefault());
this.style = Font.PLAIN;
this.size = 1;
......@@ -640,8 +659,9 @@ public class Font implements java.io.Serializable
}
if (handle.font2D instanceof CompositeFont) {
if (newStyle != -1 || newName != null) {
FontManager fm = FontManagerFactory.getInstance();
this.font2DHandle =
FontManager.getNewComposite(newName, newStyle, handle);
fm.getNewComposite(newName, newStyle, handle);
}
} else if (newName != null) {
this.createdFont = false;
......@@ -852,7 +872,6 @@ public class Font implements java.io.Serializable
throw new IllegalArgumentException ("font format not recognized");
}
boolean copiedFontData = false;
try {
final File tFile = AccessController.doPrivileged(
new PrivilegedExceptionAction<File>() {
......@@ -2320,7 +2339,7 @@ public class Font implements java.io.Serializable
(values.getKerning() == 0 && values.getLigatures() == 0 &&
values.getBaselineTransform() == null);
if (simple) {
simple = !FontManager.isComplexText(chars, beginIndex, limit);
simple = ! FontUtilities.isComplexText(chars, beginIndex, limit);
}
if (simple) {
......
......@@ -27,9 +27,14 @@
package java.awt;
import java.awt.image.BufferedImage;
import java.security.AccessController;
import java.util.Locale;
import sun.font.FontManager;
import sun.font.FontManagerFactory;
import sun.java2d.HeadlessGraphicsEnvironment;
import sun.java2d.SunGraphicsEnvironment;
import sun.security.action.GetPropertyAction;
/**
*
......@@ -73,32 +78,50 @@ public abstract class GraphicsEnvironment {
*/
public static synchronized GraphicsEnvironment getLocalGraphicsEnvironment() {
if (localEnv == null) {
String nm = (String) java.security.AccessController.doPrivileged
(new sun.security.action.GetPropertyAction
("java.awt.graphicsenv", null));
localEnv = createGE();
}
return localEnv;
}
/**
* Creates and returns the GraphicsEnvironment, according to the
* system property 'java.awt.graphicsenv'.
*
* @return the graphics environment
*/
private static GraphicsEnvironment createGE() {
GraphicsEnvironment ge;
String nm = AccessController.doPrivileged(new GetPropertyAction("java.awt.graphicsenv", null));
try {
// long t0 = System.currentTimeMillis();
Class geCls;
try {
// long t0 = System.currentTimeMillis();
// First we try if the bootclassloader finds the requested
// class. This way we can avoid to run in a privileged block.
geCls = Class.forName(nm);
} catch (ClassNotFoundException ex) {
// If the bootclassloader fails, we try again with the
// application classloader.
ClassLoader cl = ClassLoader.getSystemClassLoader();
Class geCls = Class.forName(nm, true, cl);
localEnv = (GraphicsEnvironment)geCls.newInstance();
// long t1 = System.currentTimeMillis();
// System.out.println("GE creation took " + (t1-t0)+ "ms.");
if (isHeadless()) {
localEnv = new HeadlessGraphicsEnvironment(localEnv);
}
} catch (ClassNotFoundException e) {
throw new Error("Could not find class: "+nm);
} catch (InstantiationException e) {
throw new Error("Could not instantiate Graphics Environment: "
+ nm);
} catch (IllegalAccessException e) {
throw new Error ("Could not access Graphics Environment: "
+ nm);
geCls = Class.forName(nm, true, cl);
}
ge = (GraphicsEnvironment) geCls.newInstance();
// long t1 = System.currentTimeMillis();
// System.out.println("GE creation took " + (t1-t0)+ "ms.");
if (isHeadless()) {
localEnv = new HeadlessGraphicsEnvironment(localEnv);
}
} catch (ClassNotFoundException e) {
throw new Error("Could not find class: "+nm);
} catch (InstantiationException e) {
throw new Error("Could not instantiate Graphics Environment: "
+ nm);
} catch (IllegalAccessException e) {
throw new Error ("Could not access Graphics Environment: "
+ nm);
}
return localEnv;
return ge;
}
/**
......@@ -333,7 +356,8 @@ public abstract class GraphicsEnvironment {
if (font == null) {
throw new NullPointerException("font cannot be null.");
}
return sun.font.FontManager.registerFont(font);
FontManager fm = FontManagerFactory.getInstance();
return fm.registerFont(font);
}
/**
......@@ -357,10 +381,8 @@ public abstract class GraphicsEnvironment {
* @since 1.5
*/
public void preferLocaleFonts() {
if (!(this instanceof SunGraphicsEnvironment)) {
return;
}
sun.font.FontManager.preferLocaleFonts();
FontManager fm = FontManagerFactory.getInstance();
fm.preferLocaleFonts();
}
/**
......@@ -380,10 +402,8 @@ public abstract class GraphicsEnvironment {
* @since 1.5
*/
public void preferProportionalFonts() {
if (!(this instanceof SunGraphicsEnvironment)) {
return;
}
sun.font.FontManager.preferProportionalFonts();
FontManager fm = FontManagerFactory.getInstance();
fm.preferProportionalFonts();
}
/**
......
......@@ -53,8 +53,7 @@ import java.util.Set;
import java.util.StringTokenizer;
import java.util.WeakHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.HeadlessToolkit;
......@@ -111,7 +110,7 @@ public abstract class KeyboardFocusManager
{
// Shared focus engine logger
private static final Logger focusLog = Logger.getLogger("java.awt.focus.KeyboardFocusManager");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.KeyboardFocusManager");
static {
/* ensure that the necessary native libraries are loaded */
......@@ -154,7 +153,7 @@ public abstract class KeyboardFocusManager
*/
private static native void initIDs();
private static final Logger log = Logger.getLogger("java.awt.KeyboardFocusManager");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.KeyboardFocusManager");
/**
* The identifier for the Forward focus traversal keys.
......@@ -504,8 +503,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return focusOwner;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -609,9 +608,9 @@ public abstract class KeyboardFocusManager
}
void setNativeFocusOwner(Component comp) {
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, "Calling peer {0} setCurrentFocusOwner for {1}",
new Object[] {peer, comp});
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest("Calling peer {0} setCurrentFocusOwner for {1}",
peer, comp);
}
peer.setCurrentFocusOwner(comp);
}
......@@ -673,8 +672,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return permanentFocusOwner;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -781,8 +780,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return focusedWindow;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -885,8 +884,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return activeWindow;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -919,8 +918,8 @@ public abstract class KeyboardFocusManager
Window oldActiveWindow;
synchronized (KeyboardFocusManager.class) {
oldActiveWindow = getActiveWindow();
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
}
try {
......@@ -1215,8 +1214,8 @@ public abstract class KeyboardFocusManager
if (this == getCurrentKeyboardFocusManager()) {
return currentFocusCycleRoot;
} else {
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("This manager is " + this + ", current is " + getCurrentKeyboardFocusManager());
}
throw new SecurityException(notPrivileged);
}
......@@ -2149,9 +2148,9 @@ public abstract class KeyboardFocusManager
HeavyweightFocusRequest(Component heavyweight, Component descendant,
boolean temporary, CausedFocusEvent.Cause cause) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (heavyweight == null) {
log.log(Level.FINE, "Assertion (heavyweight != null) failed");
log.fine("Assertion (heavyweight != null) failed");
}
}
......@@ -2161,12 +2160,12 @@ public abstract class KeyboardFocusManager
}
boolean addLightweightRequest(Component descendant,
boolean temporary, CausedFocusEvent.Cause cause) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (this == HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) {
log.log(Level.FINE, "Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed");
log.fine("Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed");
}
if (descendant == null) {
log.log(Level.FINE, "Assertion (descendant != null) failed");
log.fine("Assertion (descendant != null) failed");
}
}
......@@ -2339,12 +2338,12 @@ public abstract class KeyboardFocusManager
(Component heavyweight, Component descendant, boolean temporary,
boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)
{
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (heavyweight == null) {
log.log(Level.FINE, "Assertion (heavyweight != null) failed");
log.fine("Assertion (heavyweight != null) failed");
}
if (time == 0) {
log.log(Level.FINE, "Assertion (time != 0) failed");
log.fine("Assertion (time != 0) failed");
}
}
......@@ -2361,31 +2360,31 @@ public abstract class KeyboardFocusManager
Component currentFocusOwner = thisManager.getGlobalFocusOwner();
Component nativeFocusOwner = thisManager.getNativeFocusOwner();
Window nativeFocusedWindow = thisManager.getNativeFocusedWindow();
if (focusLog.isLoggable(Level.FINER)) {
focusLog.log(Level.FINER, "SNFH for {0} in {1}",
new Object[] {descendant, heavyweight});
}
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, "0. Current focus owner {0}",
currentFocusOwner);
focusLog.log(Level.FINEST, "0. Native focus owner {0}",
nativeFocusOwner);
focusLog.log(Level.FINEST, "0. Native focused window {0}",
nativeFocusedWindow);
if (focusLog.isLoggable(PlatformLogger.FINER)) {
focusLog.finer("SNFH for {0} in {1}",
descendant, heavyweight);
}
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest("0. Current focus owner {0}",
currentFocusOwner);
focusLog.finest("0. Native focus owner {0}",
nativeFocusOwner);
focusLog.finest("0. Native focused window {0}",
nativeFocusedWindow);
}
synchronized (heavyweightRequests) {
HeavyweightFocusRequest hwFocusRequest = getLastHWRequest();
if (focusLog.isLoggable(Level.FINEST)) {
focusLog.log(Level.FINEST, "Request {0}", hwFocusRequest);
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
focusLog.finest("Request {0}", hwFocusRequest);
}
if (hwFocusRequest == null &&
heavyweight == nativeFocusOwner)
{
if (descendant == currentFocusOwner) {
// Redundant request.
if (focusLog.isLoggable(Level.FINEST))
focusLog.log(Level.FINEST, "1. SNFH_FAILURE for {0}",
descendant);
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("1. SNFH_FAILURE for {0}",
descendant);
return SNFH_FAILURE;
}
......@@ -2417,8 +2416,8 @@ public abstract class KeyboardFocusManager
// SunToolkit.postPriorityEvent(newFocusOwnerEvent);
SunToolkit.postEvent(descendant.appContext, newFocusOwnerEvent);
if (focusLog.isLoggable(Level.FINEST))
focusLog.log(Level.FINEST, "2. SNFH_HANDLED for {0}", descendant);
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("2. SNFH_HANDLED for {0}", descendant);
return SNFH_SUCCESS_HANDLED;
} else if (hwFocusRequest != null &&
hwFocusRequest.heavyweight == heavyweight) {
......@@ -2431,7 +2430,7 @@ public abstract class KeyboardFocusManager
manager.enqueueKeyEvents(time, descendant);
}
if (focusLog.isLoggable(Level.FINEST))
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("3. SNFH_HANDLED for lightweight" +
descendant + " in " + heavyweight);
return SNFH_SUCCESS_HANDLED;
......@@ -2454,7 +2453,7 @@ public abstract class KeyboardFocusManager
(hwFocusRequest != null)
? hwFocusRequest.heavyweight
: nativeFocusedWindow)) {
if (focusLog.isLoggable(Level.FINEST))
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("4. SNFH_FAILURE for " + descendant);
return SNFH_FAILURE;
}
......@@ -2464,7 +2463,7 @@ public abstract class KeyboardFocusManager
heavyweightRequests.add
(new HeavyweightFocusRequest(heavyweight, descendant,
temporary, cause));
if (focusLog.isLoggable(Level.FINEST))
if (focusLog.isLoggable(PlatformLogger.FINEST))
focusLog.finest("5. SNFH_PROCEED for " + descendant);
return SNFH_SUCCESS_PROCEED;
}
......@@ -2855,13 +2854,13 @@ public abstract class KeyboardFocusManager
}
KeyboardFocusManager manager = getCurrentKeyboardFocusManager();
if (focusLog.isLoggable(Level.FINER)) {
if (focusLog.isLoggable(PlatformLogger.FINER)) {
if (event instanceof FocusEvent || event instanceof WindowEvent) {
focusLog.log(Level.FINER, ">>> {0}", new Object[] {event});
focusLog.finer(">>> {0}", event);
}
if (focusLog.isLoggable(Level.FINER) && event instanceof KeyEvent) {
focusLog.log(Level.FINER, " focus owner is {0}", new Object[] {manager.getGlobalFocusOwner()});
focusLog.log(Level.FINER, ">>> {0}", new Object[] {event});
if (focusLog.isLoggable(PlatformLogger.FINER) && event instanceof KeyEvent) {
focusLog.finer(" focus owner is {0}", manager.getGlobalFocusOwner());
focusLog.finer(">>> {0}", event);
}
}
......@@ -2945,9 +2944,9 @@ public abstract class KeyboardFocusManager
}
}
static void removeLastFocusRequest(Component heavyweight) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (heavyweight == null) {
log.log(Level.FINE, "Assertion (heavyweight != null) failed");
log.fine("Assertion (heavyweight != null) failed");
}
}
......
......@@ -29,8 +29,7 @@ import java.awt.image.*;
import java.net.URL;
import java.net.URLConnection;
import java.io.File;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import sun.awt.image.SunWritableRaster;
/**
......@@ -204,8 +203,8 @@ public final class SplashScreen {
}
}
catch(java.net.MalformedURLException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "MalformedURLException caught in the getImageURL() method", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("MalformedURLException caught in the getImageURL() method", e);
}
}
}
......@@ -355,7 +354,7 @@ public final class SplashScreen {
*/
private static SplashScreen theInstance = null;
private static final Logger log = Logger.getLogger("java.awt.SplashScreen");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.SplashScreen");
private native static void _update(long splashPtr, int[] data, int x, int y, int width, int height, int scanlineStride);
private native static boolean _isVisible(long splashPtr);
......
......@@ -48,7 +48,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.util.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
......@@ -1956,7 +1956,7 @@ public abstract class Toolkit {
*/
public abstract boolean isModalExclusionTypeSupported(Dialog.ModalExclusionType modalExclusionType);
private static final Logger log = Logger.getLogger("java.awt.Toolkit");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Toolkit");
private static final int LONG_BITS = 64;
private int[] calls = new int[LONG_BITS];
......@@ -2123,9 +2123,9 @@ public abstract class Toolkit {
}
synchronized int countAWTEventListeners(long eventMask) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (eventMask == 0) {
log.log(Level.FINE, "Assertion (eventMask != 0) failed");
log.fine("Assertion (eventMask != 0) failed");
}
}
......
......@@ -48,8 +48,6 @@ import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Set;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.accessibility.*;
import sun.awt.AWTAccessor;
......@@ -61,6 +59,7 @@ import sun.java2d.Disposer;
import sun.java2d.pipe.Region;
import sun.security.action.GetPropertyAction;
import sun.security.util.SecurityConstants;
import sun.util.logging.PlatformLogger;
/**
* A <code>Window</code> object is a top-level window with no borders and no
......@@ -324,7 +323,7 @@ public class Window extends Container implements Accessible {
*/
private static final long serialVersionUID = 4497834738069338734L;
private static final Logger log = Logger.getLogger("java.awt.Window");
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Window");
private static final boolean locationByPlatformProp;
......@@ -2985,7 +2984,7 @@ public class Window extends Container implements Accessible {
}
synchronized (getTreeLock()) {
super.setGraphicsConfiguration(gc);
if (log.isLoggable(Level.FINER)) {
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("+ Window.setGraphicsConfiguration(): new GC is \n+ " + getGraphicsConfiguration_NoClientCode() + "\n+ this is " + this);
}
}
......
......@@ -29,8 +29,7 @@ import java.awt.Event;
import java.awt.Component;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import java.util.Arrays;
/**
......@@ -55,7 +54,7 @@ import java.util.Arrays;
* @since 1.1
*/
public abstract class InputEvent extends ComponentEvent {
private static final Logger log = Logger.getLogger("java.awt.event.InputEvent");
private static final PlatformLogger logger = PlatformLogger.getLogger("java.awt.event.InputEvent");
/**
* The Shift key modifier constant.
......@@ -344,8 +343,8 @@ public abstract class InputEvent extends ComponentEvent {
sm.checkSystemClipboardAccess();
b = true;
} catch (SecurityException se) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "InputEvent.canAccessSystemClipboard() got SecurityException ", se);
if (logger.isLoggable(PlatformLogger.FINE)) {
logger.fine("InputEvent.canAccessSystemClipboard() got SecurityException ", se);
}
}
} else {
......
......@@ -32,7 +32,6 @@ import java.lang.reflect.*;
import java.lang.ref.WeakReference;
import java.security.AccessController;
import java.util.*;
import java.util.logging.*;
import com.sun.java.swing.SwingUtilities3;
......@@ -41,6 +40,7 @@ import sun.java2d.SunGraphics2D;
import sun.security.action.GetPropertyAction;
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import sun.awt.SunToolkit;
import sun.util.logging.PlatformLogger;
/**
* A PaintManager implementation that uses a BufferStrategy for
......@@ -78,7 +78,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
private static Method COMPONENT_CREATE_BUFFER_STRATEGY_METHOD;
private static Method COMPONENT_GET_BUFFER_STRATEGY_METHOD;
private static final Logger LOGGER = Logger.getLogger(
private static final PlatformLogger LOGGER = PlatformLogger.getLogger(
"javax.swing.BufferStrategyPaintManager");
/**
......@@ -222,9 +222,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
private void dispose(java.util.List<BufferInfo> bufferInfos) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "BufferStrategyPaintManager disposed",
new RuntimeException());
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("BufferStrategyPaintManager disposed",
new RuntimeException());
}
if (bufferInfos != null) {
for (BufferInfo bufferInfo : bufferInfos) {
......@@ -305,7 +305,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
}
// Invalid root, do what Swing has always done.
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("prepare failed");
}
return super.paint(paintingComponent, bufferComponent, g, x, y, w, h);
......@@ -335,7 +335,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
accumulate(x + xOffset + deltaX, y + yOffset + deltaY, w, h);
} else {
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("copyArea: prepare failed or not in sync");
}
// Prepare failed, or not in sync. By calling super.copyArea
......@@ -363,7 +363,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
}
}
if (LOGGER.isLoggable(Level.FINEST)) {
if (LOGGER.isLoggable(PlatformLogger.FINEST)) {
LOGGER.finest("beginPaint");
}
// Reset the area that needs to be painted.
......@@ -371,7 +371,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
}
public void endPaint() {
if (LOGGER.isLoggable(Level.FINEST)) {
if (LOGGER.isLoggable(PlatformLogger.FINEST)) {
LOGGER.finest("endPaint: region " + accumulatedX + " " +
accumulatedY + " " + accumulatedMaxX + " " +
accumulatedMaxY);
......@@ -420,7 +420,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
contentsLost = bufferStrategy.contentsLost();
}
if (contentsLost) {
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("endPaint: contents lost");
}
// Shown region was bogus, mark buffer as out of sync.
......@@ -514,7 +514,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
contentsLost = true;
bufferInfo = new BufferInfo(root);
bufferInfos.add(bufferInfo);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("prepare: new BufferInfo: " + root);
}
}
......@@ -525,7 +525,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
bsg = bufferStrategy.getDrawGraphics();
if (bufferStrategy.contentsRestored()) {
contentsLost = true;
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer(
"prepare: contents restored in prepare");
}
......@@ -539,7 +539,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
if (bufferInfo.getContentsLostDuringExpose()) {
contentsLost = true;
bufferInfo.setContentsLostDuringExpose(false);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("prepare: contents lost on expose");
}
}
......@@ -642,7 +642,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
if (biRoot == null) {
// Window gc'ed
bufferInfos.remove(counter);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("BufferInfo pruned, root null");
}
}
......@@ -748,7 +748,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
if (bs != null) {
weakBS = new WeakReference<BufferStrategy>(bs);
}
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("getBufferStrategy: created bs: " + bs);
}
}
......@@ -806,7 +806,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
BufferStrategy bs = null;
if (SwingUtilities3.isVsyncRequested(root)) {
bs = createBufferStrategy(root, true);
if (LOGGER.isLoggable(Level.FINER)) {
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("createBufferStrategy: using vsynced strategy");
}
}
......@@ -848,9 +848,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
invoke(root);
} catch (InvocationTargetException ite) {
// Type is not supported
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "createBufferStratety failed",
ite);
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("createBufferStratety failed",
ite);
}
} catch (IllegalArgumentException iae) {
assert false;
......@@ -864,9 +864,9 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
bs = ((Window)root).getBufferStrategy();
} catch (AWTException e) {
// Type not supported
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "createBufferStratety failed",
e);
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("createBufferStratety failed",
e);
}
}
}
......@@ -878,8 +878,8 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager {
*/
public void dispose() {
Container root = getRoot();
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "disposed BufferInfo for: " + root);
if (LOGGER.isLoggable(PlatformLogger.FINER)) {
LOGGER.finer("disposed BufferInfo for: " + root);
}
if (root != null) {
root.removeComponentListener(this);
......
......@@ -29,7 +29,7 @@ import java.awt.Container;
import java.awt.Window;
import java.util.*;
import java.awt.FocusTraversalPolicy;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/**
* A FocusTraversalPolicy that determines traversal order by sorting the
......@@ -64,7 +64,7 @@ public class SortingFocusTraversalPolicy
private Comparator<? super Component> comparator;
private boolean implicitDownCycleTraversal = true;
private Logger log = Logger.getLogger("javax.swing.SortingFocusTraversalPolicy");
private PlatformLogger log = PlatformLogger.getLogger("javax.swing.SortingFocusTraversalPolicy");
/**
* Used by getComponentAfter and getComponentBefore for efficiency. In
......@@ -115,8 +115,8 @@ public class SortingFocusTraversalPolicy
try {
index = Collections.binarySearch(cycle, aComponent, comparator);
} catch (ClassCastException e) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "### During the binary search for " + aComponent + " the exception occured: ", e);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### During the binary search for " + aComponent + " the exception occured: ", e);
}
return -1;
}
......@@ -193,7 +193,7 @@ public class SortingFocusTraversalPolicy
if (getImplicitDownCycleTraversal()) {
retComp = cont.getFocusTraversalPolicy().getDefaultComponent(cont);
if (retComp != null && log.isLoggable(Level.FINE)) {
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Transfered focus down-cycle to " + retComp +
" in the focus cycle root " + cont);
}
......@@ -205,7 +205,7 @@ public class SortingFocusTraversalPolicy
cont.getFocusTraversalPolicy().getDefaultComponent(cont) :
cont.getFocusTraversalPolicy().getLastComponent(cont));
if (retComp != null && log.isLoggable(Level.FINE)) {
if (retComp != null && log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Transfered focus to " + retComp + " in the FTP provider " + cont);
}
}
......@@ -236,7 +236,7 @@ public class SortingFocusTraversalPolicy
* aComponent is null
*/
public Component getComponentAfter(Container aContainer, Component aComponent) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Searching in " + aContainer + " for component after " + aComponent);
}
......@@ -260,7 +260,7 @@ public class SortingFocusTraversalPolicy
// See if the component is inside of policy provider.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
}
......@@ -271,7 +271,7 @@ public class SortingFocusTraversalPolicy
// Null result means that we overstepped the limit of the FTP's cycle.
// In that case we must quit the cycle, otherwise return the component found.
if (afterComp != null) {
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + afterComp);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + afterComp);
return afterComp;
}
aComponent = provider;
......@@ -279,12 +279,12 @@ public class SortingFocusTraversalPolicy
List<Component> cycle = getFocusTraversalCycle(aContainer);
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
int index = getComponentIndex(cycle, aComponent);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getFirstComponent(aContainer);
......@@ -349,7 +349,7 @@ public class SortingFocusTraversalPolicy
// See if the component is inside of policy provider.
Container provider = getTopmostProvider(aContainer, aComponent);
if (provider != null) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Asking FTP " + provider + " for component after " + aComponent);
}
......@@ -360,7 +360,7 @@ public class SortingFocusTraversalPolicy
// Null result means that we overstepped the limit of the FTP's cycle.
// In that case we must quit the cycle, otherwise return the component found.
if (beforeComp != null) {
if (log.isLoggable(Level.FINE)) log.fine("### FTP returned " + beforeComp);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### FTP returned " + beforeComp);
return beforeComp;
}
aComponent = provider;
......@@ -373,12 +373,12 @@ public class SortingFocusTraversalPolicy
List<Component> cycle = getFocusTraversalCycle(aContainer);
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle + ", component is " + aComponent);
int index = getComponentIndex(cycle, aComponent);
if (index < 0) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("### Didn't find component " + aComponent + " in a cycle " + aContainer);
}
return getLastComponent(aContainer);
......@@ -424,7 +424,7 @@ public class SortingFocusTraversalPolicy
public Component getFirstComponent(Container aContainer) {
List<Component> cycle;
if (log.isLoggable(Level.FINE)) log.fine("### Getting first component in " + aContainer);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting first component in " + aContainer);
if (aContainer == null) {
throw new IllegalArgumentException("aContainer cannot be null");
}
......@@ -436,10 +436,10 @@ public class SortingFocusTraversalPolicy
}
if (cycle.size() == 0) {
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
return null;
}
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
for (Component comp : cycle) {
if (accept(comp)) {
......@@ -466,7 +466,7 @@ public class SortingFocusTraversalPolicy
*/
public Component getLastComponent(Container aContainer) {
List<Component> cycle;
if (log.isLoggable(Level.FINE)) log.fine("### Getting last component in " + aContainer);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Getting last component in " + aContainer);
if (aContainer == null) {
throw new IllegalArgumentException("aContainer cannot be null");
......@@ -479,10 +479,10 @@ public class SortingFocusTraversalPolicy
}
if (cycle.size() == 0) {
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is empty");
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is empty");
return null;
}
if (log.isLoggable(Level.FINE)) log.fine("### Cycle is " + cycle);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("### Cycle is " + cycle);
for (int i= cycle.size() - 1; i >= 0; i--) {
Component comp = cycle.get(i);
......
......@@ -26,7 +26,7 @@ package ${PACKAGE};
import javax.swing.Painter;
import java.awt.Graphics;
import sun.font.FontManager;
import sun.font.FontUtilities;
import sun.swing.plaf.synth.DefaultSynthStyle;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
......@@ -131,7 +131,7 @@ final class ${LAF_NAME}Defaults {
//regions and their states that this class will use for later lookup.
//Additional regions can be registered later by 3rd party components.
//These are simply the default registrations.
defaultFont = FontManager.getFontConfigFUIR("sans", Font.PLAIN, 12);
defaultFont = FontUtilities.getFontConfigFUIR("sans", Font.PLAIN, 12);
defaultStyle = new DefaultSynthStyle();
defaultStyle.setFont(defaultFont);
......
......@@ -35,7 +35,7 @@ import javax.swing.event.ChangeEvent;
import java.lang.ref.WeakReference;
import java.util.WeakHashMap;
import sun.font.FontManager;
import sun.font.FontUtilities;
/**
* A pool of styles and their associated resources. This class determines
......@@ -263,8 +263,8 @@ public class StyleContext implements Serializable, AbstractDocument.AttributeCon
if (f == null) {
f = new Font(family, style, size);
}
if (! FontManager.fontSupportsDefaultEncoding(f)) {
f = FontManager.getCompositeFontUIResource(f);
if (! FontUtilities.fontSupportsDefaultEncoding(f)) {
f = FontUtilities.getCompositeFontUIResource(f);
}
FontKey key = new FontKey(family, style, size);
fontTable.put(key, f);
......
......@@ -30,7 +30,7 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
/**
* This class is to let AWT shutdown automatically when a user is done
......@@ -363,7 +363,7 @@ public final class AWTAutoShutdown implements Runnable {
}
}
final void dumpPeers(final Logger aLog) {
final void dumpPeers(final PlatformLogger aLog) {
synchronized (activationLock) {
synchronized (mainLock) {
aLog.fine("Mapped peers:");
......
......@@ -40,10 +40,9 @@ import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
import java.util.HashSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import sun.util.logging.PlatformLogger;
/**
* The AppContext is a table referenced by ThreadGroup which stores
......@@ -128,7 +127,7 @@ import java.beans.PropertyChangeListener;
* @author Fred Ecks
*/
public final class AppContext {
private static final Logger log = Logger.getLogger("sun.awt.AppContext");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.AppContext");
/* Since the contents of an AppContext are unique to each Java
* session, this class should never be serialized. */
......@@ -380,9 +379,7 @@ public final class AppContext {
try {
w.dispose();
} catch (Throwable t) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "exception occured while disposing app context", t);
}
log.finer("exception occured while disposing app context", t);
}
}
AccessController.doPrivileged(new PrivilegedAction() {
......
......@@ -39,8 +39,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import java.security.AccessController;
import java.security.PrivilegedAction;
......@@ -78,7 +77,7 @@ public class ComponentAccessor
private static Method methodGetCursorNoClientCode;
private static Method methodLocationNoClientCode;
private static final Logger log = Logger.getLogger("sun.awt.ComponentAccessor");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.ComponentAccessor");
private ComponentAccessor() {
}
......@@ -136,13 +135,13 @@ public class ComponentAccessor
methodLocationNoClientCode.setAccessible(true);
}
catch (NoSuchFieldException e) {
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
log.fine("Unable to initialize ComponentAccessor", e);
}
catch (ClassNotFoundException e) {
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
log.fine("Unable to initialize ComponentAccessor", e);
}
catch (NoSuchMethodException e) {
log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
log.fine("Unable to initialize ComponentAccessor", e);
}
// to please javac
return null;
......@@ -157,7 +156,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -168,7 +167,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -179,7 +178,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -190,7 +189,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -204,7 +203,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -214,7 +213,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return 0;
}
......@@ -225,7 +224,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return 0;
}
......@@ -236,7 +235,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return 0;
}
......@@ -247,7 +246,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return 0;
}
......@@ -258,7 +257,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return false;
}
......@@ -271,10 +270,10 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
catch (InvocationTargetException e) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return parent;
......@@ -288,10 +287,10 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
catch (InvocationTargetException e) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return font;
......@@ -307,10 +306,10 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
catch (InvocationTargetException e) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
}
......@@ -322,10 +321,10 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
catch (InvocationTargetException e) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
}
......@@ -336,7 +335,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -348,7 +347,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return color;
}
......@@ -361,7 +360,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return color;
}
......@@ -372,7 +371,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -384,7 +383,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return f;
}
......@@ -396,7 +395,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return peer;
}
......@@ -406,7 +405,7 @@ public class ComponentAccessor
fieldPeer.set(c, peer);
} catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
}
......@@ -415,7 +414,7 @@ public class ComponentAccessor
return fieldIgnoreRepaint.getBoolean(comp);
}
catch (IllegalAccessException e) {
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return false;
......@@ -427,7 +426,7 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
return false;
}
......@@ -439,10 +438,10 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
catch (InvocationTargetException e) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return enabled;
}
......@@ -455,10 +454,10 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
catch (InvocationTargetException e) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return cursor;
......@@ -472,12 +471,13 @@ public class ComponentAccessor
}
catch (IllegalAccessException e)
{
log.log(Level.FINE, "Unable to access the Component object", e);
log.fine("Unable to access the Component object", e);
}
catch (InvocationTargetException e) {
log.log(Level.FINE, "Unable to invoke on the Component object", e);
log.fine("Unable to invoke on the Component object", e);
}
return loc;
}
}
......@@ -28,7 +28,7 @@ package sun.awt;
import java.io.*;
import java.util.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/*
* Internal class that manages sun.awt.Debug settings.
......@@ -72,7 +72,7 @@ import java.util.logging.*;
* the fix for 4638447).
*/
final class DebugSettings {
private static final Logger log = Logger.getLogger("sun.awt.debug.DebugSettings");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.debug.DebugSettings");
/* standard debug property key names */
static final String PREFIX = "awtdebug";
......@@ -128,8 +128,8 @@ final class DebugSettings {
});
// echo the initial property settings to stdout
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "DebugSettings:\n{0}", this);
if (log.isLoggable(PlatformLogger.FINE)) {
log.fine("DebugSettings:\n{0}" + this);
}
}
......@@ -258,8 +258,8 @@ final class DebugSettings {
}
private void println(Object object) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, object.toString());
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer(object.toString());
}
}
......
......@@ -30,7 +30,6 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
......@@ -38,7 +37,6 @@ import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.logging.Logger;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
......@@ -49,7 +47,10 @@ import java.util.Properties;
import java.util.Set;
import java.util.Vector;
import sun.font.CompositeFontDescriptor;
import sun.java2d.SunGraphicsEnvironment;
import sun.font.SunFontManager;
import sun.font.FontManagerFactory;
import sun.font.FontUtilities;
import sun.util.logging.PlatformLogger;
/**
* Provides the definitions of the five logical fonts: Serif, SansSerif,
......@@ -65,10 +66,10 @@ public abstract class FontConfiguration {
protected static Locale startupLocale = null;
protected static Hashtable localeMap = null;
private static FontConfiguration fontConfig;
private static Logger logger;
private static PlatformLogger logger;
protected static boolean isProperties = true;
protected SunGraphicsEnvironment environment;
protected SunFontManager fontManager;
protected boolean preferLocaleFonts;
protected boolean preferPropFonts;
......@@ -80,11 +81,11 @@ public abstract class FontConfiguration {
/* A default FontConfiguration must be created before an alternate
* one to ensure proper static initialisation takes place.
*/
public FontConfiguration(SunGraphicsEnvironment environment) {
if (SunGraphicsEnvironment.debugFonts && logger == null) {
logger = Logger.getLogger("sun.awt.FontConfiguration");
public FontConfiguration(SunFontManager fm) {
if (FontUtilities.debugFonts() && logger == null) {
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
}
this.environment = environment;
fontManager = fm;
setOsNameAndVersion(); /* static initialization */
setEncoding(); /* static initialization */
/* Separating out the file location from the rest of the
......@@ -106,10 +107,10 @@ public abstract class FontConfiguration {
return true;
}
public FontConfiguration(SunGraphicsEnvironment environment,
public FontConfiguration(SunFontManager fm,
boolean preferLocaleFonts,
boolean preferPropFonts) {
this.environment = environment;
fontManager = fm;
this.preferLocaleFonts = preferLocaleFonts;
this.preferPropFonts = preferPropFonts;
/* fontConfig should be initialised by default constructor, and
......@@ -198,17 +199,17 @@ public abstract class FontConfiguration {
loadBinary(in);
}
in.close();
if (SunGraphicsEnvironment.debugFonts) {
if (FontUtilities.debugFonts()) {
logger.config("Read logical font configuration from " + f);
}
} catch (IOException e) {
if (SunGraphicsEnvironment.debugFonts) {
if (FontUtilities.debugFonts()) {
logger.config("Failed to read logical font configuration from " + f);
}
}
}
String version = getVersion();
if (!"1".equals(version) && SunGraphicsEnvironment.debugFonts) {
if (!"1".equals(version) && FontUtilities.debugFonts()) {
logger.config("Unsupported fontconfig version: " + version);
}
}
......@@ -219,8 +220,8 @@ public abstract class FontConfiguration {
File fallbackDir = new File(fallbackDirName);
if (fallbackDir.exists() && fallbackDir.isDirectory()) {
String[] ttfs = fallbackDir.list(SunGraphicsEnvironment.ttFilter);
String[] t1s = fallbackDir.list(SunGraphicsEnvironment.t1Filter);
String[] ttfs = fallbackDir.list(fontManager.getTrueTypeFilter());
String[] t1s = fallbackDir.list(fontManager.getType1Filter());
int numTTFs = (ttfs == null) ? 0 : ttfs.length;
int numT1s = (t1s == null) ? 0 : t1s.length;
int len = numTTFs + numT1s;
......@@ -236,7 +237,7 @@ public abstract class FontConfiguration {
installedFallbackFontFiles[i+numTTFs] =
fallbackDir + File.separator + t1s[i];
}
environment.registerFontsInDir(fallbackDirName);
fontManager.registerFontsInDir(fallbackDirName);
}
}
......@@ -365,7 +366,7 @@ public abstract class FontConfiguration {
stringTable = new StringBuilder(4096);
if (verbose && logger == null) {
logger = Logger.getLogger("sun.awt.FontConfiguration");
logger = PlatformLogger.getLogger("sun.awt.FontConfiguration");
}
new PropertiesHandler().load(in);
......@@ -465,7 +466,7 @@ public abstract class FontConfiguration {
nameIDs[index] = getComponentFontID(coreScripts[index],
fontIndex, styleIndex);
if (preferLocaleFonts && localeMap != null &&
sun.font.FontManager.usingAlternateFontforJALocales()) {
fontManager.usingAlternateFontforJALocales()) {
nameIDs[index] = remapLocaleMap(fontIndex, styleIndex,
coreScripts[index], nameIDs[index]);
}
......@@ -480,7 +481,7 @@ public abstract class FontConfiguration {
short id = getComponentFontID(fallbackScripts[i],
fontIndex, styleIndex);
if (preferLocaleFonts && localeMap != null &&
sun.font.FontManager.usingAlternateFontforJALocales()) {
fontManager.usingAlternateFontforJALocales()) {
id = remapLocaleMap(fontIndex, styleIndex, fallbackScripts[i], id);
}
if (preferPropFonts) {
......@@ -973,8 +974,8 @@ public abstract class FontConfiguration {
public CompositeFontDescriptor[] get2DCompositeFontInfo() {
CompositeFontDescriptor[] result =
new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];
String defaultFontFile = environment.getDefaultFontFile();
String defaultFontFaceName = environment.getDefaultFontFaceName();
String defaultFontFile = fontManager.getDefaultFontFile();
String defaultFontFaceName = fontManager.getDefaultFontFaceName();
for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
String fontName = publicFontNames[fontIndex];
......@@ -1121,7 +1122,7 @@ public abstract class FontConfiguration {
*/
HashMap<String, Boolean> existsMap;
public boolean needToSearchForFile(String fileName) {
if (!environment.isLinux) {
if (!FontUtilities.isLinux) {
return false;
} else if (existsMap == null) {
existsMap = new HashMap<String, Boolean>();
......@@ -1139,7 +1140,7 @@ public abstract class FontConfiguration {
} else {
exists = Boolean.valueOf((new File(fileName)).exists());
existsMap.put(fileName, exists);
if (SunGraphicsEnvironment.debugFonts &&
if (FontUtilities.debugFonts() &&
exists == Boolean.FALSE) {
logger.warning("Couldn't locate font file " + fileName);
}
......@@ -2067,7 +2068,8 @@ public abstract class FontConfiguration {
throw new Exception();
}
} catch (Exception e) {
if (SunGraphicsEnvironment.debugFonts && logger != null) {
if (FontUtilities.debugFonts() &&
logger != null) {
logger.config("Failed parsing " + key +
" property of font configuration.");
......
......@@ -39,12 +39,11 @@ import java.awt.peer.ComponentPeer;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManagerPeer {
private static final Logger focusLog = Logger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl");
private static AWTAccessor.KeyboardFocusManagerAccessor kfmAccessor =
AWTAccessor.getKeyboardFocusManagerAccessor();
......@@ -64,7 +63,8 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
public void clearGlobalFocusOwner(Window activeWindow) {
if (activeWindow != null) {
Component focusOwner = activeWindow.getFocusOwner();
if (focusLog.isLoggable(Level.FINE)) focusLog.fine("Clearing global focus owner " + focusOwner);
if (focusLog.isLoggable(PlatformLogger.FINE))
focusLog.fine("Clearing global focus owner " + focusOwner);
if (focusOwner != null) {
FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
......@@ -130,14 +130,16 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
FocusEvent fl = new CausedFocusEvent(currentOwner, FocusEvent.FOCUS_LOST,
false, lightweightChild, cause);
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Posting focus event: " + fl);
if (focusLog.isLoggable(PlatformLogger.FINER))
focusLog.finer("Posting focus event: " + fl);
SunToolkit.postPriorityEvent(fl);
}
FocusEvent fg = new CausedFocusEvent(lightweightChild, FocusEvent.FOCUS_GAINED,
false, currentOwner, cause);
if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Posting focus event: " + fg);
if (focusLog.isLoggable(PlatformLogger.FINER))
focusLog.finer("Posting focus event: " + fg);
SunToolkit.postPriorityEvent(fg);
return true;
}
......
......@@ -30,7 +30,7 @@ import java.awt.Insets;
import java.awt.Adjustable;
import java.awt.event.MouseWheelEvent;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/*
* ScrollPaneWheelScroller is a helper class for implmenenting mouse wheel
......@@ -39,7 +39,7 @@ import java.util.logging.*;
*/
public abstract class ScrollPaneWheelScroller {
private static final Logger log = Logger.getLogger("sun.awt.ScrollPaneWheelScroller");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.ScrollPaneWheelScroller");
private ScrollPaneWheelScroller() {}
......@@ -47,8 +47,8 @@ public abstract class ScrollPaneWheelScroller {
* Called from ScrollPane.processMouseWheelEvent()
*/
public static void handleWheelScrolling(ScrollPane sp, MouseWheelEvent e) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
}
int increment = 0;
......@@ -56,8 +56,8 @@ public abstract class ScrollPaneWheelScroller {
Adjustable adj = getAdjustableToScroll(sp);
if (adj != null) {
increment = getIncrementFromAdjustable(adj, e);
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "increment from adjustable(" + adj.getClass() + ") : " + increment);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("increment from adjustable(" + adj.getClass() + ") : " + increment);
}
scrollAdjustable(adj, increment);
}
......@@ -74,8 +74,8 @@ public abstract class ScrollPaneWheelScroller {
// if policy is display always or never, use vert
if (policy == ScrollPane.SCROLLBARS_ALWAYS ||
policy == ScrollPane.SCROLLBARS_NEVER) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using vertical scrolling due to scrollbar policy");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using vertical scrolling due to scrollbar policy");
}
return sp.getVAdjustable();
......@@ -85,31 +85,31 @@ public abstract class ScrollPaneWheelScroller {
Insets ins = sp.getInsets();
int vertScrollWidth = sp.getVScrollbarWidth();
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "insets: l = " + ins.left + ", r = " + ins.right +
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("insets: l = " + ins.left + ", r = " + ins.right +
", t = " + ins.top + ", b = " + ins.bottom);
log.log(Level.FINER, "vertScrollWidth = " + vertScrollWidth);
log.finer("vertScrollWidth = " + vertScrollWidth);
}
// Check if scrollbar is showing by examining insets of the
// ScrollPane
if (ins.right >= vertScrollWidth) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using vertical scrolling because scrollbar is present");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using vertical scrolling because scrollbar is present");
}
return sp.getVAdjustable();
}
else {
int horizScrollHeight = sp.getHScrollbarHeight();
if (ins.bottom >= horizScrollHeight) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using horiz scrolling because scrollbar is present");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using horiz scrolling because scrollbar is present");
}
return sp.getHAdjustable();
}
else {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "using NO scrollbar becsause neither is present");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("using NO scrollbar becsause neither is present");
}
return null;
}
......@@ -124,9 +124,9 @@ public abstract class ScrollPaneWheelScroller {
*/
public static int getIncrementFromAdjustable(Adjustable adj,
MouseWheelEvent e) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (adj == null) {
log.log(Level.FINE, "Assertion (adj != null) failed");
log.fine("Assertion (adj != null) failed");
}
}
......@@ -146,19 +146,19 @@ public abstract class ScrollPaneWheelScroller {
* bounds and sets the new value to the Adjustable.
*/
public static void scrollAdjustable(Adjustable adj, int amount) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (adj == null) {
log.log(Level.FINE, "Assertion (adj != null) failed");
log.fine("Assertion (adj != null) failed");
}
if (amount == 0) {
log.log(Level.FINE, "Assertion (amount != 0) failed");
log.fine("Assertion (amount != 0) failed");
}
}
int current = adj.getValue();
int upperLimit = adj.getMaximum() - adj.getVisibleAmount();
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "doScrolling by " + amount);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("doScrolling by " + amount);
}
if (amount > 0 && current < upperLimit) { // still some room to scroll
......
......@@ -33,7 +33,7 @@ import java.util.Set;
import java.util.HashMap;
import java.util.WeakHashMap;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
/**
* This class is used to aid in keeping track of DisplayChangedListeners and
......@@ -54,7 +54,7 @@ import java.util.logging.*;
* screen to another on a system equipped with multiple displays.
*/
public class SunDisplayChanger {
private static final Logger log = Logger.getLogger("sun.awt.multiscreen.SunDisplayChanger");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.multiscreen.SunDisplayChanger");
// Create a new synchronizedMap with initial capacity of one listener.
// It is asserted that the most common case is to have one GraphicsDevice
......@@ -68,13 +68,13 @@ public class SunDisplayChanger {
* notified when the display is changed.
*/
public void add(DisplayChangedListener theListener) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (theListener == null) {
log.log(Level.FINE, "Assertion (theListener != null) failed");
log.fine("Assertion (theListener != null) failed");
}
}
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Adding listener: " + theListener);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Adding listener: " + theListener);
}
listeners.put(theListener, null);
}
......@@ -83,13 +83,13 @@ public class SunDisplayChanger {
* Remove the given DisplayChangeListener from this SunDisplayChanger.
*/
public void remove(DisplayChangedListener theListener) {
if (log.isLoggable(Level.FINE)) {
if (log.isLoggable(PlatformLogger.FINE)) {
if (theListener == null) {
log.log(Level.FINE, "Assertion (theListener != null) failed");
log.fine("Assertion (theListener != null) failed");
}
}
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "Removing listener: " + theListener);
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("Removing listener: " + theListener);
}
listeners.remove(theListener);
}
......@@ -99,8 +99,8 @@ public class SunDisplayChanger {
* taken place by calling their displayChanged() methods.
*/
public void notifyListeners() {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "notifyListeners");
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("notifyListeners");
}
// This method is implemented by making a clone of the set of listeners,
// and then iterating over the clone. This is because during the course
......@@ -126,8 +126,8 @@ public class SunDisplayChanger {
DisplayChangedListener current =
(DisplayChangedListener) itr.next();
try {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "displayChanged for listener: " + current);
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("displayChanged for listener: " + current);
}
current.displayChanged();
} catch (IllegalComponentStateException e) {
......@@ -146,7 +146,7 @@ public class SunDisplayChanger {
* taken place by calling their paletteChanged() methods.
*/
public void notifyPaletteChanged() {
if (log.isLoggable(Level.FINEST)) {
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("notifyPaletteChanged");
}
// This method is implemented by making a clone of the set of listeners,
......@@ -172,8 +172,8 @@ public class SunDisplayChanger {
DisplayChangedListener current =
(DisplayChangedListener) itr.next();
try {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "paletteChanged for listener: " + current);
if (log.isLoggable(PlatformLogger.FINEST)) {
log.finest("paletteChanged for listener: " + current);
}
current.paletteChanged();
} catch (IllegalComponentStateException e) {
......
......@@ -27,14 +27,14 @@ package sun.awt;
import java.awt.*;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
public abstract class SunGraphicsCallback {
public static final int HEAVYWEIGHTS = 0x1;
public static final int LIGHTWEIGHTS = 0x2;
public static final int TWO_PASSES = 0x4;
private static final Logger log = Logger.getLogger("sun.awt.SunGraphicsCallback");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.SunGraphicsCallback");
public abstract void run(Component comp, Graphics cg);
......@@ -87,11 +87,11 @@ public abstract class SunGraphicsCallback {
int ncomponents = comps.length;
Shape clip = g.getClip();
if (log.isLoggable(Level.FINER) && (clip != null)) {
if (log.isLoggable(PlatformLogger.FINER) && (clip != null)) {
Rectangle newrect = clip.getBounds();
log.log(Level.FINER, "x = " + newrect.x + ", y = " + newrect.y +
", width = " + newrect.width +
", height = " + newrect.height);
log.finer("x = " + newrect.x + ", y = " + newrect.y +
", width = " + newrect.width +
", height = " + newrect.height);
}
// A seriously sad hack--
......
......@@ -40,8 +40,7 @@ import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.util.logging.PlatformLogger;
import sun.misc.SoftCache;
import sun.font.FontDesignMetrics;
import sun.awt.im.InputContext;
......@@ -61,7 +60,7 @@ public abstract class SunToolkit extends Toolkit
implements WindowClosingSupport, WindowClosingListener,
ComponentFactory, InputMethodSupport, KeyboardFocusManagerPeerProvider {
private static final Logger log = Logger.getLogger("sun.awt.SunToolkit");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.SunToolkit");
/* Load debug settings for native code */
static {
......@@ -986,9 +985,9 @@ public abstract class SunToolkit extends Toolkit
//with scale factors x1, x3/4, x2/3, xN, x1/N.
Image im = i.next();
if (im == null) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "SunToolkit.getScaledIconImage: " +
"Skipping the image passed into Java because it's null.");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconImage: " +
"Skipping the image passed into Java because it's null.");
}
continue;
}
......@@ -1002,9 +1001,9 @@ public abstract class SunToolkit extends Toolkit
iw = im.getWidth(null);
ih = im.getHeight(null);
} catch (Exception e){
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "SunToolkit.getScaledIconImage: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconImage: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
}
continue;
}
......@@ -1077,8 +1076,8 @@ public abstract class SunToolkit extends Toolkit
try {
int x = (width - bestWidth) / 2;
int y = (height - bestHeight) / 2;
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "WWindowPeer.getScaledIconData() result : " +
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("WWindowPeer.getScaledIconData() result : " +
"w : " + width + " h : " + height +
" iW : " + bestImage.getWidth(null) + " iH : " + bestImage.getHeight(null) +
" sim : " + bestSimilarity + " sf : " + bestScaleFactor +
......@@ -1095,9 +1094,9 @@ public abstract class SunToolkit extends Toolkit
public static DataBufferInt getScaledIconData(java.util.List<Image> imageList, int width, int height) {
BufferedImage bimage = getScaledIconImage(imageList, width, height);
if (bimage == null) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "SunToolkit.getScaledIconData: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
if (log.isLoggable(PlatformLogger.FINER)) {
log.finer("SunToolkit.getScaledIconData: " +
"Perhaps the image passed into Java is broken. Skipping this icon.");
}
return null;
}
......@@ -1913,7 +1912,7 @@ public abstract class SunToolkit extends Toolkit
}
}
protected static void dumpPeers(final Logger aLog) {
protected static void dumpPeers(final PlatformLogger aLog) {
AWTAutoShutdown.getInstance().dumpPeers(aLog);
}
......
......@@ -29,8 +29,7 @@ import java.awt.Window;
import java.lang.reflect.Field;
import java.util.logging.Logger;
import java.util.logging.Level;
import sun.util.logging.PlatformLogger;
import java.security.AccessController;
import java.security.PrivilegedAction;
......@@ -41,7 +40,7 @@ public class WindowAccessor {
private static Field fieldIsAutoRequestFocus;
private static Field fieldIsTrayIconWindow;
private static final Logger log = Logger.getLogger("sun.awt.WindowAccessor");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.WindowAccessor");
private WindowAccessor() {
}
......@@ -57,9 +56,9 @@ public class WindowAccessor {
fieldIsTrayIconWindow.setAccessible(true);
} catch (NoSuchFieldException e) {
log.log(Level.FINE, "Unable to initialize WindowAccessor: ", e);
log.fine("Unable to initialize WindowAccessor: ", e);
} catch (ClassNotFoundException e) {
log.log(Level.FINE, "Unable to initialize WindowAccessor: ", e);
log.fine("Unable to initialize WindowAccessor: ", e);
}
return null;
}
......@@ -71,7 +70,7 @@ public class WindowAccessor {
return fieldIsAutoRequestFocus.getBoolean(w);
} catch (IllegalAccessException e) {
log.log(Level.FINE, "Unable to access the Window object", e);
log.fine("Unable to access the Window object", e);
}
return true;
}
......@@ -81,7 +80,7 @@ public class WindowAccessor {
return fieldIsTrayIconWindow.getBoolean(w);
} catch (IllegalAccessException e) {
log.log(Level.FINE, "Unable to access the Window object", e);
log.fine("Unable to access the Window object", e);
}
return false;
}
......@@ -91,7 +90,7 @@ public class WindowAccessor {
fieldIsTrayIconWindow.set(w, isTrayIconWindow);
} catch (IllegalAccessException e) {
log.log(Level.FINE, "Unable to access the Window object", e);
log.fine("Unable to access the Window object", e);
}
}
}
......@@ -89,7 +89,7 @@ import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
......@@ -222,7 +222,7 @@ public abstract class DataTransferer {
*/
private static DataTransferer transferer;
private static final Logger dtLog = Logger.getLogger("sun.awt.datatransfer.DataTransfer");
private static final PlatformLogger dtLog = PlatformLogger.getLogger("sun.awt.datatransfer.DataTransfer");
static {
Class tCharArrayClass = null, tByteArrayClass = null;
......@@ -382,9 +382,9 @@ public abstract class DataTransferer {
* "text".
*/
public static boolean doesSubtypeSupportCharset(DataFlavor flavor) {
if (dtLog.isLoggable(Level.FINE)) {
if (dtLog.isLoggable(PlatformLogger.FINE)) {
if (!"text".equals(flavor.getPrimaryType())) {
dtLog.log(Level.FINE, "Assertion (\"text\".equals(flavor.getPrimaryType())) failed");
dtLog.fine("Assertion (\"text\".equals(flavor.getPrimaryType())) failed");
}
}
......
......@@ -48,7 +48,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Arrays;
import java.util.logging.*;
import sun.util.logging.PlatformLogger;
import java.io.IOException;
import java.io.InputStream;
......@@ -99,7 +99,7 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
protected static final Object _globalLock = new Object();
private static final Logger dndLog = Logger.getLogger("sun.awt.dnd.SunDropTargetContextPeer");
private static final PlatformLogger dndLog = PlatformLogger.getLogger("sun.awt.dnd.SunDropTargetContextPeer");
/*
* a primitive mechanism for advertising intra-JVM Transferables
......@@ -845,8 +845,8 @@ public abstract class SunDropTargetContextPeer implements DropTargetContextPeer,
void registerEvent(SunDropTargetEvent e) {
handler.lock();
if (!eventSet.add(e) && dndLog.isLoggable(Level.FINE)) {
dndLog.log(Level.FINE, "Event is already registered: " + e);
if (!eventSet.add(e) && dndLog.isLoggable(PlatformLogger.FINE)) {
dndLog.fine("Event is already registered: " + e);
}
handler.unlock();
}
......
......@@ -50,9 +50,9 @@ import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.logging.*;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import sun.util.logging.PlatformLogger;
import sun.awt.SunToolkit;
/**
......@@ -67,7 +67,7 @@ import sun.awt.SunToolkit;
public class InputContext extends java.awt.im.InputContext
implements ComponentListener, WindowListener {
private static final Logger log = Logger.getLogger("sun.awt.im.InputContext");
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.im.InputContext");
// The current input method is represented by two objects:
// a locator is used to keep information about the selected
// input method and locale until we actually need a real input
......@@ -386,7 +386,7 @@ public class InputContext extends java.awt.im.InputContext
}
previousInputMethod = null;
if (log.isLoggable(Level.FINE)) log.fine("Current client component " + currentClientComponent);
if (log.isLoggable(PlatformLogger.FINE)) log.fine("Current client component " + currentClientComponent);
if (inputMethod instanceof InputMethodAdapter) {
((InputMethodAdapter) inputMethod).setClientComponent(currentClientComponent);
}
......@@ -889,7 +889,7 @@ public class InputContext extends java.awt.im.InputContext
{inputMethodLocator.getDescriptor().getInputMethodDisplayName(null, Locale.getDefault()),
throwable.getLocalizedMessage()};
MessageFormat mf = new MessageFormat(errorTextFormat);
Logger logger = Logger.getLogger("sun.awt.im");
PlatformLogger logger = PlatformLogger.getLogger("sun.awt.im");
logger.config(mf.format(args));
}
......
......@@ -232,7 +232,7 @@ abstract class CMap {
* fonts are using gb2312 encoding, have to use this
* workaround to make Solaris zh_CN locale work. -sherman
*/
if (FontManager.isSolaris && font.platName != null &&
if (FontUtilities.isSolaris && font.platName != null &&
(font.platName.startsWith(
"/usr/openwin/lib/locale/zh_CN.EUC/X11/fonts/TrueType") ||
font.platName.startsWith(
......@@ -407,8 +407,8 @@ abstract class CMap {
subtableLength = buffer.getInt(offset+4) & INTMASK;
}
if (offset+subtableLength > buffer.capacity()) {
if (FontManager.logging) {
FontManager.logger.warning("Cmap subtable overflows buffer.");
if (FontUtilities.isLogging()) {
FontUtilities.getLogger().warning("Cmap subtable overflows buffer.");
}
}
switch (subtableFormat) {
......
......@@ -60,7 +60,7 @@ public final class CompositeFont extends Font2D {
public CompositeFont(String name, String[] compFileNames,
String[] compNames, int metricsSlotCnt,
int[] exclRanges, int[] maxIndexes,
boolean defer) {
boolean defer, SunFontManager fm) {
handle = new Font2DHandle(this);
fullName = name;
......@@ -85,13 +85,13 @@ public final class CompositeFont extends Font2D {
* The caller could be responsible for this, but for now it seems
* better that it is handled internally to the CompositeFont class.
*/
if (FontManager.eudcFont != null) {
if (fm.getEUDCFont() != null) {
numSlots++;
if (componentNames != null) {
componentNames = new String[numSlots];
System.arraycopy(compNames, 0, componentNames, 0, numSlots-1);
componentNames[numSlots-1] =
FontManager.eudcFont.getFontName(null);
fm.getEUDCFont().getFontName(null);
}
if (componentFileNames != null) {
componentFileNames = new String[numSlots];
......@@ -99,7 +99,7 @@ public final class CompositeFont extends Font2D {
componentFileNames, 0, numSlots-1);
}
components = new PhysicalFont[numSlots];
components[numSlots-1] = FontManager.eudcFont;
components[numSlots-1] = fm.getEUDCFont();
deferredInitialisation = new boolean[numSlots];
if (defer) {
for (int i=0; i<numSlots-1; i++) {
......@@ -165,7 +165,7 @@ public final class CompositeFont extends Font2D {
* it is harmless that we do not know a slot is already initialised
* and just need to discover that and mark it so.
*/
synchronized (FontManager.class) {
synchronized (FontManagerFactory.getInstance()) {
components = new PhysicalFont[numSlots];
components[0] = physFont;
System.arraycopy(compFont.components, 0,
......@@ -235,7 +235,8 @@ public final class CompositeFont extends Font2D {
* This global lock is rarely likely to be an issue as there
* are only going to be a few calls into this code.
*/
synchronized (FontManager.class) {
SunFontManager fm = SunFontManager.getInstance();
synchronized (fm) {
if (componentNames == null) {
componentNames = new String[numSlots];
}
......@@ -251,22 +252,21 @@ public final class CompositeFont extends Font2D {
*/
if (componentFileNames != null &&
componentFileNames[slot] != null) {
components[slot] = FontManager.initialiseDeferredFont
(componentFileNames[slot]);
components[slot] =
fm.initialiseDeferredFont(componentFileNames[slot]);
}
if (components[slot] == null) {
components[slot] = FontManager.getDefaultPhysicalFont();
components[slot] = fm.getDefaultPhysicalFont();
}
String name = components[slot].getFontName(null);
if (componentNames[slot] == null) {
componentNames[slot] = name;
} else if (!componentNames[slot].equalsIgnoreCase(name)) {
components[slot] =
(PhysicalFont)
FontManager.findFont2D(componentNames[slot],
style,
FontManager.PHYSICAL_FALLBACK);
(PhysicalFont) fm.findFont2D(componentNames[slot],
style,
FontManager.PHYSICAL_FALLBACK);
}
}
deferredInitialisation[slot] = false;
......@@ -333,21 +333,22 @@ public final class CompositeFont extends Font2D {
if (deferredInitialisation[slot]) {
doDeferredInitialisation(slot);
}
SunFontManager fm = SunFontManager.getInstance();
try {
PhysicalFont font = components[slot];
if (font == null) {
try {
font = (PhysicalFont)FontManager.
font = (PhysicalFont) fm.
findFont2D(componentNames[slot], style,
FontManager.PHYSICAL_FALLBACK);
components[slot] = font;
} catch (ClassCastException cce) {
font = FontManager.getDefaultPhysicalFont();
font = fm.getDefaultPhysicalFont();
}
}
return font;
} catch (Exception e) {
return FontManager.getDefaultPhysicalFont();
return fm.getDefaultPhysicalFont();
}
}
......
......@@ -211,10 +211,10 @@ public final class CompositeGlyphMapper extends CharToGlyphMapper {
glyphs[i] = convertToGlyph(code);
}
if (code < FontManager.MIN_LAYOUT_CHARCODE) {
if (code < FontUtilities.MIN_LAYOUT_CHARCODE) {
continue;
}
else if (FontManager.isComplexCharCode(code)) {
else if (FontUtilities.isComplexCharCode(code)) {
return true;
}
else if (code >= 0x10000) {
......
......@@ -158,7 +158,8 @@ public abstract class FileFont extends PhysicalFont {
* rare maybe it is not worth doing this last part.
*/
synchronized void deregisterFontAndClearStrikeCache() {
FontManager.deRegisterBadFont(this);
SunFontManager fm = SunFontManager.getInstance();
fm.deRegisterBadFont(this);
for (Reference strikeRef : strikeCache.values()) {
if (strikeRef != null) {
......@@ -172,14 +173,14 @@ public abstract class FileFont extends PhysicalFont {
}
}
scaler.dispose();
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
}
StrikeMetrics getFontMetrics(long pScalerContext) {
try {
return getScaler().getFontMetrics(pScalerContext);
} catch (FontScalerException fe) {
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
return getFontMetrics(pScalerContext);
}
}
......@@ -188,7 +189,7 @@ public abstract class FileFont extends PhysicalFont {
try {
return getScaler().getGlyphAdvance(pScalerContext, glyphCode);
} catch (FontScalerException fe) {
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
return getGlyphAdvance(pScalerContext, glyphCode);
}
}
......@@ -197,7 +198,7 @@ public abstract class FileFont extends PhysicalFont {
try {
getScaler().getGlyphMetrics(pScalerContext, glyphCode, metrics);
} catch (FontScalerException fe) {
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
getGlyphMetrics(pScalerContext, glyphCode, metrics);
}
}
......@@ -206,7 +207,7 @@ public abstract class FileFont extends PhysicalFont {
try {
return getScaler().getGlyphImage(pScalerContext, glyphCode);
} catch (FontScalerException fe) {
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
return getGlyphImage(pScalerContext, glyphCode);
}
}
......@@ -215,7 +216,7 @@ public abstract class FileFont extends PhysicalFont {
try {
return getScaler().getGlyphOutlineBounds(pScalerContext, glyphCode);
} catch (FontScalerException fe) {
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
return getGlyphOutlineBounds(pScalerContext, glyphCode);
}
}
......@@ -224,7 +225,7 @@ public abstract class FileFont extends PhysicalFont {
try {
return getScaler().getGlyphOutline(pScalerContext, glyphCode, x, y);
} catch (FontScalerException fe) {
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
return getGlyphOutline(pScalerContext, glyphCode, x, y);
}
}
......@@ -233,7 +234,7 @@ public abstract class FileFont extends PhysicalFont {
try {
return getScaler().getGlyphVectorOutline(pScalerContext, glyphs, numGlyphs, x, y);
} catch (FontScalerException fe) {
scaler = FontManager.getNullScaler();
scaler = FontScaler.getNullScaler();
return getGlyphVectorOutline(pScalerContext, glyphs, numGlyphs, x, y);
}
}
......@@ -275,7 +276,8 @@ public abstract class FileFont extends PhysicalFont {
*/
fontFile.delete();
/* remove from delete on exit hook list : */
FontManager.tmpFontFiles.remove(fontFile);
// FIXME: still need to be refactored
SunFontManager.getInstance().tmpFontFiles.remove(fontFile);
} catch (Exception e) {
}
}
......
......@@ -114,7 +114,7 @@ public class FileFontStrike extends PhysicalStrike {
private static native boolean initNative();
private static boolean isXPorLater = false;
static {
if (FontManager.isWindows && !FontManager.useT2K &&
if (FontUtilities.isWindows && !FontUtilities.useT2K &&
!GraphicsEnvironment.isHeadless()) {
isXPorLater = initNative();
}
......@@ -201,7 +201,7 @@ public class FileFontStrike extends PhysicalStrike {
this.disposer = new FontStrikeDisposer(fileFont, desc);
initGlyphCache();
pScalerContext = NullFontScaler.getNullScalerContext();
FontManager.deRegisterBadFont(fileFont);
SunFontManager.getInstance().deRegisterBadFont(fileFont);
return;
}
/* First, see if native code should be used to create the glyph.
......@@ -211,8 +211,8 @@ public class FileFontStrike extends PhysicalStrike {
* except that the advance returned by GDI is always overwritten by
* the JDK rasteriser supplied one (see getGlyphImageFromWindows()).
*/
if (FontManager.isWindows && isXPorLater &&
!FontManager.useT2K &&
if (FontUtilities.isWindows && isXPorLater &&
!FontUtilities.useT2K &&
!GraphicsEnvironment.isHeadless() &&
!fileFont.useJavaRasterizer &&
(desc.aaHint == INTVAL_TEXT_ANTIALIAS_LCD_HRGB ||
......@@ -241,8 +241,8 @@ public class FileFontStrike extends PhysicalStrike {
}
}
}
if (FontManager.logging && FontManager.isWindows) {
FontManager.logger.info
if (FontUtilities.isLogging() && FontUtilities.isWindows) {
FontUtilities.getLogger().info
("Strike for " + fileFont + " at size = " + intPtSize +
" use natives = " + useNatives +
" useJavaRasteriser = " + fileFont.useJavaRasterizer +
......@@ -298,7 +298,7 @@ public class FileFontStrike extends PhysicalStrike {
}
long getGlyphImageFromNative(int glyphCode) {
if (FontManager.isWindows) {
if (FontUtilities.isWindows) {
return getGlyphImageFromWindows(glyphCode);
} else {
return getGlyphImageFromX11(glyphCode);
......@@ -366,8 +366,8 @@ public class FileFontStrike extends PhysicalStrike {
} else {
if (useNatives) {
glyphPtr = getGlyphImageFromNative(glyphCode);
if (glyphPtr == 0L && FontManager.logging) {
FontManager.logger.info
if (glyphPtr == 0L && FontUtilities.isLogging()) {
FontUtilities.getLogger().info
("Strike for " + fileFont +
" at size = " + intPtSize +
" couldn't get native glyph for code = " + glyphCode);
......@@ -528,7 +528,7 @@ public class FileFontStrike extends PhysicalStrike {
if (segmentedCache) {
int numSegments = (numGlyphs + SEGSIZE-1)/SEGSIZE;
if (FontManager.longAddresses) {
if (longAddresses) {
glyphCacheFormat = SEGLONGARRAY;
segLongGlyphImages = new long[numSegments][];
this.disposer.segLongGlyphImages = segLongGlyphImages;
......@@ -538,7 +538,7 @@ public class FileFontStrike extends PhysicalStrike {
this.disposer.segIntGlyphImages = segIntGlyphImages;
}
} else {
if (FontManager.longAddresses) {
if (longAddresses) {
glyphCacheFormat = LONGARRAY;
longGlyphImages = new long[numGlyphs];
this.disposer.longGlyphImages = longGlyphImages;
......
/*
* Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package sun.font;
import java.awt.Font;
public abstract class FontAccess {
private static FontAccess access;
public static synchronized void setFontAccess(FontAccess acc) {
if (access != null) {
throw new InternalError("Attempt to set FontAccessor twice");
}
access = acc;
}
public static synchronized FontAccess getFontAccess() {
return access;
}
public abstract Font2D getFont2D(Font f);
public abstract void setFont2D(Font f, Font2DHandle h);
public abstract void setCreatedFont(Font f);
public abstract boolean isCreatedFont(Font f);
}
......@@ -261,8 +261,9 @@ public final class FontDesignMetrics extends FontMetrics {
* Note that currently Swing native L&F composites are not handled
* by this code as they use the metrics of the physical anyway.
*/
if (FontManager.maybeUsingAlternateCompositeFonts() &&
FontManager.getFont2D(font) instanceof CompositeFont) {
SunFontManager fm = SunFontManager.getInstance();
if (fm.maybeUsingAlternateCompositeFonts() &&
FontUtilities.getFont2D(font) instanceof CompositeFont) {
return new FontDesignMetrics(font, frc);
}
......@@ -353,7 +354,7 @@ public final class FontDesignMetrics extends FontMetrics {
private void initMatrixAndMetrics() {
Font2D font2D = FontManager.getFont2D(font);
Font2D font2D = FontUtilities.getFont2D(font);
fontStrike = font2D.getStrike(font, frc);
StrikeMetrics metrics = fontStrike.getFontMetrics();
this.ascent = metrics.getAscent();
......@@ -473,7 +474,7 @@ public final class FontDesignMetrics extends FontMetrics {
char ch = str.charAt(i);
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else if (FontManager.isNonSimpleChar(ch)) {
} else if (FontUtilities.isNonSimpleChar(ch)) {
width = new TextLayout(str, font, frc).getAdvance();
break;
} else {
......@@ -504,7 +505,7 @@ public final class FontDesignMetrics extends FontMetrics {
char ch = data[i];
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else if (FontManager.isNonSimpleChar(ch)) {
} else if (FontUtilities.isNonSimpleChar(ch)) {
String str = new String(data, off, len);
width = new TextLayout(str, font, frc).getAdvance();
break;
......
......@@ -107,8 +107,9 @@ public class FontFamily {
public void setFont(Font2D font, int style) {
if (font.getRank() > familyRank) {
if (FontManager.logging) {
FontManager.logger.warning("Rejecting adding " + font +
if (FontUtilities.isLogging()) {
FontUtilities.getLogger()
.warning("Rejecting adding " + font +
" of lower rank " + font.getRank() +
" to family " + this +
" of rank " + familyRank);
......
/*
* Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package sun.font;
import java.awt.AWTError;
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import java.security.AccessController;
import java.security.PrivilegedAction;
import sun.security.action.GetPropertyAction;
/**
* Factory class used to retrieve a valid FontManager instance for the current
* platform.
*
* A default implementation is given for Linux, Solaris and Windows.
* You can alter the behaviour of the {@link #getInstance()} method by setting
* the {@code sun.font.fontmanager} property. For example:
* {@code sun.font.fontmanager=sun.awt.X11FontManager}
*/
public final class FontManagerFactory {
/** Our singleton instance. */
private static FontManager instance = null;
private static final String DEFAULT_CLASS;
static {
if (FontUtilities.isWindows)
DEFAULT_CLASS = "sun.awt.Win32FontManager";
else
DEFAULT_CLASS = "sun.awt.X11FontManager";
}
/**
* Get a valid FontManager implementation for the current platform.
*
* @return a valid FontManager instance for the current platform
*/
public static synchronized FontManager getInstance() {
if (instance != null) {
return instance;
}
String fmClassName = AccessController.doPrivileged(
new GetPropertyAction("sun.font.fontmanager",
DEFAULT_CLASS));
try {
@SuppressWarnings("unchecked")
ClassLoader cl = (ClassLoader)
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return ClassLoader.getSystemClassLoader();
}
});
@SuppressWarnings("unchecked")
Class fmClass = Class.forName(fmClassName, true, cl);
instance = (FontManager) fmClass.newInstance();
} catch (ClassNotFoundException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
} catch (InstantiationException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
} catch (IllegalAccessException ex) {
InternalError err = new InternalError();
err.initCause(ex);
throw err;
}
return instance;
}
}
/*
* Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package sun.font;
import java.awt.Font;
import java.util.Locale;
import java.util.TreeMap;
/**
* This is an extension of the {@link FontManager} interface which has to
* be implemented on systems that want to use SunGraphicsEnvironment. It
* adds a couple of methods that are only required by SGE. Graphics
* implementations that use their own GraphicsEnvironment are not required
* to implement this and can use plain FontManager instead.
*/
public interface FontManagerForSGE extends FontManager {
/**
* Return an array of created Fonts, or null, if no fonts were created yet.
*/
public Font[] getCreatedFonts();
/**
* Similar to getCreatedFonts, but returns a TreeMap of fonts by family name.
*/
public TreeMap<String, String> getCreatedFontFamilyNames();
/**
* Returns all fonts installed in this environment.
*/
public Font[] getAllInstalledFonts();
public String[] getInstalledFontFamilyNames(Locale requestedLocale);
}
......@@ -34,7 +34,7 @@ public class FontManagerNativeLibrary {
public Object run() {
/* REMIND do we really have to load awt here? */
System.loadLibrary("awt");
if (SunGraphicsEnvironment.isOpenJDK() &&
if (FontUtilities.isOpenJDK &&
System.getProperty("os.name").startsWith("Windows")) {
/* Ideally fontmanager library should not depend on
particular implementation of the font scaler.
......
......@@ -114,7 +114,7 @@ public final class FontResolver {
for (int i=0; i<getAllFonts().length; i++) {
Font font = allFonts[i];
Font2D font2D = FontManager.getFont2D(font);
Font2D font2D = FontUtilities.getFont2D(font);
if (font2D.hasSupplementaryChars()) {
fonts.add(font);
indices.add(Integer.valueOf(i));
......
......@@ -29,6 +29,9 @@ import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import sun.java2d.Disposer;
import sun.java2d.DisposerRecord;
/* FontScaler is "internal interface" to font rasterizer library.
......@@ -77,6 +80,79 @@ import sun.java2d.DisposerRecord;
* this (and this is probably more important for Type1 fonts).
*/
public abstract class FontScaler implements DisposerRecord {
private static FontScaler nullScaler = null;
private static Constructor<FontScaler> scalerConstructor = null;
//Find preferred font scaler
//
//NB: we can allow property based preferences
// (theoretically logic can be font type specific)
static {
Class scalerClass = null;
Class arglst[] = new Class[] {Font2D.class, int.class,
boolean.class, int.class};
try {
if (FontUtilities.isOpenJDK) {
scalerClass = Class.forName("sun.font.FreetypeFontScaler");
} else {
scalerClass = Class.forName("sun.font.T2KFontScaler");
}
} catch (ClassNotFoundException e) {
scalerClass = NullFontScaler.class;
}
//NB: rewrite using factory? constructor is ugly way
try {
scalerConstructor = scalerClass.getConstructor(arglst);
} catch (NoSuchMethodException e) {
//should not happen
}
}
/* This is the only place to instantiate new FontScaler.
* Therefore this is very convinient place to register
* scaler with Disposer as well as trigger deregistring bad font
* in case when scaler reports this.
*/
public static FontScaler getScaler(Font2D font,
int indexInCollection,
boolean supportsCJK,
int filesize) {
FontScaler scaler = null;
try {
Object args[] = new Object[] {font, indexInCollection,
supportsCJK, filesize};
scaler = scalerConstructor.newInstance(args);
Disposer.addObjectRecord(font, scaler);
} catch (Throwable e) {
scaler = nullScaler;
//if we can not instantiate scaler assume bad font
//NB: technically it could be also because of internal scaler
// error but here we are assuming scaler is ok.
FontManager fm = FontManagerFactory.getInstance();
fm.deRegisterBadFont(font);
}
return scaler;
}
/*
* At the moment it is harmless to create 2 null scalers so, technically,
* syncronized keyword is not needed.
*
* But it is safer to keep it to avoid subtle problems if we will be adding
* checks like whether scaler is null scaler.
*/
public static synchronized FontScaler getNullScaler() {
if (nullScaler == null) {
nullScaler = new NullFontScaler();
}
return nullScaler;
}
protected WeakReference<Font2D> font = null;
protected long nativeScaler = 0; //used by decendants
//that have native state
......
/*
* Copyright 2008 Sun Microsystems, Inc. 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. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package sun.font;
import java.awt.Font;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.security.AccessController;
import javax.swing.plaf.FontUIResource;
import sun.security.action.GetPropertyAction;
import sun.util.logging.PlatformLogger;
/**
* A collection of utility methods.
*/
public final class FontUtilities {
public static final boolean isSolaris;
public static final boolean isLinux;
public static final boolean isSolaris8;
public static final boolean isSolaris9;
public static final boolean isOpenSolaris;
public static final boolean useT2K;
public static final boolean isWindows;
public static final boolean isOpenJDK;
static final String LUCIDA_FILE_NAME = "LucidaSansRegular.ttf";
// This static initializer block figures out the OS constants.
static {
String osName = AccessController.doPrivileged(
new GetPropertyAction("os.name", "unknownOS"));
isSolaris = osName.startsWith("SunOS");
isLinux = osName.startsWith("Linux");
String t2kStr = AccessController.doPrivileged(
new GetPropertyAction("sun.java2d.font.scaler"));
if (t2kStr != null) {
useT2K = "t2k".equals(t2kStr);
} else {
useT2K = false;
}
if (isSolaris) {
String version = AccessController.doPrivileged(
new GetPropertyAction("os.version", "0.0"));
isSolaris8 = version.startsWith("5.8");
isSolaris9 = version.startsWith("5.9");
float ver = Float.parseFloat(version);
if (ver > 5.10f) {
File f = new File("/etc/release");
String line = null;
try {
FileInputStream fis = new FileInputStream(f);
InputStreamReader isr = new InputStreamReader(
fis, "ISO-8859-1");
BufferedReader br = new BufferedReader(isr);
line = br.readLine();
fis.close();
} catch (Exception ex) {
// Nothing to do here.
}
if (line != null && line.indexOf("OpenSolaris") >= 0) {
isOpenSolaris = true;
} else {
isOpenSolaris = false;
}
} else {
isOpenSolaris= false;
}
} else {
isSolaris8 = false;
isSolaris9 = false;
isOpenSolaris = false;
}
isWindows = osName.startsWith("Windows");
String jreLibDirName = AccessController.doPrivileged(
new GetPropertyAction("java.home","")) + File.separator + "lib";
String jreFontDirName = jreLibDirName + File.separator + "fonts";
File lucidaFile =
new File(jreFontDirName + File.separator + LUCIDA_FILE_NAME);
isOpenJDK = !lucidaFile.exists();
}
/**
* Referenced by code in the JDK which wants to test for the
* minimum char code for which layout may be required.
* Note that even basic latin text can benefit from ligatures,
* eg "ffi" but we presently apply those only if explicitly
* requested with TextAttribute.LIGATURES_ON.
* The value here indicates the lowest char code for which failing
* to invoke layout would prevent acceptable rendering.
*/
public static final int MIN_LAYOUT_CHARCODE = 0x0300;
/**
* Referenced by code in the JDK which wants to test for the
* maximum char code for which layout may be required.
* Note this does not account for supplementary characters
* where the caller interprets 'layout' to mean any case where
* one 'char' (ie the java type char) does not map to one glyph
*/
public static final int MAX_LAYOUT_CHARCODE = 0x206F;
private static boolean debugFonts = false;
private static PlatformLogger logger = null;
private static boolean logging;
static {
String debugLevel =
System.getProperty("sun.java2d.debugfonts");
if (debugLevel != null && !debugLevel.equals("false")) {
debugFonts = true;
logger = PlatformLogger.getLogger("sun.java2d");
if (debugLevel.equals("warning")) {
logger.setLevel(PlatformLogger.WARNING);
} else if (debugLevel.equals("severe")) {
logger.setLevel(PlatformLogger.SEVERE);
}
}
if (debugFonts) {
logger = PlatformLogger.getLogger("sun.java2d");
logging = logger.isEnabled();
}
}
/**
* Calls the private getFont2D() method in java.awt.Font objects.
*
* @param font the font object to call
*
* @return the Font2D object returned by Font.getFont2D()
*/
public static Font2D getFont2D(Font font) {
return FontAccess.getFontAccess().getFont2D(font);
}
/**
* If there is anything in the text which triggers a case
* where char->glyph does not map 1:1 in straightforward
* left->right ordering, then this method returns true.
* Scripts which might require it but are not treated as such
* due to JDK implementations will not return true.
* ie a 'true' return is an indication of the treatment by
* the implementation.
* Whether supplementary characters should be considered is dependent
* on the needs of the caller. Since this method accepts the 'char' type
* then such chars are always represented by a pair. From a rendering
* perspective these will all (in the cases I know of) still be one
* unicode character -> one glyph. But if a caller is using this to
* discover any case where it cannot make naive assumptions about
* the number of chars, and how to index through them, then it may
* need the option to have a 'true' return in such a case.
*/
public static boolean isComplexText(char [] chs, int start, int limit) {
for (int i = start; i < limit; i++) {
if (chs[i] < MIN_LAYOUT_CHARCODE) {
continue;
}
else if (isNonSimpleChar(chs[i])) {
return true;
}
}
return false;
}
/* This is almost the same as the method above, except it takes a
* char which means it may include undecoded surrogate pairs.
* The distinction is made so that code which needs to identify all
* cases in which we do not have a simple mapping from
* char->unicode character->glyph can be be identified.
* For example measurement cannot simply sum advances of 'chars',
* the caret in editable text cannot advance one 'char' at a time, etc.
* These callers really are asking for more than whether 'layout'
* needs to be run, they need to know if they can assume 1->1
* char->glyph mapping.
*/
public static boolean isNonSimpleChar(char ch) {
return
isComplexCharCode(ch) ||
(ch >= CharToGlyphMapper.HI_SURROGATE_START &&
ch <= CharToGlyphMapper.LO_SURROGATE_END);
}
/* If the character code falls into any of a number of unicode ranges
* where we know that simple left->right layout mapping chars to glyphs
* 1:1 and accumulating advances is going to produce incorrect results,
* we want to know this so the caller can use a more intelligent layout
* approach. A caller who cares about optimum performance may want to
* check the first case and skip the method call if its in that range.
* Although there's a lot of tests in here, knowing you can skip
* CTL saves a great deal more. The rest of the checks are ordered
* so that rather than checking explicitly if (>= start & <= end)
* which would mean all ranges would need to be checked so be sure
* CTL is not needed, the method returns as soon as it recognises
* the code point is outside of a CTL ranges.
* NOTE: Since this method accepts an 'int' it is asssumed to properly
* represent a CHARACTER. ie it assumes the caller has already
* converted surrogate pairs into supplementary characters, and so
* can handle this case and doesn't need to be told such a case is
* 'complex'.
*/
public static boolean isComplexCharCode(int code) {
if (code < MIN_LAYOUT_CHARCODE || code > MAX_LAYOUT_CHARCODE) {
return false;
}
else if (code <= 0x036f) {
// Trigger layout for combining diacriticals 0x0300->0x036f
return true;
}
else if (code < 0x0590) {
// No automatic layout for Greek, Cyrillic, Armenian.
return false;
}
else if (code <= 0x06ff) {
// Hebrew 0590 - 05ff
// Arabic 0600 - 06ff
return true;
}
else if (code < 0x0900) {
return false; // Syriac and Thaana
}
else if (code <= 0x0e7f) {
// if Indic, assume shaping for conjuncts, reordering:
// 0900 - 097F Devanagari
// 0980 - 09FF Bengali
// 0A00 - 0A7F Gurmukhi
// 0A80 - 0AFF Gujarati
// 0B00 - 0B7F Oriya
// 0B80 - 0BFF Tamil
// 0C00 - 0C7F Telugu
// 0C80 - 0CFF Kannada
// 0D00 - 0D7F Malayalam
// 0D80 - 0DFF Sinhala
// 0E00 - 0E7F if Thai, assume shaping for vowel, tone marks
return true;
}
else if (code < 0x1780) {
return false;
}
else if (code <= 0x17ff) { // 1780 - 17FF Khmer
return true;
}
else if (code < 0x200c) {
return false;
}
else if (code <= 0x200d) { // zwj or zwnj
return true;
}
else if (code >= 0x202a && code <= 0x202e) { // directional control
return true;
}
else if (code >= 0x206a && code <= 0x206f) { // directional control
return true;
}
return false;
}
public static PlatformLogger getLogger() {
return logger;
}
public static boolean isLogging() {
return logging;
}
public static boolean debugFonts() {
return debugFonts;
}
// The following methods are used by Swing.
/* Revise the implementation to in fact mean "font is a composite font.
* This ensures that Swing components will always benefit from the
* fall back fonts
*/
public static boolean fontSupportsDefaultEncoding(Font font) {
return getFont2D(font) instanceof CompositeFont;
}
/**
* This method is provided for internal and exclusive use by Swing.
*
* It may be used in conjunction with fontSupportsDefaultEncoding(Font)
* In the event that a desktop properties font doesn't directly
* support the default encoding, (ie because the host OS supports
* adding support for the current locale automatically for native apps),
* then Swing calls this method to get a font which uses the specified
* font for the code points it covers, but also supports this locale
* just as the standard composite fonts do.
* Note: this will over-ride any setting where an application
* specifies it prefers locale specific composite fonts.
* The logic for this, is that this method is used only where the user or
* application has specified that the native L&F be used, and that
* we should honour that request to use the same font as native apps use.
*
* The behaviour of this method is to construct a new composite
* Font object that uses the specified physical font as its first
* component, and adds all the components of "dialog" as fall back
* components.
* The method currently assumes that only the size and style attributes
* are set on the specified font. It doesn't copy the font transform or
* other attributes because they aren't set on a font created from
* the desktop. This will need to be fixed if use is broadened.
*
* Operations such as Font.deriveFont will work properly on the
* font returned by this method for deriving a different point size.
* Additionally it tries to support a different style by calling
* getNewComposite() below. That also supports replacing slot zero
* with a different physical font but that is expected to be "rare".
* Deriving with a different style is needed because its been shown
* that some applications try to do this for Swing FontUIResources.
* Also operations such as new Font(font.getFontName(..), Font.PLAIN, 14);
* will NOT yield the same result, as the new underlying CompositeFont
* cannot be "looked up" in the font registry.
* This returns a FontUIResource as that is the Font sub-class needed
* by Swing.
* Suggested usage is something like :
* FontUIResource fuir;
* Font desktopFont = getDesktopFont(..);
* // NOTE even if fontSupportsDefaultEncoding returns true because
* // you get Tahoma and are running in an English locale, you may
* // still want to just call getCompositeFontUIResource() anyway
* // as only then will you get fallback fonts - eg for CJK.
* if (FontManager.fontSupportsDefaultEncoding(desktopFont)) {
* fuir = new FontUIResource(..);
* } else {
* fuir = FontManager.getCompositeFontUIResource(desktopFont);
* }
* return fuir;
*/
public static FontUIResource getCompositeFontUIResource(Font font) {
FontUIResource fuir =
new FontUIResource(font.getName(),font.getStyle(),font.getSize());
Font2D font2D = FontUtilities.getFont2D(font);
if (!(font2D instanceof PhysicalFont)) {
/* Swing should only be calling this when a font is obtained
* from desktop properties, so should generally be a physical font,
* an exception might be for names like "MS Serif" which are
* automatically mapped to "Serif", so there's no need to do
* anything special in that case. But note that suggested usage
* is first to call fontSupportsDefaultEncoding(Font) and this
* method should not be called if that were to return true.
*/
return fuir;
}
FontManager fm = FontManagerFactory.getInstance();
CompositeFont dialog2D =
(CompositeFont) fm.findFont2D("dialog", font.getStyle(), FontManager.NO_FALLBACK);
if (dialog2D == null) { /* shouldn't happen */
return fuir;
}
PhysicalFont physicalFont = (PhysicalFont)font2D;
CompositeFont compFont = new CompositeFont(physicalFont, dialog2D);
FontAccess.getFontAccess().setFont2D(fuir, compFont.handle);
/* marking this as a created font is needed as only created fonts
* copy their creator's handles.
*/
FontAccess.getFontAccess().setCreatedFont(fuir);
return fuir;
}
/* A small "map" from GTK/fontconfig names to the equivalent JDK
* logical font name.
*/
private static final String[][] nameMap = {
{"sans", "sansserif"},
{"sans-serif", "sansserif"},
{"serif", "serif"},
{"monospace", "monospaced"}
};
public static String mapFcName(String name) {
for (int i = 0; i < nameMap.length; i++) {
if (name.equals(nameMap[i][0])) {
return nameMap[i][1];
}
}
return null;
}
/* This is called by Swing passing in a fontconfig family name
* such as "sans". In return Swing gets a FontUIResource instance
* that has queried fontconfig to resolve the font(s) used for this.
* Fontconfig will if asked return a list of fonts to give the largest
* possible code point coverage.
* For now we use only the first font returned by fontconfig, and
* back it up with the most closely matching JDK logical font.
* Essentially this means pre-pending what we return now with fontconfig's
* preferred physical font. This could lead to some duplication in cases,
* if we already included that font later. We probably should remove such
* duplicates, but it is not a significant problem. It can be addressed
* later as part of creating a Composite which uses more of the
* same fonts as fontconfig. At that time we also should pay more
* attention to the special rendering instructions fontconfig returns,
* such as whether we should prefer embedded bitmaps over antialiasing.
* There's no way to express that via a Font at present.
*/
public static FontUIResource getFontConfigFUIR(String fcFamily,
int style, int size) {
String mapped = mapFcName(fcFamily);
if (mapped == null) {
mapped = "sansserif";
}
FontUIResource fuir;
FontManager fm = FontManagerFactory.getInstance();
if (fm instanceof SunFontManager) {
SunFontManager sfm = (SunFontManager) fm;
fuir = sfm.getFontConfigFUIR(mapped, style, size);
} else {
fuir = new FontUIResource(mapped, style, size);
}
return fuir;
}
/**
* Used by windows printing to assess if a font is likely to
* be layout compatible with JDK
* TrueType fonts should be, but if they have no GPOS table,
* but do have a GSUB table, then they are probably older
* fonts GDI handles differently.
*/
public static boolean textLayoutIsCompatible(Font font) {
Font2D font2D = getFont2D(font);
if (font2D instanceof TrueTypeFont) {
TrueTypeFont ttf = (TrueTypeFont) font2D;
return
ttf.getDirectoryEntry(TrueTypeFont.GSUBTag) == null ||
ttf.getDirectoryEntry(TrueTypeFont.GPOSTag) != null;
} else {
return false;
}
}
}
......@@ -79,7 +79,7 @@ class FreetypeFontScaler extends FontScaler {
pScalerContext,
nativeScaler);
}
return FontManager.getNullScaler().getFontMetrics(0L);
return FontScaler.getNullScaler().getFontMetrics(0L);
}
synchronized float getGlyphAdvance(long pScalerContext, int glyphCode)
......@@ -90,7 +90,8 @@ class FreetypeFontScaler extends FontScaler {
nativeScaler,
glyphCode);
}
return FontManager.getNullScaler().getGlyphAdvance(0L, glyphCode);
return FontScaler.getNullScaler().
getGlyphAdvance(0L, glyphCode);
}
synchronized void getGlyphMetrics(long pScalerContext,
......@@ -104,7 +105,8 @@ class FreetypeFontScaler extends FontScaler {
metrics);
return;
}
FontManager.getNullScaler().getGlyphMetrics(0L, glyphCode, metrics);
FontScaler.getNullScaler().
getGlyphMetrics(0L, glyphCode, metrics);
}
synchronized long getGlyphImage(long pScalerContext, int glyphCode)
......@@ -115,7 +117,8 @@ class FreetypeFontScaler extends FontScaler {
nativeScaler,
glyphCode);
}
return FontManager.getNullScaler().getGlyphImage(0L, glyphCode);
return FontScaler.getNullScaler().
getGlyphImage(0L, glyphCode);
}
synchronized Rectangle2D.Float getGlyphOutlineBounds(
......@@ -127,7 +130,8 @@ class FreetypeFontScaler extends FontScaler {
nativeScaler,
glyphCode);
}
return FontManager.getNullScaler().getGlyphOutlineBounds(0L,glyphCode);
return FontScaler.getNullScaler().
getGlyphOutlineBounds(0L,glyphCode);
}
synchronized GeneralPath getGlyphOutline(
......@@ -140,7 +144,8 @@ class FreetypeFontScaler extends FontScaler {
glyphCode,
x, y);
}
return FontManager.getNullScaler().getGlyphOutline(0L, glyphCode, x,y);
return FontScaler.getNullScaler().
getGlyphOutline(0L, glyphCode, x,y);
}
synchronized GeneralPath getGlyphVectorOutline(
......@@ -154,8 +159,8 @@ class FreetypeFontScaler extends FontScaler {
numGlyphs,
x, y);
}
return FontManager.getNullScaler().getGlyphVectorOutline(
0L, glyphs, numGlyphs, x, y);
return FontScaler
.getNullScaler().getGlyphVectorOutline(0L, glyphs, numGlyphs, x, y);
}
synchronized long getLayoutTableCache() throws FontScalerException {
......@@ -173,21 +178,21 @@ class FreetypeFontScaler extends FontScaler {
if (nativeScaler != 0L) {
return getNumGlyphsNative(nativeScaler);
}
return FontManager.getNullScaler().getNumGlyphs();
return FontScaler.getNullScaler().getNumGlyphs();
}
synchronized int getMissingGlyphCode() throws FontScalerException {
if (nativeScaler != 0L) {
return getMissingGlyphCodeNative(nativeScaler);
}
return FontManager.getNullScaler().getMissingGlyphCode();
return FontScaler.getNullScaler().getMissingGlyphCode();
}
synchronized int getGlyphCode(char charCode) throws FontScalerException {
if (nativeScaler != 0L) {
return getGlyphCodeNative(nativeScaler, charCode);
}
return FontManager.getNullScaler().getGlyphCode(charCode);
return FontScaler.getNullScaler().getGlyphCode(charCode);
}
synchronized Point2D.Float getGlyphPoint(long pScalerContext,
......@@ -197,7 +202,7 @@ class FreetypeFontScaler extends FontScaler {
return getGlyphPointNative(font.get(), pScalerContext,
nativeScaler, glyphCode, ptNumber);
}
return FontManager.getNullScaler().getGlyphPoint(
return FontScaler.getNullScaler().getGlyphPoint(
pScalerContext, glyphCode, ptNumber);
}
......
......@@ -259,7 +259,7 @@ public final class GlyphLayout {
*/
int aa =
FontStrikeDesc.getAAHintIntVal(frc.getAntiAliasingHint(),
FontManager.getFont2D(font),
FontUtilities.getFont2D(font),
(int)Math.abs(ptSize));
int fm = FontStrikeDesc.getFMHintIntVal
(frc.getFractionalMetricsHint());
......@@ -407,7 +407,7 @@ public final class GlyphLayout {
int lang = -1; // default for now
Font2D font2D = FontManager.getFont2D(font);
Font2D font2D = FontUtilities.getFont2D(font);
_textRecord.init(text, offset, lim, min, max);
int start = offset;
......
......@@ -36,6 +36,14 @@ import java.util.concurrent.ConcurrentHashMap;
public abstract class PhysicalStrike extends FontStrike {
static final long INTMASK = 0xffffffffL;
static boolean longAddresses;
static {
switch (StrikeCache.nativeAddressSize) {
case 8: longAddresses = true; break;
case 4: longAddresses = false; break;
default: throw new RuntimeException("Unexpected address size");
}
}
private PhysicalFont physicalFont;
protected CharToGlyphMapper mapper;
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册