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.AccessibleJideSplitPaneis used to divide multipleComponents. TheseComponents 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 classJideSplitPane.AccessibleJideSplitPaneThis class implements accessibility support for theJideSplitPaneclass.-
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_windowDeactivatedListenerstatic java.lang.StringCONTINUOUS_LAYOUT_PROPERTYBound property name for continuousLayout.static java.lang.StringDIVIDER_SIZE_PROPERTYBound property name for border size.static java.lang.StringGRIPPER_PROPERTYBound property name for gripper.static intHORIZONTAL_SPLITHorizontal split indicates theComponents are split along the x axis.protected static java.lang.StringNON_CONTINUOUS_DIVIDERThe divider used for non-continuous layout is added to the split pane with this object.static java.lang.StringONE_TOUCH_EXPANDABLE_PROPERTYBound property foroneTouchExpandable.static java.lang.StringORIENTATION_PROPERTYBound property name for orientation (horizontal or vertical).static java.lang.StringPROPERTY_DIVIDER_LOCATIONBound property name for border size.static java.lang.StringPROPERTY_HEAVYWEIGHT_COMPONENT_ENABLEDstatic java.lang.StringPROPORTIONAL_LAYOUT_PROPERTYBound property name for proportional layout.static java.lang.StringPROPORTIONS_PROPERTYBound property name for the proportions used in the layout.static intVERTICAL_SPLITVertical split indicates theComponents 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 newJideSplitPaneconfigured to arrange the child components side-by-side horizontally.JideSplitPane(int newOrientation)Creates a newJideSplitPaneconfigured with the specified orientation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddExtraDividers()Add divider if there are two panes side by side without a divider in between.java.awt.ComponentaddPane(java.awt.Component pane)Adds the specified pane to this container at the end.protected voidaddProportion(int paneIndex)Adds a proportion at the given pane index, taking a proportional amount from each of the existing proportions.voidcomponentAdded(java.awt.event.ContainerEvent e)Invoked when a component has been added to the container.voidcomponentHidden(java.awt.event.ComponentEvent e)voidcomponentMoved(java.awt.event.ComponentEvent e)voidcomponentRemoved(java.awt.event.ContainerEvent e)Invoked when a component has been removed from the container.voidcomponentResized(java.awt.event.ComponentEvent e)voidcomponentShown(java.awt.event.ComponentEvent e)protected JideSplitPaneDividercreateSplitPaneDivider()voiddoLayout()Causes this container to lay out its components.protected voiddragDividerTo(JideSplitPaneDivider divider, int location)Drags divider to right location.protected voidfinishDraggingTo(JideSplitPaneDivider divider, int location)Finishes dragging.javax.accessibility.AccessibleContextgetAccessibleContext()Gets the AccessibleContext associated with this JideSplitPane.JideSplitPaneDividergetDividerAt(int index)Returns the divider at index.intgetDividerLocation(int dividerIndex)Get the divider location.int[]getDividerLocations()Gets the divider locations.intgetDividerSize()Returns the size of the divider.intgetDividerStepSize()Get the step size while dragging the divider.javax.swing.ImageIcongetLeftOneTouchButtonImageIcon()Gets the left button's image icon.intgetNextDividerLocation(JideSplitPaneDivider divider, boolean ignoreVisibility, boolean reversed)Get previous divider's, if any, location from current divider.intgetOrientation()Returns the orientation.java.awt.ComponentgetPaneAt(int index)Returns the component at index.intgetPaneCount()Gets the count of panes, regardless of dividers.protected intgetPreviousDividerLocation(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.ImageIcongetRightOneTouchButtonImageIcon()Gets the right button's image icon.intindexOf(java.awt.Component comp)Returns the index of the component.intindexOfDivider(JideSplitPaneDivider divider)Returns the index of the divider.intindexOfPane(java.awt.Component pane)Returns the index of the pane.java.awt.ComponentinsertPane(java.awt.Component pane, int index)Inserts the specified pane to this container at the given position.java.awt.ComponentinsertPane(java.awt.Component pane, java.lang.Object constraint, int index)Inserts the specified pane to this container at the given position.booleanisContinuousLayout()Determines whether the JSplitPane is set to use a continuous layout.booleanisDragResizable()Get the flag indicating if dragging the divider could resize the panes.booleanisHeavyweightComponentEnabled()booleanisInitiallyEven()Returns the flag that tells whether to do even proportions for the initial proportional layout, in the absence of explicit proportions.booleanisOneTouchExpandable()Returns whether one-touch expand/collapse is on.booleanisProportionalLayout()Returns the proportional layout flag.booleanisShowGripper()Checks if the gripper is visible.booleanisValidateRoot()Returns true, so that calls torevalidateon any descendant of thisJideSplitPanewill cause a request to be queued that will validate theJideSplitPaneand all its descendants.protected booleanremoveExtraDividers()Remove extra divider.voidremovePane(int index)Removes the pane, specified byindex, from this container.voidremovePane(java.awt.Component pane)Removes the pane, specified byindex, from this container.protected voidremoveProportion(int paneIndex)Removes the proportion at the given pane index, spreading its value proportionally across the other proportions.voidresetToPreferredSizes()Lays out theJideSplitPanelayout based on the preferred size children components, or based on the proportions if proportional layout is on.voidsetContinuousLayout(boolean continuousLayout)Turn continuous layout on/off.voidsetDividerLocation(int dividerIndex, int location)Set the divider location.voidsetDividerLocation(JideSplitPaneDivider divider, int location)Set the divider location.voidsetDividerLocations(int[] locations)Sets the divider locations.voidsetDividerSize(int newSize)Sets the size of the divider.voidsetDividerStepSize(int dividerStepSize)Set the step size while dragging the divider.protected voidsetDividersVisible()Before this method is call, the panes must be separated by dividers.voidsetDragResizable(boolean dragResizable)Set the flag indicating if dragging the divider could resize the panes.voidsetHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)Enables heavyweight components.voidsetInitiallyEven(boolean initiallyEven)Sets the flag telling whether to do even proportions for the initial proportional layout, in the absence of explicit proportions.voidsetLeftOneTouchButtonImageIcon(javax.swing.ImageIcon leftButtonImageIcon)Sets the left button's image icon.voidsetOneTouchExpandable(boolean oneTouchExpandable)Sets the value of theoneTouchExpandableproperty.voidsetOrientation(int orientation)Sets the orientation, or how the splitter is divided.voidsetPaneAt(java.awt.Component pane, int index)Replaces the pane at the position specified by index.voidsetPaneAt(java.awt.Component pane, java.lang.Object constraint, int index)Replaces the pane at the position specified by index.voidsetProportionalLayout(boolean proportionalLayout)Sets this split pane to lay its constituents out proportionally if the given flag is true, or by preferred sizes otherwise.voidsetProportions(double[] proportions)Sets the proportions to use in laying out this split pane's children.voidsetRightOneTouchButtonImageIcon(javax.swing.ImageIcon rightButtonImageIcon)Sets the right button's image icon.voidsetShowGripper(boolean showGripper)Sets the visibility of gripper.voidsetVisible(boolean aFlag)protected voidstartDragging(JideSplitPaneDivider divider)Prepares dragging if it's not continuous layout.voidupdateUI()-
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 theComponents are split along the y axis. For example the two or moreComponents 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 theComponents are split along the x axis. For example the two or moreComponents 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 newJideSplitPaneconfigured to arrange the child components side-by-side horizontally.
-
JideSplitPane
public JideSplitPane(int newOrientation)
Creates a newJideSplitPaneconfigured with the specified orientation.- Parameters:
newOrientation-JideSplitPane.HORIZONTAL_SPLITorJideSplitPane.VERTICAL_SPLIT- Throws:
java.lang.IllegalArgumentException- iforientationis 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:
updateUIin 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 theJideSplitPanelayout 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 torevalidateon any descendant of thisJideSplitPanewill cause a request to be queued that will validate theJideSplitPaneand all its descendants.- Overrides:
isValidateRootin 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:
componentAddedin 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:
componentRemovedin interfacejava.awt.event.ContainerListener- Parameters:
e- ContainerEvent
-
componentResized
public void componentResized(java.awt.event.ComponentEvent e)
- Specified by:
componentResizedin interfacejava.awt.event.ComponentListener
-
componentMoved
public void componentMoved(java.awt.event.ComponentEvent e)
- Specified by:
componentMovedin interfacejava.awt.event.ComponentListener
-
componentShown
public void componentShown(java.awt.event.ComponentEvent e)
- Specified by:
componentShownin interfacejava.awt.event.ComponentListener
-
componentHidden
public void componentHidden(java.awt.event.ComponentEvent e)
- Specified by:
componentHiddenin 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:
setVisiblein 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 thevalidatemethod instead.- Overrides:
doLayoutin 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:
getAccessibleContextin interfacejavax.accessibility.Accessible- Overrides:
getAccessibleContextin 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 theoneTouchExpandableproperty. Iftrue, theJSplitPanewill display a UI widget on the divider to quickly expand/collapse the divider.
The default value of this property isfalse.
Please note: Some look and feels might not support one-touch expanding; they will ignore this property.- Parameters:
oneTouchExpandable-trueto 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
oneTouchExpandableproperty - 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.
-
-