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


Java PopupMenuPeer类代码示例

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


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

示例1: show

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
/**
  * Displays this popup menu at the specified coordinates relative to
  * the specified component.
  *
  * @param component The component to which the display coordinates are relative.
  * @param x The X coordinate of the menu.
  * @param y The Y coordinate of the menu.
  */
public void
show(Component component, int x, int y)
{
  if (getPeer() == null)
    this.addNotify();
  PopupMenuPeer pmp = (PopupMenuPeer)getPeer();
  if (pmp != null)
    {
      /* XXX
      Event e = new Event (component, Event.ACTION_EVENT, component);
      e.x = x;
      e.y = y;*/
      pmp.show (component, x, y);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:24,代码来源:PopupMenu.java

示例2: show

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
/**
 * Shows the popup menu at the x, y position relative to an origin
 * component.
 * The origin component must be contained within the component
 * hierarchy of the popup menu's parent.  Both the origin and the parent
 * must be showing on the screen for this method to be valid.
 * <p>
 * If this <code>PopupMenu</code> is being used as a <code>Menu</code>
 * (i.e., it has a non-<code>Component</code> parent),
 * then you cannot call this method on the <code>PopupMenu</code>.
 *
 * @param origin the component which defines the coordinate space
 * @param x the x coordinate position to popup the menu
 * @param y the y coordinate position to popup the menu
 * @exception NullPointerException  if the parent is <code>null</code>
 * @exception IllegalArgumentException  if this <code>PopupMenu</code>
 *                has a non-<code>Component</code> parent
 * @exception IllegalArgumentException if the origin is not in the
 *                parent's hierarchy
 * @exception RuntimeException if the parent is not showing on screen
 */
public void show(Component origin, int x, int y) {
    // Use localParent for thread safety.
    MenuContainer localParent = parent;
    if (localParent == null) {
        throw new NullPointerException("parent is null");
    }
    if (!(localParent instanceof Component)) {
        throw new IllegalArgumentException(
            "PopupMenus with non-Component parents cannot be shown");
    }
    Component compParent = (Component)localParent;
    //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method
    //Exception was not thrown if compParent was not equal to origin and
    //was not Container
    if (compParent != origin) {
        if (compParent instanceof Container) {
            if (!((Container)compParent).isAncestorOf(origin)) {
                throw new IllegalArgumentException("origin not in parent's hierarchy");
            }
        } else {
            throw new IllegalArgumentException("origin not in parent's hierarchy");
        }
    }
    if (compParent.getPeer() == null || !compParent.isShowing()) {
        throw new RuntimeException("parent not showing on screen");
    }
    if (peer == null) {
        addNotify();
    }
    synchronized (getTreeLock()) {
        if (peer != null) {
            ((PopupMenuPeer)peer).show(
                new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:58,代码来源:PopupMenu.java

示例3: show

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
/**
 * Shows the popup menu at the x, y position relative to an origin
 * component.
 * The origin component must be contained within the component
 * hierarchy of the popup menu's parent.  Both the origin and the parent
 * must be showing on the screen for this method to be valid.
 * <p>
 * If this {@code PopupMenu} is being used as a {@code Menu}
 * (i.e., it has a non-{@code Component} parent),
 * then you cannot call this method on the {@code PopupMenu}.
 *
 * @param origin the component which defines the coordinate space
 * @param x the x coordinate position to popup the menu
 * @param y the y coordinate position to popup the menu
 * @exception NullPointerException  if the parent is {@code null}
 * @exception IllegalArgumentException  if this {@code PopupMenu}
 *                has a non-{@code Component} parent
 * @exception IllegalArgumentException if the origin is not in the
 *                parent's hierarchy
 * @exception RuntimeException if the parent is not showing on screen
 */
@SuppressWarnings("deprecation")
public void show(Component origin, int x, int y) {
    // Use localParent for thread safety.
    MenuContainer localParent = parent;
    if (localParent == null) {
        throw new NullPointerException("parent is null");
    }
    if (!(localParent instanceof Component)) {
        throw new IllegalArgumentException(
            "PopupMenus with non-Component parents cannot be shown");
    }
    Component compParent = (Component)localParent;
    //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method
    //Exception was not thrown if compParent was not equal to origin and
    //was not Container
    if (compParent != origin) {
        if (compParent instanceof Container) {
            if (!((Container)compParent).isAncestorOf(origin)) {
                throw new IllegalArgumentException("origin not in parent's hierarchy");
            }
        } else {
            throw new IllegalArgumentException("origin not in parent's hierarchy");
        }
    }
    if (compParent.peer == null || !compParent.isShowing()) {
        throw new RuntimeException("parent not showing on screen");
    }
    if (peer == null) {
        addNotify();
    }
    synchronized (getTreeLock()) {
        if (peer != null) {
            ((PopupMenuPeer)peer).show(
                new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:59,代码来源:PopupMenu.java

示例4: show

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
/**
 * Shows the popup menu at the x, y position relative to an origin
 * component.
 * The origin component must be contained within the component
 * hierarchy of the popup menu's parent.  Both the origin and the parent
 * must be showing on the screen for this method to be valid.
 * <p>
 * If this {@code PopupMenu} is being used as a {@code Menu}
 * (i.e., it has a non-{@code Component} parent),
 * then you cannot call this method on the {@code PopupMenu}.
 *
 * @param origin the component which defines the coordinate space
 * @param x the x coordinate position to popup the menu
 * @param y the y coordinate position to popup the menu
 * @exception NullPointerException  if the parent is {@code null}
 * @exception IllegalArgumentException  if this {@code PopupMenu}
 *                has a non-{@code Component} parent
 * @exception IllegalArgumentException if the origin is not in the
 *                parent's hierarchy
 * @exception RuntimeException if the parent is not showing on screen
 */
public void show(Component origin, int x, int y) {
    // Use localParent for thread safety.
    MenuContainer localParent = parent;
    if (localParent == null) {
        throw new NullPointerException("parent is null");
    }
    if (!(localParent instanceof Component)) {
        throw new IllegalArgumentException(
            "PopupMenus with non-Component parents cannot be shown");
    }
    Component compParent = (Component)localParent;
    //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method
    //Exception was not thrown if compParent was not equal to origin and
    //was not Container
    if (compParent != origin) {
        if (compParent instanceof Container) {
            if (!((Container)compParent).isAncestorOf(origin)) {
                throw new IllegalArgumentException("origin not in parent's hierarchy");
            }
        } else {
            throw new IllegalArgumentException("origin not in parent's hierarchy");
        }
    }
    if (compParent.peer == null || !compParent.isShowing()) {
        throw new RuntimeException("parent not showing on screen");
    }
    if (peer == null) {
        addNotify();
    }
    synchronized (getTreeLock()) {
        if (peer != null) {
            ((PopupMenuPeer)peer).show(
                new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
        }
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:58,代码来源:PopupMenu.java

示例5: show

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
/**
    * Shows the popup menu at the x, y position relative to an origin
    * component.
    * The origin component must be contained within the component
    * hierarchy of the popup menu's parent.  Both the origin and the parent 
    * must be showing on the screen for this method to be valid.
    * <p>
    * If this <code>PopupMenu</code> is being used as a <code>Menu</code>
    * (i.e., it has a non-<code>Component</code> parent),
    * then you cannot call this method on the <code>PopupMenu</code>.
    * 
    * @param origin the component which defines the coordinate space
    * @param x the x coordinate position to popup the menu
    * @param y the y coordinate position to popup the menu
    * @exception NullPointerException  if the parent is <code>null</code>
    * @exception IllegalArgumentException  if this <code>PopupMenu</code>
    *                has a non-<code>Component</code> parent
    * @exception IllegalArgumentException if the origin is not in the
    *                parent's heirarchy
    * @exception RuntimeException if the parent is not showing on screen
    */
   public void show(Component origin, int x, int y) {
       // Use localParent for thread safety.
       MenuContainer localParent = parent;
if (localParent == null) {
    throw new NullPointerException("parent is null");
}
       if (!(localParent instanceof Component)) {
    throw new IllegalArgumentException(
        "PopupMenus with non-Component parents cannot be shown");
}
       Component compParent = (Component)localParent;
       //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method  
       //Exception was not thrown if compParent was not equal to origin and
       //was not Container
       if (compParent != origin) {
           if (compParent instanceof Container) {
               if (!((Container)compParent).isAncestorOf(origin)) {
                   throw new IllegalArgumentException("origin not in parent's hierarchy");
               }
           } else {
               throw new IllegalArgumentException("origin not in parent's hierarchy");
           }
}
if (compParent.getPeer() == null || !compParent.isShowing()) {
    throw new RuntimeException("parent not showing on screen");
}
if (peer == null) {
    addNotify();
}
synchronized (getTreeLock()) {
    if (peer != null) {
        ((PopupMenuPeer)peer).show(
	    new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
    }
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:58,代码来源:PopupMenu.java

示例6: show

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
/**
 * Shows the popup menu at the x, y position relative to an origin
 * component.
 * The origin component must be contained within the component
 * hierarchy of the popup menu's parent.  Both the origin and the parent
 * must be showing on the screen for this method to be valid.
 * <p>
 * If this <code>PopupMenu</code> is being used as a <code>Menu</code>
 * (i.e., it has a non-<code>Component</code> parent),
 * then you cannot call this method on the <code>PopupMenu</code>.
 *
 * @param origin the component which defines the coordinate space
 * @param x the x coordinate position to popup the menu
 * @param y the y coordinate position to popup the menu
 * @exception NullPointerException  if the parent is <code>null</code>
 * @exception IllegalArgumentException  if this <code>PopupMenu</code>
 *                has a non-<code>Component</code> parent
 * @exception IllegalArgumentException if the origin is not in the
 *                parent's heirarchy
 * @exception RuntimeException if the parent is not showing on screen
 */
public void show(Component origin, int x, int y) {
    // Use localParent for thread safety.
    MenuContainer localParent = parent;
    if (localParent == null) {
        throw new NullPointerException("parent is null");
    }
    if (!(localParent instanceof Component)) {
        throw new IllegalArgumentException(
            "PopupMenus with non-Component parents cannot be shown");
    }
    Component compParent = (Component)localParent;
    //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method
    //Exception was not thrown if compParent was not equal to origin and
    //was not Container
    if (compParent != origin) {
        if (compParent instanceof Container) {
            if (!((Container)compParent).isAncestorOf(origin)) {
                throw new IllegalArgumentException("origin not in parent's hierarchy");
            }
        } else {
            throw new IllegalArgumentException("origin not in parent's hierarchy");
        }
    }
    if (compParent.getPeer() == null || !compParent.isShowing()) {
        throw new RuntimeException("parent not showing on screen");
    }
    if (peer == null) {
        addNotify();
    }
    synchronized (getTreeLock()) {
        if (peer != null) {
            ((PopupMenuPeer)peer).show(
                new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
        }
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:58,代码来源:PopupMenu.java

示例7: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
protected PopupMenuPeer createPopupMenu(PopupMenu target) throws HeadlessException {
    throw new IllegalStateException("Method not implemented");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:UtilitiesTest.java

示例8: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
protected PopupMenuPeer createPopupMenu(PopupMenu target)
{
  // TODO: Implement this.
  throw new UnsupportedOperationException("Not yet implemented.");
}
 
开发者ID:vilie,项目名称:javify,代码行数:6,代码来源:XToolkit.java

示例9: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
protected PopupMenuPeer createPopupMenu (PopupMenu target)
{
  checkHeadless();
  return new GtkPopupMenuPeer (target);
}
 
开发者ID:vilie,项目名称:javify,代码行数:6,代码来源:GtkToolkit.java

示例10: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
protected PopupMenuPeer createPopupMenu(PopupMenu target)
{
  return new QtPopupMenuPeer( this, target );
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:QtToolkit.java

示例11: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
protected PopupMenuPeer createPopupMenu(PopupMenu target)
{
  throw new HeadlessException();
}
 
开发者ID:vilie,项目名称:javify,代码行数:5,代码来源:HeadlessToolkit.java

示例12: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
protected PopupMenuPeer createPopupMenu (PopupMenu target) 
{
  checkHeadless();
  return new GtkPopupMenuPeer (target);
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:6,代码来源:GtkToolkit.java

示例13: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
@Override
protected PopupMenuPeer createPopupMenu(PopupMenu a0) throws HeadlessException {
    throw new HeadlessException();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:5,代码来源:HeadlessToolkit.java

示例14: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
@Override
protected PopupMenuPeer createPopupMenu(PopupMenu target) throws HeadlessException {
    return new GPopupMenuPeer(target);
}
 
开发者ID:Danielku15,项目名称:GhostAWT,代码行数:5,代码来源:GhostToolkit.java

示例15: createPopupMenu

import java.awt.peer.PopupMenuPeer; //导入依赖的package包/类
@Override
protected PopupMenuPeer createPopupMenu(PopupMenu arg0) {
	throw new UnsupportedOperationException("Not yet implemented.");
	//return null;
}
 
开发者ID:julianwi,项目名称:awtonandroid,代码行数:6,代码来源:AndroidToolkit.java


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