< prev index next >
src/java.desktop/share/classes/javax/swing/JSplitPane.java
Print this page
*** 40,82 ****
import java.io.IOException;
/**
! * <code>JSplitPane</code> is used to divide two (and only two)
! * <code>Component</code>s. The two <code>Component</code>s
* are graphically divided based on the look and feel
! * implementation, and the two <code>Component</code>s can then be
* interactively resized by the user.
! * Information on using <code>JSplitPane</code> is in
* <a
href="http://docs.oracle.com/javase/tutorial/uiswing/components/splitpane.html">How to Use Split Panes</a> in
* <em>The Java Tutorial</em>.
* <p>
! * The two <code>Component</code>s in a split pane can be aligned
* left to right using
! * <code>JSplitPane.HORIZONTAL_SPLIT</code>, or top to bottom using
! * <code>JSplitPane.VERTICAL_SPLIT</code>.
! * The preferred way to change the size of the <code>Component</code>s
* is to invoke
! * <code>setDividerLocation</code> where <code>location</code> is either
* the new x or y position, depending on the orientation of the
! * <code>JSplitPane</code>.
* <p>
! * To resize the <code>Component</code>s to their preferred sizes invoke
! * <code>resetToPreferredSizes</code>.
* <p>
! * When the user is resizing the <code>Component</code>s the minimum
! * size of the <code>Components</code> is used to determine the
! * maximum/minimum position the <code>Component</code>s
* can be set to. If the minimum size of the two
* components is greater than the size of the split pane the divider
* will not allow you to resize it. To alter the minimum size of a
! * <code>JComponent</code>, see {@link JComponent#setMinimumSize}.
* <p>
* When the user resizes the split pane the new space is distributed between
! * the two components based on the <code>resizeWeight</code> property.
* A value of 0,
* the default, indicates the right/bottom component gets all the space,
* where as a value of 1 indicates the left/top component gets all the space.
* <p>
* <strong>Warning:</strong> Swing is not thread safe. For more
--- 40,82 ----
import java.io.IOException;
/**
! * {@code JSplitPane} is used to divide two (and only two)
! * {@code Component}s. The two {@code Component}s
* are graphically divided based on the look and feel
! * implementation, and the two {@code Component}s can then be
* interactively resized by the user.
! * Information on using {@code JSplitPane} is in
* <a
href="http://docs.oracle.com/javase/tutorial/uiswing/components/splitpane.html">How to Use Split Panes</a> in
* <em>The Java Tutorial</em>.
* <p>
! * The two {@code Component}s in a split pane can be aligned
* left to right using
! * {@code JSplitPane.HORIZONTAL_SPLIT}, or top to bottom using
! * {@code JSplitPane.VERTICAL_SPLIT}.
! * The preferred way to change the size of the {@code Component}s
* is to invoke
! * {@code setDividerLocation} where {@code location} is either
* the new x or y position, depending on the orientation of the
! * {@code JSplitPane}.
* <p>
! * To resize the {@code Component}s to their preferred sizes invoke
! * {@code resetToPreferredSizes}.
* <p>
! * When the user is resizing the {@code Component}s the minimum
! * size of the {@code Components} is used to determine the
! * maximum/minimum position the {@code Component}s
* can be set to. If the minimum size of the two
* components is greater than the size of the split pane the divider
* will not allow you to resize it. To alter the minimum size of a
! * {@code JComponent}, see {@link JComponent#setMinimumSize}.
* <p>
* When the user resizes the split pane the new space is distributed between
! * the two components based on the {@code resizeWeight} property.
* A value of 0,
* the default, indicates the right/bottom component gets all the space,
* where as a value of 1 indicates the left/top component gets all the space.
* <p>
* <strong>Warning:</strong> Swing is not thread safe. For more
*** 88,98 ****
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @see #setDividerLocation
* @see #resetToPreferredSizes
*
--- 88,98 ----
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*
* @see #setDividerLocation
* @see #resetToPreferredSizes
*
*** 107,156 ****
* @see #readObject
*/
private static final String uiClassID = "SplitPaneUI";
/**
! * Vertical split indicates the <code>Component</code>s are
* split along the y axis. For example the two
! * <code>Component</code>s will be split one on top of the other.
*/
public static final int VERTICAL_SPLIT = 0;
/**
! * Horizontal split indicates the <code>Component</code>s are
* split along the x axis. For example the two
! * <code>Component</code>s will be split one to the left of the
* other.
*/
public static final int HORIZONTAL_SPLIT = 1;
/**
! * Used to add a <code>Component</code> to the left of the other
! * <code>Component</code>.
*/
public static final String LEFT = "left";
/**
! * Used to add a <code>Component</code> to the right of the other
! * <code>Component</code>.
*/
public static final String RIGHT = "right";
/**
! * Used to add a <code>Component</code> above the other
! * <code>Component</code>.
*/
public static final String TOP = "top";
/**
! * Used to add a <code>Component</code> below the other
! * <code>Component</code>.
*/
public static final String BOTTOM = "bottom";
/**
! * Used to add a <code>Component</code> that will represent the divider.
*/
public static final String DIVIDER = "divider";
/**
* Bound property name for orientation (horizontal or vertical).
--- 107,156 ----
* @see #readObject
*/
private static final String uiClassID = "SplitPaneUI";
/**
! * Vertical split indicates the {@code Component}s are
* split along the y axis. For example the two
! * {@code Component}s will be split one on top of the other.
*/
public static final int VERTICAL_SPLIT = 0;
/**
! * Horizontal split indicates the {@code Component}s are
* split along the x axis. For example the two
! * {@code Component}s will be split one to the left of the
* other.
*/
public static final int HORIZONTAL_SPLIT = 1;
/**
! * Used to add a {@code Component} to the left of the other
! * {@code Component}.
*/
public static final String LEFT = "left";
/**
! * Used to add a {@code Component} to the right of the other
! * {@code Component}.
*/
public static final String RIGHT = "right";
/**
! * Used to add a {@code Component} above the other
! * {@code Component}.
*/
public static final String TOP = "top";
/**
! * Used to add a {@code Component} below the other
! * {@code Component}.
*/
public static final String BOTTOM = "bottom";
/**
! * Used to add a {@code Component} that will represent the divider.
*/
public static final String DIVIDER = "divider";
/**
* Bound property name for orientation (horizontal or vertical).
*** 241,251 ****
*/
private int dividerLocation;
/**
! * Creates a new <code>JSplitPane</code> configured to arrange the child
* components side-by-side horizontally, using two buttons for the components.
*/
public JSplitPane() {
this(JSplitPane.HORIZONTAL_SPLIT,
UIManager.getBoolean("SplitPane.continuousLayout"),
--- 241,251 ----
*/
private int dividerLocation;
/**
! * Creates a new {@code JSplitPane} configured to arrange the child
* components side-by-side horizontally, using two buttons for the components.
*/
public JSplitPane() {
this(JSplitPane.HORIZONTAL_SPLIT,
UIManager.getBoolean("SplitPane.continuousLayout"),
*** 253,310 ****
new JButton(UIManager.getString("SplitPane.rightButtonText")));
}
/**
! * Creates a new <code>JSplitPane</code> configured with the
* specified orientation.
*
! * @param newOrientation <code>JSplitPane.HORIZONTAL_SPLIT</code> or
! * <code>JSplitPane.VERTICAL_SPLIT</code>
! * @exception IllegalArgumentException if <code>orientation</code>
* is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT.
*/
@ConstructorProperties({"orientation"})
public JSplitPane(int newOrientation) {
this(newOrientation,
UIManager.getBoolean("SplitPane.continuousLayout"));
}
/**
! * Creates a new <code>JSplitPane</code> with the specified
* orientation and redrawing style.
*
! * @param newOrientation <code>JSplitPane.HORIZONTAL_SPLIT</code> or
! * <code>JSplitPane.VERTICAL_SPLIT</code>
* @param newContinuousLayout a boolean, true for the components to
* redraw continuously as the divider changes position, false
* to wait until the divider position stops changing to redraw
! * @exception IllegalArgumentException if <code>orientation</code>
* is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT
*/
public JSplitPane(int newOrientation,
boolean newContinuousLayout) {
this(newOrientation, newContinuousLayout, null, null);
}
/**
! * Creates a new <code>JSplitPane</code> with the specified
* orientation and the specified components.
*
! * @param newOrientation <code>JSplitPane.HORIZONTAL_SPLIT</code> or
! * <code>JSplitPane.VERTICAL_SPLIT</code>
! * @param newLeftComponent the <code>Component</code> that will
* appear on the left
* of a horizontally-split pane, or at the top of a
* vertically-split pane
! * @param newRightComponent the <code>Component</code> that will
* appear on the right
* of a horizontally-split pane, or at the bottom of a
* vertically-split pane
! * @exception IllegalArgumentException if <code>orientation</code>
* is not one of: HORIZONTAL_SPLIT or VERTICAL_SPLIT
*/
public JSplitPane(int newOrientation,
Component newLeftComponent,
Component newRightComponent){
--- 253,310 ----
new JButton(UIManager.getString("SplitPane.rightButtonText")));
}
/**
! * Creates a new {@code JSplitPane} configured with the
* specified orientation.
*
! * @param newOrientation {@code JSplitPane.HORIZONTAL_SPLIT} or
! * {@code JSplitPane.VERTICAL_SPLIT}
! * @exception IllegalArgumentException if {@code orientation}
* is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT.
*/
@ConstructorProperties({"orientation"})
public JSplitPane(int newOrientation) {
this(newOrientation,
UIManager.getBoolean("SplitPane.continuousLayout"));
}
/**
! * Creates a new {@code JSplitPane} with the specified
* orientation and redrawing style.
*
! * @param newOrientation {@code JSplitPane.HORIZONTAL_SPLIT} or
! * {@code JSplitPane.VERTICAL_SPLIT}
* @param newContinuousLayout a boolean, true for the components to
* redraw continuously as the divider changes position, false
* to wait until the divider position stops changing to redraw
! * @exception IllegalArgumentException if {@code orientation}
* is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT
*/
public JSplitPane(int newOrientation,
boolean newContinuousLayout) {
this(newOrientation, newContinuousLayout, null, null);
}
/**
! * Creates a new {@code JSplitPane} with the specified
* orientation and the specified components.
*
! * @param newOrientation {@code JSplitPane.HORIZONTAL_SPLIT} or
! * {@code JSplitPane.VERTICAL_SPLIT}
! * @param newLeftComponent the {@code Component} that will
* appear on the left
* of a horizontally-split pane, or at the top of a
* vertically-split pane
! * @param newRightComponent the {@code Component} that will
* appear on the right
* of a horizontally-split pane, or at the bottom of a
* vertically-split pane
! * @exception IllegalArgumentException if {@code orientation}
* is not one of: HORIZONTAL_SPLIT or VERTICAL_SPLIT
*/
public JSplitPane(int newOrientation,
Component newLeftComponent,
Component newRightComponent){
*** 313,340 ****
newLeftComponent, newRightComponent);
}
/**
! * Creates a new <code>JSplitPane</code> with the specified
* orientation and
* redrawing style, and with the specified components.
*
! * @param newOrientation <code>JSplitPane.HORIZONTAL_SPLIT</code> or
! * <code>JSplitPane.VERTICAL_SPLIT</code>
* @param newContinuousLayout a boolean, true for the components to
* redraw continuously as the divider changes position, false
* to wait until the divider position stops changing to redraw
! * @param newLeftComponent the <code>Component</code> that will
* appear on the left
* of a horizontally-split pane, or at the top of a
* vertically-split pane
! * @param newRightComponent the <code>Component</code> that will
* appear on the right
* of a horizontally-split pane, or at the bottom of a
* vertically-split pane
! * @exception IllegalArgumentException if <code>orientation</code>
* is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT
*/
public JSplitPane(int newOrientation,
boolean newContinuousLayout,
Component newLeftComponent,
--- 313,340 ----
newLeftComponent, newRightComponent);
}
/**
! * Creates a new {@code JSplitPane} with the specified
* orientation and
* redrawing style, and with the specified components.
*
! * @param newOrientation {@code JSplitPane.HORIZONTAL_SPLIT} or
! * {@code JSplitPane.VERTICAL_SPLIT}
* @param newContinuousLayout a boolean, true for the components to
* redraw continuously as the divider changes position, false
* to wait until the divider position stops changing to redraw
! * @param newLeftComponent the {@code Component} that will
* appear on the left
* of a horizontally-split pane, or at the top of a
* vertically-split pane
! * @param newRightComponent the {@code Component} that will
* appear on the right
* of a horizontally-split pane, or at the bottom of a
* vertically-split pane
! * @exception IllegalArgumentException if {@code orientation}
* is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT
*/
public JSplitPane(int newOrientation,
boolean newContinuousLayout,
Component newLeftComponent,
*** 361,371 ****
/**
* Sets the L&F object that renders this component.
*
! * @param ui the <code>SplitPaneUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
--- 361,371 ----
/**
* Sets the L&F object that renders this component.
*
! * @param ui the {@code SplitPaneUI} L&F object
* @see UIDefaults#getUI
* @beaninfo
* bound: true
* hidden: true
* attribute: visualUpdate true
*** 378,404 ****
}
}
/**
! * Returns the <code>SplitPaneUI</code> that is providing the
* current look and feel.
*
! * @return the <code>SplitPaneUI</code> object that renders this component
* @beaninfo
* expert: true
* description: The L&F object that renders this component.
*/
public SplitPaneUI getUI() {
return (SplitPaneUI)ui;
}
/**
! * Notification from the <code>UIManager</code> that the L&F has changed.
* Replaces the current UI object with the latest version from the
! * <code>UIManager</code>.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((SplitPaneUI)UIManager.getUI(this));
--- 378,404 ----
}
}
/**
! * Returns the {@code SplitPaneUI} that is providing the
* current look and feel.
*
! * @return the {@code SplitPaneUI} object that renders this component
* @beaninfo
* expert: true
* description: The L&F object that renders this component.
*/
public SplitPaneUI getUI() {
return (SplitPaneUI)ui;
}
/**
! * Notification from the {@code UIManager} that the L&F has changed.
* Replaces the current UI object with the latest version from the
! * {@code UIManager}.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((SplitPaneUI)UIManager.getUI(this));
*** 451,461 ****
/**
* Sets the component to the left (or above) the divider.
*
! * @param comp the <code>Component</code> to display in that position
*/
public void setLeftComponent(Component comp) {
if (comp == null) {
if (leftComponent != null) {
remove(leftComponent);
--- 451,461 ----
/**
* Sets the component to the left (or above) the divider.
*
! * @param comp the {@code Component} to display in that position
*/
public void setLeftComponent(Component comp) {
if (comp == null) {
if (leftComponent != null) {
remove(leftComponent);
*** 468,478 ****
/**
* Returns the component to the left (or above) the divider.
*
! * @return the <code>Component</code> displayed in that position
* @beaninfo
* preferred: true
* description: The component to the left (or above) the divider.
*/
public Component getLeftComponent() {
--- 468,478 ----
/**
* Returns the component to the left (or above) the divider.
*
! * @return the {@code Component} displayed in that position
* @beaninfo
* preferred: true
* description: The component to the left (or above) the divider.
*/
public Component getLeftComponent() {
*** 481,491 ****
/**
* Sets the component above, or to the left of the divider.
*
! * @param comp the <code>Component</code> to display in that position
* @beaninfo
* description: The component above, or to the left of the divider.
*/
public void setTopComponent(Component comp) {
setLeftComponent(comp);
--- 481,491 ----
/**
* Sets the component above, or to the left of the divider.
*
! * @param comp the {@code Component} to display in that position
* @beaninfo
* description: The component above, or to the left of the divider.
*/
public void setTopComponent(Component comp) {
setLeftComponent(comp);
*** 493,513 ****
/**
* Returns the component above, or to the left of the divider.
*
! * @return the <code>Component</code> displayed in that position
*/
public Component getTopComponent() {
return leftComponent;
}
/**
* Sets the component to the right (or below) the divider.
*
! * @param comp the <code>Component</code> to display in that position
* @beaninfo
* preferred: true
* description: The component to the right (or below) the divider.
*/
public void setRightComponent(Component comp) {
--- 493,513 ----
/**
* Returns the component above, or to the left of the divider.
*
! * @return the {@code Component} displayed in that position
*/
public Component getTopComponent() {
return leftComponent;
}
/**
* Sets the component to the right (or below) the divider.
*
! * @param comp the {@code Component} to display in that position
* @beaninfo
* preferred: true
* description: The component to the right (or below) the divider.
*/
public void setRightComponent(Component comp) {
*** 523,543 ****
/**
* Returns the component to the right (or below) the divider.
*
! * @return the <code>Component</code> displayed in that position
*/
public Component getRightComponent() {
return rightComponent;
}
/**
* Sets the component below, or to the right of the divider.
*
! * @param comp the <code>Component</code> to display in that position
* @beaninfo
* description: The component below, or to the right of the divider.
*/
public void setBottomComponent(Component comp) {
setRightComponent(comp);
--- 523,543 ----
/**
* Returns the component to the right (or below) the divider.
*
! * @return the {@code Component} displayed in that position
*/
public Component getRightComponent() {
return rightComponent;
}
/**
* Sets the component below, or to the right of the divider.
*
! * @param comp the {@code Component} to display in that position
* @beaninfo
* description: The component below, or to the right of the divider.
*/
public void setBottomComponent(Component comp) {
setRightComponent(comp);
*** 545,571 ****
/**
* Returns the component below, or to the right of the divider.
*
! * @return the <code>Component</code> displayed in that position
*/
public Component getBottomComponent() {
return rightComponent;
}
/**
! * Sets the value of the <code>oneTouchExpandable</code> property,
! * which must be <code>true</code> for the
! * <code>JSplitPane</code> to provide a UI widget
* on the divider to quickly expand/collapse the divider.
! * The default value of this property is <code>false</code>.
* Some look and feels might not support one-touch expanding;
* they will ignore this property.
*
! * @param newValue <code>true</code> to specify that the split pane should provide a
* collapse/expand widget
* @beaninfo
* bound: true
* description: UI widget on the divider to quickly
* expand/collapse the divider.
--- 545,571 ----
/**
* Returns the component below, or to the right of the divider.
*
! * @return the {@code Component} displayed in that position
*/
public Component getBottomComponent() {
return rightComponent;
}
/**
! * Sets the value of the {@code oneTouchExpandable} property,
! * which must be {@code true} for the
! * {@code JSplitPane} to provide a UI widget
* on the divider to quickly expand/collapse the divider.
! * The default value of this property is {@code false}.
* Some look and feels might not support one-touch expanding;
* they will ignore this property.
*
! * @param newValue {@code true} to specify that the split pane should provide a
* collapse/expand widget
* @beaninfo
* bound: true
* description: UI widget on the divider to quickly
* expand/collapse the divider.
*** 581,603 ****
repaint();
}
/**
! * Gets the <code>oneTouchExpandable</code> property.
*
! * @return the value of the <code>oneTouchExpandable</code> property
* @see #setOneTouchExpandable
*/
public boolean isOneTouchExpandable() {
return oneTouchExpandable;
}
/**
* Sets the last location the divider was at to
! * <code>newLastLocation</code>.
*
* @param newLastLocation an integer specifying the last divider location
* in pixels, from the left (or upper) edge of the pane to the
* left (or upper) edge of the divider
* @beaninfo
--- 581,603 ----
repaint();
}
/**
! * Gets the {@code oneTouchExpandable} property.
*
! * @return the value of the {@code oneTouchExpandable} property
* @see #setOneTouchExpandable
*/
public boolean isOneTouchExpandable() {
return oneTouchExpandable;
}
/**
* Sets the last location the divider was at to
! * {@code newLastLocation}.
*
* @param newLastLocation an integer specifying the last divider location
* in pixels, from the left (or upper) edge of the pane to the
* left (or upper) edge of the divider
* @beaninfo
*** 667,685 ****
return orientation;
}
/**
! * Sets the value of the <code>continuousLayout</code> property,
! * which must be <code>true</code> for the child components
* to be continuously
* redisplayed and laid out during user intervention.
* The default value of this property is look and feel dependent.
* Some look and feels might not support continuous layout;
* they will ignore this property.
*
! * @param newContinuousLayout <code>true</code> if the components
* should continuously be redrawn as the divider changes position
* @beaninfo
* bound: true
* description: Whether the child components are
* continuously redisplayed and laid out during
--- 667,685 ----
return orientation;
}
/**
! * Sets the value of the {@code continuousLayout} property,
! * which must be {@code true} for the child components
* to be continuously
* redisplayed and laid out during user intervention.
* The default value of this property is look and feel dependent.
* Some look and feels might not support continuous layout;
* they will ignore this property.
*
! * @param newContinuousLayout {@code true} if the components
* should continuously be redrawn as the divider changes position
* @beaninfo
* bound: true
* description: Whether the child components are
* continuously redisplayed and laid out during
*** 694,706 ****
newContinuousLayout);
}
/**
! * Gets the <code>continuousLayout</code> property.
*
! * @return the value of the <code>continuousLayout</code> property
* @see #setContinuousLayout
*/
public boolean isContinuousLayout() {
return continuousLayout;
}
--- 694,706 ----
newContinuousLayout);
}
/**
! * Gets the {@code continuousLayout} property.
*
! * @return the value of the {@code continuousLayout} property
* @see #setContinuousLayout
*/
public boolean isContinuousLayout() {
return continuousLayout;
}
*** 714,724 ****
* acts fixed). Specifically, the left/top component gets (weight * diff)
* extra space and the right/bottom component gets (1 - weight) * diff
* extra space.
*
* @param value as described above
! * @exception IllegalArgumentException if <code>value</code> is < 0 or > 1
* @since 1.3
* @beaninfo
* bound: true
* description: Specifies how to distribute extra space when the split pane
* resizes.
--- 714,724 ----
* acts fixed). Specifically, the left/top component gets (weight * diff)
* extra space and the right/bottom component gets (1 - weight) * diff
* extra space.
*
* @param value as described above
! * @exception IllegalArgumentException if {@code value} is < 0 or > 1
* @since 1.3
* @beaninfo
* bound: true
* description: Specifies how to distribute extra space when the split pane
* resizes.
*** 742,752 ****
public double getResizeWeight() {
return resizeWeight;
}
/**
! * Lays out the <code>JSplitPane</code> layout based on the preferred size
* of the children components. This will likely result in changing
* the divider location.
*/
public void resetToPreferredSizes() {
SplitPaneUI ui = getUI();
--- 742,752 ----
public double getResizeWeight() {
return resizeWeight;
}
/**
! * Lays out the {@code JSplitPane} layout based on the preferred size
* of the children components. This will likely result in changing
* the divider location.
*/
public void resetToPreferredSizes() {
SplitPaneUI ui = getUI();
*** 757,770 ****
}
/**
* Sets the divider location as a percentage of the
! * <code>JSplitPane</code>'s size.
* <p>
* This method is implemented in terms of
! * <code>setDividerLocation(int)</code>.
* This method immediately changes the size of the split pane based on
* its current size. If the split pane is not correctly realized and on
* screen, this method will have no effect (new divider location will
* become (current size * proportionalLocation) which is 0).
*
--- 757,770 ----
}
/**
* Sets the divider location as a percentage of the
! * {@code JSplitPane}'s size.
* <p>
* This method is implemented in terms of
! * {@code setDividerLocation(int)}.
* This method immediately changes the size of the split pane based on
* its current size. If the split pane is not correctly realized and on
* screen, this method will have no effect (new divider location will
* become (current size * proportionalLocation) which is 0).
*
*** 796,806 ****
* Sets the location of the divider. This is passed off to the
* look and feel implementation, and then listeners are notified. A value
* less than 0 implies the divider should be reset to a value that
* attempts to honor the preferred size of the left/top component.
* After notifying the listeners, the last divider location is updated,
! * via <code>setLastDividerLocation</code>.
*
* @param location an int specifying a UI-specific value (typically a
* pixel count)
* @beaninfo
* bound: true
--- 796,806 ----
* Sets the location of the divider. This is passed off to the
* look and feel implementation, and then listeners are notified. A value
* less than 0 implies the divider should be reset to a value that
* attempts to honor the preferred size of the left/top component.
* After notifying the listeners, the last divider location is updated,
! * via {@code setLastDividerLocation}.
*
* @param location an int specifying a UI-specific value (typically a
* pixel count)
* @beaninfo
* bound: true
*** 825,837 ****
setLastDividerLocation(oldValue);
}
/**
! * Returns the last value passed to <code>setDividerLocation</code>.
* The value returned from this method may differ from the actual
! * divider location (if <code>setDividerLocation</code> was passed a
* value bigger than the current size).
*
* @return an integer specifying the location of the divider
*/
public int getDividerLocation() {
--- 825,837 ----
setLastDividerLocation(oldValue);
}
/**
! * Returns the last value passed to {@code setDividerLocation}.
* The value returned from this method may differ from the actual
! * divider location (if {@code setDividerLocation} was passed a
* value bigger than the current size).
*
* @return an integer specifying the location of the divider
*/
public int getDividerLocation() {
*** 843,853 ****
* Returns the minimum location of the divider from the look and feel
* implementation.
*
* @return an integer specifying a UI-specific value for the minimum
* location (typically a pixel count); or -1 if the UI is
! * <code>null</code>
* @beaninfo
* description: The minimum location of the divider from the L&F.
*/
public int getMinimumDividerLocation() {
SplitPaneUI ui = getUI();
--- 843,853 ----
* Returns the minimum location of the divider from the look and feel
* implementation.
*
* @return an integer specifying a UI-specific value for the minimum
* location (typically a pixel count); or -1 if the UI is
! * {@code null}
* @beaninfo
* description: The minimum location of the divider from the L&F.
*/
public int getMinimumDividerLocation() {
SplitPaneUI ui = getUI();
*** 863,873 ****
* Returns the maximum location of the divider from the look and feel
* implementation.
*
* @return an integer specifying a UI-specific value for the maximum
* location (typically a pixel count); or -1 if the UI is
! * <code>null</code>
*/
public int getMaximumDividerLocation() {
SplitPaneUI ui = getUI();
if (ui != null) {
--- 863,873 ----
* Returns the maximum location of the divider from the look and feel
* implementation.
*
* @return an integer specifying a UI-specific value for the maximum
* location (typically a pixel count); or -1 if the UI is
! * {@code null}
*/
public int getMaximumDividerLocation() {
SplitPaneUI ui = getUI();
if (ui != null) {
*** 876,890 ****
return -1;
}
/**
! * Removes the child component, <code>component</code> from the
! * pane. Resets the <code>leftComponent</code> or
! * <code>rightComponent</code> instance variable, as necessary.
*
! * @param component the <code>Component</code> to remove
*/
public void remove(Component component) {
if (component == leftComponent) {
leftComponent = null;
} else if (component == rightComponent) {
--- 876,890 ----
return -1;
}
/**
! * Removes the child component, {@code component} from the
! * pane. Resets the {@code leftComponent} or
! * {@code rightComponent} instance variable, as necessary.
*
! * @param component the {@code Component} to remove
*/
public void remove(Component component) {
if (component == leftComponent) {
leftComponent = null;
} else if (component == rightComponent) {
*** 897,908 ****
repaint();
}
/**
! * Removes the <code>Component</code> at the specified index.
! * Updates the <code>leftComponent</code> and <code>rightComponent</code>
* instance variables as necessary, and then messages super.
*
* @param index an integer specifying the component to remove, where
* 1 specifies the left/top component and 2 specifies the
* bottom/right component
--- 897,908 ----
repaint();
}
/**
! * Removes the {@code Component} at the specified index.
! * Updates the {@code leftComponent} and {@code rightComponent}
* instance variables as necessary, and then messages super.
*
* @param index an integer specifying the component to remove, where
* 1 specifies the left/top component and 2 specifies the
* bottom/right component
*** 923,933 ****
}
/**
* Removes all the child components from the split pane. Resets the
! * <code>leftComonent</code> and <code>rightComponent</code>
* instance variables.
*/
public void removeAll() {
leftComponent = rightComponent = null;
super.removeAll();
--- 923,933 ----
}
/**
* Removes all the child components from the split pane. Resets the
! * {@code leftComonent} and {@code rightComponent}
* instance variables.
*/
public void removeAll() {
leftComponent = rightComponent = null;
super.removeAll();
*** 937,950 ****
repaint();
}
/**
! * Returns true, so that calls to <code>revalidate</code>
! * on any descendant of this <code>JSplitPane</code>
* will cause a request to be queued that
! * will validate the <code>JSplitPane</code> and all its descendants.
*
* @return true
* @see JComponent#revalidate
* @see java.awt.Container#isValidateRoot
*
--- 937,950 ----
repaint();
}
/**
! * Returns true, so that calls to {@code revalidate}
! * on any descendant of this {@code JSplitPane}
* will cause a request to be queued that
! * will validate the {@code JSplitPane} and all its descendants.
*
* @return true
* @see JComponent#revalidate
* @see java.awt.Container#isValidateRoot
*
*** 957,991 ****
}
/**
* Adds the specified component to this split pane.
! * If <code>constraints</code> identifies the left/top or
* right/bottom child component, and a component with that identifier
! * was previously added, it will be removed and then <code>comp</code>
! * will be added in its place. If <code>constraints</code> is not
* one of the known identifiers the layout manager may throw an
! * <code>IllegalArgumentException</code>.
* <p>
* The possible constraints objects (Strings) are:
* <ul>
* <li>JSplitPane.TOP
* <li>JSplitPane.LEFT
* <li>JSplitPane.BOTTOM
* <li>JSplitPane.RIGHT
* </ul>
! * If the <code>constraints</code> object is <code>null</code>,
* the component is added in the
* first available position (left/top if open, else right/bottom).
*
* @param comp the component to add
! * @param constraints an <code>Object</code> specifying the
* layout constraints
* (position) for this component
* @param index an integer specifying the index in the container's
* list.
! * @exception IllegalArgumentException if the <code>constraints</code>
* object does not match an existing component
* @see java.awt.Container#addImpl(Component, Object, int)
*/
protected void addImpl(Component comp, Object constraints, int index)
{
--- 957,991 ----
}
/**
* Adds the specified component to this split pane.
! * If {@code constraints} identifies the left/top or
* right/bottom child component, and a component with that identifier
! * was previously added, it will be removed and then {@code comp}
! * will be added in its place. If {@code constraints} is not
* one of the known identifiers the layout manager may throw an
! * {@code IllegalArgumentException}.
* <p>
* The possible constraints objects (Strings) are:
* <ul>
* <li>JSplitPane.TOP
* <li>JSplitPane.LEFT
* <li>JSplitPane.BOTTOM
* <li>JSplitPane.RIGHT
* </ul>
! * If the {@code constraints} object is {@code null},
* the component is added in the
* first available position (left/top if open, else right/bottom).
*
* @param comp the component to add
! * @param constraints an {@code Object} specifying the
* layout constraints
* (position) for this component
* @param index an integer specifying the index in the container's
* list.
! * @exception IllegalArgumentException if the {@code constraints}
* object does not match an existing component
* @see java.awt.Container#addImpl(Component, Object, int)
*/
protected void addImpl(Component comp, Object constraints, int index)
{
*** 1038,1051 ****
repaint();
}
/**
! * Subclassed to message the UI with <code>finishedPaintingChildren</code>
* after super has been messaged, as well as painting the border.
*
! * @param g the <code>Graphics</code> context within which to paint
*/
protected void paintChildren(Graphics g) {
super.paintChildren(g);
SplitPaneUI ui = getUI();
--- 1038,1051 ----
repaint();
}
/**
! * Subclassed to message the UI with {@code finishedPaintingChildren}
* after super has been messaged, as well as painting the border.
*
! * @param g the {@code Graphics} context within which to paint
*/
protected void paintChildren(Graphics g) {
super.paintChildren(g);
SplitPaneUI ui = getUI();
*** 1057,1068 ****
}
}
/**
! * See <code>readObject</code> and <code>writeObject</code> in
! * <code>JComponent</code> for more
* information about serialization in Swing.
*/
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
if (getUIClassID().equals(uiClassID)) {
--- 1057,1068 ----
}
}
/**
! * See {@code readObject} and {@code writeObject} in
! * {@code JComponent} for more
* information about serialization in Swing.
*/
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
if (getUIClassID().equals(uiClassID)) {
*** 1090,1107 ****
}
}
/**
! * Returns a string representation of this <code>JSplitPane</code>.
* This method
* is intended to be used only for debugging purposes, and the
* content and format of the returned string may vary between
* implementations. The returned string may be empty but may not
! * be <code>null</code>.
*
! * @return a string representation of this <code>JSplitPane</code>.
*/
protected String paramString() {
String orientationString = (orientation == HORIZONTAL_SPLIT ?
"HORIZONTAL_SPLIT" : "VERTICAL_SPLIT");
String continuousLayoutString = (continuousLayout ?
--- 1090,1107 ----
}
}
/**
! * Returns a string representation of this {@code JSplitPane}.
* This method
* is intended to be used only for debugging purposes, and the
* content and format of the returned string may vary between
* implementations. The returned string may be empty but may not
! * be {@code null}.
*
! * @return a string representation of this {@code JSplitPane}.
*/
protected String paramString() {
String orientationString = (orientation == HORIZONTAL_SPLIT ?
"HORIZONTAL_SPLIT" : "VERTICAL_SPLIT");
String continuousLayoutString = (continuousLayout ?
*** 1144,1163 ****
}
/**
* This class implements accessibility support for the
! * <code>JSplitPane</code> class. It provides an implementation of the
* Java Accessibility API appropriate to split pane user-interface elements.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*/
@SuppressWarnings("serial") // Same-version serialization only
protected class AccessibleJSplitPane extends AccessibleJComponent
implements AccessibleValue {
--- 1144,1163 ----
}
/**
* This class implements accessibility support for the
! * {@code JSplitPane} class. It provides an implementation of the
* Java Accessibility API appropriate to split pane user-interface elements.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*/
@SuppressWarnings("serial") // Same-version serialization only
protected class AccessibleJSplitPane extends AccessibleJComponent
implements AccessibleValue {
< prev index next >