当前位置: 首页>>代码示例>>Java>>正文


Java ContainerPeer类代码示例

本文整理汇总了Java中java.awt.peer.ContainerPeer的典型用法代码示例。如果您正苦于以下问题:Java ContainerPeer类的具体用法?Java ContainerPeer怎么用?Java ContainerPeer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContainerPeer类属于java.awt.peer包,在下文中一共展示了ContainerPeer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reparentTraverse

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:Container.java

示例2: reparentChild

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:Container.java

示例3: validateUnconditionally

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:Container.java

示例4: reparentTraverse

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
@SuppressWarnings("deprecation")
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.peer.reparent(parentPeer);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:Container.java

示例5: reparentChild

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
@SuppressWarnings("deprecation")
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)peer, (Container)comp);
        }
    } else {
        comp.peer.reparent((ContainerPeer) peer);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:Container.java

示例6: reparentChild

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/**
 * Reparents child component peer to this container peer. 
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:21,代码来源:Container.java

示例7: validateTree

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/**
    * Recursively descends the container tree and recomputes the
    * layout for any subtrees marked as needing it (those marked as
    * invalid).  Synchronization should be provided by the method
    * that calls this one:  <code>validate</code>.
    *
    * @see #doLayout
    * @see #validate
    */
   protected void validateTree() {
if (!valid) {
    if (peer instanceof ContainerPeer) {
	((ContainerPeer)peer).beginLayout();
    }
    doLayout();
           Component component[] = this.component;
    for (int i = 0 ; i < ncomponents ; ++i) {
	Component comp = component[i];
	if (   (comp instanceof Container) 
            && !(comp instanceof Window)
	    && !comp.valid) {
	    ((Container)comp).validateTree();
	} else {
	    comp.validate();
	}
    }
    if (peer instanceof ContainerPeer) {
	((ContainerPeer)peer).endLayout();
    }
}
valid = true;
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:33,代码来源:Container.java

示例8: addNotify

import java.awt.peer.ContainerPeer; //导入依赖的package包/类
/** 
 * Makes this Container displayable by connecting it to
 * a native screen resource.  Making a container displayable will
 * cause all of its children to be made displayable.
 * This method is called internally by the toolkit and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #removeNotify
 */
public void addNotify() {
    synchronized (getTreeLock()) {
 // addNotify() on the children may cause proxy event enabling
 // on this instance, so we first call super.addNotify() and
 // possibly create an lightweight event dispatcher before calling
 // addNotify() on the children which may be lightweight.
 super.addNotify();
 if (! (peer instanceof LightweightPeer)) {
     dispatcher = new LightweightDispatcher(this);
 }
 int ncomponents = this.ncomponents;
        Component component[] = this.component;
 for (int i = 0 ; i < ncomponents ; i++) {
     component[i].addNotify();
 }
        // Update stacking order if native platform allows
        ContainerPeer cpeer = (ContainerPeer)peer;
        if (cpeer.isRestackSupported()) {
            cpeer.restack();
        }


    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:34,代码来源:Container.java


注:本文中的java.awt.peer.ContainerPeer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。