Package com.jidesoft.swing
Class JideSplitPane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- com.jidesoft.swing.JideSplitPane
-
- All Implemented Interfaces:
java.awt.event.ComponentListener
,java.awt.event.ContainerListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
public class JideSplitPane extends javax.swing.JPanel implements java.awt.event.ContainerListener, java.awt.event.ComponentListener, javax.accessibility.Accessible
JideSplitPane
is used to divide multipleComponent
s. TheseComponent
s in a split pane can be aligned left to right usingJideSplitPane.HORIZONTAL_SPLIT
, or top to bottom usingJideSplitPane.VERTICAL_SPLIT
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
JideSplitPane.AccessibleJideSplitPane
This class implements accessibility support for theJideSplitPane
class.-
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field Description java.awt.event.WindowAdapter
_windowDeactivatedListener
static java.lang.String
CONTINUOUS_LAYOUT_PROPERTY
Bound property name for continuousLayout.static java.lang.String
DIVIDER_SIZE_PROPERTY
Bound property name for border size.static java.lang.String
GRIPPER_PROPERTY
Bound property name for gripper.static int
HORIZONTAL_SPLIT
Horizontal split indicates theComponent
s are split along the x axis.protected static java.lang.String
NON_CONTINUOUS_DIVIDER
The divider used for non-continuous layout is added to the split pane with this object.static java.lang.String
ONE_TOUCH_EXPANDABLE_PROPERTY
Bound property foroneTouchExpandable
.static java.lang.String
ORIENTATION_PROPERTY
Bound property name for orientation (horizontal or vertical).static java.lang.String
PROPERTY_DIVIDER_LOCATION
Bound property name for border size.static java.lang.String
PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED
static java.lang.String
PROPORTIONAL_LAYOUT_PROPERTY
Bound property name for proportional layout.static java.lang.String
PROPORTIONS_PROPERTY
Bound property name for the proportions used in the layout.static int
VERTICAL_SPLIT
Vertical split indicates theComponent
s are split along the y axis.-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
-
Constructor Summary
Constructors Constructor Description JideSplitPane()
Creates a newJideSplitPane
configured to arrange the child components side-by-side horizontally.JideSplitPane(int newOrientation)
Creates a newJideSplitPane
configured with the specified orientation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addExtraDividers()
Add divider if there are two panes side by side without a divider in between.java.awt.Component
addPane(java.awt.Component pane)
Adds the specified pane to this container at the end.protected void
addProportion(int paneIndex)
Adds a proportion at the given pane index, taking a proportional amount from each of the existing proportions.void
componentAdded(java.awt.event.ContainerEvent e)
Invoked when a component has been added to the container.void
componentHidden(java.awt.event.ComponentEvent e)
void
componentMoved(java.awt.event.ComponentEvent e)
void
componentRemoved(java.awt.event.ContainerEvent e)
Invoked when a component has been removed from the container.void
componentResized(java.awt.event.ComponentEvent e)
void
componentShown(java.awt.event.ComponentEvent e)
protected JideSplitPaneDivider
createSplitPaneDivider()
void
doLayout()
Causes this container to lay out its components.protected void
dragDividerTo(JideSplitPaneDivider divider, int location)
Drags divider to right location.protected void
finishDraggingTo(JideSplitPaneDivider divider, int location)
Finishes dragging.javax.accessibility.AccessibleContext
getAccessibleContext()
Gets the AccessibleContext associated with this JideSplitPane.JideSplitPaneDivider
getDividerAt(int index)
Returns the divider at index.int
getDividerLocation(int dividerIndex)
Get the divider location.int[]
getDividerLocations()
Gets the divider locations.int
getDividerSize()
Returns the size of the divider.int
getDividerStepSize()
Get the step size while dragging the divider.javax.swing.ImageIcon
getLeftOneTouchButtonImageIcon()
Gets the left button's image icon.int
getNextDividerLocation(JideSplitPaneDivider divider, boolean ignoreVisibility, boolean reversed)
Get previous divider's, if any, location from current divider.int
getOrientation()
Returns the orientation.java.awt.Component
getPaneAt(int index)
Returns the component at index.int
getPaneCount()
Gets the count of panes, regardless of dividers.protected int
getPreviousDividerLocation(JideSplitPaneDivider divider, boolean ignoreVisibility, boolean reversed)
Get previous divider's, if any, location from current divider.double[]
getProportions()
Returns the current array of proportions used for proportional layout, or null if none has been established viasetProportions(double[])
or via user action.javax.swing.ImageIcon
getRightOneTouchButtonImageIcon()
Gets the right button's image icon.int
indexOf(java.awt.Component comp)
Returns the index of the component.int
indexOfDivider(JideSplitPaneDivider divider)
Returns the index of the divider.int
indexOfPane(java.awt.Component pane)
Returns the index of the pane.java.awt.Component
insertPane(java.awt.Component pane, int index)
Inserts the specified pane to this container at the given position.java.awt.Component
insertPane(java.awt.Component pane, java.lang.Object constraint, int index)
Inserts the specified pane to this container at the given position.boolean
isContinuousLayout()
Determines whether the JSplitPane is set to use a continuous layout.boolean
isDragResizable()
Get the flag indicating if dragging the divider could resize the panes.boolean
isHeavyweightComponentEnabled()
boolean
isInitiallyEven()
Returns the flag that tells whether to do even proportions for the initial proportional layout, in the absence of explicit proportions.boolean
isOneTouchExpandable()
Returns whether one-touch expand/collapse is on.boolean
isProportionalLayout()
Returns the proportional layout flag.boolean
isShowGripper()
Checks if the gripper is visible.boolean
isValidateRoot()
Returns true, so that calls torevalidate
on any descendant of thisJideSplitPane
will cause a request to be queued that will validate theJideSplitPane
and all its descendants.protected boolean
removeExtraDividers()
Remove extra divider.void
removePane(int index)
Removes the pane, specified byindex
, from this container.void
removePane(java.awt.Component pane)
Removes the pane, specified byindex
, from this container.protected void
removeProportion(int paneIndex)
Removes the proportion at the given pane index, spreading its value proportionally across the other proportions.void
resetToPreferredSizes()
Lays out theJideSplitPane
layout based on the preferred size children components, or based on the proportions if proportional layout is on.void
setContinuousLayout(boolean continuousLayout)
Turn continuous layout on/off.void
setDividerLocation(int dividerIndex, int location)
Set the divider location.void
setDividerLocation(JideSplitPaneDivider divider, int location)
Set the divider location.void
setDividerLocations(int[] locations)
Sets the divider locations.void
setDividerSize(int newSize)
Sets the size of the divider.void
setDividerStepSize(int dividerStepSize)
Set the step size while dragging the divider.protected void
setDividersVisible()
Before this method is call, the panes must be separated by dividers.void
setDragResizable(boolean dragResizable)
Set the flag indicating if dragging the divider could resize the panes.void
setHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)
Enables heavyweight components.void
setInitiallyEven(boolean initiallyEven)
Sets the flag telling whether to do even proportions for the initial proportional layout, in the absence of explicit proportions.void
setLeftOneTouchButtonImageIcon(javax.swing.ImageIcon leftButtonImageIcon)
Sets the left button's image icon.void
setOneTouchExpandable(boolean oneTouchExpandable)
Sets the value of theoneTouchExpandable
property.void
setOrientation(int orientation)
Sets the orientation, or how the splitter is divided.void
setPaneAt(java.awt.Component pane, int index)
Replaces the pane at the position specified by index.void
setPaneAt(java.awt.Component pane, java.lang.Object constraint, int index)
Replaces the pane at the position specified by index.void
setProportionalLayout(boolean proportionalLayout)
Sets this split pane to lay its constituents out proportionally if the given flag is true, or by preferred sizes otherwise.void
setProportions(double[] proportions)
Sets the proportions to use in laying out this split pane's children.void
setRightOneTouchButtonImageIcon(javax.swing.ImageIcon rightButtonImageIcon)
Sets the right button's image icon.void
setShowGripper(boolean showGripper)
Sets the visibility of gripper.void
setVisible(boolean aFlag)
protected void
startDragging(JideSplitPaneDivider divider)
Prepares dragging if it's not continuous layout.void
updateUI()
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
NON_CONTINUOUS_DIVIDER
protected static final java.lang.String NON_CONTINUOUS_DIVIDER
The divider used for non-continuous layout is added to the split pane with this object.- See Also:
- Constant Field Values
-
VERTICAL_SPLIT
public static final int VERTICAL_SPLIT
Vertical split indicates theComponent
s are split along the y axis. For example the two or moreComponent
s will be split one on top of the other.- See Also:
- Constant Field Values
-
HORIZONTAL_SPLIT
public static final int HORIZONTAL_SPLIT
Horizontal split indicates theComponent
s are split along the x axis. For example the two or moreComponent
s will be split one to the left of the other.- See Also:
- Constant Field Values
-
ORIENTATION_PROPERTY
public static final java.lang.String ORIENTATION_PROPERTY
Bound property name for orientation (horizontal or vertical).- See Also:
- Constant Field Values
-
DIVIDER_SIZE_PROPERTY
public static final java.lang.String DIVIDER_SIZE_PROPERTY
Bound property name for border size.- See Also:
- Constant Field Values
-
PROPERTY_DIVIDER_LOCATION
public static final java.lang.String PROPERTY_DIVIDER_LOCATION
Bound property name for border size.- See Also:
- Constant Field Values
-
CONTINUOUS_LAYOUT_PROPERTY
public static final java.lang.String CONTINUOUS_LAYOUT_PROPERTY
Bound property name for continuousLayout.- See Also:
- Constant Field Values
-
GRIPPER_PROPERTY
public static final java.lang.String GRIPPER_PROPERTY
Bound property name for gripper.- See Also:
- Constant Field Values
-
PROPORTIONAL_LAYOUT_PROPERTY
public static final java.lang.String PROPORTIONAL_LAYOUT_PROPERTY
Bound property name for proportional layout.- See Also:
- Constant Field Values
-
PROPORTIONS_PROPERTY
public static final java.lang.String PROPORTIONS_PROPERTY
Bound property name for the proportions used in the layout.- See Also:
- Constant Field Values
-
PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED
public static final java.lang.String PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED
- See Also:
- Constant Field Values
-
_windowDeactivatedListener
public java.awt.event.WindowAdapter _windowDeactivatedListener
-
ONE_TOUCH_EXPANDABLE_PROPERTY
public static final java.lang.String ONE_TOUCH_EXPANDABLE_PROPERTY
Bound property foroneTouchExpandable
.
-
-
Constructor Detail
-
JideSplitPane
public JideSplitPane()
Creates a newJideSplitPane
configured to arrange the child components side-by-side horizontally.
-
JideSplitPane
public JideSplitPane(int newOrientation)
Creates a newJideSplitPane
configured with the specified orientation.- Parameters:
newOrientation
-JideSplitPane.HORIZONTAL_SPLIT
orJideSplitPane.VERTICAL_SPLIT
- Throws:
java.lang.IllegalArgumentException
- iforientation
is not one of HORIZONTAL_SPLIT or VERTICAL_SPLIT.
-
-
Method Detail
-
getDividerStepSize
public int getDividerStepSize()
Get the step size while dragging the divider. The default value of the step size is 0, which means no constraints on the dragging position- Returns:
- the step size.
-
setDividerStepSize
public void setDividerStepSize(int dividerStepSize)
Set the step size while dragging the divider. The step size cannot be negative.- Parameters:
dividerStepSize
- the step size
-
updateUI
public void updateUI()
- Overrides:
updateUI
in classjavax.swing.JPanel
-
setDividerSize
public void setDividerSize(int newSize)
Sets the size of the divider.- Parameters:
newSize
- an integer giving the size of the divider in pixels
-
getDividerSize
public int getDividerSize()
Returns the size of the divider.- Returns:
- an integer giving the size of the divider in pixels
-
insertPane
public java.awt.Component insertPane(java.awt.Component pane, int index)
Inserts the specified pane to this container at the given position. Note: Divider is not counted.- Parameters:
pane
- the pane to be addedindex
- the position at which to insert the component.- Returns:
- the component
pane
-
insertPane
public java.awt.Component insertPane(java.awt.Component pane, java.lang.Object constraint, int index)
Inserts the specified pane to this container at the given position. Note: Divider is not counted.- Parameters:
pane
- the pane to be addedconstraint
- an object expressing layout constraints for this componentindex
- the position at which to insert the component.- Returns:
- the component
pane
-
addPane
public java.awt.Component addPane(java.awt.Component pane)
Adds the specified pane to this container at the end.- Parameters:
pane
- the pane to be added- Returns:
- the pane
pane
-
removePane
public void removePane(java.awt.Component pane)
Removes the pane, specified byindex
, from this container.- Parameters:
pane
- the pane to be removed.
-
setPaneAt
public void setPaneAt(java.awt.Component pane, int index)
Replaces the pane at the position specified by index.- Parameters:
pane
- new paneindex
- position
-
setPaneAt
public void setPaneAt(java.awt.Component pane, java.lang.Object constraint, int index)
Replaces the pane at the position specified by index.- Parameters:
pane
- new paneconstraint
- an object expressing layout constraints for this componentindex
- position
-
removePane
public void removePane(int index)
Removes the pane, specified byindex
, from this container.- Parameters:
index
- the index of the component to be removed.
-
setOrientation
public void setOrientation(int orientation)
Sets the orientation, or how the splitter is divided. The options are:- JideSplitPane.VERTICAL_SPLIT (above/below orientation of components)
- JideSplitPane.HORIZONTAL_SPLIT (left/right orientation of components)
- Parameters:
orientation
- an integer specifying the orientation- Throws:
java.lang.IllegalArgumentException
- if orientation is not one of: HORIZONTAL_SPLIT or VERTICAL_SPLIT.
-
getOrientation
public int getOrientation()
Returns the orientation.- Returns:
- an integer giving the orientation
- See Also:
setOrientation(int)
-
resetToPreferredSizes
public void resetToPreferredSizes()
Lays out theJideSplitPane
layout based on the preferred size children components, or based on the proportions if proportional layout is on. This will likely result in changing the divider location.
-
setProportionalLayout
public void setProportionalLayout(boolean proportionalLayout)
Sets this split pane to lay its constituents out proportionally if the given flag is true, or by preferred sizes otherwise.- Parameters:
proportionalLayout
- true or false.
-
isProportionalLayout
public boolean isProportionalLayout()
Returns the proportional layout flag.- Returns:
- true or false.
-
setProportions
public void setProportions(double[] proportions)
Sets the proportions to use in laying out this split pane's children. Only applicable whenisProportionalLayout()
is true; calling it when false will throw an exception. The given array must either be null, or have one fewer slots than there are contained panes. Each item in the array (if not null) must be a number between 0 and 1, and the sum of all of them must be no more than 1.- Parameters:
proportions
- the proportions of all the panes.
-
getProportions
public double[] getProportions()
Returns the current array of proportions used for proportional layout, or null if none has been established viasetProportions(double[])
or via user action.- Returns:
- the proportions.
-
setInitiallyEven
public void setInitiallyEven(boolean initiallyEven)
Sets the flag telling whether to do even proportions for the initial proportional layout, in the absence of explicit proportions.- Parameters:
initiallyEven
- true or false.
-
isInitiallyEven
public boolean isInitiallyEven()
Returns the flag that tells whether to do even proportions for the initial proportional layout, in the absence of explicit proportions.- Returns:
- true or false.
-
isValidateRoot
public boolean isValidateRoot()
Returns true, so that calls torevalidate
on any descendant of thisJideSplitPane
will cause a request to be queued that will validate theJideSplitPane
and all its descendants.- Overrides:
isValidateRoot
in classjavax.swing.JComponent
- Returns:
- true
- See Also:
JComponent.revalidate()
-
startDragging
protected void startDragging(JideSplitPaneDivider divider)
Prepares dragging if it's not continuous layout. If it's continuous layout, do nothing.- Parameters:
divider
- the divider
-
dragDividerTo
protected void dragDividerTo(JideSplitPaneDivider divider, int location)
Drags divider to right location. If it's continuous layout, really drag the divider; if not, only drag the shadow.- Parameters:
divider
- the dividerlocation
- new location
-
finishDraggingTo
protected void finishDraggingTo(JideSplitPaneDivider divider, int location)
Finishes dragging. If it's not continuous layout, clear up the shadow component.- Parameters:
divider
- the dividerlocation
- new location
-
indexOfDivider
public int indexOfDivider(JideSplitPaneDivider divider)
Returns the index of the divider. For example, the index of the first divider is 0, the index of the second is 1. Notes: Pane is not counted- Parameters:
divider
- divider to get index- Returns:
- index of the divider. -1 if comp doesn't exist in this container
-
indexOfPane
public int indexOfPane(java.awt.Component pane)
Returns the index of the pane. For example, the index of the first pane is 0, the index of the second is 1. Notes: divider is not counted- Parameters:
pane
- pane to get index- Returns:
- index of the pane. -1 if comp doesn't exist in this container
-
indexOf
public int indexOf(java.awt.Component comp)
Returns the index of the component.- Parameters:
comp
- component to get index- Returns:
- index of the comp. -1 if comp doesn't exist in this container
-
getDividerAt
public JideSplitPaneDivider getDividerAt(int index)
Returns the divider at index.- Parameters:
index
- index- Returns:
- the divider at the index
-
getPaneAt
public java.awt.Component getPaneAt(int index)
Returns the component at index.- Parameters:
index
- index- Returns:
- the component at the index
-
getPaneCount
public int getPaneCount()
Gets the count of panes, regardless of dividers.- Returns:
- the count of panes
-
setDividerLocation
public void setDividerLocation(JideSplitPaneDivider divider, int location)
Set the divider location.- Parameters:
divider
- the dividerlocation
- new location
-
setDividerLocation
public void setDividerLocation(int dividerIndex, int location)
Set the divider location. You can only call this method to set the divider location when the component is rendered on the screen. If the component has never been displayed before, this method call has no effect.- Parameters:
dividerIndex
- the divider index, starting from 0 for the first divider.location
- new location
-
getDividerLocation
public int getDividerLocation(int dividerIndex)
Get the divider location. You can only get a valid divider location when the component is displayed on the screen. If the component has never been displayed on screen, -1 will be returned.- Parameters:
dividerIndex
- the divider index- Returns:
- the location of the divider.
-
componentAdded
public void componentAdded(java.awt.event.ContainerEvent e)
Invoked when a component has been added to the container. Basically if you add anything which is not divider, a divider will automatically added before or after the component.- Specified by:
componentAdded
in interfacejava.awt.event.ContainerListener
- Parameters:
e
- ContainerEvent
-
componentRemoved
public void componentRemoved(java.awt.event.ContainerEvent e)
Invoked when a component has been removed from the container. Basically if you remove anything which is not divider, a divider will automatically deleted before or after the component.- Specified by:
componentRemoved
in interfacejava.awt.event.ContainerListener
- Parameters:
e
- ContainerEvent
-
componentResized
public void componentResized(java.awt.event.ComponentEvent e)
- Specified by:
componentResized
in interfacejava.awt.event.ComponentListener
-
componentMoved
public void componentMoved(java.awt.event.ComponentEvent e)
- Specified by:
componentMoved
in interfacejava.awt.event.ComponentListener
-
componentShown
public void componentShown(java.awt.event.ComponentEvent e)
- Specified by:
componentShown
in interfacejava.awt.event.ComponentListener
-
componentHidden
public void componentHidden(java.awt.event.ComponentEvent e)
- Specified by:
componentHidden
in interfacejava.awt.event.ComponentListener
-
removeExtraDividers
protected boolean removeExtraDividers()
Remove extra divider. One is considered as extra dividers where two dividers are adjacent.- Returns:
- true if dividers are removed.
-
removeProportion
protected void removeProportion(int paneIndex)
Removes the proportion at the given pane index, spreading its value proportionally across the other proportions. If it's the last proportion being removed, sets the proportions to null.- Parameters:
paneIndex
- the pane index.
-
addExtraDividers
protected void addExtraDividers()
Add divider if there are two panes side by side without a divider in between.
-
addProportion
protected void addProportion(int paneIndex)
Adds a proportion at the given pane index, taking a proportional amount from each of the existing proportions.- Parameters:
paneIndex
- the pane index.
-
setVisible
public void setVisible(boolean aFlag)
- Overrides:
setVisible
in classjavax.swing.JComponent
-
setDividersVisible
protected void setDividersVisible()
Before this method is call, the panes must be separated by dividers.
-
createSplitPaneDivider
protected JideSplitPaneDivider createSplitPaneDivider()
-
getPreviousDividerLocation
protected int getPreviousDividerLocation(JideSplitPaneDivider divider, boolean ignoreVisibility, boolean reversed)
Get previous divider's, if any, location from current divider. If there is no previous divider, return 0.- Parameters:
divider
- the dividerignoreVisibility
- true to not check if the pane is visible.reversed
- from left to right or reversed.- Returns:
- the location of previous divider if any
-
getNextDividerLocation
public int getNextDividerLocation(JideSplitPaneDivider divider, boolean ignoreVisibility, boolean reversed)
Get previous divider's, if any, location from current divider. If there is no previous divider, return 0.- Parameters:
divider
- the dividerignoreVisibility
- true to not check if the pane is visible.reversed
- from left to right or reversed.- Returns:
- the location of next divider if any
-
isShowGripper
public boolean isShowGripper()
Checks if the gripper is visible.- Returns:
- true if gripper is visible
-
setShowGripper
public void setShowGripper(boolean showGripper)
Sets the visibility of gripper.- Parameters:
showGripper
- true to show gripper
-
doLayout
public void doLayout()
Causes this container to lay out its components. Most programs should not call this method directly, but should invoke thevalidate
method instead.- Overrides:
doLayout
in classjava.awt.Container
- Since:
- JDK1.1
- See Also:
LayoutManager.layoutContainer(java.awt.Container)
,Container.setLayout(java.awt.LayoutManager)
,Container.validate()
-
isContinuousLayout
public boolean isContinuousLayout()
Determines whether the JSplitPane is set to use a continuous layout.- Returns:
- true or false.
-
setContinuousLayout
public void setContinuousLayout(boolean continuousLayout)
Turn continuous layout on/off.- Parameters:
continuousLayout
- true or false.
-
getAccessibleContext
public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JideSplitPane. For split panes, the AccessibleContext takes the form of an AccessibleJideSplitPane. A new AccessibleJideSplitPane instance is created if necessary.- Specified by:
getAccessibleContext
in interfacejavax.accessibility.Accessible
- Overrides:
getAccessibleContext
in classjavax.swing.JPanel
- Returns:
- an AccessibleJideSplitPane that serves as the AccessibleContext of this JideSplitPane
-
isDragResizable
public boolean isDragResizable()
Get the flag indicating if dragging the divider could resize the panes. By default, the value is true for JideSplitPane. You could set it to false if you don't like it.- Returns:
- the flag.
-
setDragResizable
public void setDragResizable(boolean dragResizable)
Set the flag indicating if dragging the divider could resize the panes.- Parameters:
dragResizable
- the flag
-
isHeavyweightComponentEnabled
public boolean isHeavyweightComponentEnabled()
- Returns:
- true if the heavyweight component is enabled.
-
setHeavyweightComponentEnabled
public void setHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)
Enables heavyweight components. The difference is the divider. If true, the divider will be heavyweight divider. Otherwise it will use lightweight divider.- Parameters:
heavyweightComponentEnabled
- true to enable the usage of heavyweight components.
-
setOneTouchExpandable
public void setOneTouchExpandable(boolean oneTouchExpandable)
Sets the value of theoneTouchExpandable
property. Iftrue
, theJSplitPane
will display a UI widget on the divider to quickly expand/collapse the divider.false
.- Parameters:
oneTouchExpandable
-true
to specify that the split pane should provide a collapse/expand widget- See Also:
isOneTouchExpandable()
-
isOneTouchExpandable
public boolean isOneTouchExpandable()
Returns whether one-touch expand/collapse is on.- Returns:
- the value of the
oneTouchExpandable
property - See Also:
setOneTouchExpandable(boolean)
-
setLeftOneTouchButtonImageIcon
public void setLeftOneTouchButtonImageIcon(javax.swing.ImageIcon leftButtonImageIcon)
Sets the left button's image icon. By default, the button has a width of 5 pixels and a height of 10 pixel in HORIZONTAL_SPLIT mode (and a width of 10 pixels and a height of 5 pixel in VERTICAL_SPLIT mode) -- this should be considered when assigning its imageIcon.- Parameters:
leftButtonImageIcon
- the image to be displayed on the left one-touch button
-
getLeftOneTouchButtonImageIcon
public javax.swing.ImageIcon getLeftOneTouchButtonImageIcon()
Gets the left button's image icon.- Returns:
- the imageIcon used displayed on the left one-touch button
-
setRightOneTouchButtonImageIcon
public void setRightOneTouchButtonImageIcon(javax.swing.ImageIcon rightButtonImageIcon)
Sets the right button's image icon. By default, the button has a width of 5 pixels and a height of 10 pixel in HORIZONTAL_SPLIT mode (and a width of 10 pixels and a height of 5 pixel in VERTICAL_SPLIT mode) -- this should be considered when assigning its imageIcon.- Parameters:
rightButtonImageIcon
- the image to be displayed on the right one-touch button
-
getRightOneTouchButtonImageIcon
public javax.swing.ImageIcon getRightOneTouchButtonImageIcon()
Gets the right button's image icon.- Returns:
- the imageIcon used displayed on the left one-touch button
-
setDividerLocations
public void setDividerLocations(int[] locations)
Sets the divider locations.- Parameters:
locations
- the new divider locations.
-
getDividerLocations
public int[] getDividerLocations()
Gets the divider locations.- Returns:
- the divider locations.
-
-