本文整理匯總了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;
}
示例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;
}
示例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);
}
}
示例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;
}
}
示例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()));
}
}
示例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"));
}
}
示例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());
}
示例8: checkComponent
import javax.swing.JInternalFrame; //導入方法依賴的package包/類
@Override
public boolean checkComponent(Component comp) {
return ((comp instanceof JInternalFrame || comp instanceof JInternalFrame.JDesktopIcon)
&& sf.checkComponent(comp));
}