本文整理汇总了Java中javax.swing.SwingUtilities.getAncestorNamed方法的典型用法代码示例。如果您正苦于以下问题:Java SwingUtilities.getAncestorNamed方法的具体用法?Java SwingUtilities.getAncestorNamed怎么用?Java SwingUtilities.getAncestorNamed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.SwingUtilities
的用法示例。
在下文中一共展示了SwingUtilities.getAncestorNamed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: eventDispatched
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
removePopup();
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par1 = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
Container par2 = SwingUtilities.getAncestorNamed(SUB_POPUP_NAME, comp); //NOI18N
// Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
// if (par == null && barpar == null) {
if ( par1 == null && par2 == null ) {
removePopup();
}
}
}
}
示例2: eventDispatched
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public @Override void eventDispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par = SwingUtilities.getAncestorNamed("progresspopup", comp); //NOI18N
Container barpar = SwingUtilities.getAncestorOfClass(StatusLineComponent.class, comp);
if (par == null && barpar == null) {
hidePopup();
}
}
}
}
示例3: eventDispatched
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
public void eventDispatched(java.awt.AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent)aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (! (aWTEvent.getSource() instanceof Component)) {
hidePopup();
return;
}
Component comp = (Component)aWTEvent.getSource();
Container par = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
// Container barpar = SwingUtilities.getAncestorOfClass(PopupUtil.class, comp);
// if (par == null && barpar == null) {
if ( par == null ) {
hidePopup();
}
}
}
}
示例4: eventDispatched
import javax.swing.SwingUtilities; //导入方法依赖的package包/类
@Override
public void eventDispatched(AWTEvent aWTEvent) {
if (aWTEvent instanceof MouseEvent) {
MouseEvent mv = (MouseEvent) aWTEvent;
if (mv.getID() == MouseEvent.MOUSE_CLICKED && mv.getClickCount() > 0) {
//#118828
if (!(aWTEvent.getSource() instanceof Component)) {
hide();
return;
}
Component comp = (Component) aWTEvent.getSource();
Container par1 = SwingUtilities.getAncestorNamed(POPUP_NAME, comp); //NOI18N
if (par1 == null) {
hide();
}
}
}
}