< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java

Print this page




1174 
1175     /**
1176      * Set the value to indicate if one of the splitpane sides is expanded.
1177      */
1178     void setKeepHidden(boolean keepHidden) {
1179         this.keepHidden = keepHidden;
1180     }
1181 
1182     /**
1183      * The value returned indicates if one of the splitpane sides is expanded.
1184      * @return true if one of the splitpane sides is expanded, false otherwise.
1185      */
1186     private boolean getKeepHidden() {
1187         return keepHidden;
1188     }
1189 
1190     /**
1191      * Should be messaged before the dragging session starts, resets
1192      * lastDragLocation and dividerSize.
1193      */

1194     protected void startDragging() {
1195         Component       leftC = splitPane.getLeftComponent();
1196         Component       rightC = splitPane.getRightComponent();
1197         ComponentPeer   cPeer;
1198 
1199         beginDragDividerLocation = getDividerLocation(splitPane);
1200         draggingHW = false;
1201         if(leftC != null && (cPeer = leftC.getPeer()) != null &&
1202            !(cPeer instanceof LightweightPeer)) {
1203             draggingHW = true;
1204         } else if(rightC != null && (cPeer = rightC.getPeer()) != null
1205                   && !(cPeer instanceof LightweightPeer)) {
1206             draggingHW = true;
1207         }
1208         if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
1209             setLastDragLocation(divider.getBounds().x);
1210             dividerSize = divider.getSize().width;
1211             if(!isContinuousLayout() && draggingHW) {
1212                 nonContinuousLayoutDivider.setBounds
1213                         (getLastDragLocation(), 0, dividerSize,




1174 
1175     /**
1176      * Set the value to indicate if one of the splitpane sides is expanded.
1177      */
1178     void setKeepHidden(boolean keepHidden) {
1179         this.keepHidden = keepHidden;
1180     }
1181 
1182     /**
1183      * The value returned indicates if one of the splitpane sides is expanded.
1184      * @return true if one of the splitpane sides is expanded, false otherwise.
1185      */
1186     private boolean getKeepHidden() {
1187         return keepHidden;
1188     }
1189 
1190     /**
1191      * Should be messaged before the dragging session starts, resets
1192      * lastDragLocation and dividerSize.
1193      */
1194     @SuppressWarnings("deprecation")
1195     protected void startDragging() {
1196         Component       leftC = splitPane.getLeftComponent();
1197         Component       rightC = splitPane.getRightComponent();
1198         ComponentPeer   cPeer;
1199 
1200         beginDragDividerLocation = getDividerLocation(splitPane);
1201         draggingHW = false;
1202         if(leftC != null && (cPeer = leftC.getPeer()) != null &&
1203            !(cPeer instanceof LightweightPeer)) {
1204             draggingHW = true;
1205         } else if(rightC != null && (cPeer = rightC.getPeer()) != null
1206                   && !(cPeer instanceof LightweightPeer)) {
1207             draggingHW = true;
1208         }
1209         if(orientation == JSplitPane.HORIZONTAL_SPLIT) {
1210             setLastDragLocation(divider.getBounds().x);
1211             dividerSize = divider.getSize().width;
1212             if(!isContinuousLayout() && draggingHW) {
1213                 nonContinuousLayoutDivider.setBounds
1214                         (getLastDragLocation(), 0, dividerSize,


< prev index next >