Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
34f8e42d
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
34f8e42d
编写于
12月 19, 2011
作者:
D
denis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7117011: Reduce number of warnings in sun/awt/windows and sun/awt/datatransfer
Reviewed-by: art
上级
05c45bb5
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
102 addition
and
83 deletion
+102
-83
src/share/classes/sun/awt/datatransfer/DataTransferer.java
src/share/classes/sun/awt/datatransfer/DataTransferer.java
+10
-5
src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java
src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java
+4
-3
src/solaris/classes/sun/awt/X11/XClipboard.java
src/solaris/classes/sun/awt/X11/XClipboard.java
+3
-1
src/windows/classes/sun/awt/windows/TranslucentWindowPainter.java
...ows/classes/sun/awt/windows/TranslucentWindowPainter.java
+2
-1
src/windows/classes/sun/awt/windows/WBufferStrategy.java
src/windows/classes/sun/awt/windows/WBufferStrategy.java
+1
-1
src/windows/classes/sun/awt/windows/WChoicePeer.java
src/windows/classes/sun/awt/windows/WChoicePeer.java
+2
-0
src/windows/classes/sun/awt/windows/WClipboard.java
src/windows/classes/sun/awt/windows/WClipboard.java
+3
-6
src/windows/classes/sun/awt/windows/WComponentPeer.java
src/windows/classes/sun/awt/windows/WComponentPeer.java
+6
-1
src/windows/classes/sun/awt/windows/WDataTransferer.java
src/windows/classes/sun/awt/windows/WDataTransferer.java
+12
-7
src/windows/classes/sun/awt/windows/WDesktopProperties.java
src/windows/classes/sun/awt/windows/WDesktopProperties.java
+1
-0
src/windows/classes/sun/awt/windows/WDialogPeer.java
src/windows/classes/sun/awt/windows/WDialogPeer.java
+1
-0
src/windows/classes/sun/awt/windows/WEmbeddedFrame.java
src/windows/classes/sun/awt/windows/WEmbeddedFrame.java
+12
-12
src/windows/classes/sun/awt/windows/WFileDialogPeer.java
src/windows/classes/sun/awt/windows/WFileDialogPeer.java
+5
-5
src/windows/classes/sun/awt/windows/WFramePeer.java
src/windows/classes/sun/awt/windows/WFramePeer.java
+6
-19
src/windows/classes/sun/awt/windows/WInputMethod.java
src/windows/classes/sun/awt/windows/WInputMethod.java
+4
-4
src/windows/classes/sun/awt/windows/WMenuItemPeer.java
src/windows/classes/sun/awt/windows/WMenuItemPeer.java
+3
-3
src/windows/classes/sun/awt/windows/WPageDialog.java
src/windows/classes/sun/awt/windows/WPageDialog.java
+1
-0
src/windows/classes/sun/awt/windows/WPageDialogPeer.java
src/windows/classes/sun/awt/windows/WPageDialogPeer.java
+1
-1
src/windows/classes/sun/awt/windows/WPrintDialog.java
src/windows/classes/sun/awt/windows/WPrintDialog.java
+1
-0
src/windows/classes/sun/awt/windows/WPrintDialogPeer.java
src/windows/classes/sun/awt/windows/WPrintDialogPeer.java
+1
-1
src/windows/classes/sun/awt/windows/WToolkit.java
src/windows/classes/sun/awt/windows/WToolkit.java
+14
-9
src/windows/classes/sun/awt/windows/WWindowPeer.java
src/windows/classes/sun/awt/windows/WWindowPeer.java
+9
-4
未找到文件。
src/share/classes/sun/awt/datatransfer/DataTransferer.java
浏览文件 @
34f8e42d
...
...
@@ -649,8 +649,9 @@ public abstract class DataTransferer {
* The map keys are sorted according to the native formats preference
* order.
*/
public
SortedMap
getFormatsForTransferable
(
Transferable
contents
,
FlavorTable
map
)
{
public
SortedMap
<
Long
,
DataFlavor
>
getFormatsForTransferable
(
Transferable
contents
,
FlavorTable
map
)
{
DataFlavor
[]
flavors
=
contents
.
getTransferDataFlavors
();
if
(
flavors
==
null
)
{
return
new
TreeMap
();
...
...
@@ -686,9 +687,13 @@ public abstract class DataTransferer {
* DataFlavors and data formats
* @throws NullPointerException if flavors or map is <code>null</code>
*/
public
SortedMap
getFormatsForFlavors
(
DataFlavor
[]
flavors
,
FlavorTable
map
)
{
Map
formatMap
=
new
HashMap
(
flavors
.
length
);
Map
textPlainMap
=
new
HashMap
(
flavors
.
length
);
public
SortedMap
<
Long
,
DataFlavor
>
getFormatsForFlavors
(
DataFlavor
[]
flavors
,
FlavorTable
map
)
{
Map
<
Long
,
DataFlavor
>
formatMap
=
new
HashMap
<>
(
flavors
.
length
);
Map
<
Long
,
DataFlavor
>
textPlainMap
=
new
HashMap
<>
(
flavors
.
length
);
// Maps formats to indices that will be used to sort the formats
// according to the preference order.
// Larger index value corresponds to the more preferable format.
...
...
src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java
浏览文件 @
34f8e42d
...
...
@@ -52,6 +52,7 @@ import java.util.SortedMap;
import
sun.awt.SunToolkit
;
import
sun.awt.datatransfer.DataTransferer
;
import
java.awt.datatransfer.DataFlavor
;
/**
* <p>
...
...
@@ -126,9 +127,9 @@ public abstract class SunDragSourceContextPeer implements DragSourceContextPeer
dragImageOffset
=
p
;
Transferable
transferable
=
getDragSourceContext
().
getTransferable
();
SortedMap
formatMap
=
DataTransferer
.
getInstance
().
getFormatsForTransferable
(
transferable
,
DataTransferer
.
adaptFlavorMap
(
getTrigger
().
getDragSource
().
getFlavorMap
()));
SortedMap
<
Long
,
DataFlavor
>
formatMap
=
DataTransferer
.
getInstance
().
getFormatsForTransferable
(
transferable
,
DataTransferer
.
adaptFlavorMap
(
getTrigger
().
getDragSource
().
getFlavorMap
()));
long
[]
formats
=
DataTransferer
.
getInstance
().
keysToLongArray
(
formatMap
);
startDrag
(
transferable
,
formats
,
formatMap
);
...
...
src/solaris/classes/sun/awt/X11/XClipboard.java
浏览文件 @
34f8e42d
...
...
@@ -26,6 +26,7 @@
package
sun.awt.X11
;
import
java.awt.datatransfer.Transferable
;
import
java.awt.datatransfer.DataFlavor
;
import
java.util.SortedMap
;
import
java.io.IOException
;
import
java.security.AccessController
;
...
...
@@ -83,7 +84,8 @@ public final class XClipboard extends SunClipboard implements OwnershipListener
}
protected
synchronized
void
setContentsNative
(
Transferable
contents
)
{
SortedMap
formatMap
=
DataTransferer
.
getInstance
().
getFormatsForTransferable
SortedMap
<
Long
,
DataFlavor
>
formatMap
=
DataTransferer
.
getInstance
().
getFormatsForTransferable
(
contents
,
DataTransferer
.
adaptFlavorMap
(
flavorMap
));
long
[]
formats
=
DataTransferer
.
keysToLongArray
(
formatMap
);
...
...
src/windows/classes/sun/awt/windows/TranslucentWindowPainter.java
浏览文件 @
34f8e42d
...
...
@@ -40,6 +40,7 @@ import sun.java2d.DestSurfaceProvider;
import
sun.java2d.InvalidPipeException
;
import
sun.java2d.Surface
;
import
sun.java2d.pipe.RenderQueue
;
import
sun.java2d.pipe.BufferedContext
;
import
sun.java2d.pipe.hw.AccelGraphicsConfig
;
import
sun.java2d.pipe.hw.AccelSurface
;
import
sun.security.action.GetPropertyAction
;
...
...
@@ -310,7 +311,7 @@ public abstract class TranslucentWindowPainter {
RenderQueue
rq
=
as
.
getContext
().
getRenderQueue
();
rq
.
lock
();
try
{
as
.
getContext
()
.
validateContext
(
as
);
BufferedContext
.
validateContext
(
as
);
rq
.
flushAndInvokeNow
(
new
Runnable
()
{
public
void
run
()
{
long
psdops
=
as
.
getNativeOps
();
...
...
src/windows/classes/sun/awt/windows/WBufferStrategy.java
浏览文件 @
34f8e42d
...
...
@@ -37,7 +37,7 @@ import java.awt.Component;
*/
public
class
WBufferStrategy
{
private
static
native
void
initIDs
(
Class
componentClass
);
private
static
native
void
initIDs
(
Class
<?>
componentClass
);
static
{
initIDs
(
Component
.
class
);
...
...
src/windows/classes/sun/awt/windows/WChoicePeer.java
浏览文件 @
34f8e42d
...
...
@@ -84,6 +84,7 @@ class WChoicePeer extends WComponentPeer implements ChoicePeer {
native
void
create
(
WComponentPeer
parent
);
@SuppressWarnings
(
"deprecation"
)
void
initialize
()
{
Choice
opt
=
(
Choice
)
target
;
int
itemCount
=
opt
.
getItemCount
();
...
...
@@ -116,6 +117,7 @@ class WChoicePeer extends WComponentPeer implements ChoicePeer {
super
.
initialize
();
}
@SuppressWarnings
(
"deprecation"
)
protected
void
disposeImpl
()
{
// TODO: we should somehow reset the listener when the choice
// is moved to another toplevel without destroying its peer.
...
...
src/windows/classes/sun/awt/windows/WClipboard.java
浏览文件 @
34f8e42d
...
...
@@ -71,17 +71,14 @@ public class WClipboard extends SunClipboard {
// Get all of the target formats into which the Transferable can be
// translated. Then, for each format, translate the data and post
// it to the Clipboard.
Map
formatMap
=
WDataTransferer
.
getInstance
().
Map
<
Long
,
DataFlavor
>
formatMap
=
WDataTransferer
.
getInstance
().
getFormatsForTransferable
(
contents
,
flavorMap
);
openClipboard
(
this
);
try
{
for
(
Iterator
iter
=
formatMap
.
keySet
().
iterator
();
iter
.
hasNext
();
)
{
Long
lFormat
=
(
Long
)
iter
.
next
();
long
format
=
lFormat
.
longValue
();
DataFlavor
flavor
=
(
DataFlavor
)
formatMap
.
get
(
lFormat
);
for
(
Long
format
:
formatMap
.
keySet
())
{
DataFlavor
flavor
=
formatMap
.
get
(
format
);
try
{
byte
[]
bytes
=
WDataTransferer
.
getInstance
().
...
...
src/windows/classes/sun/awt/windows/WComponentPeer.java
浏览文件 @
34f8e42d
...
...
@@ -222,7 +222,7 @@ public abstract class WComponentPeer extends WObjectPeer
updateWindow
();
// make sure paint events are transferred to main event queue
// for coalescing
WToolkit
.
getWToolkit
()
.
flushPendingEvents
();
SunToolkit
.
flushPendingEvents
();
// paint the damaged area
paintArea
.
paint
(
target
,
shouldClearRectBeforePaint
());
}
...
...
@@ -320,6 +320,7 @@ public abstract class WComponentPeer extends WObjectPeer
native
void
nativeHandleEvent
(
AWTEvent
e
);
@SuppressWarnings
(
"fallthrough"
)
public
void
handleEvent
(
AWTEvent
e
)
{
int
id
=
e
.
getID
();
...
...
@@ -549,6 +550,7 @@ public abstract class WComponentPeer extends WObjectPeer
// fallback default font object
final
static
Font
defaultFont
=
new
Font
(
Font
.
DIALOG
,
Font
.
PLAIN
,
12
);
@SuppressWarnings
(
"deprecation"
)
public
Graphics
getGraphics
()
{
if
(
isDisposed
())
{
return
null
;
...
...
@@ -656,6 +658,7 @@ public abstract class WComponentPeer extends WObjectPeer
}
// TODO: consider moving it to KeyboardFocusManagerPeerImpl
@SuppressWarnings
(
"deprecation"
)
public
boolean
requestFocus
(
Component
lightweightChild
,
boolean
temporary
,
boolean
focusedWindowChangeAllowed
,
long
time
,
CausedFocusEvent
.
Cause
cause
)
...
...
@@ -1058,6 +1061,7 @@ public abstract class WComponentPeer extends WObjectPeer
// in the browser on Vista when DWM is enabled.
// @return true if the toplevel container is not an EmbeddedFrame or
// if this EmbeddedFrame is acceleration capable, false otherwise
@SuppressWarnings
(
"deprecation"
)
private
static
final
boolean
isContainingTopLevelAccelCapable
(
Component
c
)
{
while
(
c
!=
null
&&
!(
c
instanceof
WEmbeddedFrame
))
{
c
=
c
.
getParent
();
...
...
@@ -1072,6 +1076,7 @@ public abstract class WComponentPeer extends WObjectPeer
* Applies the shape to the native component window.
* @since 1.7
*/
@SuppressWarnings
(
"deprecation"
)
public
void
applyShape
(
Region
shape
)
{
if
(
shapeLog
.
isLoggable
(
PlatformLogger
.
FINER
))
{
shapeLog
.
finer
(
...
...
src/windows/classes/sun/awt/windows/WDataTransferer.java
浏览文件 @
34f8e42d
...
...
@@ -107,13 +107,15 @@ public class WDataTransferer extends DataTransferer {
"DIBV5"
};
private
static
final
Map
predefinedClipboardNameMap
;
private
static
final
Map
<
String
,
Long
>
predefinedClipboardNameMap
;
static
{
Map
tempMap
=
new
HashMap
(
predefinedClipboardNames
.
length
,
1.0f
);
Map
<
String
,
Long
>
tempMap
=
new
HashMap
<>
(
predefinedClipboardNames
.
length
,
1.0f
);
for
(
int
i
=
1
;
i
<
predefinedClipboardNames
.
length
;
i
++)
{
tempMap
.
put
(
predefinedClipboardNames
[
i
],
Long
.
valueOf
(
i
));
}
predefinedClipboardNameMap
=
Collections
.
synchronizedMap
(
tempMap
);
predefinedClipboardNameMap
=
Collections
.
synchronizedMap
(
tempMap
);
}
/**
...
...
@@ -135,7 +137,7 @@ public class WDataTransferer extends DataTransferer {
public
static
final
long
CF_FILEGROUPDESCRIPTORA
=
registerClipboardFormat
(
"FileGroupDescriptor"
);
//CF_FILECONTENTS supported as mandatory associated clipboard
private
static
final
Long
L_CF_LOCALE
=
(
Long
)
private
static
final
Long
L_CF_LOCALE
=
predefinedClipboardNameMap
.
get
(
predefinedClipboardNames
[
CF_LOCALE
]);
private
static
final
DirectColorModel
directColorModel
=
...
...
@@ -168,8 +170,11 @@ public class WDataTransferer extends DataTransferer {
return
transferer
;
}
public
SortedMap
getFormatsForFlavors
(
DataFlavor
[]
flavors
,
FlavorTable
map
)
{
SortedMap
retval
=
super
.
getFormatsForFlavors
(
flavors
,
map
);
public
SortedMap
<
Long
,
DataFlavor
>
getFormatsForFlavors
(
DataFlavor
[]
flavors
,
FlavorTable
map
)
{
SortedMap
<
Long
,
DataFlavor
>
retval
=
super
.
getFormatsForFlavors
(
flavors
,
map
);
// The Win32 native code does not support exporting LOCALE data, nor
// should it.
...
...
@@ -266,7 +271,7 @@ public class WDataTransferer extends DataTransferer {
}
protected
Long
getFormatForNativeAsLong
(
String
str
)
{
Long
format
=
(
Long
)
predefinedClipboardNameMap
.
get
(
str
);
Long
format
=
predefinedClipboardNameMap
.
get
(
str
);
if
(
format
==
null
)
{
format
=
Long
.
valueOf
(
registerClipboardFormat
(
str
));
}
...
...
src/windows/classes/sun/awt/windows/WDesktopProperties.java
浏览文件 @
34f8e42d
...
...
@@ -238,6 +238,7 @@ class WDesktopProperties {
* Called by WToolkit when Windows settings change-- we (re)load properties and
* set new values.
*/
@SuppressWarnings
(
"unchecked"
)
synchronized
Map
<
String
,
Object
>
getProperties
()
{
ThemeReader
.
flush
();
...
...
src/windows/classes/sun/awt/windows/WDialogPeer.java
浏览文件 @
34f8e42d
...
...
@@ -87,6 +87,7 @@ class WDialogPeer extends WWindowPeer implements DialogPeer {
}
}
@SuppressWarnings
(
"deprecation"
)
public
void
hide
()
{
Dialog
dlg
=
(
Dialog
)
target
;
if
(
dlg
.
getModalityType
()
!=
Dialog
.
ModalityType
.
MODELESS
)
{
...
...
src/windows/classes/sun/awt/windows/WEmbeddedFrame.java
浏览文件 @
34f8e42d
...
...
@@ -27,14 +27,12 @@ package sun.awt.windows;
import
sun.awt.*
;
import
java.awt.*
;
import
java.awt.event.*
;
import
java.awt.peer.ComponentPeer
;
import
java.util.*
;
import
java.awt.color.*
;
import
java.awt.image.*
;
import
sun.awt.image.ByteInterleavedRaster
;
import
sun.security.action.GetPropertyAction
;
import
java.lang.reflect.*
;
import
java.security.PrivilegedAction
;
import
java.security.AccessController
;
public
class
WEmbeddedFrame
extends
EmbeddedFrame
{
...
...
@@ -52,8 +50,8 @@ public class WEmbeddedFrame extends EmbeddedFrame {
private
static
int
pScale
=
0
;
private
static
final
int
MAX_BAND_SIZE
=
(
1024
*
30
);
private
static
String
printScale
=
(
String
)
java
.
security
.
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"sun.java2d.print.pluginscalefactor"
));
private
static
String
printScale
=
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"sun.java2d.print.pluginscalefactor"
));
public
WEmbeddedFrame
()
{
this
((
long
)
0
);
...
...
@@ -75,6 +73,7 @@ public class WEmbeddedFrame extends EmbeddedFrame {
}
}
@SuppressWarnings
(
"deprecation"
)
public
void
addNotify
()
{
if
(
getPeer
()
==
null
)
{
WToolkit
toolkit
=
(
WToolkit
)
Toolkit
.
getDefaultToolkit
();
...
...
@@ -134,8 +133,8 @@ public class WEmbeddedFrame extends EmbeddedFrame {
bandHeight
=
Math
.
min
(
MAX_BAND_SIZE
/
bandWidth
,
frameHeight
);
imgWid
=
(
int
)(
bandWidth
*
xscale
)
;
imgHgt
=
(
int
)(
bandHeight
*
yscale
)
;
imgWid
=
bandWidth
*
xscale
;
imgHgt
=
bandHeight
*
yscale
;
bandImage
=
new
BufferedImage
(
imgWid
,
imgHgt
,
BufferedImage
.
TYPE_3BYTE_BGR
);
}
...
...
@@ -159,7 +158,7 @@ public class WEmbeddedFrame extends EmbeddedFrame {
if
((
bandTop
+
bandHeight
)
>
frameHeight
)
{
// last band
currBandHeight
=
frameHeight
-
bandTop
;
currImgHeight
=
(
int
)(
currBandHeight
*
yscale
)
;
currImgHeight
=
currBandHeight
*
yscale
;
// multiply by 3 because the image is a 3 byte BGR
imageOffset
=
imgWid
*(
imgHgt
-
currImgHeight
)*
3
;
...
...
@@ -179,9 +178,9 @@ public class WEmbeddedFrame extends EmbeddedFrame {
if
(
printScale
==
null
)
{
// if no system property is specified,
// check for environment setting
printScale
=
(
String
)
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
()
{
public
Object
run
()
{
printScale
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
String
>
()
{
public
String
run
()
{
return
System
.
getenv
(
"JAVA2D_PLUGIN_PRINT_SCALE"
);
}
}
...
...
@@ -226,6 +225,7 @@ public class WEmbeddedFrame extends EmbeddedFrame {
public
void
activateEmbeddingTopLevel
()
{
}
@SuppressWarnings
(
"deprecation"
)
public
void
synthesizeWindowActivation
(
final
boolean
doActivate
)
{
if
(!
doActivate
||
EventQueue
.
isDispatchThread
())
{
((
WEmbeddedFramePeer
)
getPeer
()).
synthesizeWmActivate
(
doActivate
);
...
...
src/windows/classes/sun/awt/windows/WFileDialogPeer.java
浏览文件 @
34f8e42d
...
...
@@ -167,7 +167,7 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer {
WToolkit
.
executeOnEventHandlerThread
(
fileDialog
,
new
Runnable
()
{
public
void
run
()
{
fileDialog
.
hide
(
);
fileDialog
.
setVisible
(
false
);
}
});
}
// handleSelected()
...
...
@@ -182,16 +182,16 @@ public class WFileDialogPeer extends WWindowPeer implements FileDialogPeer {
WToolkit
.
executeOnEventHandlerThread
(
fileDialog
,
new
Runnable
()
{
public
void
run
()
{
fileDialog
.
hide
(
);
fileDialog
.
setVisible
(
false
);
}
});
}
// handleCancel()
//This whole static block is a part of 4152317 fix
static
{
String
filterString
=
(
String
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
String
filterString
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
String
>
()
{
public
String
run
()
{
try
{
ResourceBundle
rb
=
ResourceBundle
.
getBundle
(
"sun.awt.windows.awtLocalization"
);
return
rb
.
getString
(
"allFiles"
);
...
...
src/windows/classes/sun/awt/windows/WFramePeer.java
浏览文件 @
34f8e42d
...
...
@@ -24,25 +24,12 @@
*/
package
sun.awt.windows
;
import
java.util.Vector
;
import
java.awt.*
;
import
java.awt.peer.*
;
import
java.awt.image.ImageObserver
;
import
java.awt.image.Raster
;
import
java.awt.image.DataBuffer
;
import
java.awt.image.DataBufferInt
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.ColorModel
;
import
sun.awt.image.ImageRepresentation
;
import
sun.awt.image.IntegerComponentRaster
;
import
sun.awt.image.ToolkitImage
;
import
sun.awt.im.*
;
import
sun.awt.Win32GraphicsDevice
;
import
sun.awt.AWTAccessor
;
import
sun.awt.im.InputMethodManager
;
import
java.security.AccessController
;
import
sun.security.action.GetPropertyAction
;
class
WFramePeer
extends
WWindowPeer
implements
FramePeer
{
...
...
@@ -71,9 +58,9 @@ class WFramePeer extends WWindowPeer implements FramePeer {
private
native
void
clearMaximizedBounds
();
private
static
final
boolean
keepOnMinimize
=
"true"
.
equals
(
(
String
)
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"sun.awt.keepWorkingSetOnMinimize"
)));
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"sun.awt.keepWorkingSetOnMinimize"
)));
public
void
setMaximizedBounds
(
Rectangle
b
)
{
if
(
b
==
null
)
{
...
...
src/windows/classes/sun/awt/windows/WInputMethod.java
浏览文件 @
34f8e42d
...
...
@@ -82,12 +82,12 @@ public class WInputMethod extends InputMethodAdapter
private
final
static
boolean
COMMIT_INPUT
=
true
;
private
final
static
boolean
DISCARD_INPUT
=
false
;
private
static
Map
[]
highlightStyles
;
private
static
Map
<
TextAttribute
,
Object
>
[]
highlightStyles
;
// Initialize highlight mapping table
static
{
Map
styles
[]
=
new
Map
[
4
];
HashMap
map
;
Map
<
TextAttribute
,
Object
>
styles
[]
=
new
Map
[
4
];
HashMap
<
TextAttribute
,
Object
>
map
;
// UNSELECTED_RAW_TEXT_HIGHLIGHT
map
=
new
HashMap
(
1
);
...
...
@@ -410,7 +410,7 @@ public class WInputMethod extends InputMethodAdapter
/**
* @see java.awt.Toolkit#mapInputMethodHighlight
*/
static
Map
mapInputMethodHighlight
(
InputMethodHighlight
highlight
)
{
static
Map
<
TextAttribute
,?>
mapInputMethodHighlight
(
InputMethodHighlight
highlight
)
{
int
index
;
int
state
=
highlight
.
getState
();
if
(
state
==
InputMethodHighlight
.
RAW_TEXT
)
{
...
...
src/windows/classes/sun/awt/windows/WMenuItemPeer.java
浏览文件 @
34f8e42d
...
...
@@ -158,9 +158,9 @@ class WMenuItemPeer extends WObjectPeer implements MenuItemPeer {
private
static
Font
defaultMenuFont
;
static
{
defaultMenuFont
=
(
Font
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Objec
t
run
()
{
defaultMenuFont
=
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Font
>
()
{
public
Fon
t
run
()
{
try
{
ResourceBundle
rb
=
ResourceBundle
.
getBundle
(
"sun.awt.windows.awtLocalization"
);
return
Font
.
decode
(
rb
.
getString
(
"menuFont"
));
...
...
src/windows/classes/sun/awt/windows/WPageDialog.java
浏览文件 @
34f8e42d
...
...
@@ -55,6 +55,7 @@ public class WPageDialog extends WPrintDialog {
this
.
painter
=
painter
;
}
@SuppressWarnings
(
"deprecation"
)
public
void
addNotify
()
{
synchronized
(
getTreeLock
())
{
Container
parent
=
getParent
();
...
...
src/windows/classes/sun/awt/windows/WPageDialogPeer.java
浏览文件 @
34f8e42d
...
...
@@ -49,7 +49,7 @@ public class WPageDialogPeer extends WPrintDialogPeer {
// but if it is we need to trap it so the thread does
// not hide is called and the thread doesn't hang.
}
((
WPrintDialog
)
target
).
hide
(
);
((
WPrintDialog
)
target
).
setVisible
(
false
);
}
}).
start
();
}
...
...
src/windows/classes/sun/awt/windows/WPrintDialog.java
浏览文件 @
34f8e42d
...
...
@@ -53,6 +53,7 @@ public class WPrintDialog extends Dialog {
// Use native code to circumvent access restrictions on Component.peer
protected
native
void
setPeer
(
ComponentPeer
peer
);
@SuppressWarnings
(
"deprecation"
)
public
void
addNotify
()
{
synchronized
(
getTreeLock
())
{
Container
parent
=
getParent
();
...
...
src/windows/classes/sun/awt/windows/WPrintDialogPeer.java
浏览文件 @
34f8e42d
...
...
@@ -73,7 +73,7 @@ public class WPrintDialogPeer extends WWindowPeer implements DialogPeer {
// but if it is we need to trap it so the thread does
// not hide is called and the thread doesn't hang.
}
((
WPrintDialog
)
target
).
hide
(
);
((
WPrintDialog
)
target
).
setVisible
(
false
);
}
}).
start
();
}
...
...
src/windows/classes/sun/awt/windows/WToolkit.java
浏览文件 @
34f8e42d
...
...
@@ -74,7 +74,7 @@ public class WToolkit extends SunToolkit implements Runnable {
WClipboard
clipboard
;
// cache of font peers
private
Hashtable
cacheFontPeer
;
private
Hashtable
<
String
,
FontPeer
>
cacheFontPeer
;
// Windows properties
private
WDesktopProperties
wprops
;
...
...
@@ -110,10 +110,10 @@ public class WToolkit extends SunToolkit implements Runnable {
log
.
fine
(
"Win version: "
+
getWindowsVersion
());
}
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
()
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Void
>
()
{
public
Object
run
()
{
public
Void
run
()
{
String
browserProp
=
System
.
getProperty
(
"browser"
);
if
(
browserProp
!=
null
&&
browserProp
.
equals
(
"sun.plugin"
))
{
disableCustomPalette
();
...
...
@@ -261,8 +261,8 @@ public class WToolkit extends SunToolkit implements Runnable {
}
private
final
void
registerShutdownHook
()
{
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Void
>
()
{
public
Void
run
()
{
ThreadGroup
currentTG
=
Thread
.
currentThread
().
getThreadGroup
();
ThreadGroup
parentTG
=
currentTG
.
getParent
();
...
...
@@ -399,6 +399,7 @@ public class WToolkit extends SunToolkit implements Runnable {
return
peer
;
}
@SuppressWarnings
(
"deprecation"
)
public
void
disableBackgroundErase
(
Canvas
canvas
)
{
WCanvasPeer
peer
=
(
WCanvasPeer
)
canvas
.
getPeer
();
if
(
peer
==
null
)
{
...
...
@@ -592,7 +593,7 @@ public class WToolkit extends SunToolkit implements Runnable {
FontPeer
retval
=
null
;
String
lcName
=
name
.
toLowerCase
();
if
(
null
!=
cacheFontPeer
)
{
retval
=
(
FontPeer
)
cacheFontPeer
.
get
(
lcName
+
style
);
retval
=
cacheFontPeer
.
get
(
lcName
+
style
);
if
(
null
!=
retval
)
{
return
retval
;
}
...
...
@@ -600,7 +601,7 @@ public class WToolkit extends SunToolkit implements Runnable {
retval
=
new
WFontPeer
(
name
,
style
);
if
(
retval
!=
null
)
{
if
(
null
==
cacheFontPeer
)
{
cacheFontPeer
=
new
Hashtable
(
5
,
(
float
)
0.9
);
cacheFontPeer
=
new
Hashtable
<>(
5
,
0.9f
);
}
if
(
null
!=
cacheFontPeer
)
{
cacheFontPeer
.
put
(
lcName
+
style
,
retval
);
...
...
@@ -698,7 +699,9 @@ public class WToolkit extends SunToolkit implements Runnable {
/**
* Returns a style map for the input method highlight.
*/
public
Map
mapInputMethodHighlight
(
InputMethodHighlight
highlight
)
{
public
Map
<
java
.
awt
.
font
.
TextAttribute
,?>
mapInputMethodHighlight
(
InputMethodHighlight
highlight
)
{
return
WInputMethod
.
mapInputMethodHighlight
(
highlight
);
}
...
...
@@ -968,12 +971,14 @@ public class WToolkit extends SunToolkit implements Runnable {
return
!
Win32GraphicsEnvironment
.
isDWMCompositionEnabled
();
}
@SuppressWarnings
(
"deprecation"
)
public
void
grab
(
Window
w
)
{
if
(
w
.
getPeer
()
!=
null
)
{
((
WWindowPeer
)
w
.
getPeer
()).
grab
();
}
}
@SuppressWarnings
(
"deprecation"
)
public
void
ungrab
(
Window
w
)
{
if
(
w
.
getPeer
()
!=
null
)
{
((
WWindowPeer
)
w
.
getPeer
()).
ungrab
();
...
...
src/windows/classes/sun/awt/windows/WWindowPeer.java
浏览文件 @
34f8e42d
...
...
@@ -92,7 +92,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
}
// WComponentPeer overrides
@SuppressWarnings
(
"unchecked"
)
protected
void
disposeImpl
()
{
AppContext
appContext
=
SunToolkit
.
targetToAppContext
(
target
);
synchronized
(
appContext
)
{
...
...
@@ -378,6 +378,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
return
modalBlocker
!=
null
;
}
@SuppressWarnings
(
"deprecation"
)
public
void
setModalBlocked
(
Dialog
dialog
,
boolean
blocked
)
{
synchronized
(((
Component
)
getTarget
()).
getTreeLock
())
// State lock should always be after awtLock
{
...
...
@@ -417,6 +418,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
* The list is sorted by the time of activation, so the latest
* active window is always at the end.
*/
@SuppressWarnings
(
"unchecked"
)
public
static
long
[]
getActiveWindowHandles
()
{
AppContext
appContext
=
AppContext
.
getAppContext
();
synchronized
(
appContext
)
{
...
...
@@ -571,6 +573,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
super
.
print
(
g
);
}
@SuppressWarnings
(
"deprecation"
)
private
void
replaceSurfaceDataRecursively
(
Component
c
)
{
if
(
c
instanceof
Container
)
{
for
(
Component
child
:
((
Container
)
c
).
getComponents
())
{
...
...
@@ -691,13 +694,13 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
// its shape only. To restore the correct visual appearance
// of the window (i.e. w/ the correct shape) we have to reset
// the shape.
Shape
shape
=
((
Window
)
target
)
.
getShape
();
Shape
shape
=
target
.
getShape
();
if
(
shape
!=
null
)
{
((
Window
)
target
)
.
setShape
(
shape
);
target
.
setShape
(
shape
);
}
}
if
(
((
Window
)
target
)
.
isVisible
())
{
if
(
target
.
isVisible
())
{
updateWindow
(
true
);
}
}
...
...
@@ -730,6 +733,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
* then the method registers ActiveWindowListener, GuiDisposedListener listeners;
* it executes the initilialization only once per AppContext.
*/
@SuppressWarnings
(
"unchecked"
)
private
static
void
initActiveWindowsTracking
(
Window
w
)
{
AppContext
appContext
=
AppContext
.
getAppContext
();
synchronized
(
appContext
)
{
...
...
@@ -774,6 +778,7 @@ public class WWindowPeer extends WPanelPeer implements WindowPeer,
* updates the list of active windows per AppContext, so the latest active
* window is always at the end of the list. The list is stored in AppContext.
*/
@SuppressWarnings
(
value
=
{
"deprecation"
,
"unchecked"
})
private
static
class
ActiveWindowListener
implements
PropertyChangeListener
{
public
void
propertyChange
(
PropertyChangeEvent
e
)
{
Window
w
=
(
Window
)
e
.
getNewValue
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录