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