KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > WindowSystemSnapshot


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20
21 package org.netbeans.core.windows;
22
23
24 import java.awt.*;
25
26
27 /**
28  * Snapshot of window system model, which is passed to view.
29  * It reflects the state of model in view convenient format, which is
30  * responsibility of view to present GUI according of state of this snapshot.
31  *
32  * @author Peter Zavadsky
33  */

34 public class WindowSystemSnapshot {
35
36     private Rectangle mainWindowBoundsJoined;
37     private Rectangle mainWindowBoundsSeparated;
38     private int mainWindowFrameStateJoined;
39     private int mainWindowFrameStateSeparated;
40     private String JavaDoc toolbarConfigurationName;
41     private int editorAreaState;
42     private int editorAreaFrameState;
43     private Rectangle editorAreaBounds;
44     private ModeStructureSnapshot.ModeSnapshot activeMode;
45     private ModeStructureSnapshot.ModeSnapshot maximizedMode;
46     private ModeStructureSnapshot modeStructureSnapshot;
47     private String JavaDoc projectName;
48     
49     public WindowSystemSnapshot() {
50     }
51
52     
53     public void setMainWindowBoundsJoined(Rectangle mainWindowBoundsJoined) {
54         this.mainWindowBoundsJoined = mainWindowBoundsJoined;
55     }
56
57     public Rectangle getMainWindowBoundsJoined() {
58         return mainWindowBoundsJoined;
59     }
60     
61     public void setMainWindowBoundsSeparated(Rectangle mainWindowBoundsSeparated) {
62         this.mainWindowBoundsSeparated = mainWindowBoundsSeparated;
63     }
64
65     public Rectangle getMainWindowBoundsSeparated() {
66         return mainWindowBoundsSeparated;
67     }
68     
69     public void setMainWindowFrameStateJoined(int mainWindowFrameStateJoined) {
70         this.mainWindowFrameStateJoined = mainWindowFrameStateJoined;
71     }
72     
73     public int getMainWindowFrameStateJoined() {
74         return this.mainWindowFrameStateJoined;
75     }
76     
77     public void setMainWindowFrameStateSeparated(int mainWindowFrameStateSeparated) {
78         this.mainWindowFrameStateSeparated = mainWindowFrameStateSeparated;
79     }
80     
81     public int getMainWindowFrameStateSeparated() {
82         return this.mainWindowFrameStateSeparated;
83     }
84     
85     public void setEditorAreaBounds(Rectangle editorAreaBounds) {
86         this.editorAreaBounds = editorAreaBounds;
87     }
88     
89     /** Gets editor area bounds. */
90     public Rectangle getEditorAreaBounds() {
91         return editorAreaBounds;
92     }
93     
94     public void setEditorAreaState(int editorAreaState) {
95         this.editorAreaState = editorAreaState;
96     }
97     
98     /** Gets editor area state. */
99     public int getEditorAreaState() {
100         return editorAreaState;
101     }
102     
103     public void setEditorAreaFrameState(int editorAreaFrameState) {
104         this.editorAreaFrameState = editorAreaFrameState;
105     }
106     
107     public int getEditorAreaFrameState() {
108         return this.editorAreaFrameState;
109     }
110     
111     /** */
112     public void setActiveModeSnapshot(ModeStructureSnapshot.ModeSnapshot activeMode) {
113         this.activeMode = activeMode;
114     }
115     
116     /** Gets active mode. */
117     public ModeStructureSnapshot.ModeSnapshot getActiveModeSnapshot() {
118         return activeMode;
119     }
120     
121     /** */
122     public void setMaximizedModeSnapshot(ModeStructureSnapshot.ModeSnapshot maximizedMode) {
123         this.maximizedMode = maximizedMode;
124     }
125     
126     /** Gets maximized mode. */
127     public ModeStructureSnapshot.ModeSnapshot getMaximizedModeSnapshot() {
128         return maximizedMode;
129     }
130
131     public void setToolbarConfigurationName(String JavaDoc toolbarConfigurationName) {
132         this.toolbarConfigurationName = toolbarConfigurationName;
133     }
134     /** Toolbar config name. */
135     public String JavaDoc getToolbarConfigurationName() {
136         return toolbarConfigurationName;
137     }
138
139     public void setModeStructureSnapshot(ModeStructureSnapshot modeStructureSnapshot) {
140         this.modeStructureSnapshot = modeStructureSnapshot;
141     }
142     
143     public ModeStructureSnapshot getModeStructureSnapshot() {
144         return modeStructureSnapshot;
145     }
146     
147     // XXX
148
public void setProjectName(String JavaDoc projectName) {
149         this.projectName = projectName;
150     }
151     
152     public String JavaDoc getProjectName() {
153         return projectName;
154     }
155     
156     public ModeStructureSnapshot.ModeSnapshot findModeSnapshot(ModeImpl mode) {
157         if(mode == null) {
158             return null;
159         }
160         
161         if(modeStructureSnapshot != null) {
162             return ((ModeStructureSnapshot)modeStructureSnapshot).findModeSnapshot(mode.getName());
163         }
164         
165         return null;
166     }
167     
168     public String JavaDoc toString() {
169         return super.toString() + "[modeStructure=" + modeStructureSnapshot // NOI18N
170
+ ",\nactiveMode=" + activeMode + ",\nmaximizedMode=" + maximizedMode + "]"; // NOI18N
171
}
172 }
173
174
Popular Tags