本文整理汇总了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;
}
示例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();
}
示例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() + '}';
}
};
}
示例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() + '}';
}
};
}
示例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);
}
}
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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());
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例15: isShowing
import java.awt.Component; //导入方法依赖的package包/类
private static boolean isShowing(Component component) {
return (component != null) && component.isShowing();
}