Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
edcd0581
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
edcd0581
编写于
10月 02, 2013
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8024600: [macosx] code prevents use of -Xlint:auxiliaryclass,empty in jdk build
Reviewed-by: anthony, serb
上级
13255391
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
190 addition
and
136 deletion
+190
-136
src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java
...macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java
+0
-4
src/macosx/classes/com/apple/eawt/_OpenAppHandler.java
src/macosx/classes/com/apple/eawt/_OpenAppHandler.java
+30
-0
src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java
src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java
+0
-130
src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
...x/classes/com/apple/laf/AquaComboBoxRendererInternal.java
+157
-0
src/macosx/classes/com/apple/laf/AquaMenuBarUI.java
src/macosx/classes/com/apple/laf/AquaMenuBarUI.java
+3
-2
未找到文件。
src/macosx/classes/com/apple/eawt/_AppEventLegacyHandler.java
浏览文件 @
edcd0581
...
...
@@ -31,10 +31,6 @@ import java.util.*;
import
com.apple.eawt.AppEvent.*
;
interface
_OpenAppHandler
{
void
handleOpenApp
();
}
@SuppressWarnings
(
"deprecation"
)
class
_AppEventLegacyHandler
implements
AboutHandler
,
PreferencesHandler
,
_OpenAppHandler
,
AppReOpenedListener
,
OpenFilesHandler
,
PrintFilesHandler
,
QuitHandler
{
final
_AppEventHandler
parent
;
...
...
src/macosx/classes/com/apple/eawt/_OpenAppHandler.java
0 → 100644
浏览文件 @
edcd0581
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
com.apple.eawt
;
interface
_OpenAppHandler
{
void
handleOpenApp
();
}
\ No newline at end of file
src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java
浏览文件 @
edcd0581
...
...
@@ -25,141 +25,11 @@
package
com.apple.laf
;
import
java.awt.*
;
import
javax.swing.*
;
import
javax.swing.plaf.UIResource
;
import
sun.swing.SwingUtilities2
;
class
AquaComboBoxRenderer
extends
AquaComboBoxRendererInternal
implements
UIResource
{
public
AquaComboBoxRenderer
(
final
JComboBox
comboBox
)
{
super
(
comboBox
);
}
}
class
AquaComboBoxRendererInternal
extends
JLabel
implements
ListCellRenderer
{
final
JComboBox
fComboBox
;
boolean
fSelected
;
boolean
fChecked
;
boolean
fInList
;
boolean
fEditable
;
boolean
fDrawCheckedItem
=
true
;
// Provides space for a checkbox, and is translucent
public
AquaComboBoxRendererInternal
(
final
JComboBox
comboBox
)
{
super
();
fComboBox
=
comboBox
;
}
// Don't include checkIcon space, because this is also used for button size calculations
// - the popup-size calc will get checkIcon space from getInsets
public
Dimension
getPreferredSize
()
{
// From BasicComboBoxRenderer - trick to avoid zero-height items
final
Dimension
size
;
final
String
text
=
getText
();
if
((
text
==
null
)
||
(
""
.
equals
(
text
)))
{
setText
(
" "
);
size
=
super
.
getPreferredSize
();
setText
(
""
);
}
else
{
size
=
super
.
getPreferredSize
();
}
return
size
;
}
// Don't paint the border here, it gets painted by the UI
protected
void
paintBorder
(
final
Graphics
g
)
{
}
public
int
getBaseline
(
int
width
,
int
height
)
{
return
super
.
getBaseline
(
width
,
height
)
-
1
;
}
// Really means is the one with the mouse over it
public
Component
getListCellRendererComponent
(
final
JList
list
,
final
Object
value
,
int
index
,
final
boolean
isSelected
,
final
boolean
cellHasFocus
)
{
fInList
=
(
index
>=
0
);
// When the button wants the item painted, it passes in -1
fSelected
=
isSelected
;
if
(
index
<
0
)
{
index
=
fComboBox
.
getSelectedIndex
();
}
// changed this to not ask for selected index but directly compare the current item and selected item
// different from basic because basic has no concept of checked, just has the last one selected,
// and the user changes selection. We have selection and a check mark.
// we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes
// it does a linear compare of every object in the checkbox until it finds the selected one, so if
// we have a 5000 element list we will 5000 * (selected index) .equals() of objects.
// See Radar #3141307
// Fix for Radar # 3204287 where we ask for an item at a negative index!
if
(
index
>=
0
)
{
final
Object
item
=
fComboBox
.
getItemAt
(
index
);
fChecked
=
fInList
&&
item
!=
null
&&
item
.
equals
(
fComboBox
.
getSelectedItem
());
}
else
{
fChecked
=
false
;
}
fEditable
=
fComboBox
.
isEditable
();
if
(
isSelected
)
{
if
(
fEditable
)
{
setBackground
(
UIManager
.
getColor
(
"List.selectionBackground"
));
setForeground
(
UIManager
.
getColor
(
"List.selectionForeground"
));
}
else
{
setBackground
(
list
.
getSelectionBackground
());
setForeground
(
list
.
getSelectionForeground
());
}
}
else
{
if
(
fEditable
)
{
setBackground
(
UIManager
.
getColor
(
"List.background"
));
setForeground
(
UIManager
.
getColor
(
"List.foreground"
));
}
else
{
setBackground
(
list
.
getBackground
());
setForeground
(
list
.
getForeground
());
}
}
setFont
(
list
.
getFont
());
if
(
value
instanceof
Icon
)
{
setIcon
((
Icon
)
value
);
}
else
{
setText
((
value
==
null
)
?
" "
:
value
.
toString
());
}
return
this
;
}
public
Insets
getInsets
(
Insets
insets
)
{
if
(
insets
==
null
)
insets
=
new
Insets
(
0
,
0
,
0
,
0
);
insets
.
top
=
1
;
insets
.
bottom
=
1
;
insets
.
right
=
5
;
insets
.
left
=
(
fInList
&&
!
fEditable
?
16
+
7
:
5
);
return
insets
;
}
protected
void
setDrawCheckedItem
(
final
boolean
drawCheckedItem
)
{
this
.
fDrawCheckedItem
=
drawCheckedItem
;
}
// Paint this component, and a checkbox if it's the selected item and not in the button
protected
void
paintComponent
(
final
Graphics
g
)
{
if
(
fInList
)
{
if
(
fSelected
&&
!
fEditable
)
{
AquaMenuPainter
.
instance
().
paintSelectedMenuItemBackground
(
g
,
getWidth
(),
getHeight
());
}
else
{
g
.
setColor
(
getBackground
());
g
.
fillRect
(
0
,
0
,
getWidth
(),
getHeight
());
}
if
(
fChecked
&&
!
fEditable
&&
fDrawCheckedItem
)
{
final
int
y
=
getHeight
()
-
4
;
g
.
setColor
(
getForeground
());
SwingUtilities2
.
drawString
(
fComboBox
,
g
,
"\u2713"
,
6
,
y
);
}
}
super
.
paintComponent
(
g
);
}
}
src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
0 → 100644
浏览文件 @
edcd0581
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package
com.apple.laf
;
import
sun.swing.SwingUtilities2
;
import
javax.swing.*
;
import
java.awt.*
;
class
AquaComboBoxRendererInternal
extends
JLabel
implements
ListCellRenderer
{
final
JComboBox
fComboBox
;
boolean
fSelected
;
boolean
fChecked
;
boolean
fInList
;
boolean
fEditable
;
boolean
fDrawCheckedItem
=
true
;
// Provides space for a checkbox, and is translucent
public
AquaComboBoxRendererInternal
(
final
JComboBox
comboBox
)
{
super
();
fComboBox
=
comboBox
;
}
// Don't include checkIcon space, because this is also used for button size calculations
// - the popup-size calc will get checkIcon space from getInsets
public
Dimension
getPreferredSize
()
{
// From BasicComboBoxRenderer - trick to avoid zero-height items
final
Dimension
size
;
final
String
text
=
getText
();
if
((
text
==
null
)
||
(
""
.
equals
(
text
)))
{
setText
(
" "
);
size
=
super
.
getPreferredSize
();
setText
(
""
);
}
else
{
size
=
super
.
getPreferredSize
();
}
return
size
;
}
// Don't paint the border here, it gets painted by the UI
protected
void
paintBorder
(
final
Graphics
g
)
{
}
public
int
getBaseline
(
int
width
,
int
height
)
{
return
super
.
getBaseline
(
width
,
height
)
-
1
;
}
// Really means is the one with the mouse over it
public
Component
getListCellRendererComponent
(
final
JList
list
,
final
Object
value
,
int
index
,
final
boolean
isSelected
,
final
boolean
cellHasFocus
)
{
fInList
=
(
index
>=
0
);
// When the button wants the item painted, it passes in -1
fSelected
=
isSelected
;
if
(
index
<
0
)
{
index
=
fComboBox
.
getSelectedIndex
();
}
// changed this to not ask for selected index but directly compare the current item and selected item
// different from basic because basic has no concept of checked, just has the last one selected,
// and the user changes selection. We have selection and a check mark.
// we used to call fComboBox.getSelectedIndex which ends up being a very bad call for large checkboxes
// it does a linear compare of every object in the checkbox until it finds the selected one, so if
// we have a 5000 element list we will 5000 * (selected index) .equals() of objects.
// See Radar #3141307
// Fix for Radar # 3204287 where we ask for an item at a negative index!
if
(
index
>=
0
)
{
final
Object
item
=
fComboBox
.
getItemAt
(
index
);
fChecked
=
fInList
&&
item
!=
null
&&
item
.
equals
(
fComboBox
.
getSelectedItem
());
}
else
{
fChecked
=
false
;
}
fEditable
=
fComboBox
.
isEditable
();
if
(
isSelected
)
{
if
(
fEditable
)
{
setBackground
(
UIManager
.
getColor
(
"List.selectionBackground"
));
setForeground
(
UIManager
.
getColor
(
"List.selectionForeground"
));
}
else
{
setBackground
(
list
.
getSelectionBackground
());
setForeground
(
list
.
getSelectionForeground
());
}
}
else
{
if
(
fEditable
)
{
setBackground
(
UIManager
.
getColor
(
"List.background"
));
setForeground
(
UIManager
.
getColor
(
"List.foreground"
));
}
else
{
setBackground
(
list
.
getBackground
());
setForeground
(
list
.
getForeground
());
}
}
setFont
(
list
.
getFont
());
if
(
value
instanceof
Icon
)
{
setIcon
((
Icon
)
value
);
}
else
{
setText
((
value
==
null
)
?
" "
:
value
.
toString
());
}
return
this
;
}
public
Insets
getInsets
(
Insets
insets
)
{
if
(
insets
==
null
)
insets
=
new
Insets
(
0
,
0
,
0
,
0
);
insets
.
top
=
1
;
insets
.
bottom
=
1
;
insets
.
right
=
5
;
insets
.
left
=
(
fInList
&&
!
fEditable
?
16
+
7
:
5
);
return
insets
;
}
protected
void
setDrawCheckedItem
(
final
boolean
drawCheckedItem
)
{
this
.
fDrawCheckedItem
=
drawCheckedItem
;
}
// Paint this component, and a checkbox if it's the selected item and not in the button
protected
void
paintComponent
(
final
Graphics
g
)
{
if
(
fInList
)
{
if
(
fSelected
&&
!
fEditable
)
{
AquaMenuPainter
.
instance
().
paintSelectedMenuItemBackground
(
g
,
getWidth
(),
getHeight
());
}
else
{
g
.
setColor
(
getBackground
());
g
.
fillRect
(
0
,
0
,
getWidth
(),
getHeight
());
}
if
(
fChecked
&&
!
fEditable
&&
fDrawCheckedItem
)
{
final
int
y
=
getHeight
()
-
4
;
g
.
setColor
(
getForeground
());
SwingUtilities2
.
drawString
(
fComboBox
,
g
,
"\u2713"
,
6
,
y
);
}
}
super
.
paintComponent
(
g
);
}
}
src/macosx/classes/com/apple/laf/AquaMenuBarUI.java
浏览文件 @
edcd0581
...
...
@@ -73,8 +73,9 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid
public
Dimension
getPreferredSize
(
final
JComponent
c
)
{
if
(
isScreenMenuBar
((
JMenuBar
)
c
))
{
if
(
setScreenMenuBar
((
JFrame
)(
c
.
getTopLevelAncestor
())))
;
return
new
Dimension
(
0
,
0
);
if
(
setScreenMenuBar
((
JFrame
)(
c
.
getTopLevelAncestor
())))
{
return
new
Dimension
(
0
,
0
);
}
}
return
null
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录