KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > java > swing > plaf > nimbus > InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowMaximizedState


1 /*
2  * InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowMaximizedState.java 07/12/12
3  *
4  * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package com.sun.java.swing.plaf.nimbus;
8
9 import java.awt.*;
10 import javax.swing.*;
11
12 /**
13  */

14 class InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowMaximizedState extends State {
15     InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowMaximizedState() {
16         super("WindowMaximized");
17     }
18
19     @Override JavaDoc protected boolean isInState(JComponent c) {
20
21                                Component parent = c;
22                                while (parent.getParent() != null) {
23                                    if (parent instanceof JInternalFrame) {
24                                        break;
25                                    }
26                                    parent = parent.getParent();
27                                }
28                                if (parent instanceof JInternalFrame) {
29                                    return ((JInternalFrame)parent).isMaximum();
30                                }
31                                return false;
32     }
33 }
34
35
Popular Tags