Java 类java.awt.MenuComponent 实例源码

项目:whackpad    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目:manifold-ij    文件:ModalEventQueue.java   
public void dispatchEvent( AWTEvent event )
{
  Object src = event.getSource();
  if( event instanceof ActiveEvent )
  {
    ((ActiveEvent)event).dispatch();
  }
  else if( src instanceof Component )
  {
    ((Component)src).dispatchEvent( event );
  }
  else if( src instanceof MenuComponent )
  {
    ((MenuComponent)src).dispatchEvent( event );
  }
}
项目: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);
}
项目:javify    文件:QtMenuComponentPeer.java   
public QtMenuComponentPeer( QtToolkit kit, MenuComponent owner )
{
  this.toolkit = kit;
  this.owner = owner;
  nativeObject = 0;
  synchronized(this)
    {
      callInit(); // Calls the init method FROM THE MAIN THREAD.
      try
        {
          wait(); // Wait for the thing to be created.
        }
      catch(InterruptedException e)
        {
        }
    }
  setup();
}
项目: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);
}
项目:jvm-stm    文件:QtMenuComponentPeer.java   
public QtMenuComponentPeer( QtToolkit kit, MenuComponent owner )
 {
   this.toolkit = kit;
   this.owner = owner;
   nativeObject = 0;
   synchronized(this) 
     {
callInit(); // Calls the init method FROM THE MAIN THREAD.
try
  { 
    wait(); // Wait for the thing to be created.
  }
catch(InterruptedException e)
  {
  }
     }
   setup();
 }
项目:code404    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目:S3F    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目:rhino-jscover    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目:astor    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目: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);
}
项目:JamVM-PH    文件:QtMenuComponentPeer.java   
public QtMenuComponentPeer( QtToolkit kit, MenuComponent owner )
 {
   this.toolkit = kit;
   this.owner = owner;
   nativeObject = 0;
   synchronized(this) 
     {
callInit(); // Calls the init method FROM THE MAIN THREAD.
try
  { 
    wait(); // Wait for the thing to be created.
  }
catch(InterruptedException e)
  {
  }
     }
   setup();
 }
项目:Rhino-Prov-Mod    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目: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);
}
项目:classpath    文件:QtMenuComponentPeer.java   
public QtMenuComponentPeer( QtToolkit kit, MenuComponent owner )
{
  this.toolkit = kit;
  this.owner = owner;
  nativeObject = 0;
  synchronized(this)
    {
      callInit(); // Calls the init method FROM THE MAIN THREAD.
      try
        {
          wait(); // Wait for the thing to be created.
        }
      catch(InterruptedException e)
        {
        }
    }
  setup();
}
项目:closure-compiler-old    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目:closure-compiler-copy    文件:SwingGui.java   
/**
 * Processes the next GUI event.
 */
public void dispatchNextGuiEvent() throws InterruptedException {
    EventQueue queue = awtEventQueue;
    if (queue == null) {
        queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
        awtEventQueue = queue;
    }
    AWTEvent event = queue.getNextEvent();
    if (event instanceof ActiveEvent) {
        ((ActiveEvent)event).dispatch();
    } else {
        Object source = event.getSource();
        if (source instanceof Component) {
            Component comp = (Component)source;
            comp.dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent)source).dispatchEvent(event);
        }
    }
}
项目:openjdk-jdk10    文件:ComponentOperator.java   
/**
 * Maps {@code Component.remove(MenuComponent)} through queue
 */
public void remove(final MenuComponent menuComponent) {
    runMapping(new MapVoidAction("remove") {
        @Override
        public void map() {
            getSource().remove(menuComponent);
        }
    });
}
项目:openjdk9    文件:ComponentOperator.java   
/**
 * Maps {@code Component.remove(MenuComponent)} through queue
 */
public void remove(final MenuComponent menuComponent) {
    runMapping(new MapVoidAction("remove") {
        @Override
        public void map() {
            getSource().remove(menuComponent);
        }
    });
}
项目:javify    文件:GtkMenuComponentPeer.java   
/**
 * Will call the abstract <code>create()</code> that needs to be
 * overridden by subclasses, to create the MenuComponent. It will
 * then correctly setup the font for the component based on the
 * component and/or its containing parent component.
 */
public GtkMenuComponentPeer(MenuComponent component)
{
  super(component);
  create();
  setFont();
}
项目:jvm-stm    文件:GtkMenuComponentPeer.java   
/**
 * Will call the abstract <code>create()</code> that needs to be
 * overridden by subclasses, to create the MenuComponent. It will
 * then correctly setup the font for the component based on the
 * component and/or its containing parent component.
 */
public GtkMenuComponentPeer(MenuComponent component)
{
  super(component);
  create();
  setFont();
}
项目:minimal-j    文件:SwingInternalFrame.java   
private void showModal() {
    EventQueue theQueue = getToolkit().getSystemEventQueue();
    while (isVisible()) {
        AWTEvent event = null;
        try {
            event = theQueue.getNextEvent();
        } catch (InterruptedException x) {
            LOG.warning(x.getLocalizedMessage());
            continue;
        }
        Object source = event.getSource();

        if (event instanceof MouseEvent) {
            MouseEvent e = (MouseEvent) event;
            MouseEvent m = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, this);
            if (!this.contains(m.getPoint()) && e.getID() != MouseEvent.MOUSE_DRAGGED) {
                continue;
            }
        }

        if (event instanceof ActiveEvent) {
            ((ActiveEvent) event).dispatch();
        } else if (source instanceof Component) {
            ((Component) source).dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent) source).dispatchEvent(event);
        } else {
            LOG.warning("Not dispatched: " + event);
        }
    }
}
项目:minimal-j    文件:EditablePanel.java   
public void lock() {
    lockCount++;
    setCursorRecursive(this, Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    EventQueue theQueue = getToolkit().getSystemEventQueue();
    while (lockCount > 0) {
        AWTEvent event = null;
        try {
            event = theQueue.getNextEvent();
        } catch (InterruptedException x) {
            LOG.warning(x.getLocalizedMessage());
            continue;
        }
        Object source = event.getSource();

        if (event instanceof MouseEvent) {
            continue;
        }

        if (event instanceof ActiveEvent) {
            ((ActiveEvent) event).dispatch();
        } else if (source instanceof Component) {
            ((Component) source).dispatchEvent(event);
        } else if (source instanceof MenuComponent) {
            ((MenuComponent) source).dispatchEvent(event);
        } else {
            LOG.warning("Not dispatched: " + event);
        }
    }
    setCursorRecursive(this, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
项目: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.
    }
  }
}
项目:JamVM-PH    文件:GtkMenuComponentPeer.java   
/**
 * Will call the abstract <code>create()</code> that needs to be
 * overridden by subclasses, to create the MenuComponent. It will
 * then correctly setup the font for the component based on the
 * component and/or its containing parent component.
 */
public GtkMenuComponentPeer(MenuComponent component)
{
  super(component);
  create();
  setFont();
}
项目:classpath    文件:GtkMenuComponentPeer.java   
/**
 * Will call the abstract <code>create()</code> that needs to be
 * overridden by subclasses, to create the MenuComponent. It will
 * then correctly setup the font for the component based on the
 * component and/or its containing parent component.
 */
public GtkMenuComponentPeer(MenuComponent component)
{
  super(component);
  create();
  setFont();
}
项目: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) {}
    }
}
项目:incubator-netbeans    文件:PlaceholderPanel.java   
@Override
public synchronized void remove(MenuComponent popup) {
    super.remove(popup);
    updateOpacity();
    invalidate();
}
项目:incubator-netbeans    文件:JTitledPanel.java   
public void remove(MenuComponent component) {
    getContentPanel().remove(component);
}
项目:OpenJSharp    文件:CMenuComponent.java   
CMenuComponent(MenuComponent target) {
    this.target = target;
    this.modelPtr = createModel();
}
项目:OpenJSharp    文件:CMenuComponent.java   
MenuComponent getTarget() {
    return target;
}
项目:jdk8u-jdk    文件:CMenuComponent.java   
CMenuComponent(final MenuComponent target) {
    super(0, true);
    this.target = target;
    setPtr(createModel());
}
项目:jdk8u-jdk    文件:CMenuComponent.java   
final MenuComponent getTarget() {
    return target;
}
项目:openjdk-jdk10    文件:CMenuComponent.java   
CMenuComponent(final MenuComponent target) {
    super(0, true);
    this.target = target;
    setPtr(createModel());
}
项目:openjdk-jdk10    文件:CMenuComponent.java   
final MenuComponent getTarget() {
    return target;
}
项目:openjdk9    文件:CMenuComponent.java   
CMenuComponent(MenuComponent target) {
    this.target = target;
    this.modelPtr = createModel();
}
项目:openjdk9    文件:CMenuComponent.java   
MenuComponent getTarget() {
    return target;
}
项目:jdk8u_jdk    文件:CMenuComponent.java   
CMenuComponent(final MenuComponent target) {
    super(0, true);
    this.target = target;
    setPtr(createModel());
}
项目:jdk8u_jdk    文件:CMenuComponent.java   
final MenuComponent getTarget() {
    return target;
}