1 /* |
1 /* |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
25 |
25 |
26 |
26 |
27 package javax.swing.plaf.basic; |
27 package javax.swing.plaf.basic; |
28 |
28 |
29 |
29 |
|
30 import sun.awt.AWTAccessor; |
|
31 import sun.awt.AWTAccessor.ComponentAccessor; |
30 import sun.swing.DefaultLookup; |
32 import sun.swing.DefaultLookup; |
31 import sun.swing.UIAction; |
33 import sun.swing.UIAction; |
32 import javax.swing.*; |
34 import javax.swing.*; |
33 import javax.swing.border.Border; |
35 import javax.swing.border.Border; |
34 import java.awt.*; |
36 import java.awt.*; |
1189 |
1191 |
1190 /** |
1192 /** |
1191 * Should be messaged before the dragging session starts, resets |
1193 * Should be messaged before the dragging session starts, resets |
1192 * lastDragLocation and dividerSize. |
1194 * lastDragLocation and dividerSize. |
1193 */ |
1195 */ |
1194 @SuppressWarnings("deprecation") |
|
1195 protected void startDragging() { |
1196 protected void startDragging() { |
1196 Component leftC = splitPane.getLeftComponent(); |
1197 Component leftC = splitPane.getLeftComponent(); |
1197 Component rightC = splitPane.getRightComponent(); |
1198 Component rightC = splitPane.getRightComponent(); |
1198 ComponentPeer cPeer; |
1199 ComponentPeer cPeer; |
1199 |
1200 |
1200 beginDragDividerLocation = getDividerLocation(splitPane); |
1201 beginDragDividerLocation = getDividerLocation(splitPane); |
1201 draggingHW = false; |
1202 draggingHW = false; |
1202 if(leftC != null && (cPeer = leftC.getPeer()) != null && |
1203 final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); |
|
1204 if(leftC != null && (cPeer = acc.getPeer(leftC)) != null && |
1203 !(cPeer instanceof LightweightPeer)) { |
1205 !(cPeer instanceof LightweightPeer)) { |
1204 draggingHW = true; |
1206 draggingHW = true; |
1205 } else if(rightC != null && (cPeer = rightC.getPeer()) != null |
1207 } else if(rightC != null && (cPeer = acc.getPeer(rightC)) != null |
1206 && !(cPeer instanceof LightweightPeer)) { |
1208 && !(cPeer instanceof LightweightPeer)) { |
1207 draggingHW = true; |
1209 draggingHW = true; |
1208 } |
1210 } |
1209 if(orientation == JSplitPane.HORIZONTAL_SPLIT) { |
1211 if(orientation == JSplitPane.HORIZONTAL_SPLIT) { |
1210 setLastDragLocation(divider.getBounds().x); |
1212 setLastDragLocation(divider.getBounds().x); |