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 26 public class TileWindowsVerticalAction extends AbstractVAIBuilderAction { 27 28 31 public TileWindowsVerticalAction() { 32 super(); 33 } 34 35 38 public void runnit() { 39 40 JDesktopPane pane = ((VAIBuilderFrame)getController().getFrame()).getDesktopPane(); 41 42 JInternalFrame iframes[] = pane.getAllFrames(); 43 44 int activeCount = 0; 45 for (int i = 0; i < iframes.length; i++) { 46 if (iframes[i].isIcon() == false) { 47 activeCount++; 48 } 49 } 50 51 JInternalFrame[] activeFrames = new JInternalFrame[activeCount]; 52 53 activeCount = 0; 54 for (int i = 0; i < iframes.length; i++) { 55 if (iframes[i].isIcon() == false) { 56 activeFrames[activeCount] = iframes[i]; 57 activeCount++; 58 } 59 } 60 61 for (int i = 0; i < activeCount; i++) { 62 activeFrames[i].setBounds(i*(pane.getWidth()/activeCount),0,pane.getWidth()/activeCount,pane.getHeight()); 63 } 64 65 } 66 67 } 68 | Popular Tags |