src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java

Print this page


   1 /*
   2  * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 243         if (SynthLookAndFeel.shouldUpdateStyle(e)) {
 244             updateStyle((JSplitPane)e.getSource());
 245         }
 246     }
 247 
 248     /**
 249      * Creates the default divider.
 250      */
 251     @Override
 252     public BasicSplitPaneDivider createDefaultDivider() {
 253         SynthSplitPaneDivider divider = new SynthSplitPaneDivider(this);
 254 
 255         divider.setDividerSize(splitPane.getDividerSize());
 256         return divider;
 257     }
 258 
 259     /**
 260      * {@inheritDoc}
 261      */
 262     @Override

 263     protected Component createDefaultNonContinuousLayoutDivider() {
 264         return new Canvas() {
 265             public void paint(Graphics g) {
 266                 paintDragDivider(g, 0, 0, getWidth(), getHeight());
 267             }
 268         };
 269     }
 270 
 271     /**
 272      * Notifies this UI delegate to repaint the specified component.
 273      * This method paints the component background, then calls
 274      * the {@link #paint(SynthContext,Graphics)} method.
 275      *
 276      * <p>In general, this method does not need to be overridden by subclasses.
 277      * All Look and Feel rendering code should reside in the {@code paint} method.
 278      *
 279      * @param g the {@code Graphics} object used for painting
 280      * @param c the component being painted
 281      * @see #paint(SynthContext,Graphics)
 282      */


   1 /*
   2  * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 243         if (SynthLookAndFeel.shouldUpdateStyle(e)) {
 244             updateStyle((JSplitPane)e.getSource());
 245         }
 246     }
 247 
 248     /**
 249      * Creates the default divider.
 250      */
 251     @Override
 252     public BasicSplitPaneDivider createDefaultDivider() {
 253         SynthSplitPaneDivider divider = new SynthSplitPaneDivider(this);
 254 
 255         divider.setDividerSize(splitPane.getDividerSize());
 256         return divider;
 257     }
 258 
 259     /**
 260      * {@inheritDoc}
 261      */
 262     @Override
 263     @SuppressWarnings("serial") // anonymous class
 264     protected Component createDefaultNonContinuousLayoutDivider() {
 265         return new Canvas() {
 266             public void paint(Graphics g) {
 267                 paintDragDivider(g, 0, 0, getWidth(), getHeight());
 268             }
 269         };
 270     }
 271 
 272     /**
 273      * Notifies this UI delegate to repaint the specified component.
 274      * This method paints the component background, then calls
 275      * the {@link #paint(SynthContext,Graphics)} method.
 276      *
 277      * <p>In general, this method does not need to be overridden by subclasses.
 278      * All Look and Feel rendering code should reside in the {@code paint} method.
 279      *
 280      * @param g the {@code Graphics} object used for painting
 281      * @param c the component being painted
 282      * @see #paint(SynthContext,Graphics)
 283      */