Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
bc63563e
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bc63563e
编写于
10月 06, 2009
作者:
Y
yan
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
b8065ea0
9ebeb0fa
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
169 addition
and
56 deletion
+169
-56
jdk/src/share/classes/java/awt/Component.java
jdk/src/share/classes/java/awt/Component.java
+71
-1
jdk/src/share/classes/java/awt/Container.java
jdk/src/share/classes/java/awt/Container.java
+85
-43
jdk/src/share/classes/java/awt/EventQueue.java
jdk/src/share/classes/java/awt/EventQueue.java
+2
-1
jdk/src/share/classes/sun/awt/AWTAutoShutdown.java
jdk/src/share/classes/sun/awt/AWTAutoShutdown.java
+10
-4
jdk/src/share/native/sun/awt/giflib/gifalloc.c
jdk/src/share/native/sun/awt/giflib/gifalloc.c
+1
-0
jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
+0
-7
未找到文件。
jdk/src/share/classes/java/awt/Component.java
浏览文件 @
bc63563e
...
...
@@ -94,7 +94,17 @@ import sun.util.logging.PlatformLogger;
* the nonmenu-related Abstract Window Toolkit components. Class
* <code>Component</code> can also be extended directly to create a
* lightweight component. A lightweight component is a component that is
* not associated with a native opaque window.
* not associated with a native window. On the contrary, a heavyweight
* component is associated with a native window. The {@link #isLightweight()}
* method may be used to distinguish between the two kinds of the components.
* <p>
* Lightweight and heavyweight components may be mixed in a single component
* hierarchy. However, for correct operating of such a mixed hierarchy of
* components, the whole hierarchy must be valid. When the hierarchy gets
* invalidated, like after changing the bounds of components, or
* adding/removing components to/from containers, the whole hierarchy must be
* validated afterwards by means of the {@link Container#validate()} method
* invoked on the top-most invalid container of the hierarchy.
* <p>
* <h3>Serialization</h3>
* It is important to note that only AWT listeners which conform
...
...
@@ -1492,9 +1502,14 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Shows or hides this component depending on the value of parameter
* <code>b</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param b if <code>true</code>, shows this component;
* otherwise, hides this component
* @see #isVisible
* @see #invalidate
* @since JDK1.1
*/
public
void
setVisible
(
boolean
b
)
{
...
...
@@ -1753,10 +1768,15 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Sets the font of this component.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param f the font to become this component's font;
* if this parameter is <code>null</code> then this
* component will inherit the font of its parent
* @see #getFont
* @see #invalidate
* @since JDK1.0
* @beaninfo
* bound: true
...
...
@@ -1830,8 +1850,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Sets the locale of this component. This is a bound property.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param l the locale to become this component's locale
* @see #getLocale
* @see #invalidate
* @since JDK1.1
*/
public
void
setLocale
(
Locale
l
)
{
...
...
@@ -1951,12 +1976,17 @@ public abstract class Component implements ImageObserver, MenuContainer,
* Moves this component to a new location. The top-left corner of
* the new location is specified by the <code>x</code> and <code>y</code>
* parameters in the coordinate space of this component's parent.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param x the <i>x</i>-coordinate of the new location's
* top-left corner in the parent's coordinate space
* @param y the <i>y</i>-coordinate of the new location's
* top-left corner in the parent's coordinate space
* @see #getLocation
* @see #setBounds
* @see #invalidate
* @since JDK1.1
*/
public
void
setLocation
(
int
x
,
int
y
)
{
...
...
@@ -1979,11 +2009,16 @@ public abstract class Component implements ImageObserver, MenuContainer,
* Moves this component to a new location. The top-left corner of
* the new location is specified by point <code>p</code>. Point
* <code>p</code> is given in the parent's coordinate space.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param p the point defining the top-left corner
* of the new location, given in the coordinate space of this
* component's parent
* @see #getLocation
* @see #setBounds
* @see #invalidate
* @since JDK1.1
*/
public
void
setLocation
(
Point
p
)
{
...
...
@@ -2018,10 +2053,15 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Resizes this component so that it has width <code>width</code>
* and height <code>height</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param width the new width of this component in pixels
* @param height the new height of this component in pixels
* @see #getSize
* @see #setBounds
* @see #invalidate
* @since JDK1.1
*/
public
void
setSize
(
int
width
,
int
height
)
{
...
...
@@ -2043,10 +2083,15 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Resizes this component so that it has width <code>d.width</code>
* and height <code>d.height</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param d the dimension specifying the new size
* of this component
* @see #setSize
* @see #setBounds
* @see #invalidate
* @since JDK1.1
*/
public
void
setSize
(
Dimension
d
)
{
...
...
@@ -2089,6 +2134,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
* Moves and resizes this component. The new location of the top-left
* corner is specified by <code>x</code> and <code>y</code>, and the
* new size is specified by <code>width</code> and <code>height</code>.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param x the new <i>x</i>-coordinate of this component
* @param y the new <i>y</i>-coordinate of this component
* @param width the new <code>width</code> of this component
...
...
@@ -2099,6 +2148,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
* @see #setLocation(Point)
* @see #setSize(int, int)
* @see #setSize(Dimension)
* @see #invalidate
* @since JDK1.1
*/
public
void
setBounds
(
int
x
,
int
y
,
int
width
,
int
height
)
{
...
...
@@ -2231,12 +2281,17 @@ public abstract class Component implements ImageObserver, MenuContainer,
* position is specified by <code>r.x</code> and <code>r.y</code>,
* and its new size is specified by <code>r.width</code> and
* <code>r.height</code>
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param r the new bounding rectangle for this component
* @see #getBounds
* @see #setLocation(int, int)
* @see #setLocation(Point)
* @see #setSize(int, int)
* @see #setSize(Dimension)
* @see #invalidate
* @since JDK1.1
*/
public
void
setBounds
(
Rectangle
r
)
{
...
...
@@ -6625,8 +6680,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
* native screen resource.
* This method is called internally by the toolkit and should
* not be called directly by programs.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @see #isDisplayable
* @see #removeNotify
* @see #invalidate
* @since JDK1.0
*/
public
void
addNotify
()
{
...
...
@@ -8593,8 +8653,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
* To set the orientation of an entire component
* hierarchy, use
* {@link #applyComponentOrientation applyComponentOrientation}.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
*
* @see ComponentOrientation
* @see #invalidate
*
* @author Laura Werner, IBM
* @beaninfo
...
...
@@ -8630,12 +8695,17 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Sets the <code>ComponentOrientation</code> property of this component
* and all components contained within it.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
*
* @param orientation the new component orientation of this component and
* the components contained within it.
* @exception NullPointerException if <code>orientation</code> is null.
* @see #setComponentOrientation
* @see #getComponentOrientation
* @see #invalidate
* @since 1.4
*/
public
void
applyComponentOrientation
(
ComponentOrientation
orientation
)
{
...
...
jdk/src/share/classes/java/awt/Container.java
浏览文件 @
bc63563e
...
...
@@ -381,16 +381,15 @@ public class Container extends Component {
* Appends the specified component to the end of this container.
* This is a convenience method for {@link #addImpl}.
* <p>
* Note: If a component has been added to a container that
* has been displayed, <code>validate</code> must be
* called on that container to display the new component.
* If multiple components are being added, you can improve
* efficiency by calling <code>validate</code> only once,
* after all the components have been added.
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* display the added component.
*
* @param comp the component to be added
* @exception NullPointerException if {@code comp} is {@code null}
* @see #addImpl
* @see #invalidate
* @see #validate
* @see javax.swing.JComponent#revalidate()
* @return the component argument
...
...
@@ -406,8 +405,15 @@ public class Container extends Component {
* <p>
* This method is obsolete as of 1.1. Please use the
* method <code>add(Component, Object)</code> instead.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* display the added component.
*
* @exception NullPointerException if {@code comp} is {@code null}
* @see #add(Component, Object)
* @see #invalidate
*/
public
Component
add
(
String
name
,
Component
comp
)
{
addImpl
(
comp
,
name
,
-
1
);
...
...
@@ -419,12 +425,11 @@ public class Container extends Component {
* position.
* This is a convenience method for {@link #addImpl}.
* <p>
* Note: If a component has been added to a container that
* has been displayed, <code>validate</code> must be
* called on that container to display the new component.
* If multiple components are being added, you can improve
* efficiency by calling <code>validate</code> only once,
* after all the components have been added.
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* display the added component.
*
*
* @param comp the component to be added
* @param index the position at which to insert the component,
...
...
@@ -435,6 +440,7 @@ public class Container extends Component {
* @return the component <code>comp</code>
* @see #addImpl
* @see #remove
* @see #invalidate
* @see #validate
* @see javax.swing.JComponent#revalidate()
*/
...
...
@@ -700,6 +706,9 @@ public class Container extends Component {
* This property is guaranteed to apply only to lightweight
* non-<code>Container</code> components.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
* <p>
* <b>Note</b>: Not all platforms support changing the z-order of
* heavyweight components from one container into another without
* the call to <code>removeNotify</code>. There is no way to detect
...
...
@@ -723,6 +732,7 @@ public class Container extends Component {
* @exception IllegalArgumentException if adding a <code>Window</code>
* to a container
* @see #getComponentZOrder(java.awt.Component)
* @see #invalidate
* @since 1.5
*/
public
void
setComponentZOrder
(
Component
comp
,
int
index
)
{
...
...
@@ -923,18 +933,18 @@ public class Container extends Component {
* this container's layout using the specified constraints object.
* This is a convenience method for {@link #addImpl}.
* <p>
* Note: If a component has been added to a container that
* has been displayed, <code>validate</code> must be
* called on that container to display the new component.
* If multiple components are being added, you can improve
* efficiency by calling <code>validate</code> only once,
* after all the components have been added.
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* display the added component.
*
*
* @param comp the component to be added
* @param constraints an object expressing
* layout contraints for this component
* @exception NullPointerException if {@code comp} is {@code null}
* @see #addImpl
* @see #invalidate
* @see #validate
* @see javax.swing.JComponent#revalidate()
* @see LayoutManager
...
...
@@ -951,12 +961,11 @@ public class Container extends Component {
* the specified constraints object.
* This is a convenience method for {@link #addImpl}.
* <p>
* Note: If a component has been added to a container that
* has been displayed, <code>validate</code> must be
* called on that container to display the new component.
* If multiple components are being added, you can improve
* efficiency by calling <code>validate</code> only once,
* after all the components have been added.
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* display the added component.
*
*
* @param comp the component to be added
* @param constraints an object expressing layout contraints for this
...
...
@@ -967,6 +976,7 @@ public class Container extends Component {
* @exception IllegalArgumentException if {@code index} is invalid (see
* {@link #addImpl} for details)
* @see #addImpl
* @see #invalidate
* @see #validate
* @see javax.swing.JComponent#revalidate()
* @see #remove
...
...
@@ -1014,6 +1024,11 @@ public class Container extends Component {
* <code>super.addImpl(comp, constraints, index)</code>
* </blockquote>
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* display the added component.
*
* @param comp the component to be added
* @param constraints an object expressing layout constraints
* for this component
...
...
@@ -1033,6 +1048,7 @@ public class Container extends Component {
* @see #add(Component)
* @see #add(Component, int)
* @see #add(Component, java.lang.Object)
* @see #invalidate
* @see LayoutManager
* @see LayoutManager2
* @since JDK1.1
...
...
@@ -1145,19 +1161,18 @@ public class Container extends Component {
* This method also notifies the layout manager to remove the
* component from this container's layout via the
* <code>removeLayoutComponent</code> method.
*
* <p>
* Note: If a component has been removed from a container that
* had been displayed, {@link #validate} must be
* called on that container to reflect changes.
* If multiple components are being removed, you can improve
* efficiency by calling {@link #validate} only once,
* after all the components have been removed.
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* reflect the changes.
*
*
* @param index the index of the component to be removed
* @throws ArrayIndexOutOfBoundsException if {@code index} is not in
* range {@code [0, getComponentCount()-1]}
* @see #add
* @see #invalidate
* @see #validate
* @see #getComponentCount
* @since JDK1.1
...
...
@@ -1209,17 +1224,15 @@ public class Container extends Component {
* This method also notifies the layout manager to remove the
* component from this container's layout via the
* <code>removeLayoutComponent</code> method.
*
* <p>
* Note: If a component has been removed from a container that
* had been displayed, {@link #validate} must be
* called on that container to reflect changes.
* If multiple components are being removed, you can improve
* efficiency by calling {@link #validate} only once,
* after all the components have been removed.
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* reflect the changes.
*
* @param comp the component to be removed
* @see #add
* @see #invalidate
* @see #validate
* @see #remove(int)
*/
...
...
@@ -1239,8 +1252,15 @@ public class Container extends Component {
* This method also notifies the layout manager to remove the
* components from this container's layout via the
* <code>removeLayoutComponent</code> method.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy. If the container has already been
* displayed, the hierarchy must be validated thereafter in order to
* reflect the changes.
*
* @see #add
* @see #remove
* @see #invalidate
*/
public
void
removeAll
()
{
synchronized
(
getTreeLock
())
{
...
...
@@ -1432,9 +1452,14 @@ public class Container extends Component {
/**
* Sets the layout manager for this container.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param mgr the specified layout manager
* @see #doLayout
* @see #getLayout
* @see #invalidate
*/
public
void
setLayout
(
LayoutManager
mgr
)
{
layoutMgr
=
mgr
;
...
...
@@ -1502,9 +1527,17 @@ public class Container extends Component {
* <p>If this {@code Container} is not valid, this method invokes
* the {@code validateTree} method and marks this {@code Container}
* as valid. Otherwise, no action is performed.
* <p>
* Note that the {@code invalidate()} method may invalidate not only the
* component it is called upon, but also the parents of the component.
* Therefore, to restore the validity of the hierarchy, the {@code
* validate()} method must be invoked on the top-most invalid container of
* the hierarchy. For performance reasons a developer may postpone the
* validation of the hierarchy till a bunch of layout-related operations
* completes, e.g. after adding all the children to the container.
*
* @see #add(java.awt.Component)
* @see
Component
#invalidate
* @see #invalidate
* @see javax.swing.JComponent#revalidate()
* @see #validateTree
*/
...
...
@@ -1588,8 +1621,13 @@ public class Container extends Component {
/**
* Sets the font of this container.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param f The font to become this container's font.
* @see Component#getFont
* @see #invalidate
* @since JDK1.0
*/
public
void
setFont
(
Font
f
)
{
...
...
@@ -3386,12 +3424,16 @@ public class Container extends Component {
/**
* Sets the <code>ComponentOrientation</code> property of this container
* and all components contained within it.
* <p>
* This method changes layout-related information, and therefore,
* invalidates the component hierarchy.
*
* @param o the new component orientation of this container and
* the components contained within it.
* @exception NullPointerException if <code>orientation</code> is null.
* @see Component#setComponentOrientation
* @see Component#getComponentOrientation
* @see #invalidate
* @since 1.4
*/
public
void
applyComponentOrientation
(
ComponentOrientation
o
)
{
...
...
@@ -4069,16 +4111,16 @@ public class Container extends Component {
mixingLog
.
fine
(
"this = "
+
this
);
}
if
(!
isMixingNeeded
())
{
return
;
}
boolean
isLightweight
=
isLightweight
();
if
(
isLightweight
&&
isRecursivelyVisibleUpToHeavyweightContainer
())
{
recursiveShowHeavyweightChildren
();
}
if
(!
isMixingNeeded
())
{
return
;
}
if
(!
isLightweight
||
(
isLightweight
&&
hasHeavyweightDescendants
()))
{
recursiveApplyCurrentShape
();
}
...
...
jdk/src/share/classes/java/awt/EventQueue.java
浏览文件 @
bc63563e
...
...
@@ -843,7 +843,8 @@ public class EventQueue {
final
void
initDispatchThread
()
{
synchronized
(
this
)
{
if
(
dispatchThread
==
null
&&
!
threadGroup
.
isDestroyed
())
{
AppContext
appContext
=
AppContext
.
getAppContext
();
if
(
dispatchThread
==
null
&&
!
threadGroup
.
isDestroyed
()
&&
!
appContext
.
isDisposed
())
{
dispatchThread
=
(
EventDispatchThread
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
...
...
jdk/src/share/classes/sun/awt/AWTAutoShutdown.java
浏览文件 @
bc63563e
...
...
@@ -154,14 +154,17 @@ public final class AWTAutoShutdown implements Runnable {
/**
* Add a specified thread to the set of busy event dispatch threads.
* If this set already contains the specified thread
, the call leaves
* this set unchanged and returns silently.
* If this set already contains the specified thread
or the thread is null,
* th
e call leaves th
is set unchanged and returns silently.
*
* @param thread thread to be added to this set, if not present.
* @see AWTAutoShutdown#notifyThreadFree
* @see AWTAutoShutdown#isReadyToShutdown
*/
public
void
notifyThreadBusy
(
final
Thread
thread
)
{
if
(
thread
==
null
)
{
return
;
}
synchronized
(
activationLock
)
{
synchronized
(
mainLock
)
{
if
(
blockerThread
==
null
)
{
...
...
@@ -177,14 +180,17 @@ public final class AWTAutoShutdown implements Runnable {
/**
* Remove a specified thread from the set of busy event dispatch threads.
* If this set doesn't contain the specified thread
, the call leaves
* this set unchanged and returns silently.
* If this set doesn't contain the specified thread
or the thread is null,
* th
e call leaves th
is set unchanged and returns silently.
*
* @param thread thread to be removed from this set, if present.
* @see AWTAutoShutdown#notifyThreadBusy
* @see AWTAutoShutdown#isReadyToShutdown
*/
public
void
notifyThreadFree
(
final
Thread
thread
)
{
if
(
thread
==
null
)
{
return
;
}
synchronized
(
activationLock
)
{
synchronized
(
mainLock
)
{
busyThreadSet
.
remove
(
thread
);
...
...
jdk/src/share/native/sun/awt/giflib/gifalloc.c
浏览文件 @
bc63563e
...
...
@@ -88,6 +88,7 @@ MakeMapObject(int ColorCount,
Object
->
Colors
=
(
GifColorType
*
)
calloc
(
ColorCount
,
sizeof
(
GifColorType
));
if
(
Object
->
Colors
==
(
GifColorType
*
)
NULL
)
{
free
(
Object
);
return
((
ColorMapObject
*
)
NULL
);
}
...
...
jdk/src/solaris/classes/sun/awt/X11/XToolkit.java
浏览文件 @
bc63563e
...
...
@@ -326,13 +326,6 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
if
(
log
.
isLoggable
(
PlatformLogger
.
FINE
))
{
dumpPeers
();
}
awtLock
();
try
{
XlibWrapper
.
XSetErrorHandler
(
saved_error_handler
);
}
finally
{
awtUnlock
();
}
}
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录