当前位置: 首页>>代码示例>>Java>>正文


Java PopupMenuUI类代码示例

本文整理汇总了Java中javax.swing.plaf.PopupMenuUI的典型用法代码示例。如果您正苦于以下问题:Java PopupMenuUI类的具体用法?Java PopupMenuUI怎么用?Java PopupMenuUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PopupMenuUI类属于javax.swing.plaf包,在下文中一共展示了PopupMenuUI类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testIsPopupTrigger

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
public void testIsPopupTrigger() {
    class MyPopupMenuUI extends PopupMenuUI {
        public boolean value = false;

        @Override
        public boolean isPopupTrigger(final MouseEvent event) {
            return value;
        }
    }
    ;
    MyPopupMenuUI fakeUI = new MyPopupMenuUI();
    popup.setUI(fakeUI);
    assertSame(fakeUI, popup.getUI());
    fakeUI.value = true;
    assertEquals(fakeUI.value, popup.isPopupTrigger(null));
    fakeUI.value = false;
    assertEquals(fakeUI.value, popup.isPopupTrigger(null));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:19,代码来源:JPopupMenuTest.java

示例2: isPopupTrigger

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
/**
 * Invokes the <code>isPopupTrigger</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.3
 */
public boolean isPopupTrigger(MouseEvent a) {
    boolean returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).isPopupTrigger(a);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).isPopupTrigger(a);
    }
    return returnValue;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:MultiPopupMenuUI.java

示例3: getPopup

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
/**
 * Invokes the <code>getPopup</code> method on each UI handled by this object.
 *
 * @return the value obtained from the first UI, which is
 * the UI obtained from the default <code>LookAndFeel</code>
 * @since 1.4
 */
public Popup getPopup(JPopupMenu a, int b, int c) {
    Popup returnValue =
        ((PopupMenuUI) (uis.elementAt(0))).getPopup(a,b,c);
    for (int i = 1; i < uis.size(); i++) {
        ((PopupMenuUI) (uis.elementAt(i))).getPopup(a,b,c);
    }
    return returnValue;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:MultiPopupMenuUI.java

示例4: getUI

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
/**
 * Maps {@code JPopupMenu.getUI()} through queue
 */
public PopupMenuUI getUI() {
    return (runMapping(new MapAction<PopupMenuUI>("getUI") {
        @Override
        public PopupMenuUI map() {
            return ((JPopupMenu) getSource()).getUI();
        }
    }));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JPopupMenuOperator.java

示例5: setUI

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
/**
 * Maps {@code JPopupMenu.setUI(PopupMenuUI)} through queue
 */
public void setUI(final PopupMenuUI popupMenuUI) {
    runMapping(new MapVoidAction("setUI") {
        @Override
        public void map() {
            ((JPopupMenu) getSource()).setUI(popupMenuUI);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:JPopupMenuOperator.java

示例6: updateUI

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
@Override
public void updateUI() {
    setUI((MenuItemUI) UIManager.getUI(this));

    if(popupMenu != null) {
        popupMenu.setUI((PopupMenuUI) UIManager.getUI(popupMenu));
    }
}
 
开发者ID:P15,项目名称:jailer,代码行数:9,代码来源:JScrollC2Menu.java

示例7: updateUI

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
@Override
public void updateUI() {
	setUI((MenuItemUI) UIManager.getUI(this));

	if (popupMenu != null) {
		popupMenu.setUI((PopupMenuUI) UIManager.getUI(popupMenu));
	}
}
 
开发者ID:P15,项目名称:jailer,代码行数:9,代码来源:JScrollMenu.java

示例8: TiledImageJMenu

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
public TiledImageJMenu(String text, ImageInfoReader imageInfoReader) {
	super(text);
	tileImage = getTiledImage(imageInfoReader);
	getPopupMenu().setUI(new PopupMenuUI() {

		@Override
		public void paint(Graphics g, JComponent c) {
			TiledImagePainter.paintComponent(c, g, tileImage);
			super.paint(g, c);
		}
	});
}
 
开发者ID:WorldGrower,项目名称:WorldGrower,代码行数:13,代码来源:TiledImageJMenu.java

示例9: getPopup

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
@Override
public Popup getPopup(JPopupMenu popup, int x, int y) {
	for (int i = 1; i < numberOfUIs; i++) {
		((PopupMenuUI) uis.get(i)).getPopup(popup, x, y);
	}
	return ((PopupMenuUI) uis.firstElement()).getPopup(popup, x, y);		
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:MultiPopupMenuUI.java

示例10: isPopupTrigger

import javax.swing.plaf.PopupMenuUI; //导入依赖的package包/类
@Override
public boolean isPopupTrigger(MouseEvent event) {
	for (int i = 1; i < numberOfUIs; i++) {
		((PopupMenuUI) uis.get(i)).isPopupTrigger(event);
	}
	return ((PopupMenuUI) uis.firstElement()).isPopupTrigger(event);	
}
 
开发者ID:shannah,项目名称:cn1,代码行数:8,代码来源:MultiPopupMenuUI.java


注:本文中的javax.swing.plaf.PopupMenuUI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。