1 7 8 package com.memoire.vainstall.builder.action; 9 10 import com.memoire.vainstall.builder.*; 11 import com.memoire.vainstall.builder.gui.*; 12 13 import java.awt.Rectangle ; 14 15 import javax.swing.*; 16 17 27 public class CascadeWindowsAction extends AbstractVAIBuilderAction { 28 29 32 public CascadeWindowsAction() { 33 super(); 34 } 35 36 39 public void runnit() { 40 41 JDesktopPane pane = ((VAIBuilderFrame)getController().getFrame()).getDesktopPane(); 42 43 JInternalFrame iframes[] = pane.getAllFrames(); 44 45 int activeCount = 0; 46 for (int i = 0; i < iframes.length; i++) { 47 if (iframes[i].isIcon() == false) { 48 activeCount++; 49 } 50 } 51 52 JInternalFrame[] activeFrames = new JInternalFrame[activeCount]; 53 54 activeCount = 0; 55 for (int i = 0; i < iframes.length; i++) { 56 if (iframes[i].isIcon() == false) { 57 activeFrames[activeCount] = iframes[i]; 58 activeCount++; 59 } 60 } 61 62 int down = activeCount-1; 63 64 for (int i = 0; i < activeCount; i++) { 65 activeFrames[i].setBounds(down*40,down*40,activeFrames[i].getWidth(),activeFrames[i].getHeight()); 66 down--; 67 } 68 69 } 70 71 } 72 | Popular Tags |