3909N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A Basic L&F implementation of the SplitPaneUI. 0N/A * @author Scott Violet 0N/A * @author Steve Wilson 0N/A * The divider used for non-continuous layout is added to the split pane 0N/A "nonContinuousDivider";
0N/A * How far (relative) the divider does move when it is moved around by 0N/A * the cursor keys on the keyboard. 0N/A * JSplitPane instance this instance is providing 0N/A * the look and feel for. 0N/A * LayoutManager that is created and placed into the split pane. 0N/A * Instance of the divider for this JSplitPane. 0N/A * Instance of the PropertyChangeListener for this JSplitPane. 0N/A * Instance of the FocusListener for this JSplitPane. 0N/A * Keys to use for forward focus traversal when the JComponent is 0N/A * Keys to use for backward focus traversal when the JComponent is 0N/A * The size of the divider while the dragging session is valid. 0N/A * Instance for the shadow of the divider when non continuous layout 0N/A * Set to true in startDragging if any of the children 0N/A * (not including the nonContinuousLayoutDivider) are heavy weights. 0N/A * Location of the divider when the dragging session began. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this previously undocumented field is no 0N/A * Key bindings are now defined by the LookAndFeel, please refer to 0N/A * the key bindings specification for further details. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A // Private data of the instance 0N/A // the first occurrence of 0N/A // setDividerLocation() 0N/A // Indicates wether the one of splitpane sides is expanded 0N/A /** Indicates that we have painted once. */ 0N/A // This is used by the LayoutManager to determine when it should use 0N/A // the divider location provided by the JSplitPane. This is used as there 0N/A // is no way to determine when the layout process has completed. 0N/A /** If true, setDividerLocation does nothing. */ 0N/A * Creates a new BasicSplitPaneUI instance 0N/A * Installs the UI defaults. 0N/A "SplitPane.foreground");
3461N/A // note: don't rename this temp variable to dividerSize 3461N/A // since it will conflict with "this.dividerSize" field 0N/A /* Install the nonContinuousLayoutDivider here to avoid having to 0N/A // focus forward traversal key 0N/A // focus backward traversal key 0N/A * Installs the event listeners for the UI. 0N/A * Installs the keyboard actions for the UI. 0N/A "SplitPane.actionMap");
0N/A "SplitPane.ancestorInputMap");
0N/A * Uninstalls the UI. 0N/A * Uninstalls the UI defaults. 0N/A // sets the focus forward and backward traversal keys to null 0N/A // to restore the defaults 0N/A * Uninstalls the event listeners for the UI. 0N/A * Uninstalls the keyboard actions for the UI. 0N/A * Creates a PropertyChangeListener for the JSplitPane UI. 0N/A * Creates a FocusListener for the JSplitPane UI. 0N/A * As of Java 2 platform v1.3 this method is no 0N/A * longer used. Subclassers previously using this method should 0N/A * instead create an Action wrapping the ActionListener, and register 0N/A * that Action by overriding <code>installKeyboardActions</code> and 0N/A * placing the Action in the SplitPane's ActionMap. Please refer to 0N/A * the key bindings specification for further details. 0N/A * Creates a ActionListener for the JSplitPane UI that listens for 0N/A * specific key presses. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this method is no 0N/A * longer used. Subclassers previously using this method should 0N/A * instead create an Action wrapping the ActionListener, and register 0N/A * that Action by overriding <code>installKeyboardActions</code> and 0N/A * placing the Action in the SplitPane's ActionMap. Please refer to 0N/A * the key bindings specification for further details. 0N/A * Creates a ActionListener for the JSplitPane UI that listens for 0N/A * specific key presses. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this method is no 0N/A * longer used. Subclassers previously using this method should 0N/A * instead create an Action wrapping the ActionListener, and register 0N/A * that Action by overriding <code>installKeyboardActions</code> and 0N/A * placing the Action in the SplitPane's ActionMap. Please refer to 0N/A * the key bindings specification for further details. 0N/A * Creates a ActionListener for the JSplitPane UI that listens for 0N/A * specific key presses. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this method is no 0N/A * longer used. Subclassers previously using this method should 0N/A * instead create an Action wrapping the ActionListener, and register 0N/A * that Action by overriding <code>installKeyboardActions</code> and 0N/A * placing the Action in the SplitPane's ActionMap. Please refer to 0N/A * the key bindings specification for further details. 0N/A * Creates a ActionListener for the JSplitPane UI that listens for 0N/A * specific key presses. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * As of Java 2 platform v1.3 this method is no 0N/A * longer used. Subclassers previously using this method should 0N/A * instead create an Action wrapping the ActionListener, and register 0N/A * that Action by overriding <code>installKeyboardActions</code> and 0N/A * placing the Action in the SplitPane's ActionMap. Please refer to 0N/A * the key bindings specification for further details. 0N/A * Creates a ActionListener for the JSplitPane UI that listens for 0N/A * specific key presses. 0N/A * @deprecated As of Java 2 platform v1.3. 0N/A * Returns the orientation for the JSplitPane. 0N/A * Set the orientation for the JSplitPane. 0N/A * Determines wether the JSplitPane is set to use a continuous layout. 0N/A * Returns the last drag location of the JSplitPane. 0N/A * Set the last drag location of the JSplitPane. 0N/A * @return increment via keyboard methods. 0N/A * Implementation of the PropertyChangeListener 0N/A * that the JSplitPane UI uses. 0N/A * This class should be treated as a "protected" inner class. 0N/A * Instantiate it only within subclasses of BasicSplitPaneUI. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A * Messaged from the <code>JSplitPane</code> the receiver is 0N/A * contained in. May potentially reset the layout manager and cause a 0N/A * <code>validate</code> to be sent. 0N/A * Implementation of the FocusListener that the JSplitPane UI uses. 0N/A * This class should be treated as a "protected" inner class. 0N/A * Instantiate it only within subclasses of BasicSplitPaneUI. 0N/A // NOTE: This class exists only for backward compatability. All 0N/A // its functionality has been moved into Handler. If you need to add 0N/A // new functionality add it to the Handler, but make sure this 0N/A // class calls into the Handler. 0N/A * Implementation of an ActionListener that the JSplitPane UI uses for 0N/A * handling specific key presses. 0N/A * This class should be treated as a "protected" inner class. 0N/A * Instantiate it only within subclasses of BasicSplitPaneUI. 0N/A * Implementation of an ActionListener that the JSplitPane UI uses for 0N/A * handling specific key presses. 0N/A * This class should be treated as a "protected" inner class. 0N/A * Instantiate it only within subclasses of BasicSplitPaneUI. 0N/A * Implementation of an ActionListener that the JSplitPane UI uses for 0N/A * handling specific key presses. 0N/A * This class should be treated as a "protected" inner class. 0N/A * Instantiate it only within subclasses of BasicSplitPaneUI. 0N/A * Implementation of an ActionListener that the JSplitPane UI uses for 0N/A * handling specific key presses. 0N/A * This class should be treated as a "protected" inner class. 0N/A * Instantiate it only within subclasses of BasicSplitPaneUI. 0N/A * Implementation of an ActionListener that the JSplitPane UI uses for 0N/A * handling specific key presses. 0N/A * This class should be treated as a "protected" inner class. 0N/A * Instantiate it only within subclasses of BasicSplitPaneUI. 0N/A * Returns the divider between the top Components. 0N/A * Returns the default non continuous layout divider, which is an 1999N/A * instance of {@code Canvas} that fills in the background with dark gray. 0N/A * Sets the divider to use when the splitPane is configured to 0N/A * not continuously layout. This divider will only be used during a 0N/A * dragging session. It is recommended that the passed in component 0N/A * be a heavy weight. 0N/A * Sets the divider to use. 0N/A /* Needs to remove all the components and re-add them! YECK! */ 0N/A // This is all done so that the nonContinuousLayoutDivider will 0N/A // be drawn on top of the other components, without this, one 0N/A // of the heavyweights will draw over the divider! 0N/A * Returns the divider to use when the splitPane is configured to 0N/A * not continuously layout. This divider will only be used during a 0N/A * Returns the splitpane this instance is currently contained 0N/A * Creates the default divider. 0N/A * Messaged to reset the preferred sizes. 0N/A * Sets the location of the divider to location. 0N/A * Returns the location of the divider, which may differ from what 0N/A * the splitpane thinks the location of the divider is. 0N/A * Gets the minimum location of the divider. 0N/A * Gets the maximum location of the divider. 1999N/A * Called when the specified split pane has finished painting 0N/A * Returns the preferred size for the passed in component, 0N/A * This is passed off to the current layoutmanager. 0N/A * Returns the minimum size for the passed in component, 0N/A * This is passed off to the current layoutmanager. 0N/A * Returns the maximum size for the passed in component, 0N/A * This is passed off to the current layoutmanager. 0N/A * Returns the insets. The insets are returned from the border insets 0N/A * of the current border. 0N/A * Resets the layout manager based on orientation and messages it 0N/A * with invalidateLayout to pull in appropriate Components. 0N/A * Set the value to indicate if one of the splitpane sides is expanded. 0N/A * The value returned indicates if one of the splitpane sides is expanded. 0N/A * @return true if one of the splitpane sides is expanded, false otherwise. 0N/A * Should be messaged before the dragging session starts, resets 0N/A * lastDragLocation and dividerSize. 0N/A * Messaged during a dragging session to move the divider to the 0N/A * passed in location. If continuousLayout is true the location is 0N/A * reset and the splitPane validated. 0N/A * Messaged to finish the dragging session. If not continuous display 0N/A * the dividers location will be reset. 0N/A * As of Java 2 platform v1.3 this method is no longer used. Instead 0N/A * you should set the border on the divider. 0N/A * Returns the width of one side of the divider border. 0N/A * @deprecated As of Java 2 platform v1.3, instead set the border on the 0N/A * LayoutManager for JSplitPanes that have an orientation of 0N/A /* left, right, divider. (in this exact order) */ 0N/A /** Size of the splitpane the last time laid out. */ 0N/A /** True if resetToPreferredSizes has been invoked. */ 0N/A /** Axis, 0 for horizontal, or 1 for veritcal. */ 0N/A * Does the actual layout. 0N/A // If the splitpane has a zero size then no op out of here. 0N/A // If we execute this function now, we're going to cause ourselves 0N/A // Reset the bounds of each component 0N/A // This is tricky, there is never a good time for us 0N/A // to push the value to the splitpane, painted appears to 0N/A // the best time to do it. What is really needed is 0N/A // notification that layout has completed. 0N/A // This is not always needed, but is rather tricky 0N/A // to determine when... The case this is needed for 0N/A // is if the user sets the divider location to some 0N/A // bogus value, say 0, and the actual value is 1, the 0N/A // call to setDividerLocation(1) will preserve the 0N/A // old value of 0, when we really want the divider 0N/A // location value before the call. This is needed for 0N/A // the one touch buttons. 0N/A * Adds the component at place. Place must be one of 0N/A * JSplitPane.LEFT, RIGHT, TOP, BOTTOM, or null (for the 0N/A "unknown constraint: " +
0N/A * Returns the minimum size needed to contain the children. 0N/A * The width is the sum of all the childrens min widths and 0N/A * the height is the largest of the childrens minimum heights. 0N/A * Returns the preferred size needed to contain the children. 0N/A * The width is the sum of all the childrens preferred widths and 0N/A * the height is the largest of the childrens preferred heights. 0N/A * Removes the specified component from our knowledge. 0N/A * Adds the specified component to the layout, using the specified 0N/A * constraint object. 0N/A * @param comp the component to be added 0N/A * @param constraints where/how the component is added to the layout. 0N/A "constraint must be a " +
0N/A "string (or null)");
0N/A * Returns the alignment along the x axis. This specifies how 0N/A * the component would like to be aligned relative to other 0N/A * components. The value should be a number between 0 and 1 0N/A * where 0 represents alignment along the origin, 1 is aligned 0N/A * the furthest away from the origin, 0.5 is centered, etc. 0N/A * Returns the alignment along the y axis. This specifies how 0N/A * the component would like to be aligned relative to other 0N/A * components. The value should be a number between 0 and 1 0N/A * where 0 represents alignment along the origin, 1 is aligned 0N/A * the furthest away from the origin, 0.5 is centered, etc. 0N/A * Does nothing. If the developer really wants to change the 0N/A * size of one of the views JSplitPane.resetToPreferredSizes should 0N/A * Returns the maximum layout size, which is Integer.MAX_VALUE 0N/A * in both directions. 0N/A * Marks the receiver so that the next time this instance is 0N/A * laid out it'll ask for the preferred sizes. 0N/A * Resets the size of the Component at the passed in location. 0N/A * Sets the sizes to <code>newSizes</code>. 0N/A * Returns the sizes of the components. 0N/A * Returns the width of the passed in Components preferred size. 0N/A * Returns the width of the passed in Components minimum size. 0N/A * Returns the width of the passed in component. 0N/A * Returns the available width based on the container size and 0N/A * Returns the left inset, unless the Insets are null in which case 0N/A * Sets the width of the component c to be size, placing its 0N/A * x location at location, y to the insets.top and height 0N/A * to the containersize.height less the top and bottom insets. 0N/A * If the axis == 0, the width is returned, otherwise the height. 0N/A * If the axis == 0, the width is returned, otherwise the height. 0N/A * Returns a particular value of the inset identified by the 0N/A * axis and <code>isTop</code><p> 0N/A * Returns a particular value of the inset identified by the 0N/A * axis and <code>isTop</code><p> 0N/A * Determines the components. This should be called whenever 0N/A * a new instance of this is installed into an existing 0N/A /* Find the divider. */ 0N/A * Resets the size of the first component to <code>leftSize</code>, 0N/A * and the right component to the remainder of the space. 0N/A * Returns an array of the minimum sizes of the components. 0N/A * Returns an array of the minimum sizes of the components. 0N/A * Resets the components to their preferred sizes. 0N/A // Set the sizes to the preferred sizes (if fits), otherwise 0N/A // set to min sizes and distribute any extra space. 0N/A * Distributes <code>space</code> between the two components 0N/A * (divider won't get any extra space) based on the weighting. This 0N/A * attempts to honor the min size of the components. 0N/A * @param keepHidden if true and one of the components is 0x0 0N/A * it gets none of the extra space 0N/A // Both aren't valid, force them both to be valid 0N/A // both below min, just make sure > 0 0N/A // both below min, just make sure > 0 0N/A * LayoutManager used for JSplitPanes with an orientation of 0N/A // PropertyChangeListener 0N/A * Messaged from the <code>JSplitPane</code> the receiver is 0N/A * contained in. May potentially reset the layout manager and cause a 0N/A * <code>validate</code> to be sent. 0N/A // don't change the focus if the new focused component belongs 0N/A // to the same splitpane and the same side 0N/A // focus next side of the parent split pane