/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* A Basic L&F implementation of the SplitPaneUI.
*
* @author Scott Violet
* @author Steve Wilson
* @author Ralph Kar
*/
{
/**
* The divider used for non-continuous layout is added to the split pane
* with this object.
*/
"nonContinuousDivider";
/**
* How far (relative) the divider does move when it is moved around by
* the cursor keys on the keyboard.
*/
/**
* JSplitPane instance this instance is providing
* the look and feel for.
*/
/**
* LayoutManager that is created and placed into the split pane.
*/
/**
* Instance of the divider for this JSplitPane.
*/
/**
* Instance of the PropertyChangeListener for this JSplitPane.
*/
/**
* Instance of the FocusListener for this JSplitPane.
*/
/**
* Keys to use for forward focus traversal when the JComponent is
* managing focus.
*/
/**
* Keys to use for backward focus traversal when the JComponent is
* managing focus.
*/
/**
* The size of the divider while the dragging session is valid.
*/
protected int dividerSize;
/**
* Instance for the shadow of the divider when non continuous layout
* is being used.
*/
/**
* Set to true in startDragging if any of the children
* (not including the nonContinuousLayoutDivider) are heavy weights.
*/
protected boolean draggingHW;
/**
* Location of the divider when the dragging session began.
*/
protected int beginDragDividerLocation;
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
/**
* As of Java 2 platform v1.3 this previously undocumented field is no
* longer used.
* Key bindings are now defined by the LookAndFeel, please refer to
* the key bindings specification for further details.
*
* @deprecated As of Java 2 platform v1.3.
*/
// Private data of the instance
private int orientation;
private int lastDragLocation;
private boolean continuousLayout;
private boolean dividerKeyboardResize;
// the first occurrence of
// setDividerLocation()
private boolean rememberPaneSizes;
// Indicates wether the one of splitpane sides is expanded
private boolean keepHidden = false;
/** Indicates that we have painted once. */
// This is used by the LayoutManager to determine when it should use
// the divider location provided by the JSplitPane. This is used as there
// is no way to determine when the layout process has completed.
boolean painted;
/** If true, setDividerLocation does nothing. */
boolean ignoreDividerLocationChange;
/**
* Creates a new BasicSplitPaneUI instance
*/
return new BasicSplitPaneUI();
}
}
/**
* Installs the UI.
*/
splitPane = (JSplitPane) c;
dividerLocationIsSet = false;
dividerKeyboardResize = false;
keepHidden = false;
setLastDragLocation(-1);
}
/**
* Installs the UI defaults.
*/
protected void installDefaults(){
"SplitPane.foreground");
divider.setBasicSplitPaneUI(this);
if (b == null || !(b instanceof UIResource)) {
}
// note: don't rename this temp variable to dividerSize
// since it will conflict with "this.dividerSize" field
/* Install the nonContinuousLayoutDivider here to avoid having to
if(nonContinuousLayoutDivider == null) {
true);
} else {
}
// focus forward traversal key
}
// focus backward traversal key
}
}
/**
* Installs the event listeners for the UI.
*/
protected void installListeners() {
if ((propertyChangeListener = createPropertyChangeListener()) !=
null) {
}
}
}
/**
* Installs the keyboard actions for the UI.
*/
protected void installKeyboardActions() {
km);
"SplitPane.actionMap");
}
"SplitPane.ancestorInputMap");
}
return null;
}
/**
* Uninstalls the UI.
*/
dividerLocationIsSet = false;
dividerKeyboardResize = false;
}
/**
* Uninstalls the UI defaults.
*/
protected void uninstallDefaults() {
}
if(nonContinuousLayoutDivider != null) {
}
if (b instanceof UIResource) {
}
// sets the focus forward and backward traversal keys to null
// to restore the defaults
}
/**
* Uninstalls the event listeners for the UI.
*/
protected void uninstallListeners() {
if (propertyChangeListener != null) {
}
if (focusListener != null) {
}
}
/**
* Uninstalls the keyboard actions for the UI.
*/
protected void uninstallKeyboardActions() {
null);
}
/**
* Creates a PropertyChangeListener for the JSplitPane UI.
*/
return getHandler();
}
}
return handler;
}
/**
* Creates a FocusListener for the JSplitPane UI.
*/
return getHandler();
}
/**
* As of Java 2 platform v1.3 this method is no
* longer used. Subclassers previously using this method should
* instead create an Action wrapping the ActionListener, and register
* that Action by overriding <code>installKeyboardActions</code> and
* placing the Action in the SplitPane's ActionMap. Please refer to
* the key bindings specification for further details.
* <p>
* Creates a ActionListener for the JSplitPane UI that listens for
* specific key presses.
*
* @deprecated As of Java 2 platform v1.3.
*/
return new KeyboardUpLeftHandler();
}
/**
* As of Java 2 platform v1.3 this method is no
* longer used. Subclassers previously using this method should
* instead create an Action wrapping the ActionListener, and register
* that Action by overriding <code>installKeyboardActions</code> and
* placing the Action in the SplitPane's ActionMap. Please refer to
* the key bindings specification for further details.
* <p>
* Creates a ActionListener for the JSplitPane UI that listens for
* specific key presses.
*
* @deprecated As of Java 2 platform v1.3.
*/
return new KeyboardDownRightHandler();
}
/**
* As of Java 2 platform v1.3 this method is no
* longer used. Subclassers previously using this method should
* instead create an Action wrapping the ActionListener, and register
* that Action by overriding <code>installKeyboardActions</code> and
* placing the Action in the SplitPane's ActionMap. Please refer to
* the key bindings specification for further details.
* <p>
* Creates a ActionListener for the JSplitPane UI that listens for
* specific key presses.
*
* @deprecated As of Java 2 platform v1.3.
*/
return new KeyboardHomeHandler();
}
/**
* As of Java 2 platform v1.3 this method is no
* longer used. Subclassers previously using this method should
* instead create an Action wrapping the ActionListener, and register
* that Action by overriding <code>installKeyboardActions</code> and
* placing the Action in the SplitPane's ActionMap. Please refer to
* the key bindings specification for further details.
* <p>
* Creates a ActionListener for the JSplitPane UI that listens for
* specific key presses.
*
* @deprecated As of Java 2 platform v1.3.
*/
return new KeyboardEndHandler();
}
/**
* As of Java 2 platform v1.3 this method is no
* longer used. Subclassers previously using this method should
* instead create an Action wrapping the ActionListener, and register
* that Action by overriding <code>installKeyboardActions</code> and
* placing the Action in the SplitPane's ActionMap. Please refer to
* the key bindings specification for further details.
* <p>
* Creates a ActionListener for the JSplitPane UI that listens for
* specific key presses.
*
* @deprecated As of Java 2 platform v1.3.
*/
return new KeyboardResizeToggleHandler();
}
/**
* Returns the orientation for the JSplitPane.
*/
public int getOrientation() {
return orientation;
}
/**
* Set the orientation for the JSplitPane.
*/
this.orientation = orientation;
}
/**
* Determines wether the JSplitPane is set to use a continuous layout.
*/
public boolean isContinuousLayout() {
return continuousLayout;
}
/**
*/
public void setContinuousLayout(boolean b) {
continuousLayout = b;
}
/**
* Returns the last drag location of the JSplitPane.
*/
public int getLastDragLocation() {
return lastDragLocation;
}
/**
* Set the last drag location of the JSplitPane.
*/
public void setLastDragLocation(int l) {
lastDragLocation = l;
}
/**
* @return increment via keyboard methods.
*/
int getKeyboardMoveIncrement() {
return 3;
}
/**
* Implementation of the PropertyChangeListener
* that the JSplitPane UI uses.
* <p>
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicSplitPaneUI.
*/
{
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
/**
* Messaged from the <code>JSplitPane</code> the receiver is
* contained in. May potentially reset the layout manager and cause a
* <code>validate</code> to be sent.
*/
getHandler().propertyChange(e);
}
}
/**
* Implementation of the FocusListener that the JSplitPane UI uses.
* <p>
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicSplitPaneUI.
*/
{
// NOTE: This class exists only for backward compatability. All
// its functionality has been moved into Handler. If you need to add
// new functionality add it to the Handler, but make sure this
// class calls into the Handler.
}
}
}
/**
* Implementation of an ActionListener that the JSplitPane UI uses for
* handling specific key presses.
* <p>
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicSplitPaneUI.
*/
{
if (dividerKeyboardResize) {
(splitPane) - getKeyboardMoveIncrement()));
}
}
}
/**
* Implementation of an ActionListener that the JSplitPane UI uses for
* handling specific key presses.
* <p>
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicSplitPaneUI.
*/
{
if (dividerKeyboardResize) {
}
}
}
/**
* Implementation of an ActionListener that the JSplitPane UI uses for
* handling specific key presses.
* <p>
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicSplitPaneUI.
*/
{
if (dividerKeyboardResize) {
}
}
}
/**
* Implementation of an ActionListener that the JSplitPane UI uses for
* handling specific key presses.
* <p>
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicSplitPaneUI.
*/
{
if (dividerKeyboardResize) {
bottomI);
}
else {
rightI);
}
}
}
}
/**
* Implementation of an ActionListener that the JSplitPane UI uses for
* handling specific key presses.
* <p>
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicSplitPaneUI.
*/
{
if (!dividerKeyboardResize) {
}
}
}
/**
* Returns the divider between the top Components.
*/
return divider;
}
/**
* Returns the default non continuous layout divider, which is an
* instance of {@code Canvas} that fills in the background with dark gray.
*/
return new Canvas() {
} else {
}
}
}
};
}
/**
* Sets the divider to use when the splitPane is configured to
* not continuously layout. This divider will only be used during a
* dragging session. It is recommended that the passed in component
* be a heavy weight.
*/
}
/**
* Sets the divider to use.
*/
boolean rememberSizes) {
}
}
private void addHeavyweightDivider() {
/* Needs to remove all the components and re-add them! YECK! */
// This is all done so that the nonContinuousLayoutDivider will
// be drawn on top of the other components, without this, one
// of the heavyweights will draw over the divider!
int lastLocation = splitPane.
if(rememberPaneSizes) {
}
}
}
/**
* Returns the divider to use when the splitPane is configured to
* not continuously layout. This divider will only be used during a
* dragging session.
*/
return nonContinuousLayoutDivider;
}
/**
* Returns the splitpane this instance is currently contained
* in.
*/
return splitPane;
}
/**
* Creates the default divider.
*/
return new BasicSplitPaneDivider(this);
}
/**
* Messaged to reset the preferred sizes.
*/
}
}
/**
* Sets the location of the divider to location.
*/
if (!ignoreDividerLocationChange) {
dividerLocationIsSet = true;
if (keepHidden) {
setKeepHidden(false);
}
}
}
else {
ignoreDividerLocationChange = false;
}
}
/**
* Returns the location of the divider, which may differ from what
* the splitpane thinks the location of the divider is.
*/
return divider.getLocation().x;
return divider.getLocation().y;
}
/**
* Gets the minimum location of the divider.
*/
int minLoc = 0;
} else {
}
} else {
}
}
}
return minLoc;
}
/**
* Gets the maximum location of the divider.
*/
int maxLoc = 0;
}
} else {
}
maxLoc -= dividerSize;
} else {
}
}
}
}
/**
* Called when the specified split pane has finished painting
* its children.
*/
!isContinuousLayout() && !draggingHW) {
} else {
dividerSize - 1);
}
}
}
/**
* @inheritDoc
*/
ignoreDividerLocationChange = true;
}
painted = true;
}
/**
* Returns the preferred size for the passed in component,
* This is passed off to the current layoutmanager.
*/
}
/**
* Returns the minimum size for the passed in component,
* This is passed off to the current layoutmanager.
*/
}
/**
* Returns the maximum size for the passed in component,
* This is passed off to the current layoutmanager.
*/
}
/**
* Returns the insets. The insets are returned from the border insets
* of the current border.
*/
return null;
}
/**
* Resets the layout manager based on orientation and messages it
* with invalidateLayout to pull in appropriate Components.
*/
protected void resetLayoutManager() {
} else {
}
}
/**
* Set the value to indicate if one of the splitpane sides is expanded.
*/
this.keepHidden = keepHidden;
}
/**
* The value returned indicates if one of the splitpane sides is expanded.
* @return true if one of the splitpane sides is expanded, false otherwise.
*/
private boolean getKeepHidden() {
return keepHidden;
}
/**
* Should be messaged before the dragging session starts, resets
* lastDragLocation and dividerSize.
*/
protected void startDragging() {
draggingHW = false;
!(cPeer instanceof LightweightPeer)) {
draggingHW = true;
&& !(cPeer instanceof LightweightPeer)) {
draggingHW = true;
}
if(!isContinuousLayout() && draggingHW) {
}
} else {
if(!isContinuousLayout() && draggingHW) {
}
}
}
/**
* Messaged during a dragging session to move the divider to the
* passed in location. If continuousLayout is true the location is
* reset and the splitPane validated.
*/
if(getLastDragLocation() != location) {
if(isContinuousLayout()) {
} else {
int lastLoc = getLastDragLocation();
if(draggingHW) {
getLastDragLocation(), 0);
} else {
}
} else {
if(draggingHW) {
} else {
}
}
}
}
}
/**
* Messaged to finish the dragging session. If not continuous display
* the dividers location will be reset.
*/
setLastDragLocation(-1);
if(!isContinuousLayout()) {
if (draggingHW) {
}
else {
}
}
}
}
/**
* As of Java 2 platform v1.3 this method is no longer used. Instead
* you should set the border on the divider.
* <p>
* Returns the width of one side of the divider border.
*
* @deprecated As of Java 2 platform v1.3, instead set the border on the
* divider.
*/
protected int getDividerBorderSize() {
return 1;
}
/**
* LayoutManager for JSplitPanes that have an orientation of
* HORIZONTAL_SPLIT.
*/
{
/* left, right, divider. (in this exact order) */
protected int[] sizes;
/** Size of the splitpane the last time laid out. */
private int lastSplitPaneSize;
/** True if resetToPreferredSizes has been invoked. */
private boolean doReset;
/** Axis, 0 for horizontal, or 1 for veritcal. */
private int axis;
this(0);
}
sizes = new int[3];
}
//
// LayoutManager
//
/**
* Does the actual layout.
*/
// If the splitpane has a zero size then no op out of here.
// If we execute this function now, we're going to cause ourselves
// much grief.
lastSplitPaneSize = 0;
return;
}
insets);
}
else if (lastSplitPaneSize <= 0 ||
}
else {
}
dividerLocationIsSet = false;
}
else if (availableSize != lastSplitPaneSize) {
getKeepHidden());
}
doReset = false;
dividerLocationIsSet = false;
// Reset the bounds of each component
int counter = 0;
while (counter < 3) {
}
switch (counter) {
case 0:
counter = 2;
break;
case 2:
counter = 1;
break;
case 1:
counter = 3;
break;
}
}
if (painted) {
// This is tricky, there is never a good time for us
// to push the value to the splitpane, painted appears to
// the best time to do it. What is really needed is
// notification that layout has completed.
ignoreDividerLocationChange = true;
try {
// This is not always needed, but is rather tricky
// to determine when... The case this is needed for
// is if the user sets the divider location to some
// bogus value, say 0, and the actual value is 1, the
// call to setDividerLocation(1) will preserve the
// old value of 0, when we really want the divider
// location value before the call. This is needed for
// the one touch buttons.
} finally {
ignoreDividerLocationChange = false;
}
}
}
}
/**
* Adds the component at place. Place must be one of
* JSplitPane.LEFT, RIGHT, TOP, BOTTOM, or null (for the
* divider).
*/
boolean isValid = true;
/* Divider. */
getPreferredSize());
isValid = false;
} else {
isValid = false;
}
if(!isValid)
throw new IllegalArgumentException("cannot add to layout: " +
"unknown constraint: " +
place);
doReset = true;
}
/**
* Returns the minimum size needed to contain the children.
* The width is the sum of all the childrens min widths and
* the height is the largest of the childrens minimum heights.
*/
int minPrimary = 0;
int minSecondary = 0;
if(secSize > minSecondary)
}
}
getSizeForPrimaryAxis(insets, false);
getSizeForSecondaryAxis(insets, false);
}
if (axis == 0) {
}
}
/**
* Returns the preferred size needed to contain the children.
* The width is the sum of all the childrens preferred widths and
* the height is the largest of the childrens preferred heights.
*/
int prePrimary = 0;
int preSecondary = 0;
if(secSize > preSecondary)
}
}
getSizeForPrimaryAxis(insets, false);
getSizeForSecondaryAxis(insets, false);
}
if (axis == 0) {
}
}
/**
* Removes the specified component from our knowledge.
*/
doReset = true;
}
}
}
//
// LayoutManager2
//
/**
* Adds the specified component to the layout, using the specified
* constraint object.
* @param comp the component to be added
*/
} else {
throw new IllegalArgumentException("cannot add to layout: " +
"constraint must be a " +
"string (or null)");
}
}
/**
* Returns the alignment along the x axis. This specifies how
* the component would like to be aligned relative to other
* components. The value should be a number between 0 and 1
* where 0 represents alignment along the origin, 1 is aligned
* the furthest away from the origin, 0.5 is centered, etc.
*/
return 0.0f;
}
/**
* Returns the alignment along the y axis. This specifies how
* the component would like to be aligned relative to other
* components. The value should be a number between 0 and 1
* where 0 represents alignment along the origin, 1 is aligned
* the furthest away from the origin, 0.5 is centered, etc.
*/
return 0.0f;
}
/**
* Does nothing. If the developer really wants to change the
* size of one of the views JSplitPane.resetToPreferredSizes should
* be messaged.
*/
}
/**
* Returns the maximum layout size, which is Integer.MAX_VALUE
* in both directions.
*/
}
//
// New methods.
//
/**
* Marks the receiver so that the next time this instance is
* laid out it'll ask for the preferred sizes.
*/
public void resetToPreferredSizes() {
doReset = true;
}
/**
* Resets the size of the Component at the passed in location.
*/
doReset = true;
}
/**
* Sets the sizes to <code>newSizes</code>.
*/
}
/**
* Returns the sizes of the components.
*/
protected int[] getSizes() {
int[] retSizes = new int[3];
return retSizes;
}
/**
* Returns the width of the passed in Components preferred size.
*/
return getSizeForPrimaryAxis(c.getPreferredSize());
}
/**
* Returns the width of the passed in Components minimum size.
*/
return getSizeForPrimaryAxis(c.getMinimumSize());
}
/**
* Returns the width of the passed in component.
*/
return getSizeForPrimaryAxis(c.getSize());
}
/**
* Returns the available width based on the container size and
* Insets.
*/
return getSizeForPrimaryAxis(containerSize);
return (getSizeForPrimaryAxis(containerSize) -
(getSizeForPrimaryAxis(insets, true) +
getSizeForPrimaryAxis(insets, false)));
}
/**
* Returns the left inset, unless the Insets are null in which case
* 0 is returned.
*/
return getSizeForPrimaryAxis(insets, true);
return 0;
}
/**
* Sets the width of the component c to be size, placing its
* x location at location, y to the insets.top and height
* to the containersize.height less the top and bottom insets.
*/
if (axis == 0) {
}
else {
}
}
else {
if (axis == 0) {
}
else {
}
}
}
/**
* If the axis == 0, the width is returned, otherwise the height.
*/
if (axis == 0) {
}
}
/**
* If the axis == 0, the width is returned, otherwise the height.
*/
if (axis == 0) {
}
}
/**
* Returns a particular value of the inset identified by the
* axis and <code>isTop</code><p>
* axis isTop
* 0 true - left
* 0 false - right
* 1 true - top
* 1 false - bottom
*/
if (axis == 0) {
if (isTop) {
}
}
if (isTop) {
}
}
/**
* Returns a particular value of the inset identified by the
* axis and <code>isTop</code><p>
* axis isTop
* 0 true - left
* 0 false - right
* 1 true - top
* 1 false - bottom
*/
if (axis == 0) {
if (isTop) {
}
}
if (isTop) {
}
}
/**
* Determines the components. This should be called whenever
* a new instance of this is installed into an existing
* SplitPane.
*/
protected void updateComponents() {
} else {
}
}
} else {
}
}
/* Find the divider. */
} else {
}
break;
}
}
}
else {
}
}
/**
* Resets the size of the first component to <code>leftSize</code>,
* and the right component to the remainder of the space.
*/
int max = availableSize;
if (dValid) {
}
if (lValid) {
if (rValid) {
}
else {
}
}
else if (rValid) {
}
}
/**
* Returns an array of the minimum sizes of the components.
*/
int[] getPreferredSizes() {
int[] retValue = new int[3];
(components[counter]);
}
else {
}
}
return retValue;
}
/**
* Returns an array of the minimum sizes of the components.
*/
int[] getMinimumSizes() {
int[] retValue = new int[3];
(components[counter]);
}
else {
}
}
return retValue;
}
/**
* Resets the components to their preferred sizes.
*/
// Set the sizes to the preferred sizes (if fits), otherwise
// set to min sizes and distribute any extra space.
int[] testSizes = getPreferredSizes();
int totalSize = 0;
}
}
if (totalSize > availableSize) {
testSizes = getMinimumSizes();
totalSize = 0;
}
}
}
}
/**
* Distributes <code>space</code> between the two components
* (divider won't get any extra space) based on the weighting. This
* attempts to honor the min size of the components.
*
* @param keepHidden if true and one of the components is 0x0
* it gets none of the extra space
*/
if (keepHidden) {
if (lValid && getSizeForPrimaryAxis(
lValid = false;
if (rValid && getSizeForPrimaryAxis(
// Both aren't valid, force them both to be valid
lValid = true;
}
}
else if (rValid && getSizeForPrimaryAxis(
rValid = false;
}
}
}
}
}
else if (!lMinValid) {
// both below min, just make sure > 0
}
}
else {
}
}
else if (!rMinValid) {
// both below min, just make sure > 0
}
}
else {
}
}
}
}
}
else if (lValid) {
}
else if (rValid) {
}
}
}
/**
* LayoutManager used for JSplitPanes with an orientation of
* VERTICAL_SPLIT.
* <p>
*/
public class BasicVerticalLayoutManager extends
{
public BasicVerticalLayoutManager() {
super(1);
}
}
//
// PropertyChangeListener
//
/**
* Messaged from the <code>JSplitPane</code> the receiver is
* contained in. May potentially reset the layout manager and cause a
* <code>validate</code> to be sent.
*/
if(!isContinuousLayout()) {
if(nonContinuousLayoutDivider == null) {
true);
} else if(nonContinuousLayoutDivider.getParent() ==
null) {
true);
}
}
}
}
}
//
// FocusListener
//
dividerKeyboardResize = true;
}
dividerKeyboardResize = false;
}
}
super(key);
}
return;
}
if (key == NEGATIVE_INCREMENT) {
if (ui.dividerKeyboardResize) {
}
}
else if (key == POSITIVE_INCREMENT) {
if (ui.dividerKeyboardResize) {
}
}
else if (key == SELECT_MIN) {
if (ui.dividerKeyboardResize) {
}
}
else if (key == SELECT_MAX) {
if (ui.dividerKeyboardResize) {
bottomI);
}
else {
rightI);
}
}
}
else if (key == START_RESIZE) {
if (!ui.dividerKeyboardResize) {
} else {
JSplitPane.class, splitPane);
if (parentSplitPane!=null) {
}
}
}
else if (key == TOGGLE_FOCUS) {
}
else if (key == FOCUS_OUT_FORWARD) {
}
else if (key == FOCUS_OUT_BACKWARD) {
}
}
do {
}
}
}
// don't change the focus if the new focused component belongs
// to the same splitpane and the same side
return;
}
}
}
return next;
}
}
JSplitPane parentSplitPane = (JSplitPane)SwingUtilities.getAncestorOfClass(JSplitPane.class, splitPane);
if (parentSplitPane!=null) {
// focus next side of the parent split pane
} else {
}
}
return next;
}
if (c!=null && c instanceof JSplitPane) {
c = left;
} else {
}
}
return c;
}
}
}