當前位置: 首頁>>代碼示例>>Java>>正文


Java JInternalFrame.JDesktopIcon方法代碼示例

本文整理匯總了Java中javax.swing.JInternalFrame.JDesktopIcon方法的典型用法代碼示例。如果您正苦於以下問題:Java JInternalFrame.JDesktopIcon方法的具體用法?Java JInternalFrame.JDesktopIcon怎麽用?Java JInternalFrame.JDesktopIcon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JInternalFrame的用法示例。


在下文中一共展示了JInternalFrame.JDesktopIcon方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getShowingSubPanel

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
 * Get any panel this {@code Canvas} is displaying.
 *
 * @return A {@code Component} the {@code Canvas} is
 *         displaying, or null if none found.
 */
public Component getShowingSubPanel() {
    for (Component c : getComponents()) {
        if (c instanceof ToolBoxFrame) {
            continue;
        }
        if (c instanceof JInternalFrame) {
            return c;
        } else if (c instanceof JInternalFrame.JDesktopIcon) {
            return c;
        }
    }
    return null;
}
 
開發者ID:FreeCol,項目名稱:freecol,代碼行數:20,代碼來源:Canvas.java

示例2: matches

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
private boolean matches(Component c, int partIndex) {
    if (partIndex < 0) return true;
    if (c == null) return false;
    //only get here if partIndex > 0 and c == null

    String name = c.getName();
    if (parts[partIndex].named && parts[partIndex].s.equals(name)) {
        //so far so good, recurse
        return matches(c.getParent(), partIndex - 1);
    } else if (!parts[partIndex].named) {
        //if c is not named, and parts[partIndex] has an expected class
        //type registered, then check to make sure c is of the
        //right type;
        Class clazz = parts[partIndex].c;
        if (clazz != null && clazz.isAssignableFrom(c.getClass())) {
            //so far so good, recurse
            return matches(c.getParent(), partIndex - 1);
        } else if (clazz == null &&
                   registeredRegions.containsKey(parts[partIndex].s)) {
            Region r = registeredRegions.get(parts[partIndex].s);
            Component parent = r.isSubregion() ? c : c.getParent();
            //special case the JInternalFrameTitlePane, because it
            //doesn't fit the mold. very, very funky.
            if (r == Region.INTERNAL_FRAME_TITLE_PANE && parent != null
                && parent instanceof JInternalFrame.JDesktopIcon) {
                JInternalFrame.JDesktopIcon icon =
                        (JInternalFrame.JDesktopIcon) parent;
                parent = icon.getInternalFrame();
            }
            //it was the name of a region. So far, so good. Recurse.
            return matches(parent, partIndex - 1);
        }
    }

    return false;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:37,代碼來源:NimbusDefaults.java

示例3: sort

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
public void sort() {
	List<Component> icons = new ArrayList<>();
	for (Component comp : getComponents()) {
		if (comp instanceof JInternalFrame.JDesktopIcon) {
			icons.add(comp);
		}
	}
	int x = 0;
	for (Component icon : icons) {
		int y = getHeight() - icon.getHeight();
		icon.setLocation(x, y);
		x += icon.getWidth();
		setLayer(icon, 10);
	}
}
 
開發者ID:Col-E,項目名稱:Recaf,代碼行數:16,代碼來源:ClassDisplayPanel.java

示例4: findJInternalFrame

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
 * Searches JInternalframe in container.
 *
 * @param cont Container to search component in.
 * @param chooser a component chooser specifying searching criteria.
 * @param index Ordinal component index.
 * @return JInternalframe instance or null if component was not found.
 */
public static JInternalFrame findJInternalFrame(Container cont, ComponentChooser chooser, int index) {
    Component res = findComponent(cont, new JInternalFrameFinder(chooser), index);
    if (res instanceof JInternalFrame) {
        return (JInternalFrame) res;
    } else if (res instanceof JInternalFrame.JDesktopIcon) {
        return ((JInternalFrame.JDesktopIcon) res).getInternalFrame();
    } else {
        return null;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:19,代碼來源:JInternalFrameOperator.java

示例5: waitJInternalFrame

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
 * Waits JInternalframe in container.
 *
 * @param cont Container to search component in.
 * @param chooser a component chooser specifying searching criteria.
 * @param index Ordinal component index.
 * @return JInternalframe instance.
 *
 */
public static JInternalFrame waitJInternalFrame(final Container cont, final ComponentChooser chooser, final int index) {
    Component res = waitComponent(cont, new JInternalFrameFinder(chooser), index);
    if (res instanceof JInternalFrame) {
        return (JInternalFrame) res;
    } else if (res instanceof JInternalFrame.JDesktopIcon) {
        return ((JInternalFrame.JDesktopIcon) res).getInternalFrame();
    } else {
        throw (new TimeoutExpiredException(chooser.getDescription()));
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:JInternalFrameOperator.java

示例6: findOne

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
private static JInternalFrame findOne(ContainerOperator<?> cont, String text, int index) {
    Component source = waitComponent(cont,
            new JInternalFrameByTitleFinder(text,
                    cont.getComparator()),
            index);
    if (source instanceof JInternalFrame) {
        return (JInternalFrame) source;
    } else if (source instanceof JInternalFrame.JDesktopIcon) {
        return ((JInternalFrame.JDesktopIcon) source).getInternalFrame();
    } else {
        throw (new TimeoutExpiredException("No internal frame was found"));
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:14,代碼來源:JInternalFrameOperator.java

示例7: JDesktopIconOperator

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
/**
 * Constructs JDesktopIconOperator.
 *
 * @param b a component
 */
public JDesktopIconOperator(JInternalFrame.JDesktopIcon b) {
    super(b);
    setOutput(JemmyProperties.getCurrentOutput());
    setTimeouts(JemmyProperties.getCurrentTimeouts());
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:11,代碼來源:JInternalFrameOperator.java

示例8: checkComponent

import javax.swing.JInternalFrame; //導入方法依賴的package包/類
@Override
public boolean checkComponent(Component comp) {
    return ((comp instanceof JInternalFrame || comp instanceof JInternalFrame.JDesktopIcon)
            && sf.checkComponent(comp));
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:6,代碼來源:JInternalFrameOperator.java


注:本文中的javax.swing.JInternalFrame.JDesktopIcon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。