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


Java FramePeer类代码示例

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


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

示例1: addNotify

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Makes this Frame displayable by connecting it to
 * a native screen resource.  Making a frame displayable will
 * cause any 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()) {
        if (peer == null) {
            peer = getToolkit().createFrame(this);
        }
        FramePeer p = (FramePeer)peer;
        MenuBar menuBar = this.menuBar;
        if (menuBar != null) {
            mbManagement = true;
            menuBar.addNotify();
            p.setMenuBar(menuBar);
        }
        p.setMaximizedBounds(maximizedBounds);
        super.addNotify();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Frame.java

示例2: setTitle

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Sets the title for this frame to the specified string.
 * @param title the title to be displayed in the frame's border.
 *              A <code>null</code> value
 *              is treated as an empty string, "".
 * @see      #getTitle
 */
public void setTitle(String title) {
    String oldTitle = this.title;
    if (title == null) {
        title = "";
    }


    synchronized(this) {
        this.title = title;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setTitle(title);
        }
    }
    firePropertyChange("title", oldTitle, title);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:Frame.java

示例3: setMenuBar

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Sets the menu bar for this frame to the specified menu bar.
 * @param     mb the menu bar being set.
 *            If this parameter is <code>null</code> then any
 *            existing menu bar on this frame is removed.
 * @see       #getMenuBar
 */
public void setMenuBar(MenuBar mb) {
    synchronized (getTreeLock()) {
        if (menuBar == mb) {
            return;
        }
        if ((mb != null) && (mb.parent != null)) {
            mb.parent.remove(mb);
        }
        if (menuBar != null) {
            remove(menuBar);
        }
        menuBar = mb;
        if (menuBar != null) {
            menuBar.parent = this;

            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                menuBar.addNotify();
                invalidateIfValid();
                peer.setMenuBar(menuBar);
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:Frame.java

示例4: setResizable

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   <code>true</code> if this frame is resizable;
 *                       <code>false</code> otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:Frame.java

示例5: remove

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Removes the specified menu bar from this frame.
 * @param    m   the menu component to remove.
 *           If <code>m</code> is <code>null</code>, then
 *           no action is taken
 */
public void remove(MenuComponent m) {
    if (m == null) {
        return;
    }
    synchronized (getTreeLock()) {
        if (m == menuBar) {
            menuBar = null;
            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                invalidateIfValid();
                peer.setMenuBar(null);
                m.removeNotify();
            }
            m.parent = null;
        } else {
            super.remove(m);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:Frame.java

示例6: removeNotify

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Makes this Frame undisplayable by removing its connection
 * to its native screen resource. Making a Frame undisplayable
 * will cause any of its children to be made undisplayable.
 * This method is called by the toolkit internally and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #addNotify
 */
public void removeNotify() {
    synchronized (getTreeLock()) {
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            // get the latest Frame state before disposing
            getState();

            if (menuBar != null) {
                mbManagement = true;
                peer.setMenuBar(null);
                menuBar.removeNotify();
            }
        }
        super.removeNotify();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Frame.java

示例7: addNotify

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Makes this Frame displayable by connecting it to
 * a native screen resource.  Making a frame displayable will
 * cause any 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()) {
        if (peer == null) {
            peer = getComponentFactory().createFrame(this);
        }
        FramePeer p = (FramePeer)peer;
        MenuBar menuBar = this.menuBar;
        if (menuBar != null) {
            mbManagement = true;
            menuBar.addNotify();
            p.setMenuBar(menuBar);
        }
        p.setMaximizedBounds(maximizedBounds);
        super.addNotify();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:Frame.java

示例8: setTitle

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Sets the title for this frame to the specified string.
 * @param title the title to be displayed in the frame's border.
 *              A {@code null} value
 *              is treated as an empty string, "".
 * @see      #getTitle
 */
public void setTitle(String title) {
    String oldTitle = this.title;
    if (title == null) {
        title = "";
    }


    synchronized(this) {
        this.title = title;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setTitle(title);
        }
    }
    firePropertyChange("title", oldTitle, title);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:Frame.java

示例9: setMenuBar

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Sets the menu bar for this frame to the specified menu bar.
 * @param     mb the menu bar being set.
 *            If this parameter is {@code null} then any
 *            existing menu bar on this frame is removed.
 * @see       #getMenuBar
 */
public void setMenuBar(MenuBar mb) {
    synchronized (getTreeLock()) {
        if (menuBar == mb) {
            return;
        }
        if ((mb != null) && (mb.parent != null)) {
            mb.parent.remove(mb);
        }
        if (menuBar != null) {
            remove(menuBar);
        }
        menuBar = mb;
        if (menuBar != null) {
            menuBar.parent = this;

            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                menuBar.addNotify();
                invalidateIfValid();
                peer.setMenuBar(menuBar);
            }
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:Frame.java

示例10: setResizable

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Sets whether this frame is resizable by the user.
 * @param    resizable   {@code true} if this frame is resizable;
 *                       {@code false} otherwise.
 * @see      java.awt.Frame#isResizable
 */
public void setResizable(boolean resizable) {
    boolean oldResizable = this.resizable;
    boolean testvalid = false;

    synchronized (this) {
        this.resizable = resizable;
        FramePeer peer = (FramePeer)this.peer;
        if (peer != null) {
            peer.setResizable(resizable);
            testvalid = true;
        }
    }

    // On some platforms, changing the resizable state affects
    // the insets of the Frame. If we could, we'd call invalidate()
    // from the peer, but we need to guarantee that we're not holding
    // the Frame lock when we call invalidate().
    if (testvalid) {
        invalidateIfValid();
    }
    firePropertyChange("resizable", oldResizable, resizable);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:Frame.java

示例11: remove

import java.awt.peer.FramePeer; //导入依赖的package包/类
/**
 * Removes the specified menu bar from this frame.
 * @param    m   the menu component to remove.
 *           If {@code m} is {@code null}, then
 *           no action is taken
 */
public void remove(MenuComponent m) {
    if (m == null) {
        return;
    }
    synchronized (getTreeLock()) {
        if (m == menuBar) {
            menuBar = null;
            FramePeer peer = (FramePeer)this.peer;
            if (peer != null) {
                mbManagement = true;
                invalidateIfValid();
                peer.setMenuBar(null);
                m.removeNotify();
            }
            m.parent = null;
        } else {
            super.remove(m);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:Frame.java

示例12: synthesizeWindowActivation

import java.awt.peer.FramePeer; //导入依赖的package包/类
public void synthesizeWindowActivation(final boolean activate) {
    final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this);
    if (!activate || EventQueue.isDispatchThread()) {
        peer.emulateActivation(activate);
    } else {
        // To avoid focus concurrence b/w IE and EmbeddedFrame
        // activation is postponed by means of posting it to EDT.
        Runnable r = new Runnable() {
            public void run() {
                peer.emulateActivation(true);
            }
        };
        WToolkit.postEvent(WToolkit.targetToAppContext(this),
                           new InvocationEvent(this, r));
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:WEmbeddedFrame.java


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