本文整理了Java中javax.swing.JDesktopPane.getAllFrames()
方法的一些代码示例,展示了JDesktopPane.getAllFrames()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JDesktopPane.getAllFrames()
方法的具体详情如下:
包路径:javax.swing.JDesktopPane
类名称:JDesktopPane
方法名:getAllFrames
暂无
代码示例来源:origin: chewiebug/GCViewer
public List<GCDocument> getAllGCDocuments() {
List<GCDocument> documents = new ArrayList<>();
for (JInternalFrame frame : desktopPane.getAllFrames()) {
if (frame instanceof GCDocument) {
GCDocument document = (GCDocument) frame;
documents.add(document);
}
}
return documents;
}
代码示例来源:origin: chewiebug/GCViewer
public void actionPerformed(final ActionEvent e) {
final JInternalFrame[] frames = gcViewer.getDesktopPane().getAllFrames();
final DesktopManager desktopManager = gcViewer.getDesktopPane().getDesktopManager();
for (int i=0; i<frames.length; i++) {
final JInternalFrame frame = frames[i];
desktopManager.deiconifyFrame(frame);
try {
frame.setMaximum(false);
}
catch (PropertyVetoException e1) {
e1.printStackTrace();
}
final int height = gcViewer.getDesktopPane().getHeight()/frames.length;
desktopManager.setBoundsForFrame(frame, 0, height * i, gcViewer.getDesktopPane().getWidth(), height);
}
}
}
代码示例来源:origin: bcdev/beam
public JInternalFrame[] getAllFrames() {
return desktopPane.getAllFrames();
}
代码示例来源:origin: com.github.houbie/rhino-mod
/**
* Returns the current selected internal frame.
*/
private JInternalFrame getSelectedFrame() {
JInternalFrame[] frames = desk.getAllFrames();
for (int i = 0; i < frames.length; i++) {
if (frames[i].isShowing()) {
return frames[i];
}
}
return frames[frames.length - 1];
}
代码示例来源:origin: com.github.tntim96/rhino
/**
* Returns the current selected internal frame.
*/
private JInternalFrame getSelectedFrame() {
JInternalFrame[] frames = desk.getAllFrames();
for (int i = 0; i < frames.length; i++) {
if (frames[i].isShowing()) {
return frames[i];
}
}
return frames[frames.length - 1];
}
代码示例来源:origin: cytoscape/application
public void closeAllWindows() {
JInternalFrame[] allFrames = desktop.getAllFrames();
for (int i= allFrames.length -1; i>=0; i--) {
allFrames[i].dispose();
}
}
代码示例来源:origin: stackoverflow.com
jdp.setDesktopManager( new DefaultDesktopManager(){
@Override
public void deiconifyFrame(JInternalFrame f) {
super.deiconifyFrame(f);
JDesktopPane d = f.getDesktopPane();
JInternalFrame[] frames = d.getAllFrames();
for(JInternalFrame frame : frames ) {
Rectangle bounds = getBoundsForIconOf(frame);
// relayout all frames
}
}
});
代码示例来源:origin: ro.isdc.wro4j/rhino
/**
* Returns the current selected internal frame.
*/
private JInternalFrame getSelectedFrame() {
JInternalFrame[] frames = desk.getAllFrames();
for (int i = 0; i < frames.length; i++) {
if (frames[i].isShowing()) {
return frames[i];
}
}
return frames[frames.length - 1];
}
代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger
/**
* Returns the current selected internal frame.
*/
private JInternalFrame getSelectedFrame() {
JInternalFrame[] frames = desk.getAllFrames();
for (int i = 0; i < frames.length; i++) {
if (frames[i].isShowing()) {
return frames[i];
}
}
return frames[frames.length - 1];
}
代码示例来源:origin: UISpec4J/UISpec4J
/**
* Returs all the internal windows contained in the desktop.
*/
public Window[] getWindows() {
JInternalFrame[] allFrames = jDesktopPane.getAllFrames();
Window[] result = new Window[allFrames.length];
for (int i = 0; i < allFrames.length; i++) {
result[i] = new Window(allFrames[i]);
}
return result;
}
代码示例来源:origin: robo-code/robocode
private void windowCloseAllActionPerformed() {
JInternalFrame[] frames = editor.getDesktopPane().getAllFrames();
if (frames != null) {
for (JInternalFrame frame : frames) {
frame.doDefaultCloseAction();
}
}
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
protected void componentClosed() {
tabbedContainer.removeActionListener(tabActionListener);
for (JInternalFrame internalFrame : desktopPane.getAllFrames()) {
internalFrame.dispose();
}
}
代码示例来源:origin: robo-code/robocode
public EditWindow getActiveWindow() {
JInternalFrame[] frames = getDesktopPane().getAllFrames();
EditWindow editWindow = null;
if (frames != null) {
for (JInternalFrame frame : frames) {
if (frame.isSelected()) {
if (frame instanceof EditWindow) {
editWindow = (EditWindow) frame;
}
break;
}
}
}
return editWindow;
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
public void actionPerformed(ActionEvent e) {
int desktopWidth = desktopPane.getWidth();
int desktopHeight = desktopPane.getHeight();
JInternalFrame[] internalFrames = desktopPane.getAllFrames();
for (JInternalFrame internalFrame : internalFrames) {
internalFrame.setBounds(0, 0, desktopWidth, desktopHeight);
}
}
}
代码示例来源:origin: org.cytoscape/swing-application-impl
public void closeAllWindows() {
JDesktopPane desktop = desk.getNetworkViewManager().getDesktopPane();
JInternalFrame[] allFrames = desktop.getAllFrames();
for (int i= allFrames.length -1; i>=0; i--) {
allFrames[i].dispose();
}
}
代码示例来源:origin: net.java.linoleum/application
private JInternalFrame getFrame(final JDesktopPane desktop, final URI uri) {
for (final JInternalFrame c : desktop.getAllFrames()) {
final String name = c.getName();
if (name != null && name.equals(getName()) && c instanceof Frame) {
if (((Frame) c).reuseFor(uri)) {
return c;
}
}
}
return getFrame();
}
代码示例来源:origin: UISpec4J/UISpec4J
public void check() {
JInternalFrame[] allFrames = jDesktopPane.getAllFrames();
for (JInternalFrame allFrame : allFrames) {
if (Utils.equals(title, allFrame.getTitle())) {
return;
}
}
AssertAdapter.fail("No window with title '" + title + "' found");
}
};
代码示例来源:origin: senbox-org/snap-desktop
@Override
protected void componentHidden() {
for (JInternalFrame internalFrame : desktopPane.getAllFrames()) {
NotifiableComponent.get(getTopComponent(internalFrame)).componentHidden();
}
}
代码示例来源:origin: senbox-org/snap-desktop
@Override
protected void componentShowing() {
for (JInternalFrame internalFrame : desktopPane.getAllFrames()) {
NotifiableComponent.get(getTopComponent(internalFrame)).componentShowing();
}
}
代码示例来源:origin: com.mgmtp.gcviewer/gcviewer
public void internalFrameClosed(final InternalFrameEvent e) {
if (desktopPane.getAllFrames().length == 0) arrangeAction.setEnabled(false);
((GCDocument)e.getInternalFrame()).getRefreshWatchDog().stop();
// remove menuitem from menu and from button group
for (int i=2; i<windowMenu.getItemCount(); i++) {
final JMenuItem item = windowMenu.getItem(i);
if (((WindowMenuItemAction)item.getAction()).getInternalFrame() == e.getInternalFrame()) {
windowMenu.remove(item);
windowCheckBoxGroup.remove(item);
break;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!