Merge
This commit is contained in:
commit
e544e85ebd
@ -1,249 +1,250 @@
|
||||
#
|
||||
# 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
|
||||
|
File diff suppressed because one or more lines are too long
@ -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;
|
||||
|
@ -60,7 +60,6 @@ import java.lang.reflect.Method;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import javax.accessibility.*;
|
||||
import java.util.logging.*;
|
||||
import java.applet.Applet;
|
||||
|
||||
import sun.security.action.GetPropertyAction;
|
||||
@ -74,6 +73,9 @@ import sun.awt.CausedFocusEvent;
|
||||
import sun.awt.EmbeddedFrame;
|
||||
import sun.awt.dnd.SunDropTargetEvent;
|
||||
import sun.awt.im.CompositionArea;
|
||||
import sun.font.FontManager;
|
||||
import sun.font.FontManagerFactory;
|
||||
import sun.font.SunFontManager;
|
||||
import sun.java2d.SunGraphics2D;
|
||||
import sun.java2d.pipe.Region;
|
||||
import sun.awt.image.VSyncedBSManager;
|
||||
@ -81,6 +83,7 @@ import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
|
||||
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
|
||||
import sun.awt.RequestFocusController;
|
||||
import sun.java2d.SunGraphicsEnvironment;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
/**
|
||||
* A <em>component</em> is an object having a graphical representation
|
||||
@ -175,10 +178,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
Serializable
|
||||
{
|
||||
|
||||
private static final Logger log = Logger.getLogger("java.awt.Component");
|
||||
private static final Logger eventLog = Logger.getLogger("java.awt.event.Component");
|
||||
private static final Logger focusLog = Logger.getLogger("java.awt.focus.Component");
|
||||
private static final Logger mixingLog = Logger.getLogger("java.awt.mixing.Component");
|
||||
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Component");
|
||||
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Component");
|
||||
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.Component");
|
||||
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Component");
|
||||
|
||||
/**
|
||||
* The peer of the component. The peer implements the component's
|
||||
@ -2848,8 +2851,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
* @since JDK1.0
|
||||
*/
|
||||
public FontMetrics getFontMetrics(Font font) {
|
||||
// REMIND: PlatformFont flag should be obsolete soon...
|
||||
if (sun.font.FontManager.usePlatformFontMetrics()) {
|
||||
// This is an unsupported hack, but left in for a customer.
|
||||
// Do not remove.
|
||||
FontManager fm = FontManagerFactory.getInstance();
|
||||
if (fm instanceof SunFontManager
|
||||
&& ((SunFontManager) fm).usePlatformFontMetrics()) {
|
||||
|
||||
if (peer != null &&
|
||||
!(peer instanceof LightweightPeer)) {
|
||||
return peer.getFontMetrics(font);
|
||||
@ -4471,13 +4478,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
// Check that this component belongs to this app-context
|
||||
AppContext compContext = appContext;
|
||||
if (compContext != null && !compContext.equals(AppContext.getAppContext())) {
|
||||
if (eventLog.isLoggable(Level.FINE)) {
|
||||
eventLog.log(Level.FINE, "Event " + e + " is being dispatched on the wrong AppContext");
|
||||
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||
eventLog.fine("Event " + e + " is being dispatched on the wrong AppContext");
|
||||
}
|
||||
}
|
||||
|
||||
if (eventLog.isLoggable(Level.FINEST)) {
|
||||
eventLog.log(Level.FINEST, "{0}", e);
|
||||
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
eventLog.finest("{0}", e);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -4512,8 +4519,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((e instanceof FocusEvent) && focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "" + e);
|
||||
if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("" + e);
|
||||
}
|
||||
// MouseWheel may need to be retargeted here so that
|
||||
// AWTEventListener sees the event go to the correct
|
||||
@ -4570,8 +4577,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
if (inputContext != null) {
|
||||
inputContext.dispatchEvent(e);
|
||||
if (e.isConsumed()) {
|
||||
if ((e instanceof FocusEvent) && focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "3579: Skipping " + e);
|
||||
if ((e instanceof FocusEvent) && focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("3579: Skipping " + e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -4605,8 +4612,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
if (p != null) {
|
||||
p.preProcessKeyEvent((KeyEvent)e);
|
||||
if (e.isConsumed()) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "Pre-process consumed event");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("Pre-process consumed event");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -4738,9 +4745,9 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
// position relative to its parent.
|
||||
MouseWheelEvent newMWE;
|
||||
|
||||
if (eventLog.isLoggable(Level.FINEST)) {
|
||||
eventLog.log(Level.FINEST, "dispatchMouseWheelToAncestor");
|
||||
eventLog.log(Level.FINEST, "orig event src is of " + e.getSource().getClass());
|
||||
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
eventLog.finest("dispatchMouseWheelToAncestor");
|
||||
eventLog.finest("orig event src is of " + e.getSource().getClass());
|
||||
}
|
||||
|
||||
/* parent field for Window refers to the owning Window.
|
||||
@ -4761,8 +4768,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
}
|
||||
}
|
||||
|
||||
if (eventLog.isLoggable(Level.FINEST)) {
|
||||
eventLog.log(Level.FINEST, "new event src is " + anc.getClass());
|
||||
if (eventLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
eventLog.finest("new event src is " + anc.getClass());
|
||||
}
|
||||
|
||||
if (anc != null && anc.eventEnabled(e)) {
|
||||
@ -5257,11 +5264,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
// Should only be called while holding the tree lock
|
||||
int numListening(long mask) {
|
||||
// One mask or the other, but not neither or both.
|
||||
if (eventLog.isLoggable(Level.FINE)) {
|
||||
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||
if ((mask != AWTEvent.HIERARCHY_EVENT_MASK) &&
|
||||
(mask != AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK))
|
||||
{
|
||||
eventLog.log(Level.FINE, "Assertion failed");
|
||||
eventLog.fine("Assertion failed");
|
||||
}
|
||||
}
|
||||
if ((mask == AWTEvent.HIERARCHY_EVENT_MASK &&
|
||||
@ -5298,9 +5305,9 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
break;
|
||||
case HierarchyEvent.ANCESTOR_MOVED:
|
||||
case HierarchyEvent.ANCESTOR_RESIZED:
|
||||
if (eventLog.isLoggable(Level.FINE)) {
|
||||
if (eventLog.isLoggable(PlatformLogger.FINE)) {
|
||||
if (changeFlags != 0) {
|
||||
eventLog.log(Level.FINE, "Assertion (changeFlags == 0) failed");
|
||||
eventLog.fine("Assertion (changeFlags == 0) failed");
|
||||
}
|
||||
}
|
||||
if (hierarchyBoundsListener != null ||
|
||||
@ -5314,8 +5321,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
break;
|
||||
default:
|
||||
// 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");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -7376,8 +7383,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
CausedFocusEvent.Cause cause)
|
||||
{
|
||||
if (!isRequestFocusAccepted(temporary, focusedWindowChangeAllowed, cause)) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "requestFocus is not accepted");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("requestFocus is not accepted");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -7388,8 +7395,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
Component window = this;
|
||||
while ( (window != null) && !(window instanceof Window)) {
|
||||
if (!window.isVisible()) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "component is recurively invisible");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("component is recurively invisible");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -7400,15 +7407,15 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
Component heavyweight = (peer instanceof LightweightPeer)
|
||||
? getNativeContainer() : this;
|
||||
if (heavyweight == null || !heavyweight.isVisible()) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "Component is not a part of visible hierarchy");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("Component is not a part of visible hierarchy");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
peer = heavyweight.peer;
|
||||
if (peer == null) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "Peer is null");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("Peer is null");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -7420,12 +7427,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
if (!success) {
|
||||
KeyboardFocusManager.getCurrentKeyboardFocusManager
|
||||
(appContext).dequeueKeyEvents(time, this);
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "Peer request failed");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("Peer request failed");
|
||||
}
|
||||
} else {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "Pass for " + this);
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("Pass for " + this);
|
||||
}
|
||||
}
|
||||
return success;
|
||||
@ -7436,24 +7443,24 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
CausedFocusEvent.Cause cause)
|
||||
{
|
||||
if (!isFocusable() || !isVisible()) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "Not focusable or not visible");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("Not focusable or not visible");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ComponentPeer peer = this.peer;
|
||||
if (peer == null) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "peer is null");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("peer is null");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Window window = getContainingWindow();
|
||||
if (window == null || !((Window)window).isFocusableWindow()) {
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "Component doesn't have toplevel");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("Component doesn't have toplevel");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -7474,8 +7481,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
// Controller is supposed to verify focus transfers and for this it
|
||||
// should know both from and to components. And it shouldn't verify
|
||||
// transfers from when these components are equal.
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "focus owner is null or this");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("focus owner is null or this");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -7487,8 +7494,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
// most recent focus owner. But most recent focus owner can be
|
||||
// changed by requestFocsuXXX() call only, so this transfer has
|
||||
// been already approved.
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "cause is activation");
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("cause is activation");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -7498,8 +7505,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
temporary,
|
||||
focusedWindowChangeAllowed,
|
||||
cause);
|
||||
if (focusLog.isLoggable(Level.FINEST)) {
|
||||
focusLog.log(Level.FINEST, "RequestFocusController returns {0}", ret);
|
||||
if (focusLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
focusLog.finest("RequestFocusController returns {0}", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -7590,7 +7597,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
}
|
||||
|
||||
boolean transferFocus(boolean clearOnFailure) {
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("clearOnFailure = " + clearOnFailure);
|
||||
}
|
||||
Component toFocus = getNextFocusCandidate();
|
||||
@ -7599,12 +7606,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_FORWARD);
|
||||
}
|
||||
if (clearOnFailure && !res) {
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("clear global focus owner");
|
||||
}
|
||||
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
|
||||
}
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("returning result: " + res);
|
||||
}
|
||||
return res;
|
||||
@ -7619,19 +7626,19 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
comp = rootAncestor;
|
||||
rootAncestor = comp.getFocusCycleRootAncestor();
|
||||
}
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
|
||||
}
|
||||
Component candidate = null;
|
||||
if (rootAncestor != null) {
|
||||
FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
|
||||
Component toFocus = policy.getComponentAfter(rootAncestor, comp);
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("component after is " + toFocus);
|
||||
}
|
||||
if (toFocus == null) {
|
||||
toFocus = policy.getDefaultComponent(rootAncestor);
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("default component is " + toFocus);
|
||||
}
|
||||
}
|
||||
@ -7643,7 +7650,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
}
|
||||
candidate = toFocus;
|
||||
}
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("Focus transfer candidate: " + candidate);
|
||||
}
|
||||
return candidate;
|
||||
@ -7680,12 +7687,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
}
|
||||
}
|
||||
if (!res) {
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("clear global focus owner");
|
||||
}
|
||||
KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
|
||||
}
|
||||
if (focusLog.isLoggable(Level.FINER)) {
|
||||
if (focusLog.isLoggable(PlatformLogger.FINER)) {
|
||||
focusLog.finer("returning result: " + res);
|
||||
}
|
||||
return res;
|
||||
@ -9441,7 +9448,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
checkTreeLock();
|
||||
|
||||
if (!areBoundsValid()) {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
||||
}
|
||||
return;
|
||||
@ -9477,7 +9484,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
}
|
||||
this.compoundShape = shape;
|
||||
Point compAbsolute = getLocationOnWindow();
|
||||
if (mixingLog.isLoggable(Level.FINER)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINER)) {
|
||||
mixingLog.fine("this = " + this +
|
||||
"; compAbsolute=" + compAbsolute + "; shape=" + shape);
|
||||
}
|
||||
@ -9611,7 +9618,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
checkTreeLock();
|
||||
Region s = getNormalShape();
|
||||
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this + "; normalShape=" + s);
|
||||
}
|
||||
|
||||
@ -9645,7 +9652,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
}
|
||||
}
|
||||
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("currentShape=" + s);
|
||||
}
|
||||
|
||||
@ -9655,12 +9662,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
void applyCurrentShape() {
|
||||
checkTreeLock();
|
||||
if (!areBoundsValid()) {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
||||
}
|
||||
return; // Because applyCompoundShape() ignores such components anyway
|
||||
}
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this);
|
||||
}
|
||||
applyCompoundShape(calculateCurrentShape());
|
||||
@ -9669,7 +9676,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
final void subtractAndApplyShape(Region s) {
|
||||
checkTreeLock();
|
||||
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this + "; s=" + s);
|
||||
}
|
||||
|
||||
@ -9716,7 +9723,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
|
||||
void mixOnShowing() {
|
||||
synchronized (getTreeLock()) {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this);
|
||||
}
|
||||
if (!isMixingNeeded()) {
|
||||
@ -9734,7 +9741,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
// We cannot be sure that the peer exists at this point, so we need the argument
|
||||
// to find out whether the hiding component is (well, actually was) a LW or a HW.
|
||||
synchronized (getTreeLock()) {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this + "; isLightweight = " + isLightweight);
|
||||
}
|
||||
if (!isMixingNeeded()) {
|
||||
@ -9748,7 +9755,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
|
||||
void mixOnReshaping() {
|
||||
synchronized (getTreeLock()) {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this);
|
||||
}
|
||||
if (!isMixingNeeded()) {
|
||||
@ -9767,7 +9774,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
boolean becameHigher = newZorder < oldZorder;
|
||||
Container parent = getContainer();
|
||||
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this +
|
||||
"; oldZorder=" + oldZorder + "; newZorder=" + newZorder + "; parent=" + parent);
|
||||
}
|
||||
@ -9811,13 +9818,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
|
||||
final boolean isMixingNeeded() {
|
||||
if (SunToolkit.getSunAwtDisableMixing()) {
|
||||
if (mixingLog.isLoggable(Level.FINEST)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINEST)) {
|
||||
mixingLog.finest("this = " + this + "; Mixing disabled via sun.awt.disableMixing");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!areBoundsValid()) {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this + "; areBoundsValid = " + areBoundsValid());
|
||||
}
|
||||
return false;
|
||||
@ -9825,7 +9832,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
Window window = getContainingWindow();
|
||||
if (window != null) {
|
||||
if (!window.hasHeavyweightDescendants() || !window.hasLightweightDescendants()) {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("containing window = " + window +
|
||||
"; has h/w descendants = " + window.hasHeavyweightDescendants() +
|
||||
"; has l/w descendants = " + window.hasLightweightDescendants());
|
||||
@ -9833,8 +9840,8 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (mixingLog.isLoggable(Level.FINE)) {
|
||||
mixingLog.finest("this = " + this + "; containing window is null");
|
||||
if (mixingLog.isLoggable(PlatformLogger.FINE)) {
|
||||
mixingLog.fine("this = " + this + "; containing window is null");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -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,34 +78,52 @@ 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));
|
||||
|
||||
try {
|
||||
// long t0 = System.currentTimeMillis();
|
||||
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);
|
||||
}
|
||||
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 {
|
||||
// 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();
|
||||
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 ge;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether or not a display, keyboard, and mouse can be
|
||||
* supported in this environment. If this method returns true,
|
||||
@ -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(PlatformLogger.FINER)) {
|
||||
focusLog.finer("SNFH for {0} in {1}",
|
||||
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.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;
|
||||
|
48
jdk/src/share/classes/sun/font/FontAccess.java
Normal file
48
jdk/src/share/classes/sun/font/FontAccess.java
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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);
|
||||
|
File diff suppressed because it is too large
Load Diff
106
jdk/src/share/classes/sun/font/FontManagerFactory.java
Normal file
106
jdk/src/share/classes/sun/font/FontManagerFactory.java
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
}
|
57
jdk/src/share/classes/sun/font/FontManagerForSGE.java
Normal file
57
jdk/src/share/classes/sun/font/FontManagerForSGE.java
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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
|
||||
|
485
jdk/src/share/classes/sun/font/FontUtilities.java
Normal file
485
jdk/src/share/classes/sun/font/FontUtilities.java
Normal file
@ -0,0 +1,485 @@
|
||||
/*
|
||||
* 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;
|
||||
|
@ -197,7 +197,7 @@ public class StandardGlyphVector extends GlyphVector {
|
||||
|
||||
// how do we know its a base glyph
|
||||
// for now, it is if the natural advance of the glyph is non-zero
|
||||
Font2D f2d = FontManager.getFont2D(font);
|
||||
Font2D f2d = FontUtilities.getFont2D(font);
|
||||
FontStrike strike = f2d.getStrike(font, frc);
|
||||
|
||||
float[] deltas = { trackPt.x, trackPt.y };
|
||||
@ -1116,7 +1116,7 @@ public class StandardGlyphVector extends GlyphVector {
|
||||
}
|
||||
|
||||
private void initFontData() {
|
||||
font2D = FontManager.getFont2D(font);
|
||||
font2D = FontUtilities.getFont2D(font);
|
||||
float s = font.getSize2D();
|
||||
if (font.isTransformed()) {
|
||||
ftx = font.getTransform();
|
||||
|
@ -237,7 +237,7 @@ public final class StrikeCache {
|
||||
* any glyphs. In this case we still want to free the scaler
|
||||
* context.
|
||||
*/
|
||||
if (FontManager.longAddresses) {
|
||||
if (longAddresses()) {
|
||||
freeLongMemory(new long[0], disposer.pScalerContext);
|
||||
} else {
|
||||
freeIntMemory(new int[0], disposer.pScalerContext);
|
||||
@ -245,6 +245,10 @@ public final class StrikeCache {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean longAddresses() {
|
||||
return nativeAddressSize == 8;
|
||||
}
|
||||
|
||||
static void disposeStrike(final FontStrikeDisposer disposer) {
|
||||
// we need to execute the strike disposal on the rendering thread
|
||||
// because they may be accessed on that thread at the time of the
|
||||
|
3674
jdk/src/share/classes/sun/font/SunFontManager.java
Normal file
3674
jdk/src/share/classes/sun/font/SunFontManager.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -39,9 +39,10 @@ import java.nio.IntBuffer;
|
||||
import java.nio.ShortBuffer;
|
||||
import java.nio.channels.ClosedChannelException;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Locale;
|
||||
import java.util.logging.Level;
|
||||
import sun.java2d.Disposer;
|
||||
import sun.java2d.DisposerRecord;
|
||||
|
||||
@ -101,6 +102,9 @@ public class TrueTypeFont extends FileFont {
|
||||
public static final int FULL_NAME_ID = 4;
|
||||
public static final int POSTSCRIPT_NAME_ID = 6;
|
||||
|
||||
private static final short US_LCID = 0x0409; // US English - default
|
||||
|
||||
private static Map<String, Short> lcidMap;
|
||||
|
||||
class DirectoryEntry {
|
||||
int tag;
|
||||
@ -176,7 +180,7 @@ public class TrueTypeFont extends FileFont {
|
||||
* @throws FontFormatException - if the font can't be opened
|
||||
* or fails verification, or there's no usable cmap
|
||||
*/
|
||||
TrueTypeFont(String platname, Object nativeNames, int fIndex,
|
||||
public TrueTypeFont(String platname, Object nativeNames, int fIndex,
|
||||
boolean javaRasterizer)
|
||||
throws FontFormatException {
|
||||
super(platname, nativeNames);
|
||||
@ -207,12 +211,13 @@ public class TrueTypeFont extends FileFont {
|
||||
* as PCF bitmap fonts on the X11 font path).
|
||||
* This method is called when creating the first strike for this font.
|
||||
*/
|
||||
@Override
|
||||
protected boolean checkUseNatives() {
|
||||
if (checkedNatives) {
|
||||
return useNatives;
|
||||
}
|
||||
if (!FontManager.isSolaris || useJavaRasterizer ||
|
||||
FontManager.useT2K || nativeNames == null ||
|
||||
if (!FontUtilities.isSolaris || useJavaRasterizer ||
|
||||
FontUtilities.useT2K || nativeNames == null ||
|
||||
getDirectoryEntry(EBLCTag) != null ||
|
||||
GraphicsEnvironment.isHeadless()) {
|
||||
checkedNatives = true;
|
||||
@ -279,8 +284,8 @@ public class TrueTypeFont extends FileFont {
|
||||
*/
|
||||
private synchronized FileChannel open() throws FontFormatException {
|
||||
if (disposerRecord.channel == null) {
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.info("open TTF: " + platName);
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().info("open TTF: " + platName);
|
||||
}
|
||||
try {
|
||||
RandomAccessFile raf = (RandomAccessFile)
|
||||
@ -296,7 +301,10 @@ public class TrueTypeFont extends FileFont {
|
||||
});
|
||||
disposerRecord.channel = raf.getChannel();
|
||||
fileSize = (int)disposerRecord.channel.size();
|
||||
FontManager.addToPool(this);
|
||||
FontManager fm = FontManagerFactory.getInstance();
|
||||
if (fm instanceof SunFontManager) {
|
||||
((SunFontManager) fm).addToPool(this);
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
close();
|
||||
throw new FontFormatException(e.toString());
|
||||
@ -340,11 +348,11 @@ public class TrueTypeFont extends FileFont {
|
||||
* isn't updated. If the file has changed whilst we
|
||||
* are executing we want to bail, not spin.
|
||||
*/
|
||||
if (FontManager.logging) {
|
||||
if (FontUtilities.isLogging()) {
|
||||
String msg = "Read offset is " + offset +
|
||||
" file size is " + fileSize+
|
||||
" file is " + platName;
|
||||
FontManager.logger.severe(msg);
|
||||
FontUtilities.getLogger().severe(msg);
|
||||
}
|
||||
return -1;
|
||||
} else {
|
||||
@ -362,8 +370,8 @@ public class TrueTypeFont extends FileFont {
|
||||
msg += " File size was " + fileSize +
|
||||
" and now is " + currSize;
|
||||
}
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.severe(msg);
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().severe(msg);
|
||||
}
|
||||
// We could still flip() the buffer here because
|
||||
// it's possible that we did read some data in
|
||||
@ -377,10 +385,10 @@ public class TrueTypeFont extends FileFont {
|
||||
// data was read to probably continue.
|
||||
if (bread > length/2 || bread > 16384) {
|
||||
buffer.flip();
|
||||
if (FontManager.logging) {
|
||||
if (FontUtilities.isLogging()) {
|
||||
msg = "Returning " + bread +
|
||||
" bytes instead of " + length;
|
||||
FontManager.logger.severe(msg);
|
||||
FontUtilities.getLogger().severe(msg);
|
||||
}
|
||||
} else {
|
||||
bread = -1;
|
||||
@ -395,8 +403,8 @@ public class TrueTypeFont extends FileFont {
|
||||
}
|
||||
}
|
||||
} catch (FontFormatException e) {
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.log(Level.SEVERE,
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().severe(
|
||||
"While reading " + platName, e);
|
||||
}
|
||||
bread = -1; // signal EOF
|
||||
@ -416,8 +424,8 @@ public class TrueTypeFont extends FileFont {
|
||||
* seems unlikely this would occur as problems opening the
|
||||
* file are handled as a FontFormatException.
|
||||
*/
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.log(Level.SEVERE,
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().severe(
|
||||
"While reading " + platName, e);
|
||||
}
|
||||
if (bread == 0) {
|
||||
@ -540,8 +548,8 @@ public class TrueTypeFont extends FileFont {
|
||||
}
|
||||
initNames();
|
||||
} catch (Exception e) {
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.severe(e.toString());
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().severe(e.toString());
|
||||
}
|
||||
if (e instanceof FontFormatException) {
|
||||
throw (FontFormatException)e;
|
||||
@ -687,7 +695,7 @@ public class TrueTypeFont extends FileFont {
|
||||
return defaultCodePage;
|
||||
}
|
||||
|
||||
if (FontManager.isWindows) {
|
||||
if (FontUtilities.isWindows) {
|
||||
defaultCodePage =
|
||||
(String)java.security.AccessController.doPrivileged(
|
||||
new sun.security.action.GetPropertyAction("file.encoding"));
|
||||
@ -724,6 +732,7 @@ public class TrueTypeFont extends FileFont {
|
||||
/* Theoretically, reserved bits must not be set, include symbol bits */
|
||||
public static final int reserved_bits1 = 0x80000000;
|
||||
public static final int reserved_bits2 = 0x0000ffff;
|
||||
@Override
|
||||
boolean supportsEncoding(String encoding) {
|
||||
if (encoding == null) {
|
||||
encoding = getCodePage();
|
||||
@ -858,6 +867,7 @@ public class TrueTypeFont extends FileFont {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
byte[] getTableBytes(int tag) {
|
||||
ByteBuffer buffer = getTableBuffer(tag);
|
||||
if (buffer == null) {
|
||||
@ -932,6 +942,7 @@ public class TrueTypeFont extends FileFont {
|
||||
/* This probably won't get called but is there to support the
|
||||
* contract() of setStyle() defined in the superclass.
|
||||
*/
|
||||
@Override
|
||||
protected void setStyle() {
|
||||
setStyle(getTableBuffer(os_2Tag));
|
||||
}
|
||||
@ -977,7 +988,7 @@ public class TrueTypeFont extends FileFont {
|
||||
style = Font.ITALIC;
|
||||
break;
|
||||
case fsSelectionBoldBit:
|
||||
if (FontManager.isSolaris && platName.endsWith("HG-GothicB.ttf")) {
|
||||
if (FontUtilities.isSolaris && platName.endsWith("HG-GothicB.ttf")) {
|
||||
/* Workaround for Solaris's use of a JA font that's marked as
|
||||
* being designed bold, but is used as a PLAIN font.
|
||||
*/
|
||||
@ -1015,6 +1026,7 @@ public class TrueTypeFont extends FileFont {
|
||||
ulPos = -sb.get(4) / (float)upem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getStyleMetrics(float pointSize, float[] metrics, int offset) {
|
||||
|
||||
if (ulSize == 0f && ulPos == 0f) {
|
||||
@ -1075,8 +1087,8 @@ public class TrueTypeFont extends FileFont {
|
||||
try {
|
||||
return new String(bytes, 0, len, charset);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.warning(e + " EncodingID=" + encoding);
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().warning(e + " EncodingID=" + encoding);
|
||||
}
|
||||
return new String(bytes, 0, len);
|
||||
} catch (Throwable t) {
|
||||
@ -1101,7 +1113,7 @@ public class TrueTypeFont extends FileFont {
|
||||
int stringPtr = sbuffer.get() & 0xffff;
|
||||
|
||||
nameLocale = sun.awt.SunToolkit.getStartupLocale();
|
||||
short nameLocaleID = FontManager.getLCIDFromLocale(nameLocale);
|
||||
short nameLocaleID = getLCIDFromLocale(nameLocale);
|
||||
|
||||
for (int i=0; i<numRecords; i++) {
|
||||
short platformID = sbuffer.get();
|
||||
@ -1232,7 +1244,7 @@ public class TrueTypeFont extends FileFont {
|
||||
|
||||
protected synchronized FontScaler getScaler() {
|
||||
if (scaler == null) {
|
||||
scaler = FontManager.getScaler(this, fontIndex,
|
||||
scaler = FontScaler.getScaler(this, fontIndex,
|
||||
supportsCJK, fileSize);
|
||||
}
|
||||
return scaler;
|
||||
@ -1242,6 +1254,7 @@ public class TrueTypeFont extends FileFont {
|
||||
/* Postscript name is rarely requested. Don't waste cycles locating it
|
||||
* as part of font creation, nor storage to hold it. Get it only on demand.
|
||||
*/
|
||||
@Override
|
||||
public String getPostscriptName() {
|
||||
String name = lookupName(ENGLISH_LOCALE_ID, POSTSCRIPT_NAME_ID);
|
||||
if (name == null) {
|
||||
@ -1251,13 +1264,14 @@ public class TrueTypeFont extends FileFont {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFontName(Locale locale) {
|
||||
if (locale == null) {
|
||||
return fullName;
|
||||
} else if (locale.equals(nameLocale) && localeFullName != null) {
|
||||
return localeFullName;
|
||||
} else {
|
||||
short localeID = FontManager.getLCIDFromLocale(locale);
|
||||
short localeID = getLCIDFromLocale(locale);
|
||||
String name = lookupName(localeID, FULL_NAME_ID);
|
||||
if (name == null) {
|
||||
return fullName;
|
||||
@ -1267,16 +1281,239 @@ public class TrueTypeFont extends FileFont {
|
||||
}
|
||||
}
|
||||
|
||||
// Return a Microsoft LCID from the given Locale.
|
||||
// Used when getting localized font data.
|
||||
|
||||
private static void addLCIDMapEntry(Map<String, Short> map,
|
||||
String key, short value) {
|
||||
map.put(key, Short.valueOf(value));
|
||||
}
|
||||
|
||||
private static synchronized void createLCIDMap() {
|
||||
if (lcidMap != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<String, Short> map = new HashMap<String, Short>(200);
|
||||
|
||||
// the following statements are derived from the langIDMap
|
||||
// in src/windows/native/java/lang/java_props_md.c using the following
|
||||
// awk script:
|
||||
// $1~/\/\*/ { next}
|
||||
// $3~/\?\?/ { next }
|
||||
// $3!~/_/ { next }
|
||||
// $1~/0x0409/ { next }
|
||||
// $1~/0x0c0a/ { next }
|
||||
// $1~/0x042c/ { next }
|
||||
// $1~/0x0443/ { next }
|
||||
// $1~/0x0812/ { next }
|
||||
// $1~/0x04/ { print " addLCIDMapEntry(map, " substr($3, 0, 3) "\", (short) " substr($1, 0, 6) ");" ; next }
|
||||
// $3~/,/ { print " addLCIDMapEntry(map, " $3 " (short) " substr($1, 0, 6) ");" ; next }
|
||||
// { print " addLCIDMapEntry(map, " $3 ", (short) " substr($1, 0, 6) ");" ; next }
|
||||
// The lines of this script:
|
||||
// - eliminate comments
|
||||
// - eliminate questionable locales
|
||||
// - eliminate language-only locales
|
||||
// - eliminate the default LCID value
|
||||
// - eliminate a few other unneeded LCID values
|
||||
// - print language-only locale entries for x04* LCID values
|
||||
// (apparently Microsoft doesn't use language-only LCID values -
|
||||
// see http://www.microsoft.com/OpenType/otspec/name.htm
|
||||
// - print complete entries for all other LCID values
|
||||
// Run
|
||||
// awk -f awk-script langIDMap > statements
|
||||
addLCIDMapEntry(map, "ar", (short) 0x0401);
|
||||
addLCIDMapEntry(map, "bg", (short) 0x0402);
|
||||
addLCIDMapEntry(map, "ca", (short) 0x0403);
|
||||
addLCIDMapEntry(map, "zh", (short) 0x0404);
|
||||
addLCIDMapEntry(map, "cs", (short) 0x0405);
|
||||
addLCIDMapEntry(map, "da", (short) 0x0406);
|
||||
addLCIDMapEntry(map, "de", (short) 0x0407);
|
||||
addLCIDMapEntry(map, "el", (short) 0x0408);
|
||||
addLCIDMapEntry(map, "es", (short) 0x040a);
|
||||
addLCIDMapEntry(map, "fi", (short) 0x040b);
|
||||
addLCIDMapEntry(map, "fr", (short) 0x040c);
|
||||
addLCIDMapEntry(map, "iw", (short) 0x040d);
|
||||
addLCIDMapEntry(map, "hu", (short) 0x040e);
|
||||
addLCIDMapEntry(map, "is", (short) 0x040f);
|
||||
addLCIDMapEntry(map, "it", (short) 0x0410);
|
||||
addLCIDMapEntry(map, "ja", (short) 0x0411);
|
||||
addLCIDMapEntry(map, "ko", (short) 0x0412);
|
||||
addLCIDMapEntry(map, "nl", (short) 0x0413);
|
||||
addLCIDMapEntry(map, "no", (short) 0x0414);
|
||||
addLCIDMapEntry(map, "pl", (short) 0x0415);
|
||||
addLCIDMapEntry(map, "pt", (short) 0x0416);
|
||||
addLCIDMapEntry(map, "rm", (short) 0x0417);
|
||||
addLCIDMapEntry(map, "ro", (short) 0x0418);
|
||||
addLCIDMapEntry(map, "ru", (short) 0x0419);
|
||||
addLCIDMapEntry(map, "hr", (short) 0x041a);
|
||||
addLCIDMapEntry(map, "sk", (short) 0x041b);
|
||||
addLCIDMapEntry(map, "sq", (short) 0x041c);
|
||||
addLCIDMapEntry(map, "sv", (short) 0x041d);
|
||||
addLCIDMapEntry(map, "th", (short) 0x041e);
|
||||
addLCIDMapEntry(map, "tr", (short) 0x041f);
|
||||
addLCIDMapEntry(map, "ur", (short) 0x0420);
|
||||
addLCIDMapEntry(map, "in", (short) 0x0421);
|
||||
addLCIDMapEntry(map, "uk", (short) 0x0422);
|
||||
addLCIDMapEntry(map, "be", (short) 0x0423);
|
||||
addLCIDMapEntry(map, "sl", (short) 0x0424);
|
||||
addLCIDMapEntry(map, "et", (short) 0x0425);
|
||||
addLCIDMapEntry(map, "lv", (short) 0x0426);
|
||||
addLCIDMapEntry(map, "lt", (short) 0x0427);
|
||||
addLCIDMapEntry(map, "fa", (short) 0x0429);
|
||||
addLCIDMapEntry(map, "vi", (short) 0x042a);
|
||||
addLCIDMapEntry(map, "hy", (short) 0x042b);
|
||||
addLCIDMapEntry(map, "eu", (short) 0x042d);
|
||||
addLCIDMapEntry(map, "mk", (short) 0x042f);
|
||||
addLCIDMapEntry(map, "tn", (short) 0x0432);
|
||||
addLCIDMapEntry(map, "xh", (short) 0x0434);
|
||||
addLCIDMapEntry(map, "zu", (short) 0x0435);
|
||||
addLCIDMapEntry(map, "af", (short) 0x0436);
|
||||
addLCIDMapEntry(map, "ka", (short) 0x0437);
|
||||
addLCIDMapEntry(map, "fo", (short) 0x0438);
|
||||
addLCIDMapEntry(map, "hi", (short) 0x0439);
|
||||
addLCIDMapEntry(map, "mt", (short) 0x043a);
|
||||
addLCIDMapEntry(map, "se", (short) 0x043b);
|
||||
addLCIDMapEntry(map, "gd", (short) 0x043c);
|
||||
addLCIDMapEntry(map, "ms", (short) 0x043e);
|
||||
addLCIDMapEntry(map, "kk", (short) 0x043f);
|
||||
addLCIDMapEntry(map, "ky", (short) 0x0440);
|
||||
addLCIDMapEntry(map, "sw", (short) 0x0441);
|
||||
addLCIDMapEntry(map, "tt", (short) 0x0444);
|
||||
addLCIDMapEntry(map, "bn", (short) 0x0445);
|
||||
addLCIDMapEntry(map, "pa", (short) 0x0446);
|
||||
addLCIDMapEntry(map, "gu", (short) 0x0447);
|
||||
addLCIDMapEntry(map, "ta", (short) 0x0449);
|
||||
addLCIDMapEntry(map, "te", (short) 0x044a);
|
||||
addLCIDMapEntry(map, "kn", (short) 0x044b);
|
||||
addLCIDMapEntry(map, "ml", (short) 0x044c);
|
||||
addLCIDMapEntry(map, "mr", (short) 0x044e);
|
||||
addLCIDMapEntry(map, "sa", (short) 0x044f);
|
||||
addLCIDMapEntry(map, "mn", (short) 0x0450);
|
||||
addLCIDMapEntry(map, "cy", (short) 0x0452);
|
||||
addLCIDMapEntry(map, "gl", (short) 0x0456);
|
||||
addLCIDMapEntry(map, "dv", (short) 0x0465);
|
||||
addLCIDMapEntry(map, "qu", (short) 0x046b);
|
||||
addLCIDMapEntry(map, "mi", (short) 0x0481);
|
||||
addLCIDMapEntry(map, "ar_IQ", (short) 0x0801);
|
||||
addLCIDMapEntry(map, "zh_CN", (short) 0x0804);
|
||||
addLCIDMapEntry(map, "de_CH", (short) 0x0807);
|
||||
addLCIDMapEntry(map, "en_GB", (short) 0x0809);
|
||||
addLCIDMapEntry(map, "es_MX", (short) 0x080a);
|
||||
addLCIDMapEntry(map, "fr_BE", (short) 0x080c);
|
||||
addLCIDMapEntry(map, "it_CH", (short) 0x0810);
|
||||
addLCIDMapEntry(map, "nl_BE", (short) 0x0813);
|
||||
addLCIDMapEntry(map, "no_NO_NY", (short) 0x0814);
|
||||
addLCIDMapEntry(map, "pt_PT", (short) 0x0816);
|
||||
addLCIDMapEntry(map, "ro_MD", (short) 0x0818);
|
||||
addLCIDMapEntry(map, "ru_MD", (short) 0x0819);
|
||||
addLCIDMapEntry(map, "sr_CS", (short) 0x081a);
|
||||
addLCIDMapEntry(map, "sv_FI", (short) 0x081d);
|
||||
addLCIDMapEntry(map, "az_AZ", (short) 0x082c);
|
||||
addLCIDMapEntry(map, "se_SE", (short) 0x083b);
|
||||
addLCIDMapEntry(map, "ga_IE", (short) 0x083c);
|
||||
addLCIDMapEntry(map, "ms_BN", (short) 0x083e);
|
||||
addLCIDMapEntry(map, "uz_UZ", (short) 0x0843);
|
||||
addLCIDMapEntry(map, "qu_EC", (short) 0x086b);
|
||||
addLCIDMapEntry(map, "ar_EG", (short) 0x0c01);
|
||||
addLCIDMapEntry(map, "zh_HK", (short) 0x0c04);
|
||||
addLCIDMapEntry(map, "de_AT", (short) 0x0c07);
|
||||
addLCIDMapEntry(map, "en_AU", (short) 0x0c09);
|
||||
addLCIDMapEntry(map, "fr_CA", (short) 0x0c0c);
|
||||
addLCIDMapEntry(map, "sr_CS", (short) 0x0c1a);
|
||||
addLCIDMapEntry(map, "se_FI", (short) 0x0c3b);
|
||||
addLCIDMapEntry(map, "qu_PE", (short) 0x0c6b);
|
||||
addLCIDMapEntry(map, "ar_LY", (short) 0x1001);
|
||||
addLCIDMapEntry(map, "zh_SG", (short) 0x1004);
|
||||
addLCIDMapEntry(map, "de_LU", (short) 0x1007);
|
||||
addLCIDMapEntry(map, "en_CA", (short) 0x1009);
|
||||
addLCIDMapEntry(map, "es_GT", (short) 0x100a);
|
||||
addLCIDMapEntry(map, "fr_CH", (short) 0x100c);
|
||||
addLCIDMapEntry(map, "hr_BA", (short) 0x101a);
|
||||
addLCIDMapEntry(map, "ar_DZ", (short) 0x1401);
|
||||
addLCIDMapEntry(map, "zh_MO", (short) 0x1404);
|
||||
addLCIDMapEntry(map, "de_LI", (short) 0x1407);
|
||||
addLCIDMapEntry(map, "en_NZ", (short) 0x1409);
|
||||
addLCIDMapEntry(map, "es_CR", (short) 0x140a);
|
||||
addLCIDMapEntry(map, "fr_LU", (short) 0x140c);
|
||||
addLCIDMapEntry(map, "bs_BA", (short) 0x141a);
|
||||
addLCIDMapEntry(map, "ar_MA", (short) 0x1801);
|
||||
addLCIDMapEntry(map, "en_IE", (short) 0x1809);
|
||||
addLCIDMapEntry(map, "es_PA", (short) 0x180a);
|
||||
addLCIDMapEntry(map, "fr_MC", (short) 0x180c);
|
||||
addLCIDMapEntry(map, "sr_BA", (short) 0x181a);
|
||||
addLCIDMapEntry(map, "ar_TN", (short) 0x1c01);
|
||||
addLCIDMapEntry(map, "en_ZA", (short) 0x1c09);
|
||||
addLCIDMapEntry(map, "es_DO", (short) 0x1c0a);
|
||||
addLCIDMapEntry(map, "sr_BA", (short) 0x1c1a);
|
||||
addLCIDMapEntry(map, "ar_OM", (short) 0x2001);
|
||||
addLCIDMapEntry(map, "en_JM", (short) 0x2009);
|
||||
addLCIDMapEntry(map, "es_VE", (short) 0x200a);
|
||||
addLCIDMapEntry(map, "ar_YE", (short) 0x2401);
|
||||
addLCIDMapEntry(map, "es_CO", (short) 0x240a);
|
||||
addLCIDMapEntry(map, "ar_SY", (short) 0x2801);
|
||||
addLCIDMapEntry(map, "en_BZ", (short) 0x2809);
|
||||
addLCIDMapEntry(map, "es_PE", (short) 0x280a);
|
||||
addLCIDMapEntry(map, "ar_JO", (short) 0x2c01);
|
||||
addLCIDMapEntry(map, "en_TT", (short) 0x2c09);
|
||||
addLCIDMapEntry(map, "es_AR", (short) 0x2c0a);
|
||||
addLCIDMapEntry(map, "ar_LB", (short) 0x3001);
|
||||
addLCIDMapEntry(map, "en_ZW", (short) 0x3009);
|
||||
addLCIDMapEntry(map, "es_EC", (short) 0x300a);
|
||||
addLCIDMapEntry(map, "ar_KW", (short) 0x3401);
|
||||
addLCIDMapEntry(map, "en_PH", (short) 0x3409);
|
||||
addLCIDMapEntry(map, "es_CL", (short) 0x340a);
|
||||
addLCIDMapEntry(map, "ar_AE", (short) 0x3801);
|
||||
addLCIDMapEntry(map, "es_UY", (short) 0x380a);
|
||||
addLCIDMapEntry(map, "ar_BH", (short) 0x3c01);
|
||||
addLCIDMapEntry(map, "es_PY", (short) 0x3c0a);
|
||||
addLCIDMapEntry(map, "ar_QA", (short) 0x4001);
|
||||
addLCIDMapEntry(map, "es_BO", (short) 0x400a);
|
||||
addLCIDMapEntry(map, "es_SV", (short) 0x440a);
|
||||
addLCIDMapEntry(map, "es_HN", (short) 0x480a);
|
||||
addLCIDMapEntry(map, "es_NI", (short) 0x4c0a);
|
||||
addLCIDMapEntry(map, "es_PR", (short) 0x500a);
|
||||
|
||||
lcidMap = map;
|
||||
}
|
||||
|
||||
private static short getLCIDFromLocale(Locale locale) {
|
||||
// optimize for common case
|
||||
if (locale.equals(Locale.US)) {
|
||||
return US_LCID;
|
||||
}
|
||||
|
||||
if (lcidMap == null) {
|
||||
createLCIDMap();
|
||||
}
|
||||
|
||||
String key = locale.toString();
|
||||
while (!"".equals(key)) {
|
||||
Short lcidObject = (Short) lcidMap.get(key);
|
||||
if (lcidObject != null) {
|
||||
return lcidObject.shortValue();
|
||||
}
|
||||
int pos = key.lastIndexOf('_');
|
||||
if (pos < 1) {
|
||||
return US_LCID;
|
||||
}
|
||||
key = key.substring(0, pos);
|
||||
}
|
||||
|
||||
return US_LCID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFamilyName(Locale locale) {
|
||||
if (locale == null) {
|
||||
return familyName;
|
||||
} else if (locale.equals(nameLocale) && localeFamilyName != null) {
|
||||
return localeFamilyName;
|
||||
} else {
|
||||
short localeID = FontManager.getLCIDFromLocale(locale);
|
||||
short localeID = getLCIDFromLocale(locale);
|
||||
String name = lookupName(localeID, FAMILY_NAME_ID);
|
||||
if (name == null) {
|
||||
return familyName;
|
||||
return familyName;
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
@ -1353,6 +1590,7 @@ public class TrueTypeFont extends FileFont {
|
||||
|
||||
/* Used by the OpenType engine for mark positioning.
|
||||
*/
|
||||
@Override
|
||||
Point2D.Float getGlyphPoint(long pScalerContext,
|
||||
int glyphCode, int ptNumber) {
|
||||
try {
|
||||
@ -1414,6 +1652,7 @@ public class TrueTypeFont extends FileFont {
|
||||
* REMIND: consider unpacking the table into an array of booleans
|
||||
* for faster use.
|
||||
*/
|
||||
@Override
|
||||
public boolean useAAForPtSize(int ptsize) {
|
||||
|
||||
char[] gasp = getGaspTable();
|
||||
@ -1433,12 +1672,15 @@ public class TrueTypeFont extends FileFont {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSupplementaryChars() {
|
||||
return ((TrueTypeGlyphMapper)getMapper()).hasSupplementaryChars();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "** TrueType Font: Family="+familyName+ " Name="+fullName+
|
||||
" style="+style+" fileName="+platName;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,9 +60,9 @@ public class TrueTypeGlyphMapper extends CharToGlyphMapper {
|
||||
missingGlyph = 0; /* standard for TrueType fonts */
|
||||
ByteBuffer buffer = font.getTableBuffer(TrueTypeFont.maxpTag);
|
||||
numGlyphs = buffer.getChar(4); // offset 4 bytes in MAXP table.
|
||||
if (FontManager.isSolaris && isJAlocale && font.supportsJA()) {
|
||||
if (FontUtilities.isSolaris && isJAlocale && font.supportsJA()) {
|
||||
needsJAremapping = true;
|
||||
if (FontManager.isSolaris8 &&
|
||||
if (FontUtilities.isSolaris8 &&
|
||||
getGlyphFromCMAP(JA_WAVE_DASH_CHAR) == missingGlyph) {
|
||||
remapJAWaveDash = true;
|
||||
}
|
||||
@ -82,8 +82,8 @@ public class TrueTypeGlyphMapper extends CharToGlyphMapper {
|
||||
glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) {
|
||||
return glyphCode;
|
||||
} else {
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.warning
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().warning
|
||||
(font + " out of range glyph id=" +
|
||||
Integer.toHexString((int)glyphCode) +
|
||||
" for char " + Integer.toHexString(charCode));
|
||||
@ -97,11 +97,11 @@ public class TrueTypeGlyphMapper extends CharToGlyphMapper {
|
||||
}
|
||||
|
||||
private void handleBadCMAP() {
|
||||
if (FontManager.logging) {
|
||||
FontManager.logger.severe("Null Cmap for " + font +
|
||||
if (FontUtilities.isLogging()) {
|
||||
FontUtilities.getLogger().severe("Null Cmap for " + font +
|
||||
"substituting for this font");
|
||||
}
|
||||
FontManager.deRegisterBadFont(font);
|
||||
SunFontManager.getInstance().deRegisterBadFont(font);
|
||||
/* The next line is not really a solution, but might
|
||||
* reduce the exceptions until references to this font2D
|
||||
* are gone.
|
||||
@ -242,10 +242,10 @@ public class TrueTypeGlyphMapper extends CharToGlyphMapper {
|
||||
font.glyphToCharMap[glyphs[i]] = (char)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) {
|
||||
|
@ -635,7 +635,7 @@ public class Type1Font extends FileFont {
|
||||
|
||||
protected synchronized FontScaler getScaler() {
|
||||
if (scaler == null) {
|
||||
scaler = FontManager.getScaler(this, 0, false, fileSize);
|
||||
scaler = FontScaler.getScaler(this, 0, false, fileSize);
|
||||
}
|
||||
|
||||
return scaler;
|
||||
@ -652,7 +652,7 @@ public class Type1Font extends FileFont {
|
||||
try {
|
||||
return getScaler().getNumGlyphs();
|
||||
} catch (FontScalerException e) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
return getNumGlyphs();
|
||||
}
|
||||
}
|
||||
@ -661,7 +661,7 @@ public class Type1Font extends FileFont {
|
||||
try {
|
||||
return getScaler().getMissingGlyphCode();
|
||||
} catch (FontScalerException e) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
return getMissingGlyphCode();
|
||||
}
|
||||
}
|
||||
@ -670,7 +670,7 @@ public class Type1Font extends FileFont {
|
||||
try {
|
||||
return getScaler().getGlyphCode(charCode);
|
||||
} catch (FontScalerException e) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
return getGlyphCode(charCode);
|
||||
}
|
||||
}
|
||||
@ -679,5 +679,4 @@ public class Type1Font extends FileFont {
|
||||
return "** Type1 Font: Family="+familyName+ " Name="+fullName+
|
||||
" style="+style+" fileName="+platName;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public final class Type1GlyphMapper extends CharToGlyphMapper {
|
||||
try {
|
||||
missingGlyph = scaler.getMissingGlyphCode();
|
||||
} catch (FontScalerException fe) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
try {
|
||||
missingGlyph = scaler.getMissingGlyphCode();
|
||||
} catch (FontScalerException e) { //should not happen
|
||||
@ -59,7 +59,7 @@ public final class Type1GlyphMapper extends CharToGlyphMapper {
|
||||
try {
|
||||
return scaler.getNumGlyphs();
|
||||
} catch (FontScalerException e) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
return getNumGlyphs();
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,7 @@ public final class Type1GlyphMapper extends CharToGlyphMapper {
|
||||
try {
|
||||
return scaler.getGlyphCode(ch) != missingGlyph;
|
||||
} catch(FontScalerException e) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
return canDisplay(ch);
|
||||
}
|
||||
}
|
||||
@ -81,7 +81,7 @@ public final class Type1GlyphMapper extends CharToGlyphMapper {
|
||||
try {
|
||||
return scaler.getGlyphCode(ch);
|
||||
} catch (FontScalerException e) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
return charToGlyph(ch);
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,7 @@ public final class Type1GlyphMapper extends CharToGlyphMapper {
|
||||
try {
|
||||
return scaler.getGlyphCode((char)ch);
|
||||
} catch (FontScalerException e) {
|
||||
scaler = FontManager.getNullScaler();
|
||||
scaler = FontScaler.getNullScaler();
|
||||
return charToGlyph(ch);
|
||||
}
|
||||
}
|
||||
@ -160,10 +160,10 @@ public final class Type1GlyphMapper extends CharToGlyphMapper {
|
||||
|
||||
glyphs[i] = charToGlyph(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) {
|
||||
|
@ -66,6 +66,7 @@ import java.awt.Transparency;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.font.TextLayout;
|
||||
import sun.font.FontDesignMetrics;
|
||||
import sun.font.FontUtilities;
|
||||
import sun.java2d.pipe.PixelDrawPipe;
|
||||
import sun.java2d.pipe.PixelFillPipe;
|
||||
import sun.java2d.pipe.ShapeDrawPipe;
|
||||
@ -592,7 +593,7 @@ public final class SunGraphics2D
|
||||
}
|
||||
}
|
||||
|
||||
info.font2D = FontManager.getFont2D(font);
|
||||
info.font2D = FontUtilities.getFont2D(font);
|
||||
|
||||
int fmhint = fractionalMetricsHint;
|
||||
if (fmhint == SunHints.INTVAL_FRACTIONALMETRICS_DEFAULT) {
|
||||
@ -741,7 +742,8 @@ public final class SunGraphics2D
|
||||
font.isTransformed() ||
|
||||
fontInfo == null || // Precaution, if true shouldn't get here
|
||||
(fontInfo.aaHint == SunHints.INTVAL_TEXT_ANTIALIAS_ON) !=
|
||||
FontManager.getFont2D(font).useAAForPtSize(font.getSize()))) {
|
||||
FontUtilities.getFont2D(font).
|
||||
useAAForPtSize(font.getSize()))) {
|
||||
textpipe = invalidpipe;
|
||||
}
|
||||
this.font = font;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -171,9 +171,9 @@ public class PiscesRenderingEngine extends RenderingEngine {
|
||||
float lw;
|
||||
if (thin) {
|
||||
if (antialias) {
|
||||
lw = 0.5f;
|
||||
lw = userSpaceLineWidth(at, 0.5f);
|
||||
} else {
|
||||
lw = 1.0f;
|
||||
lw = userSpaceLineWidth(at, 1.0f);
|
||||
}
|
||||
} else {
|
||||
lw = bs.getLineWidth();
|
||||
@ -189,6 +189,72 @@ public class PiscesRenderingEngine extends RenderingEngine {
|
||||
lsink);
|
||||
}
|
||||
|
||||
private float userSpaceLineWidth(AffineTransform at, float lw) {
|
||||
|
||||
double widthScale;
|
||||
|
||||
if ((at.getType() & (AffineTransform.TYPE_GENERAL_TRANSFORM |
|
||||
AffineTransform.TYPE_GENERAL_SCALE)) != 0) {
|
||||
widthScale = Math.sqrt(at.getDeterminant());
|
||||
} else {
|
||||
/* First calculate the "maximum scale" of this transform. */
|
||||
double A = at.getScaleX(); // m00
|
||||
double C = at.getShearX(); // m01
|
||||
double B = at.getShearY(); // m10
|
||||
double D = at.getScaleY(); // m11
|
||||
|
||||
/*
|
||||
* Given a 2 x 2 affine matrix [ A B ] such that
|
||||
* [ C D ]
|
||||
* v' = [x' y'] = [Ax + Cy, Bx + Dy], we want to
|
||||
* find the maximum magnitude (norm) of the vector v'
|
||||
* with the constraint (x^2 + y^2 = 1).
|
||||
* The equation to maximize is
|
||||
* |v'| = sqrt((Ax+Cy)^2+(Bx+Dy)^2)
|
||||
* or |v'| = sqrt((AA+BB)x^2 + 2(AC+BD)xy + (CC+DD)y^2).
|
||||
* Since sqrt is monotonic we can maximize |v'|^2
|
||||
* instead and plug in the substitution y = sqrt(1 - x^2).
|
||||
* Trigonometric equalities can then be used to get
|
||||
* rid of most of the sqrt terms.
|
||||
*/
|
||||
|
||||
double EA = A*A + B*B; // x^2 coefficient
|
||||
double EB = 2*(A*C + B*D); // xy coefficient
|
||||
double EC = C*C + D*D; // y^2 coefficient
|
||||
|
||||
/*
|
||||
* There is a lot of calculus omitted here.
|
||||
*
|
||||
* Conceptually, in the interests of understanding the
|
||||
* terms that the calculus produced we can consider
|
||||
* that EA and EC end up providing the lengths along
|
||||
* the major axes and the hypot term ends up being an
|
||||
* adjustment for the additional length along the off-axis
|
||||
* angle of rotated or sheared ellipses as well as an
|
||||
* adjustment for the fact that the equation below
|
||||
* averages the two major axis lengths. (Notice that
|
||||
* the hypot term contains a part which resolves to the
|
||||
* difference of these two axis lengths in the absence
|
||||
* of rotation.)
|
||||
*
|
||||
* In the calculus, the ratio of the EB and (EA-EC) terms
|
||||
* ends up being the tangent of 2*theta where theta is
|
||||
* the angle that the long axis of the ellipse makes
|
||||
* with the horizontal axis. Thus, this equation is
|
||||
* calculating the length of the hypotenuse of a triangle
|
||||
* along that axis.
|
||||
*/
|
||||
|
||||
double hypot = Math.sqrt(EB*EB + (EA-EC)*(EA-EC));
|
||||
/* sqrt omitted, compare to squared limits below. */
|
||||
double widthsquared = ((EA + EC + hypot)/2.0);
|
||||
|
||||
widthScale = Math.sqrt(widthsquared);
|
||||
}
|
||||
|
||||
return (float) (lw / widthScale);
|
||||
}
|
||||
|
||||
void strokeTo(Shape src,
|
||||
AffineTransform at,
|
||||
float width,
|
||||
|
@ -87,6 +87,8 @@ import sun.awt.FontConfiguration;
|
||||
import sun.awt.FontDescriptor;
|
||||
import sun.awt.PlatformFont;
|
||||
import sun.awt.SunToolkit;
|
||||
import sun.font.FontManagerFactory;
|
||||
import sun.font.FontUtilities;
|
||||
|
||||
import java.nio.charset.*;
|
||||
import java.nio.CharBuffer;
|
||||
@ -1077,7 +1079,7 @@ public class PSPrinterJob extends RasterPrinterJob {
|
||||
}
|
||||
|
||||
int styleMask = font.getStyle() |
|
||||
sun.font.FontManager.getFont2D(font).getStyle();
|
||||
FontUtilities.getFont2D(font).getStyle();
|
||||
|
||||
String style = FontConfiguration.getStyleString(styleMask);
|
||||
|
||||
|
@ -32,6 +32,8 @@ import sun.font.CompositeFont;
|
||||
import sun.font.Font2D;
|
||||
import sun.font.Font2DHandle;
|
||||
import sun.font.FontManager;
|
||||
import sun.font.FontManagerFactory;
|
||||
import sun.font.FontUtilities;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
@ -698,7 +700,7 @@ public abstract class PathGraphics extends ProxyGraphics2D {
|
||||
}
|
||||
|
||||
Font font = g.getFont();
|
||||
Font2D font2D = FontManager.getFont2D(font);
|
||||
Font2D font2D = FontUtilities.getFont2D(font);
|
||||
if (font2D.handle.font2D != font2D) {
|
||||
/* suspicious, may be a bad font. lets bail */
|
||||
return false;
|
||||
@ -933,7 +935,7 @@ public abstract class PathGraphics extends ProxyGraphics2D {
|
||||
* The logic here is erring on the side of caution, in particular
|
||||
* in including supplementary characters.
|
||||
*/
|
||||
if (FontManager.isComplexText(chars, 0, chars.length)) {
|
||||
if (FontUtilities.isComplexText(chars, 0, chars.length)) {
|
||||
return printGlyphVector(g, x, y);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ import sun.security.util.SecurityConstants;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import sun.font.FontDesignMetrics;
|
||||
import sun.font.FontManager;
|
||||
import sun.font.FontUtilities;
|
||||
import sun.java2d.SunGraphicsEnvironment;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
@ -202,7 +202,7 @@ public class SwingUtilities2 {
|
||||
* <tt>false</tt> if TextLayout is not required
|
||||
*/
|
||||
public static final boolean isComplexLayout(char[] text, int start, int limit) {
|
||||
return FontManager.isComplexText(text, start, limit);
|
||||
return FontUtilities.isComplexText(text, start, limit);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include "GlyphIterator.h"
|
||||
#include "LESwaps.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
le_uint32 AlternateSubstitutionSubtable::process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter) const
|
||||
{
|
||||
// NOTE: For now, we'll just pick the first alternative...
|
||||
@ -64,3 +66,5 @@ le_uint32 AlternateSubstitutionSubtable::process(GlyphIterator *glyphIterator, c
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -32,12 +32,19 @@
|
||||
#ifndef __ALTERNATESUBSTITUTIONSUBTABLES_H
|
||||
#define __ALTERNATESUBSTITUTIONSUBTABLES_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "LEGlyphFilter.h"
|
||||
#include "OpenTypeTables.h"
|
||||
#include "GlyphSubstitutionTables.h"
|
||||
#include "GlyphIterator.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct AlternateSetTable
|
||||
{
|
||||
le_uint16 glyphCount;
|
||||
@ -52,4 +59,5 @@ struct AlternateSubstitutionSubtable : GlyphSubstitutionSubtable
|
||||
le_uint32 process(GlyphIterator *glyphIterator, const LEGlyphFilter *filter = NULL) const;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "AnchorTables.h"
|
||||
#include "LESwaps.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
void AnchorTable::getAnchor(LEGlyphID glyphID, const LEFontInstance *fontInstance,
|
||||
LEPoint &anchor) const
|
||||
{
|
||||
@ -124,3 +126,6 @@ void Format3AnchorTable::getAnchor(const LEFontInstance *fontInstance, LEPoint &
|
||||
|
||||
fontInstance->pixelsToUnits(pixels, anchor);
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
|
@ -32,10 +32,17 @@
|
||||
#ifndef __ANCHORTABLES_H
|
||||
#define __ANCHORTABLES_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "LEFontInstance.h"
|
||||
#include "OpenTypeTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct AnchorTable
|
||||
{
|
||||
le_uint16 anchorFormat;
|
||||
@ -66,5 +73,7 @@ struct Format3AnchorTable : AnchorTable
|
||||
void getAnchor(const LEFontInstance *fontInstance, LEPoint &anchor) const;
|
||||
};
|
||||
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -49,23 +49,25 @@
|
||||
#include "ArabicShaping.h"
|
||||
#include "CanonShaping.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
le_bool CharSubstitutionFilter::accept(LEGlyphID glyph) const
|
||||
{
|
||||
return fFontInstance->canDisplay((LEUnicode) glyph);
|
||||
}
|
||||
|
||||
ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(
|
||||
const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
||||
le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable)
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ArabicOpenTypeLayoutEngine)
|
||||
|
||||
ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
||||
le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable)
|
||||
: OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags, gsubTable)
|
||||
{
|
||||
fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount);
|
||||
fFeatureOrder = TRUE;
|
||||
}
|
||||
|
||||
ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(
|
||||
const LEFontInstance *fontInstance,
|
||||
le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags)
|
||||
ArabicOpenTypeLayoutEngine::ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
||||
le_int32 typoFlags)
|
||||
: OpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags)
|
||||
{
|
||||
fFeatureMap = ArabicShaping::getFeatureMap(fFeatureMapCount);
|
||||
@ -86,9 +88,8 @@ ArabicOpenTypeLayoutEngine::~ArabicOpenTypeLayoutEngine()
|
||||
// Input: characters
|
||||
// Output: characters, char indices, tags
|
||||
// Returns: output character count
|
||||
le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[],
|
||||
le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
||||
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
||||
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
{
|
||||
if (LE_FAILURE(success)) {
|
||||
return 0;
|
||||
@ -124,8 +125,8 @@ le_int32 ArabicOpenTypeLayoutEngine::characterProcessing(const LEUnicode chars[]
|
||||
return count;
|
||||
}
|
||||
|
||||
void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset,
|
||||
le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse,
|
||||
LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
{
|
||||
if (LE_FAILURE(success)) {
|
||||
return;
|
||||
@ -137,24 +138,20 @@ void ArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], l
|
||||
}
|
||||
|
||||
if (fGPOSTable != NULL) {
|
||||
OpenTypeLayoutEngine::adjustGlyphPositions(chars, offset, count,
|
||||
reverse, glyphStorage, success);
|
||||
OpenTypeLayoutEngine::adjustGlyphPositions(chars, offset, count, reverse, glyphStorage, success);
|
||||
} else if (fGDEFTable != NULL) {
|
||||
GDEFMarkFilter filter(fGDEFTable);
|
||||
|
||||
adjustMarkGlyphs(glyphStorage, &filter, success);
|
||||
} else {
|
||||
GlyphDefinitionTableHeader *gdefTable =
|
||||
(GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable;
|
||||
GlyphDefinitionTableHeader *gdefTable = (GlyphDefinitionTableHeader *) CanonShaping::glyphDefinitionTable;
|
||||
GDEFMarkFilter filter(gdefTable);
|
||||
|
||||
adjustMarkGlyphs(&chars[offset], count, reverse, glyphStorage, &filter, success);
|
||||
}
|
||||
}
|
||||
|
||||
UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine(
|
||||
const LEFontInstance *fontInstance,
|
||||
le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags)
|
||||
UnicodeArabicOpenTypeLayoutEngine::UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags)
|
||||
: ArabicOpenTypeLayoutEngine(fontInstance, scriptCode, languageCode, typoFlags)
|
||||
{
|
||||
fGSUBTable = (const GlyphSubstitutionTableHeader *) CanonShaping::glyphSubstitutionTable;
|
||||
@ -169,8 +166,7 @@ UnicodeArabicOpenTypeLayoutEngine::~UnicodeArabicOpenTypeLayoutEngine()
|
||||
}
|
||||
|
||||
// "glyphs", "indices" -> glyphs, indices
|
||||
le_int32 UnicodeArabicOpenTypeLayoutEngine::glyphPostProcessing(
|
||||
LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
le_int32 UnicodeArabicOpenTypeLayoutEngine::glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
{
|
||||
if (LE_FAILURE(success)) {
|
||||
return 0;
|
||||
@ -193,17 +189,14 @@ le_int32 UnicodeArabicOpenTypeLayoutEngine::glyphPostProcessing(
|
||||
|
||||
glyphStorage.adoptCharIndicesArray(tempGlyphStorage);
|
||||
|
||||
ArabicOpenTypeLayoutEngine::mapCharsToGlyphs(tempChars, 0, tempGlyphCount, FALSE,
|
||||
TRUE, glyphStorage, success);
|
||||
ArabicOpenTypeLayoutEngine::mapCharsToGlyphs(tempChars, 0, tempGlyphCount, FALSE, TRUE, glyphStorage, success);
|
||||
|
||||
LE_DELETE_ARRAY(tempChars);
|
||||
|
||||
return tempGlyphCount;
|
||||
}
|
||||
|
||||
void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[],
|
||||
le_int32 offset, le_int32 count, le_bool reverse, le_bool /*mirror*/,
|
||||
LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool /*mirror*/, LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
{
|
||||
if (LE_FAILURE(success)) {
|
||||
return;
|
||||
@ -228,9 +221,8 @@ void UnicodeArabicOpenTypeLayoutEngine::mapCharsToGlyphs(const LEUnicode chars[]
|
||||
}
|
||||
}
|
||||
|
||||
void UnicodeArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[],
|
||||
le_int32 offset, le_int32 count, le_bool reverse,
|
||||
LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
void UnicodeArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse,
|
||||
LEGlyphStorage &glyphStorage, LEErrorCode &success)
|
||||
{
|
||||
if (LE_FAILURE(success)) {
|
||||
return;
|
||||
@ -245,3 +237,6 @@ void UnicodeArabicOpenTypeLayoutEngine::adjustGlyphPositions(const LEUnicode cha
|
||||
|
||||
adjustMarkGlyphs(&chars[offset], count, reverse, glyphStorage, &filter, success);
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include "GlyphDefinitionTables.h"
|
||||
#include "GlyphPositioningTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
/**
|
||||
* This class implements OpenType layout for Arabic fonts. It overrides
|
||||
* the characerProcessing method to assign the correct OpenType feature
|
||||
@ -71,8 +73,8 @@ public:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode,
|
||||
le_int32 languageCode, le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable);
|
||||
ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
||||
le_int32 typoFlags, const GlyphSubstitutionTableHeader *gsubTable);
|
||||
|
||||
/**
|
||||
* This constructor is used when the font requires a "canned" GSUB table which can't be known
|
||||
@ -87,8 +89,8 @@ public:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode,
|
||||
le_int32 languageCode, le_int32 typoFlags);
|
||||
ArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
||||
le_int32 typoFlags);
|
||||
|
||||
/**
|
||||
* The destructor, virtual for correct polymorphic invocation.
|
||||
@ -97,6 +99,20 @@ public:
|
||||
*/
|
||||
virtual ~ArabicOpenTypeLayoutEngine();
|
||||
|
||||
/**
|
||||
* ICU "poor man's RTTI", returns a UClassID for the actual class.
|
||||
*
|
||||
* @stable ICU 2.8
|
||||
*/
|
||||
virtual UClassID getDynamicClassID() const;
|
||||
|
||||
/**
|
||||
* ICU "poor man's RTTI", returns a UClassID for this class.
|
||||
*
|
||||
* @stable ICU 2.8
|
||||
*/
|
||||
static UClassID getStaticClassID();
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
@ -108,8 +124,7 @@ protected:
|
||||
* @param offset - the index of the first character to process
|
||||
* @param count - the number of characters to process
|
||||
* @param max - the number of characters in the input context
|
||||
* @param rightToLeft - <code>TRUE</code> if the characters are in a
|
||||
* right to left directional run
|
||||
* @param rightToLeft - <code>TRUE</code> if the characters are in a right to left directional run
|
||||
*
|
||||
* Output parameters:
|
||||
* @param outChars - the output character arrayt
|
||||
@ -121,9 +136,8 @@ protected:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset,
|
||||
le_int32 count, le_int32 max, le_bool rightToLeft,
|
||||
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
|
||||
LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
|
||||
/**
|
||||
* This method applies the GPOS table if it is present, otherwise it ensures that all vowel
|
||||
@ -142,11 +156,9 @@ protected:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset,
|
||||
le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
|
||||
// static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count,
|
||||
// le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
// static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
|
||||
};
|
||||
|
||||
@ -178,8 +190,8 @@ public:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance,
|
||||
le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags);
|
||||
UnicodeArabicOpenTypeLayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode,
|
||||
le_int32 typoFlags);
|
||||
|
||||
/**
|
||||
* The destructor, virtual for correct polymorphic invocation.
|
||||
@ -208,8 +220,7 @@ protected:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage,
|
||||
LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
virtual le_int32 glyphPostProcessing(LEGlyphStorage &tempGlyphStorage, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
|
||||
/**
|
||||
* This method copies the input characters into the output glyph index array,
|
||||
@ -227,8 +238,7 @@ protected:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset,
|
||||
le_int32 count, le_bool reverse, le_bool mirror,
|
||||
virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror,
|
||||
LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
|
||||
/**
|
||||
@ -245,8 +255,9 @@ protected:
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset,
|
||||
le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "LEGlyphStorage.h"
|
||||
#include "ClassDefinitionTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
// This table maps Unicode joining types to
|
||||
// ShapeTypes.
|
||||
const ArabicShaping::ShapeType ArabicShaping::shapeTypes[] =
|
||||
@ -102,9 +104,7 @@ ArabicShaping::ShapeType ArabicShaping::getShapeType(LEUnicode c)
|
||||
#define markFeatureMask 0x00040000UL
|
||||
#define mkmkFeatureMask 0x00020000UL
|
||||
|
||||
#define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | \
|
||||
markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | \
|
||||
dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask)
|
||||
#define ISOL_FEATURES (isolFeatureMask | ligaFeatureMask | msetFeatureMask | markFeatureMask | ccmpFeatureMask | rligFeatureMask | caltFeatureMask | dligFeatureMask | cswhFeatureMask | cursFeatureMask | kernFeatureMask | mkmkFeatureMask)
|
||||
|
||||
#define SHAPE_MASK 0xF0000000UL
|
||||
|
||||
@ -226,3 +226,5 @@ void ArabicShaping::shape(const LEUnicode *chars, le_int32 offset, le_int32 char
|
||||
adjustTags(erout, 2, glyphStorage);
|
||||
}
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -32,12 +32,19 @@
|
||||
#ifndef __ARABICSHAPING_H
|
||||
#define __ARABICSHAPING_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "OpenTypeTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class LEGlyphStorage;
|
||||
|
||||
class ArabicShaping {
|
||||
class ArabicShaping /* not : public UObject because all methods are static */ {
|
||||
public:
|
||||
// Joining types
|
||||
enum JoiningTypes
|
||||
@ -74,8 +81,8 @@ public:
|
||||
|
||||
typedef le_int32 ShapeType;
|
||||
|
||||
static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount,
|
||||
le_int32 charMax, le_bool rightToLeft, LEGlyphStorage &glyphStorage);
|
||||
static void shape(const LEUnicode *chars, le_int32 offset, le_int32 charCount, le_int32 charMax,
|
||||
le_bool rightToLeft, LEGlyphStorage &glyphStorage);
|
||||
|
||||
static const FeatureMap *getFeatureMap(le_int32 &count);
|
||||
|
||||
@ -88,8 +95,8 @@ private:
|
||||
static const le_uint8 shapingTypeTable[];
|
||||
static const ShapeType shapeTypes[];
|
||||
|
||||
static void adjustTags(le_int32 outIndex, le_int32 shapeOffset,
|
||||
LEGlyphStorage &glyphStorage);
|
||||
static void adjustTags(le_int32 outIndex, le_int32 shapeOffset, LEGlyphStorage &glyphStorage);
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -32,12 +32,19 @@
|
||||
#ifndef __ATTACHMENTPOSITIONINGSUBTABLES_H
|
||||
#define __ATTACHMENTPOSITIONINGSUBTABLES_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "OpenTypeTables.h"
|
||||
#include "GlyphPositioningTables.h"
|
||||
#include "ValueRecords.h"
|
||||
#include "GlyphIterator.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct AttachmentPositioningSubtable : GlyphPositioningSubtable
|
||||
{
|
||||
Offset baseCoverageTableOffset;
|
||||
@ -55,4 +62,6 @@ inline le_int32 AttachmentPositioningSubtable::getBaseCoverage(LEGlyphID baseGly
|
||||
return getGlyphCoverage(baseCoverageTableOffset, baseGlyphID);
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
|
@ -36,6 +36,8 @@
|
||||
#include "LETypes.h"
|
||||
#include "CanonShaping.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
const le_uint8 CanonShaping::glyphSubstitutionTable[] = {
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x01, 0x58, 0x02, 0x86, 0x00, 0x12, 0x61, 0x72, 0x61, 0x62,
|
||||
0x00, 0x6E, 0x62, 0x65, 0x6E, 0x67, 0x00, 0x82, 0x63, 0x79, 0x72, 0x6C, 0x00, 0x8E, 0x64, 0x65,
|
||||
@ -3773,3 +3775,5 @@ const le_uint8 CanonShaping::glyphDefinitionTable[] = {
|
||||
0x00, 0xDC, 0xD1, 0x85, 0xD1, 0x89, 0x00, 0xE6, 0xD1, 0x8A, 0xD1, 0x8B, 0x00, 0xDC, 0xD1, 0xAA,
|
||||
0xD1, 0xAD, 0x00, 0xE6, 0xD2, 0x42, 0xD2, 0x44, 0x00, 0xE6
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -35,8 +35,9 @@
|
||||
#include "GlyphDefinitionTables.h"
|
||||
#include "ClassDefinitionTables.h"
|
||||
|
||||
void CanonShaping::sortMarks(le_int32 *indices,
|
||||
const le_int32 *combiningClasses, le_int32 index, le_int32 limit)
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
void CanonShaping::sortMarks(le_int32 *indices, const le_int32 *combiningClasses, le_int32 index, le_int32 limit)
|
||||
{
|
||||
for (le_int32 j = index + 1; j < limit; j += 1) {
|
||||
le_int32 i;
|
||||
@ -55,13 +56,11 @@ void CanonShaping::sortMarks(le_int32 *indices,
|
||||
}
|
||||
}
|
||||
|
||||
void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount,
|
||||
le_bool rightToLeft, LEUnicode *outChars, LEGlyphStorage &glyphStorage)
|
||||
void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount, le_bool rightToLeft,
|
||||
LEUnicode *outChars, LEGlyphStorage &glyphStorage)
|
||||
{
|
||||
const GlyphDefinitionTableHeader *gdefTable =
|
||||
(const GlyphDefinitionTableHeader *) glyphDefinitionTable;
|
||||
const ClassDefinitionTable *classTable =
|
||||
gdefTable->getMarkAttachClassDefinitionTable();
|
||||
const GlyphDefinitionTableHeader *gdefTable = (const GlyphDefinitionTableHeader *) glyphDefinitionTable;
|
||||
const ClassDefinitionTable *classTable = gdefTable->getMarkAttachClassDefinitionTable();
|
||||
le_int32 *combiningClasses = LE_NEW_ARRAY(le_int32, charCount);
|
||||
le_int32 *indices = LE_NEW_ARRAY(le_int32, charCount);
|
||||
LEErrorCode status = LE_NO_ERROR;
|
||||
@ -103,3 +102,5 @@ void CanonShaping::reorderMarks(const LEUnicode *inChars, le_int32 charCount,
|
||||
LE_DELETE_ARRAY(indices);
|
||||
LE_DELETE_ARRAY(combiningClasses);
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -34,20 +34,22 @@
|
||||
|
||||
#include "LETypes.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class LEGlyphStorage;
|
||||
|
||||
class CanonShaping
|
||||
class CanonShaping /* not : public UObject because all members are static */
|
||||
{
|
||||
public:
|
||||
static const le_uint8 glyphSubstitutionTable[];
|
||||
static const le_uint8 glyphDefinitionTable[];
|
||||
|
||||
static void reorderMarks(const LEUnicode *inChars, le_int32 charCount,
|
||||
le_bool rightToLeft, LEUnicode *outChars, LEGlyphStorage &glyphStorage);
|
||||
static void reorderMarks(const LEUnicode *inChars, le_int32 charCount, le_bool rightToLeft,
|
||||
LEUnicode *outChars, LEGlyphStorage &glyphStorage);
|
||||
|
||||
private:
|
||||
static void sortMarks(le_int32 *indices, const le_int32 *combiningClasses,
|
||||
le_int32 index, le_int32 limit);
|
||||
static void sortMarks(le_int32 *indices, const le_int32 *combiningClasses, le_int32 index, le_int32 limit);
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "LETypes.h"
|
||||
#include "LEGlyphFilter.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class LEFontInstance;
|
||||
|
||||
/**
|
||||
@ -43,7 +45,7 @@ class LEFontInstance;
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class CharSubstitutionFilter : public LEGlyphFilter
|
||||
class CharSubstitutionFilter : public UMemory, public LEGlyphFilter
|
||||
{
|
||||
private:
|
||||
/**
|
||||
@ -98,4 +100,7 @@ public:
|
||||
le_bool accept(LEGlyphID glyph) const;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "ClassDefinitionTables.h"
|
||||
#include "LESwaps.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
le_int32 ClassDefinitionTable::getGlyphClass(LEGlyphID glyphID) const
|
||||
{
|
||||
switch(SWAPW(classFormat)) {
|
||||
@ -139,3 +141,5 @@ le_bool ClassDefFormat2Table::hasGlyphClass(le_int32 glyphClass) const
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -32,9 +32,16 @@
|
||||
#ifndef __CLASSDEFINITIONTABLES_H
|
||||
#define __CLASSDEFINITIONTABLES_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "OpenTypeTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct ClassDefinitionTable
|
||||
{
|
||||
le_uint16 classFormat;
|
||||
@ -69,4 +76,5 @@ struct ClassDefFormat2Table : ClassDefinitionTable
|
||||
le_bool hasGlyphClass(le_int32 glyphClass) const;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -32,12 +32,19 @@
|
||||
#ifndef __CONTEXTUALGLYPHINSERTION_H
|
||||
#define __CONTEXTUALGLYPHINSERTION_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "LayoutTables.h"
|
||||
#include "StateTables.h"
|
||||
#include "MorphTables.h"
|
||||
#include "MorphStateTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct ContextualGlyphInsertionHeader : MorphStateTableHeader
|
||||
{
|
||||
};
|
||||
@ -60,4 +67,5 @@ struct LigatureSubstitutionStateEntry : StateEntry
|
||||
ByteOffset markedInsertionListOffset;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -39,6 +39,10 @@
|
||||
#include "LEGlyphStorage.h"
|
||||
#include "LESwaps.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ContextualGlyphSubstitutionProcessor)
|
||||
|
||||
ContextualGlyphSubstitutionProcessor::ContextualGlyphSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader)
|
||||
: StateTableProcessor(morphSubtableHeader)
|
||||
{
|
||||
@ -57,8 +61,7 @@ void ContextualGlyphSubstitutionProcessor::beginStateTable()
|
||||
markGlyph = 0;
|
||||
}
|
||||
|
||||
ByteOffset ContextualGlyphSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage,
|
||||
le_int32 &currGlyph, EntryTableIndex index)
|
||||
ByteOffset ContextualGlyphSubstitutionProcessor::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph, EntryTableIndex index)
|
||||
{
|
||||
const ContextualGlyphSubstitutionStateEntry *entry = &entryTable[index];
|
||||
ByteOffset newState = SWAPW(entry->newStateOffset);
|
||||
@ -97,3 +100,5 @@ ByteOffset ContextualGlyphSubstitutionProcessor::processStateEntry(LEGlyphStorag
|
||||
void ContextualGlyphSubstitutionProcessor::endStateTable()
|
||||
{
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -32,12 +32,19 @@
|
||||
#ifndef __CONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H
|
||||
#define __CONTEXTUALGLYPHSUBSTITUTIONPROCESSOR_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "MorphTables.h"
|
||||
#include "SubtableProcessor.h"
|
||||
#include "StateTableProcessor.h"
|
||||
#include "ContextualGlyphSubstitution.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
class LEGlyphStorage;
|
||||
|
||||
class ContextualGlyphSubstitutionProcessor : public StateTableProcessor
|
||||
@ -52,6 +59,20 @@ public:
|
||||
ContextualGlyphSubstitutionProcessor(const MorphSubtableHeader *morphSubtableHeader);
|
||||
virtual ~ContextualGlyphSubstitutionProcessor();
|
||||
|
||||
/**
|
||||
* ICU "poor man's RTTI", returns a UClassID for the actual class.
|
||||
*
|
||||
* @stable ICU 2.8
|
||||
*/
|
||||
virtual UClassID getDynamicClassID() const;
|
||||
|
||||
/**
|
||||
* ICU "poor man's RTTI", returns a UClassID for this class.
|
||||
*
|
||||
* @stable ICU 2.8
|
||||
*/
|
||||
static UClassID getStaticClassID();
|
||||
|
||||
private:
|
||||
ContextualGlyphSubstitutionProcessor();
|
||||
|
||||
@ -62,6 +83,8 @@ protected:
|
||||
le_int32 markGlyph;
|
||||
|
||||
const ContextualGlyphSubstitutionHeader *contextualGlyphSubstitutionHeader;
|
||||
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -32,11 +32,18 @@
|
||||
#ifndef __CONTEXTUALGLYPHSUBSTITUTION_H
|
||||
#define __CONTEXTUALGLYPHSUBSTITUTION_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "LayoutTables.h"
|
||||
#include "StateTables.h"
|
||||
#include "MorphTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct ContextualGlyphSubstitutionHeader : MorphStateTableHeader
|
||||
{
|
||||
ByteOffset substitutionTableOffset;
|
||||
@ -55,4 +62,5 @@ struct ContextualGlyphSubstitutionStateEntry : StateEntry
|
||||
WordOffset currOffset;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
|
||||
*
|
||||
*/
|
||||
@ -39,6 +38,8 @@
|
||||
#include "CoverageTables.h"
|
||||
#include "LESwaps.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
/*
|
||||
NOTE: This could be optimized somewhat by keeping track
|
||||
of the previous sequenceIndex in the loop and doing next()
|
||||
@ -350,7 +351,7 @@ le_uint32 ChainingContextualSubstitutionSubtable::process(const LookupProcessor
|
||||
|
||||
// NOTE: This could be a #define, but that seems to confuse
|
||||
// the Visual Studio .NET 2003 compiler on the calls to the
|
||||
// GlyphIterator constructor. It somehow can't decide if
|
||||
// GlyphIterator constructor. It somehow can't decide if
|
||||
// emptyFeatureList matches an le_uint32 or an le_uint16...
|
||||
static const FeatureMask emptyFeatureList = 0x00000000UL;
|
||||
|
||||
@ -542,3 +543,5 @@ le_uint32 ChainingContextualSubstitutionFormat3Subtable::process(const LookupPro
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -32,6 +32,11 @@
|
||||
#ifndef __CONTEXTUALSUBSTITUTIONSUBTABLES_H
|
||||
#define __CONTEXTUALSUBSTITUTIONSUBTABLES_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "LEFontInstance.h"
|
||||
#include "OpenTypeTables.h"
|
||||
@ -39,6 +44,8 @@
|
||||
#include "GlyphIterator.h"
|
||||
#include "LookupProcessor.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct SubstitutionLookupRecord
|
||||
{
|
||||
le_uint16 sequenceIndex;
|
||||
@ -218,4 +225,5 @@ struct ChainingContextualSubstitutionFormat3Subtable
|
||||
le_uint32 process(const LookupProcessor *lookupProcessor, GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const;
|
||||
};
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -35,6 +35,8 @@
|
||||
#include "CoverageTables.h"
|
||||
#include "LESwaps.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
le_int32 CoverageTable::getGlyphCoverage(LEGlyphID glyphID) const
|
||||
{
|
||||
switch(SWAPW(coverageFormat))
|
||||
@ -106,3 +108,5 @@ le_int32 CoverageFormat2Table::getGlyphCoverage(LEGlyphID glyphID) const
|
||||
|
||||
return startCoverageIndex + (ttGlyphID - firstInRange);
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
@ -32,9 +32,16 @@
|
||||
#ifndef __COVERAGETABLES_H
|
||||
#define __COVERAGETABLES_H
|
||||
|
||||
/**
|
||||
* \file
|
||||
* \internal
|
||||
*/
|
||||
|
||||
#include "LETypes.h"
|
||||
#include "OpenTypeTables.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
struct CoverageTable
|
||||
{
|
||||
le_uint16 coverageFormat;
|
||||
@ -58,5 +65,5 @@ struct CoverageFormat2Table : CoverageTable
|
||||
le_int32 getGlyphCoverage(LEGlyphID glyphID) const;
|
||||
};
|
||||
|
||||
|
||||
U_NAMESPACE_END
|
||||
#endif
|
||||
|
@ -37,6 +37,8 @@
|
||||
#include "OpenTypeUtilities.h"
|
||||
#include "LESwaps.h"
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
|
||||
le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const LEFontInstance *fontInstance) const
|
||||
{
|
||||
LEGlyphID glyphID = glyphIterator->getCurrGlyphID();
|
||||
@ -68,3 +70,5 @@ le_uint32 CursiveAttachmentSubtable::process(GlyphIterator *glyphIterator, const
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
U_NAMESPACE_END
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user