KickJava   Java API By Example, From Geeks To Geeks.

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


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 package org.netbeans.core.windows;
21
22 import java.awt.Dimension JavaDoc;
23 import javax.swing.JSplitPane JavaDoc;
24 import org.netbeans.swing.tabcontrol.TabbedContainer;
25 import org.openide.util.Utilities;
26
27 /**
28  * Constants in window system.
29  *
30  * @author Peter Zavadsky
31  */

32 public abstract class Constants {
33
34     /** Constant that identifies state of editor area */
35     public static final int EDITOR_AREA_JOINED = 0;
36     public static final int EDITOR_AREA_SEPARATED = 1;
37
38     /** Constant that identifies mode state. */
39     public static final int MODE_STATE_JOINED = 0;
40     public static final int MODE_STATE_SEPARATED = 1;
41     
42     /** Constant that identifies mode kind */
43     public static final int MODE_KIND_EDITOR = TabbedContainer.TYPE_EDITOR;
44     public static final int MODE_KIND_VIEW = TabbedContainer.TYPE_VIEW;
45     public static final int MODE_KIND_SLIDING = TabbedContainer.TYPE_SLIDING;
46
47     /** Vertical orientation constant used in constraint. */
48     public static final int VERTICAL = JSplitPane.VERTICAL_SPLIT;
49     /** Horizontal orientation constant used in constraint. */
50     public static final int HORIZONTAL = JSplitPane.HORIZONTAL_SPLIT;
51     
52     /** Sides of attaching, used both for regular modes and sliding modes */
53     public static final String JavaDoc TOP = JSplitPane.TOP;
54     public static final String JavaDoc BOTTOM = JSplitPane.BOTTOM;
55     public static final String JavaDoc LEFT = JSplitPane.LEFT;
56     public static final String JavaDoc RIGHT = JSplitPane.RIGHT;
57     
58     public static final int DIVIDER_SIZE_VERTICAL = 4;
59     public static final int DIVIDER_SIZE_HORIZONTAL = 5;
60
61     /** Sets size of drop area (when splitting mode and around area). */
62     public static final int DROP_AREA_SIZE = 20;
63     
64     /** How many pixels is necessary to drag to start the DnD. */
65     public static final int DRAG_GESTURE_START_DISTANCE = 10;
66     /** What time inmilliseconds is necessary to hold dragging mouse button for
67      & DnD to be started */

68     public static final int DRAG_GESTURE_START_TIME = 200;
69     
70     // DnD drop ratios.
71
/** How big portion of the original mode has to be taken (range from 0.0 to 1.0). */
72     public static final double DROP_TO_SIDE_RATIO = 0.25D;
73     /** How big portion should take the new mode from each one (between which is dropped) (range from 0.0 to 1.0). */
74     public static final double DROP_BETWEEN_RATIO = 1.0D/3;
75     /** How big portion of entire area should take the dropped mode (range from 0.0 to 1.0). */
76     public static final double DROP_AROUND_RATIO = 0.25D;
77     
78     // XXX
79
/** Size of new separated mode when creting during DnD (separeted mode). */
80     public static final Dimension JavaDoc DROP_NEW_MODE_SIZE = new Dimension JavaDoc(300, 200);
81
82     
83     /** Name of client property (of Boolean type) which says whether the TopComponent is allowed
84      * to be docked anywhere (even crossing view-editor border). */

85     public static final String JavaDoc TOPCOMPONENT_ALLOW_DOCK_ANYWHERE = "TopComponentAllowDockAnywhere"; // NOI18N
86

87     /** Client property to distinguish JWindows/JDialogs used as ui elements
88      * for separate modes - floating windows.
89      */

90     public static final String JavaDoc SEPARATE_WINDOW_PROPERTY = "SeparateWindow";
91
92     // System properties (switches):
93
/** Allows user to move <code>TopComponent</code>S between document and view modes,
94      * which is restricted otherwise. */

95     public static final boolean SWITCH_MODE_ADD_NO_RESTRICT = Boolean.getBoolean("netbeans.winsys.allow.dock.anywhere"); // NOI18N
96
//public static final boolean SWITCH_MODE_ADD_NO_RESTRICT = Boolean.TRUE;
97
/** Disables DnD of <code>TopComponent</code>S. */
98     public static final boolean SWITCH_DND_DISABLE = Boolean.getBoolean("netbeans.winsys.disable_dnd"); // NOI18N
99
/** During DnD it provides nicer feedback (fading of possible drop), however performance is worsen in that case. */
100     public static final boolean SWITCH_DROP_INDICATION_FADE = Boolean.getBoolean("netbeans.winsys.dndfade.on"); //NOI18N
101
/** Shows the status line at the end of menu bar instead of at the bottom of main window. */
102     public static final boolean SWITCH_STATUSLINE_IN_MENUBAR = Boolean.getBoolean("netbeans.winsys.statusLine.in.menuBar"); // NOI18N
103

104     /** Gets the image resource to be used in the empty editor area. */
105     public static final String JavaDoc SWITCH_IMAGE_SOURCE = System.getProperty("netbeans.winsys.imageSource"); // NOI18N
106

107     // XXX #37999
108
/** For view, do not show emty documents area, i.e. when no document is opened. */
109     public static final boolean SWITCH_HIDE_EMPTY_DOCUMENT_AREA = Boolean.getBoolean("netbeans.winsys.hideEmptyDocArea"); // NOI18N
110

111     //Issue 39166, OS-X will display a strange gray rectangle while dragging - they
112
//really require an image to be supplied. Leaving this off for other platforms pending
113
//HIE approval and performance impact evaluation - probably safe for Windows, probably
114
//a big performance hit on Linux. Appears that XP L&F will not display images even if
115
//supplied.
116
public static final boolean SWITCH_USE_DRAG_IMAGES = Boolean.getBoolean("netbeans.winsys.dragimage") || Utilities.isMac();
117    
118     /** Allowing complete removal of toolbars. */
119     public static final boolean NO_TOOLBARS = Boolean.getBoolean("netbeans.winsys.no_toolbars"); // NOI18N
120

121     /** File name whose InstanceCookie can contain custom menu bar component.*/
122     public static final String JavaDoc CUSTOM_MENU_BAR_PATH = System.getProperty("netbeans.winsys.menu_bar.path"); // NOI18N
123

124     /** File name whose InstanceCookie can contain custom status line component.*/
125     public static final String JavaDoc CUSTOM_STATUS_LINE_PATH = System.getProperty("netbeans.winsys.status_line.path"); // NOI18N
126

127     private Constants() {}
128 }
129
Popular Tags