All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.JSplitPane
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.swing.JComponent
|
+----java.awt.swing.JSplitPane
- public class JSplitPane
- extends JComponent
- implements Accessible
JSplitPane is used to divide two (and only two) Components. The two
Components are graphicaly divided based on the look and feel
implementation. By user intervention the two Components can be
interactively resized.
The two Components can be aligned left to right,
JSplitPane.HORIZONTAL_SPLIT
, or top to bottom,
JSplitPane.VERTICAL_SPLIT
.
The preferred way to change the size of the Componets is to message
setDividerLocation where location is either the new x or y position
depending on the orientation of the JSplitPane. JSplitPane will also
try and reposition the other Component if one changes.
To resize the Components to their preferred sizes message
resetPreferredSizes.
When the user is resizing the Components the minimum size of the
Components is used to determine the maximum/minimum position the
Components can be set to. So that if the minimum size of the two
components is greater than the size of the splitpane the divider
will not allow you to resize it. Refer to JComponent.setMinimumSize
for a way to alter the minimum size of a JComponent.
BOTTOM- Used to add a Component below the other Component.
CONTINUOUS_LAYOUT_PROPERTY- Bound property name for continuousLayout.
continuousLayout- Whether or not the views are continuously redisplayed while
resizing.
DIVIDER- Used to add a Component that will represent the divider.
DIVIDER_SIZE_PROPERTY- Bound property name for border.
dividerSize- Size of the divider.
HORIZONTAL_SPLIT- Horizontal split indicates the Components are split along the
x axis, eg the two Components will be split one to the left of the
other.
LAST_DIVIDER_LOCATION_PROPERTY- Bound property for lastLocation.
lastDividerLocation- Previous location of the split pane.
LEFT- Used to add a Component to go on the left side of the other
Component.
leftComponent- The left or top component.
ONE_TOUCH_EXPANDABLE_PROPERTY- Bound property for oneTouchExpandable.
oneTouchExpandable- Is a little widget provided to quickly expand/collapse the
split pane.
orientation- How the views are split.
ORIENTATION_PROPERTY- Bound property name for orientation.
RIGHT- Used to add a Component to go on the right side of the other
Component.
rightComponent-
TOP- Used to add a Component above the other Component.
VERTICAL_SPLIT- Vertical split indicates the Components are split along the
y axis, eg the two Components will be split one on top of the other.
JSplitPane()
- Returns a new JSplitPane configured to vertically divide
the child components and with two buttons.
JSplitPane(int)
- Returns a new JSplitPane configured with the passed in orientation
and no continuous layout.
JSplitPane(int, boolean)
- Returns a new JSplitPane with the specified orientation and
continuousLayout.
JSplitPane(int, boolean, Component, Component)
- Returns a new JSplitPane with the specified orientation,
continuousLayout and passed in Components.
JSplitPane(int, Component, Component)
- Returns a new JSplitPane with the specified orientation,
continuousLayout and passed in Components.
addImpl(Component, Object, int)
- If
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 comp
will be added in its place.
getAccessibleRole()
- Get the role of this object.
getAccessibleStateSet()
- Get the state set of this object.
getAccessibleValue()
- Get the accessible value of this object.
getBottomComponent()
- Returns the component below, or to the right of the divider.
getDividerLocation()
- Returns the location of the divider from the look and feel
implementation.
getDividerSize()
- Returns the size of the divider.
getLastDividerLocation()
- Returns the last location the divider was at.
getLeftComponent()
- Returns the component to the left (or above) the divider.
getMaximumAccessibleValue()
- Get the maximum accessible value of this object.
getMaximumDividerLocation()
- Returns the maximum location of the divider from the look and feel
implementation.
getMinimumAccessibleValue()
- Get the minimum accessible value of this object.
getMinimumDividerLocation()
- Returns the minimum location of the divider from the look and feel
implementation.
getOrientation()
- Returns the orientation.
getRightComponent()
- Returns the component to the right (or below) the divider.
getTopComponent()
- Returns the component above, or to the left of the divider.
getUI()
- Returns the TreeUI that is providing the current look and
feel.
getUIClassID()
-
isContinuousLayout()
- Returns true if the child comopnents are continuously redisplayed and
layed out during user intervention.
isOneTouchExpandable()
- Returns true if the receiver provides a UI widget to collapse/expand
the divider.
paintChildren(Graphics)
- Subclassed to message the UI with finishedPaintingChildren after
super has been messaged, as well as painting the border.
remove(Component)
- Removes the child component,
component
from the
receiver.
remove(int)
- Removes the Component at the passed in index.
removeAll()
- Removes all the child components from the receiver.
resetToPreferredSizes()
- Messaged to relayout the JSplitPane based on the preferred size
of the children components.
setAccessibleValue(Number)
- Set the value of this object as a Number.
setBottomComponent(Component)
- Sets the component below, or to the right of the divider.
setContinuousLayout(boolean)
- Sets whether or not the child components are continuously
redisplayed and layed out during user intervention.
setDividerLocation(int)
- Sets the location of the divider.
setDividerSize(int)
- Sets the size of the divider to
newSize
.
setLastDividerLocation(int)
- Sets the last location the divier was at to
newLastLocation
.
setLeftComponent(Component)
- Sets the component to the left (or above) the divider.
setOneTouchExpandable(boolean)
- If
newValue
is true, the reciever will provide
UI widgets on the divider to quickly expand/collapse the
divider.
setOrientation(int)
- Sets the orientation, or how the splitter is divided.
setRightComponent(Component)
- Sets the component to the right (or below) the divider.
setTopComponent(Component)
- Sets the component above, or to the left of the divider.
setUI(SplitPaneUI)
- Sets the TreeUI that will provide the current look and feel.
updateUI()
- Called to replace the UI with the latest version from the
default UIFactory.
VERTICAL_SPLIT
public static int VERTICAL_SPLIT
- Vertical split indicates the Components are split along the
y axis, eg the two Components will be split one on top of the other.
HORIZONTAL_SPLIT
public static int HORIZONTAL_SPLIT
- Horizontal split indicates the Components are split along the
x axis, eg the two Components will be split one to the left of the
other.
LEFT
public static String LEFT
- Used to add a Component to go on the left side of the other
Component.
RIGHT
public static String RIGHT
- Used to add a Component to go on the right side of the other
Component.
TOP
public static String TOP
- Used to add a Component above the other Component.
BOTTOM
public static String BOTTOM
- Used to add a Component below the other Component.
DIVIDER
public static String DIVIDER
- Used to add a Component that will represent the divider.
ORIENTATION_PROPERTY
public static final String ORIENTATION_PROPERTY
- Bound property name for orientation.
CONTINUOUS_LAYOUT_PROPERTY
public static final String CONTINUOUS_LAYOUT_PROPERTY
- Bound property name for continuousLayout.
DIVIDER_SIZE_PROPERTY
public static final String DIVIDER_SIZE_PROPERTY
- Bound property name for border.
ONE_TOUCH_EXPANDABLE_PROPERTY
public static final String ONE_TOUCH_EXPANDABLE_PROPERTY
- Bound property for oneTouchExpandable.
LAST_DIVIDER_LOCATION_PROPERTY
public static final String LAST_DIVIDER_LOCATION_PROPERTY
- Bound property for lastLocation.
orientation
protected int orientation
- How the views are split.
continuousLayout
protected boolean continuousLayout
- Whether or not the views are continuously redisplayed while
resizing.
leftComponent
protected Component leftComponent
- The left or top component.
rightComponent
protected Component rightComponent
dividerSize
protected int dividerSize
- Size of the divider.
oneTouchExpandable
protected boolean oneTouchExpandable
- Is a little widget provided to quickly expand/collapse the
split pane.
lastDividerLocation
protected int lastDividerLocation
- Previous location of the split pane.
JSplitPane
public JSplitPane()
- Returns a new JSplitPane configured to vertically divide
the child components and with two buttons.
JSplitPane
public JSplitPane(int newOrientation)
- Returns a new JSplitPane configured with the passed in orientation
and no continuous layout.
JSplitPane
public JSplitPane(int newOrientation,
boolean newContinuousLayout)
- Returns a new JSplitPane with the specified orientation and
continuousLayout.
JSplitPane
public JSplitPane(int newOrientation,
Component newLeftComponent,
Component newRightComponent)
- Returns a new JSplitPane with the specified orientation,
continuousLayout and passed in Components.
JSplitPane
public JSplitPane(int newOrientation,
boolean newContinuousLayout,
Component newLeftComponent,
Component newRightComponent)
- Returns a new JSplitPane with the specified orientation,
continuousLayout and passed in Components.
setUI
public void setUI(SplitPaneUI ui)
- Sets the TreeUI that will provide the current look and feel.
getUI
public SplitPaneUI getUI()
- Returns the TreeUI that is providing the current look and
feel.
updateUI
public void updateUI()
- Called to replace the UI with the latest version from the
default UIFactory.
- Overrides:
- updateUI in class JComponent
getUIClassID
public String getUIClassID()
- Returns:
- "SplitPaneUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
setDividerSize
public void setDividerSize(int newSize)
- Sets the size of the divider to
newSize
.
getDividerSize
public int getDividerSize()
- Returns the size of the divider.
setLeftComponent
public void setLeftComponent(Component comp)
- Sets the component to the left (or above) the divider.
getLeftComponent
public Component getLeftComponent()
- Returns the component to the left (or above) the divider.
setTopComponent
public void setTopComponent(Component comp)
- Sets the component above, or to the left of the divider.
getTopComponent
public Component getTopComponent()
- Returns the component above, or to the left of the divider.
setRightComponent
public void setRightComponent(Component comp)
- Sets the component to the right (or below) the divider.
getRightComponent
public Component getRightComponent()
- Returns the component to the right (or below) the divider.
setBottomComponent
public void setBottomComponent(Component comp)
- Sets the component below, or to the right of the divider.
getBottomComponent
public Component getBottomComponent()
- Returns the component below, or to the right of the divider.
setOneTouchExpandable
public void setOneTouchExpandable(boolean newValue)
- If
newValue
is true, the reciever will provide
UI widgets on the divider to quickly expand/collapse the
divider.
isOneTouchExpandable
public boolean isOneTouchExpandable()
- Returns true if the receiver provides a UI widget to collapse/expand
the divider.
setLastDividerLocation
public void setLastDividerLocation(int newLastLocation)
- Sets the last location the divier was at to
newLastLocation
.
getLastDividerLocation
public int getLastDividerLocation()
- Returns the last location the divider was at.
setOrientation
public void setOrientation(int orientation)
- Sets the orientation, or how the splitter is divided.
getOrientation
public int getOrientation()
- Returns the orientation.
setContinuousLayout
public void setContinuousLayout(boolean newContinuousLayout)
- Sets whether or not the child components are continuously
redisplayed and layed out during user intervention.
isContinuousLayout
public boolean isContinuousLayout()
- Returns true if the child comopnents are continuously redisplayed and
layed out during user intervention.
resetToPreferredSizes
public void resetToPreferredSizes()
- Messaged to relayout the JSplitPane based on the preferred size
of the children components.
setDividerLocation
public void setDividerLocation(int location)
- Sets the location of the divider. This is passed off to the
look and feel implementation.
getDividerLocation
public int getDividerLocation()
- Returns the location of the divider from the look and feel
implementation.
getMinimumDividerLocation
public int getMinimumDividerLocation()
- Returns the minimum location of the divider from the look and feel
implementation.
getMaximumDividerLocation
public int getMaximumDividerLocation()
- Returns the maximum location of the divider from the look and feel
implementation.
remove
public void remove(Component component)
- Removes the child component,
component
from the
receiver. Reset the leftComponent or rightComponent instance
variable if necessary.
- Overrides:
- remove in class Container
remove
public void remove(int index)
- Removes the Component at the passed in index. This updates the
leftComponent and rightComponent ivars if necessary, and then
messages super.
- Overrides:
- remove in class Container
removeAll
public void removeAll()
- Removes all the child components from the receiver. Resets the
leftComonent and rightComponent instance variables.
- Overrides:
- removeAll in class Container
addImpl
protected void addImpl(Component comp,
Object constraints,
int index)
- If
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 comp
will be added in its place. If constraints
is not
one of the known identifers the layout manager may throw an
IllegalArgumentException.
- Overrides:
- addImpl in class Container
paintChildren
protected void paintChildren(Graphics g)
- Subclassed to message the UI with finishedPaintingChildren after
super has been messaged, as well as painting the border.
- Overrides:
- paintChildren in class JComponent
getAccessibleStateSet
public AccessibleStateSet getAccessibleStateSet()
- Get the state set of this object.
- Returns:
- an instance of AccessibleState containing the current state
of the object
- Overrides:
- getAccessibleStateSet in class JComponent
- See Also:
- AccessibleState
getAccessibleValue
public Number getAccessibleValue()
- Get the accessible value of this object.
- Returns:
- a localized String describing the value of this object
- Overrides:
- getAccessibleValue in class JComponent
setAccessibleValue
public boolean setAccessibleValue(Number n)
- Set the value of this object as a Number.
- Returns:
- True if the value was set.
- Overrides:
- setAccessibleValue in class JComponent
getMinimumAccessibleValue
public Number getMinimumAccessibleValue()
- Get the minimum accessible value of this object.
- Returns:
- The minimum value of this object.
- Overrides:
- getMinimumAccessibleValue in class JComponent
getMaximumAccessibleValue
public Number getMaximumAccessibleValue()
- Get the maximum accessible value of this object.
- Returns:
- The maximum value of this object.
- Overrides:
- getMaximumAccessibleValue in class JComponent
getAccessibleRole
public AccessibleRole getAccessibleRole()
- Get the role of this object.
- Returns:
- an instance of AccessibleRole describing the role of the object
- Overrides:
- getAccessibleRole in class JComponent
- See Also:
- AccessibleRole
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature