本文整理汇总了Java中java.awt.Menu.getPeer方法的典型用法代码示例。如果您正苦于以下问题:Java Menu.getPeer方法的具体用法?Java Menu.getPeer怎么用?Java Menu.getPeer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Menu
的用法示例。
在下文中一共展示了Menu.getPeer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMouseEvent
import java.awt.Menu; //导入方法依赖的package包/类
/**
* Handles mouse events.
*
* @param ev the mouse event
*/
public void handleMouseEvent(MouseEvent ev)
{
Point point = ev.getPoint();
for (int i = 0; i < awtMenuBar.getMenuCount(); i++)
{
Menu menu = awtMenuBar.getMenu(i);
SwingMenuPeer peer = (SwingMenuPeer) menu.getPeer();
int x1 = peer.getX();
int x2 = x1 + peer.getWidth();
if (point.x >= x1 && point.x <= x2)
{
ev.translatePoint(peer.getX(), peer.getY());
peer.handleMouseEvent(ev);
break;
}
}
}
示例2: handleMouseMotionEvent
import java.awt.Menu; //导入方法依赖的package包/类
/**
* Handles mouse motion events.
*
* @param ev the mouse motion event
*/
public void handleMouseMotionEvent(MouseEvent ev)
{
Point point = ev.getPoint();
for (int i = 0; i < awtMenuBar.getMenuCount(); i++)
{
Menu menu = awtMenuBar.getMenu(i);
SwingMenuPeer peer = (SwingMenuPeer) menu.getPeer();
int x1 = peer.getX();
int x2 = x1 + peer.getWidth();
if (point.x >= x1 && point.x <= x2)
{
ev.translatePoint(peer.getX(), peer.getY());
peer.handleMouseMotionEvent(ev);
break;
}
}
}
示例3: addMenu
import java.awt.Menu; //导入方法依赖的package包/类
public void addMenu( Menu m )
{
if (m.getPeer() == null)
m.addNotify();
((QtMenuPeer)m.getPeer()).addItems();
addMenu( (QtMenuPeer)m.getPeer() );
}
示例4: addHelpMenu
import java.awt.Menu; //导入方法依赖的package包/类
public void addHelpMenu( Menu m )
{
if (m.getPeer() == null)
m.addNotify();
((QtMenuPeer)m.getPeer()).addItems();
addHelpMenu( (QtMenuPeer)m.getPeer() );
}
示例5: addHelpMenu
import java.awt.Menu; //导入方法依赖的package包/类
/**
* Adds a help menu to the menu bar.
*
* @param menu the menu to add
*/
public void addHelpMenu(Menu menu)
{
// FIXME: We should manage the help menu differently, so that it always
// appears at the rightmost position.
SwingMenuPeer menuPeer = (SwingMenuPeer) menu.getPeer();
menuBar.add(menuPeer.menu);
}
示例6: addHelpMenu
import java.awt.Menu; //导入方法依赖的package包/类
@Override
public void addHelpMenu(Menu m) {
CMenu cMenu = (CMenu)m.getPeer();
nativeSetHelpMenu(getModel(), cMenu.getModel());
}
示例7: addMenu
import java.awt.Menu; //导入方法依赖的package包/类
/**
* Adds a menu to the menu bar.
*
* @param m the menu to add
*/
public void addMenu(Menu m)
{
SwingMenuPeer menuPeer = (SwingMenuPeer) m.getPeer();
menuBar.add(menuPeer.menu);
}