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


Java Component.isShowing方法代码示例

本文整理汇总了Java中java.awt.Component.isShowing方法的典型用法代码示例。如果您正苦于以下问题:Java Component.isShowing方法的具体用法?Java Component.isShowing怎么用?Java Component.isShowing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.Component的用法示例。


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

示例1: createCompImage

import java.awt.Component; //导入方法依赖的package包/类
private Image createCompImage(Component comp, Dimension targetSize) {
    // component won't paint if not showing anyway, so don't create
    // empty image but honestly return null 
    if (!comp.isShowing()) {
        return null;
    }
    
    Image image = comp.createImage(comp.getWidth(), comp.getHeight());
    
    /*BufferedImage image = GraphicsEnvironment.getLocalGraphicsEnvironment().
            getDefaultScreenDevice().getDefaultConfiguration().
            createCompatibleImage(comp.getWidth(), comp.getHeight());*/
    //BufferedImage image = new BufferedImage (targetSize.width, targetSize.height, BufferedImage.TYPE_INT_RGB);
    
    Graphics2D gr2d = (Graphics2D)image.getGraphics();
    
    comp.paint(gr2d);
    
    gr2d.dispose();
    
    return image;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ScaleFx.java

示例2: accept

import java.awt.Component; //导入方法依赖的package包/类
@Override
protected boolean accept(Component aComponent) {
    //Do not allow focus to go to a child of the editor we're using if
    //we are in the process of removing the editor
    if (isEditing() && inEditorRemoveRequest()) {
        InplaceEditor ine = getEditor().getInplaceEditor();

        if (ine != null) {
            if ((aComponent == ine.getComponent()) || ine.isKnownComponent(aComponent)) {
                return false;
            }
        }
    }

    return super.accept(aComponent) && aComponent.isShowing();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:SheetTable.java

示例3: JPopupWindowFinder

import java.awt.Component; //导入方法依赖的package包/类
/**
 * Constructs JPopupWindowFinder.
 *
 * @param sf searching criteria for a JPopupMenu inside the window..
 */
public JPopupWindowFinder(ComponentChooser sf) {
    subFinder = new JPopupMenuFinder(sf);
    ppFinder = new ComponentChooser() {
        @Override
        public boolean checkComponent(Component comp) {
            return (comp.isShowing()
                    && comp.isVisible()
                    && subFinder.checkComponent(comp));
        }

        @Override
        public String getDescription() {
            return subFinder.getDescription();
        }

        @Override
        public String toString() {
            return "JPopupMenuOperator.JPopupWindowFinder.ComponentChooser{description = " + getDescription() + '}';
        }
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:JPopupMenuOperator.java

示例4: JToolTipWindowFinder

import java.awt.Component; //导入方法依赖的package包/类
public JToolTipWindowFinder() {
    ppFinder = new ComponentChooser() {
        @Override
        public boolean checkComponent(Component comp) {
            return (comp.isShowing()
                    && comp.isVisible()
                    && comp instanceof JToolTip);
        }

        @Override
        public String getDescription() {
            return "A tool tip";
        }

        @Override
        public String toString() {
            return "JComponentOperator.JToolTipWindowFinder.ComponentChooser{description = " + getDescription() + '}';
        }
    };
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:JComponentOperator.java

示例5: fillUp

import java.awt.Component; //导入方法依赖的package包/类
private void fillUp(List<Component> allComponents, Component c) {
    if (!c.isVisible() || !c.isShowing()) {
        return;
    }
    allComponents.add(c);
    if (c instanceof Container) {
        Component[] components = ((Container) c).getComponents();
        for (Component component : components) {
            fillUp(allComponents, component);
        }
    }
    if (c instanceof Window) {
        Window[] ownedWindows = ((Window) c).getOwnedWindows();
        for (Window window : ownedWindows) {
            fillUp(allComponents, window);
        }
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:JavaElementPropertyAccessor.java

示例6: checkComponent

import java.awt.Component; //导入方法依赖的package包/类
@Override
public boolean checkComponent(Component comp) {
    if (comp instanceof Dialog) {
        if ((FIND_INVISIBLE_WINDOWS || (comp.isShowing() && comp.isVisible()))
                && ((Dialog) comp).getTitle() != null) {
            String titleToComp = ((Dialog) comp).getTitle();
            String contextToComp = title;
            if (compareCaseSensitive) {
                titleToComp = titleToComp.toUpperCase();
                contextToComp = contextToComp.toUpperCase();
            }
            if (compareExactly) {
                return titleToComp.equals(contextToComp);
            } else {
                return titleToComp.contains(contextToComp);
            }
        }
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:DialogWaiter.java

示例7: AsyncInitSupport

import java.awt.Component; //导入方法依赖的package包/类
/** Creates a new instance of AsyncInitComponent
 * @param comp4Init Component to be initialized. Mustn't be showing at this
 * time. IllegalStateException is thrown if component is already showing.
 * @param initJob Instance of initialization job.
 */
public AsyncInitSupport(Component comp4Init, AsyncGUIJob initJob) {
    this.comp4Init = comp4Init;
    this.initJob = initJob;
    if (comp4Init.isShowing()) {
        throw new IllegalStateException("Component already shown, can't be inited: " + comp4Init);
    }

    comp4Init.addHierarchyListener(this);
    LOG.log(Level.FINE, "addHierarchyListener for {0}", comp4Init);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:AsyncInitSupport.java

示例8: accept

import java.awt.Component; //导入方法依赖的package包/类
@Override
protected boolean accept(Component aComponent) {
    //Do not allow focus to go to a child of the editor we're using if
    //we are in the process of removing the editor
    if (isEditing() && inEditRequest) {
        return isKnownComponent (aComponent);
    }
    return super.accept(aComponent) && aComponent.isShowing();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ETable.java

示例9: checkComponent

import java.awt.Component; //导入方法依赖的package包/类
@Override
public boolean checkComponent(Component comp) {
    if (comp.isShowing() && comp instanceof Window) {
        ComponentSearcher cs = new ComponentSearcher((Container) comp);
        cs.setOutput(JemmyProperties.getCurrentOutput().createErrorOutput());
        return (cs.findComponent(ppFinder)
                != null);
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:JPopupMenuOperator.java

示例10: assertShowing

import java.awt.Component; //导入方法依赖的package包/类
private void assertShowing(String msg, boolean showing, Component c) throws InterruptedException {
    for (int i = 0; i < 100; i++) {
        if (c.isShowing() == showing) {
            break;
        }
        LOG.log(Level.INFO, "Another round ({0}): {1}", new Object[]{i, c});
        Thread.sleep(100);
    }
    assertEquals(msg, showing, c.isShowing());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:DialogDisplayerImplTest.java

示例11: updateItemPresenters

import java.awt.Component; //导入方法依赖的package包/类
private void updateItemPresenters() {
    if (pieChart.getModel().getItemCount() != itemPresenters.size()) {
        repopulateItemPresenters();
        updateSnippets();
    } else {
        refreshItemPresenters();
    }

    Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();

    if ((focusOwner != null) && !focusOwner.isShowing()) {
        navPanel.requestFocusInWindow();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:StatisticsPanel.java

示例12: processEnterMessage

import java.awt.Component; //导入方法依赖的package包/类
/**
 * actual processing on EventQueue Thread
 */

protected void processEnterMessage(SunDropTargetEvent event) {
    Component  c    = (Component)event.getSource();
    DropTarget dt   = c.getDropTarget();
    Point      hots = event.getPoint();

    local = getJVMLocalSourceTransferable();

    if (currentDTC != null) { // some wreckage from last time
        currentDTC.removeNotify();
        currentDTC = null;
    }

    if (c.isShowing() && dt != null && dt.isActive()) {
        currentDT  = dt;
        currentDTC = currentDT.getDropTargetContext();

        currentDTC.addNotify(this);

        currentA   = dt.getDefaultActions();

        try {
            ((DropTargetListener)dt).dragEnter(new DropTargetDragEvent(currentDTC,
                                                                       hots,
                                                                       currentDA,
                                                                       currentSA));
        } catch (Exception e) {
            e.printStackTrace();
            currentDA = DnDConstants.ACTION_NONE;
        }
    } else {
        currentDT  = null;
        currentDTC = null;
        currentDA   = DnDConstants.ACTION_NONE;
        currentSA   = DnDConstants.ACTION_NONE;
        currentA   = DnDConstants.ACTION_NONE;
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:SunDropTargetContextPeer.java

示例13: checkComponent

import java.awt.Component; //导入方法依赖的package包/类
@Override
public boolean checkComponent(Component comp) {
    if (comp instanceof Frame) {
        return ((FIND_INVISIBLE_WINDOWS || (comp.isShowing() && comp.isVisible()))
                && chooser.checkComponent(comp));
    } else {
        return false;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:FrameWaiter.java

示例14: checkComponent

import java.awt.Component; //导入方法依赖的package包/类
@Override
public boolean checkComponent(Component comp) {
    if (comp instanceof Dialog) {
        if (comp.isShowing() && ((Dialog) comp).getTitle() != null) {
            return comparator.equals(((Dialog) comp).getTitle(), title);
        }
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:DialogOperator.java

示例15: isShowing

import java.awt.Component; //导入方法依赖的package包/类
private static boolean isShowing(Component component) {
    return (component != null) && component.isShowing();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:Test6199676.java


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