Java 类java.awt.MenuContainer 实例源码

项目:javify    文件:GtkMenuComponentPeer.java   
/**
 * 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);
}
项目:jvm-stm    文件:GtkMenuComponentPeer.java   
/**
 * 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);
}
项目:RipplePower    文件:WaitCursorEventQueue.java   
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) {
        }
    }
}
项目:JamVM-PH    文件:GtkMenuComponentPeer.java   
/**
 * 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);
}
项目:classpath    文件:GtkMenuComponentPeer.java   
/**
 * 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);
}
项目:javify    文件:GtkMenuPeer.java   
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?
}
项目:jvm-stm    文件:GtkMenuPeer.java   
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?
}
项目:jspresso-ce    文件:WaitCursorTimer.java   
/**
 * {@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.
    }
  }
}
项目:cn1    文件:IMManager.java   
private final InputMethodDescriptor getDesc() {
    MenuContainer parent = getParent();
    if (parent instanceof IMSubmenu) {
        return ((IMSubmenu) parent).getDesc();
    }
    return null;
}
项目:JamVM-PH    文件:GtkMenuPeer.java   
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?
}
项目:classpath    文件:GtkMenuPeer.java   
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?
}
项目:freeVM    文件:IMManager.java   
private final InputMethodDescriptor getDesc() {
    MenuContainer parent = getParent();
    if (parent instanceof IMSubmenu) {
        return ((IMSubmenu) parent).getDesc();
    }
    return null;
}
项目:freeVM    文件:IMManager.java   
private final InputMethodDescriptor getDesc() {
    MenuContainer parent = getParent();
    if (parent instanceof IMSubmenu) {
        return ((IMSubmenu) parent).getDesc();
    }
    return null;
}
项目:mbarix4j    文件:WaitCursorEventQueue.java   
/**
 */
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) {}
    }
}