This class implements JSplitPane. It is used to divide two components. By
dragging the SplitPane's divider, the user can resize the two components.
Note that the divider cannot resize a component to smaller than it's
minimum size.
BOTTOM
public static final String BOTTOM
The constraints string used to add components to the bottom.
- ""
DIVIDER
public static final String DIVIDER
The property fired when the divider property changes.
- ""
HORIZONTAL_SPLIT
public static final int HORIZONTAL_SPLIT
The value of the orientation when the components are split horizontally.
- 1
LEFT
public static final String LEFT
The constraints string used to add components to the left.
- ""
RIGHT
public static final String RIGHT
The constraints string used to add components to the right.
- ""
TOP
public static final String TOP
The constraints string used to add components to the top.
- ""
VERTICAL_SPLIT
public static final int VERTICAL_SPLIT
The value of the orientation when the components are split vertically.
- 0
continuousLayout
protected boolean continuousLayout
Whether the JSplitPane uses continuous layout.
dividerSize
protected int dividerSize
The size of the divider.
lastDividerLocation
protected int lastDividerLocation
The last location of the divider given by the UI.
oneTouchExpandable
protected boolean oneTouchExpandable
Whether the JSplitPane uses one touch expandable buttons.
orientation
protected int orientation
The orientation of the JSplitPane.
JSplitPane
public JSplitPane()
Creates a new JSplitPane object using HORIZONTAL_SPLIT and a
nonContinuousLayout mode.
JSplitPane
public JSplitPane(int newOrientation)
Creates a new JSplitPane object using a nonContinuousLayout mode and the
given orientation.
newOrientation
- The orientation to use.
JSplitPane
public JSplitPane(int newOrientation,
boolean newContinuousLayout)
Creates a new JSplitPane object with the given layout mode and
orientation.
newOrientation
- The orientation to use.newContinuousLayout
- The layout mode to use.
JSplitPane
public JSplitPane(int newOrientation,
boolean newContinuousLayout,
Component newLeftComponent,
Component newRightComponent)
Creates a new JSplitPane object with the given orientation, layout mode,
and left and right components.
newOrientation
- The orientation to use.newContinuousLayout
- The layout mode to use.newLeftComponent
- The left component.newRightComponent
- The right component.
IllegalArgumentException
- DOCUMENT ME!
JSplitPane
public JSplitPane(int newOrientation,
Component newLeftComponent,
Component newRightComponent)
Creates a new JSplitPane object using nonContinuousLayout mode, the given
orientation and left and right components.
newOrientation
- The orientation to use.newLeftComponent
- The left component.newRightComponent
- The right component.
addImpl
protected void addImpl(Component comp,
Object constraints,
int index)
This method adds a component to the JSplitPane. The constraints object is
a string that identifies where this component should go. If the
constraints is not a known one, it will throw an
IllegalArgumentException. The valid constraints are LEFT, TOP, RIGHT,
BOTTOM and DIVIDER.
- addImpl in interface Container
comp
- The component to add.constraints
- The constraints string to use.index
- Where to place to component in the list of components.
IllegalArgumentException
- When the constraints is not a known identifier.
getDividerLocation
public int getDividerLocation()
This method returns the location of the divider. This method is passed to
the UI.
- The location of the divider.
getDividerSize
public int getDividerSize()
This method returns the size of the divider.
- The size of the divider.
getLastDividerLocation
public int getLastDividerLocation()
This method returns the last divider location.
- The last divider location.
getMaximumDividerLocation
public int getMaximumDividerLocation()
This method returns the maximum divider location. This method is passed
to the UI.
- DOCUMENT ME!
getMinimumDividerLocation
public int getMinimumDividerLocation()
This method returns the minimum divider location. This method is passed
to the UI.
- The minimum divider location.
getOrientation
public int getOrientation()
This method returns the orientation that the JSplitPane is using.
- The current orientation.
getResizeWeight
public double getResizeWeight()
This method returns the current resize weight.
- The current resize weight.
getUIClassID
public String getUIClassID()
This method returns a string identifier to determine which UI class it
needs.
- getUIClassID in interface JComponent
- A string that identifies it's UI class.
isContinuousLayout
public boolean isContinuousLayout()
This method returns true if the JSplitPane is using a continuousLayout.
- True if using a continuousLayout.
isOneTouchExpandable
public boolean isOneTouchExpandable()
This method returns true if the divider has one touch expandable buttons.
- True if one touch expandable is used.
paintChildren
protected void paintChildren(Graphics g)
This method overrides JComponent's paintChildren so the UI can be
messaged when the children have finished painting.
- paintChildren in interface JComponent
g
- The Graphics object to paint with.
paramString
protected String paramString()
This method returns a String that describes this JSplitPane. The string
is primarily used for debugging purposes.
- paramString in interface JComponent
- A String used for debugging purposes.
remove
public void remove(int index)
This method removes the component at the given index.
- remove in interface Container
index
- The index of the component to remove.
remove
public void remove(Component component)
This method removes the given component from the JSplitPane.
- remove in interface Container
component
- The Component to remove.
removeAll
public void removeAll()
This method removes all components from the JSplitPane.
- removeAll in interface Container
resetToPreferredSizes
public void resetToPreferredSizes()
This method resets all children of the JSplitPane to their preferred
sizes.
setBottomComponent
public void setBottomComponent(Component comp)
This method sets the bottom component.
comp
- The Component to be placed at the bottom.
setContinuousLayout
public void setContinuousLayout(boolean newContinuousLayout)
This method sets the layout mode for the JSplitPane.
newContinuousLayout
- Whether the JSplitPane is in continuousLayout
mode.
setDividerLocation
public void setDividerLocation(double proportionalLocation)
This method sets the location of the divider. A value of 0 sets the
divider to the farthest left. A value of 1 sets the divider to the
farthest right.
proportionalLocation
- A double that describes the location of the
divider.
IllegalArgumentException
- DOCUMENT ME!
setDividerLocation
public void setDividerLocation(int location)
This method sets the location of the divider.
location
- The location of the divider.
setDividerSize
public void setDividerSize(int newSize)
This method sets the size of the divider.
newSize
- The size of the divider.
setLastDividerLocation
public void setLastDividerLocation(int newLastLocation)
This method sets the last location of the divider.
newLastLocation
- The last location of the divider.
setOneTouchExpandable
public void setOneTouchExpandable(boolean newValue)
This method sets whether the divider has one touch expandable buttons.
The one touch expandable buttons can expand the size of either component
to the maximum allowed size.
newValue
- Whether the divider will have one touch expandable
buttons.
setOrientation
public void setOrientation(int orientation)
This method sets the orientation of the JSplitPane.
orientation
- The orientation of the JSplitPane.
IllegalArgumentException
- DOCUMENT ME!
setResizeWeight
public void setResizeWeight(double value)
This method determines how extra space will be distributed among the left
and right components. A value of 0 will allocate all extra space to the
right component. A value of 1 indicates that all extra space will go to
the left component. A value in between 1 and 0 will split the space
accordingly.
value
- The resize weight.
setTopComponent
public void setTopComponent(Component comp)
This method sets the top component.
comp
- The top component.
setUI
public void setUI(SplitPaneUI ui)
This method sets the UI used by the JSplitPane.
ui
- The UI to use.
updateUI
public void updateUI()
This method resets the UI to the one specified by the current Look and
Feel.
- updateUI in interface JComponent
JSplitPane.java --
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath 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 for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.