本文整理匯總了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);
}