102 static final int TOOLKIT_MODAL = 3;
103
104 // window style bits
105 static final int _RESERVED_FOR_DATA = 1 << 0;
106
107 // corresponds to native style mask bits
108 static final int DECORATED = 1 << 1;
109 static final int TEXTURED = 1 << 2;
110 static final int UNIFIED = 1 << 3;
111 static final int UTILITY = 1 << 4;
112 static final int HUD = 1 << 5;
113 static final int SHEET = 1 << 6;
114
115 static final int CLOSEABLE = 1 << 7;
116 static final int MINIMIZABLE = 1 << 8;
117
118 static final int RESIZABLE = 1 << 9; // both a style bit and prop bit
119 static final int NONACTIVATING = 1 << 24;
120 static final int IS_DIALOG = 1 << 25;
121 static final int IS_MODAL = 1 << 26;
122
123 static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
124
125 // corresponds to method-based properties
126 static final int HAS_SHADOW = 1 << 10;
127 static final int ZOOMABLE = 1 << 11;
128
129 static final int ALWAYS_ON_TOP = 1 << 15;
130 static final int HIDES_ON_DEACTIVATE = 1 << 17;
131 static final int DRAGGABLE_BACKGROUND = 1 << 19;
132 static final int DOCUMENT_MODIFIED = 1 << 21;
133 static final int FULLSCREENABLE = 1 << 23;
134
135 static final int _METHOD_PROP_BITMASK = RESIZABLE | HAS_SHADOW | ZOOMABLE | ALWAYS_ON_TOP | HIDES_ON_DEACTIVATE | DRAGGABLE_BACKGROUND | DOCUMENT_MODIFIED | FULLSCREENABLE;
136
137 // corresponds to callback-based properties
138 static final int SHOULD_BECOME_KEY = 1 << 12;
139 static final int SHOULD_BECOME_MAIN = 1 << 13;
140 static final int MODAL_EXCLUDED = 1 << 16;
141
301 final boolean resizable = isFrame ? ((Frame)target).isResizable() : (isDialog ? ((Dialog)target).isResizable() : false);
302 styleBits = SET(styleBits, RESIZABLE, resizable);
303 if (!resizable) {
304 styleBits = SET(styleBits, ZOOMABLE, false);
305 }
306 }
307
308 if (target.isAlwaysOnTop()) {
309 styleBits = SET(styleBits, ALWAYS_ON_TOP, true);
310 }
311
312 if (target.getModalExclusionType() == Dialog.ModalExclusionType.APPLICATION_EXCLUDE) {
313 styleBits = SET(styleBits, MODAL_EXCLUDED, true);
314 }
315
316 // If the target is a dialog, popup or tooltip we want it to ignore the brushed metal look.
317 if (isPopup) {
318 styleBits = SET(styleBits, TEXTURED, false);
319 // Popups in applets don't activate applet's process
320 styleBits = SET(styleBits, NONACTIVATING, true);
321 }
322
323 if (Window.Type.UTILITY.equals(target.getType())) {
324 styleBits = SET(styleBits, UTILITY, true);
325 }
326
327 if (target instanceof javax.swing.RootPaneContainer) {
328 javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane();
329 Object prop = null;
330
331 prop = rootpane.getClientProperty(WINDOW_BRUSH_METAL_LOOK);
332 if (prop != null) {
333 styleBits = SET(styleBits, TEXTURED, Boolean.parseBoolean(prop.toString()));
334 }
335
336 if (isDialog && ((Dialog)target).getModalityType() == ModalityType.DOCUMENT_MODAL) {
337 prop = rootpane.getClientProperty(WINDOW_DOC_MODAL_SHEET);
338 if (prop != null) {
339 styleBits = SET(styleBits, SHEET, Boolean.parseBoolean(prop.toString()));
340 }
|
102 static final int TOOLKIT_MODAL = 3;
103
104 // window style bits
105 static final int _RESERVED_FOR_DATA = 1 << 0;
106
107 // corresponds to native style mask bits
108 static final int DECORATED = 1 << 1;
109 static final int TEXTURED = 1 << 2;
110 static final int UNIFIED = 1 << 3;
111 static final int UTILITY = 1 << 4;
112 static final int HUD = 1 << 5;
113 static final int SHEET = 1 << 6;
114
115 static final int CLOSEABLE = 1 << 7;
116 static final int MINIMIZABLE = 1 << 8;
117
118 static final int RESIZABLE = 1 << 9; // both a style bit and prop bit
119 static final int NONACTIVATING = 1 << 24;
120 static final int IS_DIALOG = 1 << 25;
121 static final int IS_MODAL = 1 << 26;
122 static final int IS_POPUP = 1 << 27;
123
124 static final int _STYLE_PROP_BITMASK = DECORATED | TEXTURED | UNIFIED | UTILITY | HUD | SHEET | CLOSEABLE | MINIMIZABLE | RESIZABLE;
125
126 // corresponds to method-based properties
127 static final int HAS_SHADOW = 1 << 10;
128 static final int ZOOMABLE = 1 << 11;
129
130 static final int ALWAYS_ON_TOP = 1 << 15;
131 static final int HIDES_ON_DEACTIVATE = 1 << 17;
132 static final int DRAGGABLE_BACKGROUND = 1 << 19;
133 static final int DOCUMENT_MODIFIED = 1 << 21;
134 static final int FULLSCREENABLE = 1 << 23;
135
136 static final int _METHOD_PROP_BITMASK = RESIZABLE | HAS_SHADOW | ZOOMABLE | ALWAYS_ON_TOP | HIDES_ON_DEACTIVATE | DRAGGABLE_BACKGROUND | DOCUMENT_MODIFIED | FULLSCREENABLE;
137
138 // corresponds to callback-based properties
139 static final int SHOULD_BECOME_KEY = 1 << 12;
140 static final int SHOULD_BECOME_MAIN = 1 << 13;
141 static final int MODAL_EXCLUDED = 1 << 16;
142
302 final boolean resizable = isFrame ? ((Frame)target).isResizable() : (isDialog ? ((Dialog)target).isResizable() : false);
303 styleBits = SET(styleBits, RESIZABLE, resizable);
304 if (!resizable) {
305 styleBits = SET(styleBits, ZOOMABLE, false);
306 }
307 }
308
309 if (target.isAlwaysOnTop()) {
310 styleBits = SET(styleBits, ALWAYS_ON_TOP, true);
311 }
312
313 if (target.getModalExclusionType() == Dialog.ModalExclusionType.APPLICATION_EXCLUDE) {
314 styleBits = SET(styleBits, MODAL_EXCLUDED, true);
315 }
316
317 // If the target is a dialog, popup or tooltip we want it to ignore the brushed metal look.
318 if (isPopup) {
319 styleBits = SET(styleBits, TEXTURED, false);
320 // Popups in applets don't activate applet's process
321 styleBits = SET(styleBits, NONACTIVATING, true);
322 styleBits = SET(styleBits, IS_POPUP, true);
323 }
324
325 if (Window.Type.UTILITY.equals(target.getType())) {
326 styleBits = SET(styleBits, UTILITY, true);
327 }
328
329 if (target instanceof javax.swing.RootPaneContainer) {
330 javax.swing.JRootPane rootpane = ((javax.swing.RootPaneContainer)target).getRootPane();
331 Object prop = null;
332
333 prop = rootpane.getClientProperty(WINDOW_BRUSH_METAL_LOOK);
334 if (prop != null) {
335 styleBits = SET(styleBits, TEXTURED, Boolean.parseBoolean(prop.toString()));
336 }
337
338 if (isDialog && ((Dialog)target).getModalityType() == ModalityType.DOCUMENT_MODAL) {
339 prop = rootpane.getClientProperty(WINDOW_DOC_MODAL_SHEET);
340 if (prop != null) {
341 styleBits = SET(styleBits, SHEET, Boolean.parseBoolean(prop.toString()));
342 }
|