/*
* $RCSfile: TileWindowsHorizontalAction.java,v $
* @modification $Date: 2001/09/28 19:31:19 $
* @version $Id: TileWindowsHorizontalAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
*
*/
package com.memoire.vainstall.builder.action;
import com.memoire.vainstall.builder.*;
import com.memoire.vainstall.builder.gui.*;
import java.awt.Rectangle;
import javax.swing.*;
/**
* This action tiles all internal frames horizontal on the desktop pane
* that is not iconified.
*
* @see com.memoire.vainstall.builder.util.AbstractVAIBuilderAction
*
* @author Henrik Falk
* @version $Id: TileWindowsHorizontalAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
*/
public class TileWindowsHorizontalAction extends AbstractVAIBuilderAction {
/**
* Default constructor
*/
public TileWindowsHorizontalAction() {
super();
}
/**
* Implements the runnit method
*/
public void runnit() {
JDesktopPane pane = ((VAIBuilderFrame)getController().getFrame()).getDesktopPane();
JInternalFrame iframes[] = pane.getAllFrames();
int activeCount = 0;
for (int i = 0; i < iframes.length; i++) {
if (iframes[i].isIcon() == false) {
activeCount++;
}
}
JInternalFrame[] activeFrames = new JInternalFrame[activeCount];
activeCount = 0;
for (int i = 0; i < iframes.length; i++) {
if (iframes[i].isIcon() == false) {
activeFrames[activeCount] = iframes[i];
activeCount++;
}
}
for(int i=0;i<activeCount;i++) {
activeFrames[i].setBounds(0,i*(pane.getHeight()/activeCount),pane.getWidth(),pane.getHeight()/activeCount);
}
}
}
|