KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > windows > view > WindowSystemAccessorImpl


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.view;
22
23
24 import java.awt.*;
25
26
27 /**
28  * Accessor impl of window system model, which is processed in 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 accessor.
31  *
32  * @author Peter Zavadsky
33  */

34 final class WindowSystemAccessorImpl implements WindowSystemAccessor {
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 ModeAccessor activeMode;
45     private ModeAccessor maximizedMode;
46     private ModeStructureAccessor modeStructureAccessor;
47     
48     public WindowSystemAccessorImpl() {
49     }
50
51     
52     public void setMainWindowBoundsJoined(Rectangle mainWindowBoundsJoined) {
53         this.mainWindowBoundsJoined = mainWindowBoundsJoined;
54     }
55
56     public Rectangle getMainWindowBoundsJoined() {
57         return mainWindowBoundsJoined;
58     }
59     
60     public void setMainWindowBoundsSeparated(Rectangle mainWindowBoundsSeparated) {
61         this.mainWindowBoundsSeparated = mainWindowBoundsSeparated;
62     }
63
64     public Rectangle getMainWindowBoundsSeparated() {
65         return mainWindowBoundsSeparated;
66     }
67     
68     public void setMainWindowFrameStateJoined(int mainWindowFrameStateJoined) {
69         this.mainWindowFrameStateJoined = mainWindowFrameStateJoined;
70     }
71     
72     public int getMainWindowFrameStateJoined() {
73         return this.mainWindowFrameStateJoined;
74     }
75     
76     public void setMainWindowFrameStateSeparated(int mainWindowFrameStateSeparated) {
77         this.mainWindowFrameStateSeparated = mainWindowFrameStateSeparated;
78     }
79     
80     public int getMainWindowFrameStateSeparated() {
81         return this.mainWindowFrameStateSeparated;
82     }
83     
84     public void setEditorAreaBounds(Rectangle editorAreaBounds) {
85         this.editorAreaBounds = editorAreaBounds;
86     }
87     
88     /** Gets editor area bounds. */
89     public Rectangle getEditorAreaBounds() {
90         return editorAreaBounds;
91     }
92     
93     public void setEditorAreaState(int editorAreaState) {
94         this.editorAreaState = editorAreaState;
95     }
96     
97     /** Gets editor area state. */
98     public int getEditorAreaState() {
99         return editorAreaState;
100     }
101     
102     public void setEditorAreaFrameState(int editorAreaFrameState) {
103         this.editorAreaFrameState = editorAreaFrameState;
104     }
105     
106     public int getEditorAreaFrameState() {
107         return this.editorAreaFrameState;
108     }
109     
110     /** */
111     public void setActiveModeAccessor(ModeAccessor activeMode) {
112         this.activeMode = activeMode;
113     }
114     
115     /** Gets active mode. */
116     public ModeAccessor getActiveModeAccessor() {
117         return activeMode;
118     }
119     
120     /** */
121     public void setMaximizedModeAccessor(ModeAccessor maximizedMode) {
122         this.maximizedMode = maximizedMode;
123     }
124     
125     /** Gets maximized mode. */
126     public ModeAccessor getMaximizedModeAccessor() {
127         return maximizedMode;
128     }
129
130     public void setToolbarConfigurationName(String JavaDoc toolbarConfigurationName) {
131         this.toolbarConfigurationName = toolbarConfigurationName;
132     }
133     /** Toolbar config name. */
134     public String JavaDoc getToolbarConfigurationName() {
135         return toolbarConfigurationName;
136     }
137
138     public void setModeStructureAccessor(ModeStructureAccessor modeStructureAccessor) {
139         this.modeStructureAccessor = modeStructureAccessor;
140     }
141     
142     public ModeStructureAccessor getModeStructureAccessor() {
143         return modeStructureAccessor;
144     }
145     
146     public ModeAccessor findModeAccessor(String JavaDoc modeName) {
147         if(modeName == null) {
148             return null;
149         }
150         
151         if(modeStructureAccessor != null) {
152             return ((ModeStructureAccessorImpl)modeStructureAccessor).findModeAccessor(modeName);
153         }
154         
155         return null;
156     }
157     
158     public String JavaDoc toString() {
159         return super.toString() + "[modeStructure=" + modeStructureAccessor // NOI18N
160
+ ",\nactiveMode=" + activeMode + ",\nmaximizedMode=" + maximizedMode + "]"; // NOI18N
161
}
162 }
163
164
Popular Tags