本文整理汇总了Java中java.awt.MenuContainer类的典型用法代码示例。如果您正苦于以下问题:Java MenuContainer类的具体用法?Java MenuContainer怎么用?Java MenuContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MenuContainer类属于java.awt包,在下文中一共展示了MenuContainer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setFont
import java.awt.MenuContainer; //导入依赖的package包/类
/**
* Sets font based on MenuComponent font, or containing menu(bar)
* parent font.
*/
private void setFont()
{
MenuComponent mc = ((MenuComponent) awtWidget);
Font f = mc.getFont();
if (f == null)
{
MenuContainer parent = mc.getParent ();
// Submenus inherit the font of their containing Menu(Bar).
if (parent instanceof MenuComponent)
f = parent.getFont ();
}
setFont(f);
}
示例2: setFont
import java.awt.MenuContainer; //导入依赖的package包/类
/**
* Sets font based on MenuComponent font, or containing menu(bar)
* parent font.
*/
private void setFont()
{
MenuComponent mc = ((MenuComponent) awtWidget);
Font f = mc.getFont();
if (f == null)
{
MenuContainer parent = mc.getParent ();
// Submenus inherit the font of their containing Menu(Bar).
if (parent instanceof MenuComponent)
f = parent.getFont ();
}
setFont(f);
}
示例3: run
import java.awt.MenuContainer; //导入依赖的package包/类
public synchronized void run() {
while (true) {
try {
wait();
wait(delay);
if (source instanceof Component) {
parent = SwingUtilities.getRoot((Component) source);
} else if (source instanceof MenuComponent) {
MenuContainer mParent = ((MenuComponent) source).getParent();
if (mParent instanceof Component) {
parent = SwingUtilities.getRoot((Component) mParent);
}
}
if ((parent != null) && parent.isShowing()) {
parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
} catch (InterruptedException ie) {
}
}
}
示例4: GtkMenuPeer
import java.awt.MenuContainer; //导入依赖的package包/类
public GtkMenuPeer (Menu menu)
{
super (menu);
if (menu.isTearOff())
addTearOff();
MenuContainer parent = menu.getParent ();
if (parent instanceof Menu)
setupAccelGroup ((GtkMenuPeer)((Menu)parent).getPeer ());
else if (parent instanceof Component)
setupAccelGroup ((GtkComponentPeer)((Component)parent).getPeer ());
else
setupAccelGroup (null); // XXX, should we warn about unknown parent?
}
示例5: GtkMenuPeer
import java.awt.MenuContainer; //导入依赖的package包/类
public GtkMenuPeer (Menu menu)
{
super (menu);
if (menu.isTearOff())
addTearOff();
MenuContainer parent = menu.getParent ();
if (parent instanceof Menu)
setupAccelGroup ((GtkMenuPeer)((Menu)parent).getPeer ());
else if (parent instanceof Component)
setupAccelGroup ((GtkComponentPeer)((Component)parent).getPeer ());
else
setupAccelGroup (null); // XXX, should we warn about unknown parent?
}
示例6: run
import java.awt.MenuContainer; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public synchronized void run() {
//noinspection InfiniteLoopStatement
while (true) {
try {
// wait for notification from startTimer()
wait();
// wait for event processing to reach the threshold, or
// interruption from stopTimer()
wait(delay);
if (source instanceof Component) {
parent = SwingUtil.getWindowOrInternalFrame((Component) source);
} else if (source instanceof MenuComponent) {
MenuContainer mParent = ((MenuComponent) source).getParent();
if (mParent instanceof Component) {
parent = SwingUtil.getWindowOrInternalFrame((Component) mParent);
}
}
if (parent != null && parent.isShowing()) {
if (parent instanceof RootPaneContainer) {
((RootPaneContainer) parent).getGlassPane().setCursor(
Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
// parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
} catch (InterruptedException ie) {
// just finish.
}
}
}
示例7: getDesc
import java.awt.MenuContainer; //导入依赖的package包/类
private final InputMethodDescriptor getDesc() {
MenuContainer parent = getParent();
if (parent instanceof IMSubmenu) {
return ((IMSubmenu) parent).getDesc();
}
return null;
}
示例8: run
import java.awt.MenuContainer; //导入依赖的package包/类
/**
*/
public synchronized void run() {
while (true) {
try {
// wait for notification from startTimer()
wait();
// wait for event processing to reach the threshold, or
// interruption from stopTimer()
wait(delay);
if (source instanceof Component) {
parent = SwingUtilities.getRoot((Component) source);
}
else if (source instanceof MenuComponent) {
MenuContainer mParent = ((MenuComponent) source).getParent();
if (mParent instanceof Component) {
parent = SwingUtilities.getRoot((Component) mParent);
}
}
if ((parent != null) && parent.isShowing()) {
parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
}
catch (InterruptedException ie) {}
}
}