本文整理汇总了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));
}
示例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;
}
示例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;
}
示例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();
}
}));
}
示例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);
}
});
}
示例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));
}
}
示例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));
}
}
示例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);
}
});
}
示例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);
}
示例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);
}