01: /*
02: * $RCSfile: TileWindowsVerticalAction.java,v $
03: * @modification $Date: 2001/09/28 19:31:19 $
04: * @version $Id: TileWindowsVerticalAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
05: *
06: */
07:
08: package com.memoire.vainstall.builder.action;
09:
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: /**
18: * This action tiles all internal frames vertical on the desktop pane
19: * that is not iconified.
20: *
21: * @see com.memoire.vainstall.builder.util.AbstractVAIBuilderAction
22: *
23: * @author Henrik Falk
24: * @version $Id: TileWindowsVerticalAction.java,v 1.1 2001/09/28 19:31:19 hfalk Exp $
25: */
26: public class TileWindowsVerticalAction extends AbstractVAIBuilderAction {
27:
28: /**
29: * Default constructor
30: */
31: public TileWindowsVerticalAction() {
32: super ();
33: }
34:
35: /**
36: * Implements the runnit method
37: */
38: public void runnit() {
39:
40: JDesktopPane pane = ((VAIBuilderFrame) getController()
41: .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: for (int i = 0; i < activeCount; i++) {
63: activeFrames[i].setBounds(i
64: * (pane.getWidth() / activeCount), 0, pane
65: .getWidth()
66: / activeCount, pane.getHeight());
67: }
68:
69: }
70:
71: }
|