Package org.flexdock.docking.defaults
Class DockingSplitPane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JSplitPane
org.flexdock.docking.defaults.DockingSplitPane
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible,DockingConstants
- Author:
- Christopher Butler
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JSplitPane
JSplitPane.AccessibleJSplitPaneNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected DockingPortprotected doubleprotected doubleprotected StringFields inherited from class javax.swing.JSplitPane
BOTTOM, CONTINUOUS_LAYOUT_PROPERTY, continuousLayout, DIVIDER, DIVIDER_LOCATION_PROPERTY, DIVIDER_SIZE_PROPERTY, dividerSize, HORIZONTAL_SPLIT, LAST_DIVIDER_LOCATION_PROPERTY, lastDividerLocation, LEFT, leftComponent, ONE_TOUCH_EXPANDABLE_PROPERTY, oneTouchExpandable, orientation, ORIENTATION_PROPERTY, RESIZE_WEIGHT_PROPERTY, RIGHT, rightComponent, TOP, VERTICAL_SPLITFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface org.flexdock.docking.DockingConstants
ACTIVE_WINDOW, BOTTOM, CENTER, CENTER_REGION, CLOSE_ACTION, DEFAULT_PERSISTENCE_KEY, DOCKING_ID, EAST_REGION, HEAVYWEIGHT_DOCKABLES, HORIZONTAL, LEFT, MOUSE_PRESSED, NORTH_REGION, PERMANENT_FOCUS_OWNER, PIN_ACTION, REGION, RIGHT, SOUTH_REGION, TOP, UNINITIALIZED, UNINITIALIZED_RATIO, UNKNOWN_REGION, UNSPECIFIED_SIBLING_PREF, VERTICAL, WEST_REGIONFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDockingSplitPane(DockingPort port, String region) Creates a newDockingSplitPanefor the specifiedDockingPortwith the understanding that the resultingDockingSplitPanewill be used for docking aDockableinto theDockingPort'sspecifiedregion. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Releases any internal references to external objects to aid garbage collection.voiddoLayout()Overridden to ensure proper divider location on initial rendering.protected voidfinalize()Returns the 'oldest'Componentto have been added to thisDockingSplitPaneas a result of a docking operation.doubleReturns the docking region for which thisDockingSplitPanewas created.protected booleanbooleanIndicates whether the 'oldest'Componentto have been added to thisDockingSplitPaneas a result of a docking operation is in the TOP or LEFT side of the split pane.voidvoidsetBounds(int x, int y, int w, int h) voidsetConstantPercent(boolean cstPercent) voidsetDividerLocation(double percent) voidsetInitialDividerRatio(double ratio) Sets the initial divider ration for creating split panes.Methods inherited from class javax.swing.JSplitPane
addImpl, getAccessibleContext, getBottomComponent, getDividerLocation, getDividerSize, getLastDividerLocation, getLeftComponent, getMaximumDividerLocation, getMinimumDividerLocation, getOrientation, getResizeWeight, getRightComponent, getTopComponent, getUI, getUIClassID, isContinuousLayout, isOneTouchExpandable, isValidateRoot, paintChildren, paramString, remove, remove, removeAll, setBottomComponent, setContinuousLayout, setDividerLocation, setDividerSize, setLastDividerLocation, setLeftComponent, setOneTouchExpandable, setOrientation, setResizeWeight, setRightComponent, setTopComponent, setUI, updateUIMethods 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, 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, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
dockingPort
-
region
-
dividerLocDetermined
protected boolean dividerLocDetermined -
controllerInTopLeft
protected boolean controllerInTopLeft -
initialDividerRatio
protected double initialDividerRatio -
percent
protected double percent
-
-
Constructor Details
-
DockingSplitPane
Creates a newDockingSplitPanefor the specifiedDockingPortwith the understanding that the resultingDockingSplitPanewill be used for docking aDockableinto theDockingPort'sspecifiedregion. Neitherportorregionmay benull.regionmust be a valid docking region as defined byisValidDockingRegion(String region).- Parameters:
port- theDockingPortfor which thisDockingSplitPaneis to be created.region- the region within the specifiedDockingPortfor which thisDockingSplitPaneis to be created.- See Also:
-
-
Method Details
-
setBounds
public void setBounds(int x, int y, int w, int h) -
setConstantPercent
public void setConstantPercent(boolean cstPercent) -
resetToPreferredSizes
public void resetToPreferredSizes()- Overrides:
resetToPreferredSizesin classJSplitPane
-
setDividerLocation
public void setDividerLocation(double percent) - Overrides:
setDividerLocationin classJSplitPane
-
getPercent
public double getPercent() -
isDividerSizeProperlyDetermined
protected boolean isDividerSizeProperlyDetermined() -
getElderComponent
Returns the 'oldest'Componentto have been added to thisDockingSplitPaneas a result of a docking operation. ADockingSplitPaneis created based upon the need to share space within aDockingPortbetween twoDockables. This happens when a newDockableis introduced into an outer region of aDockingPortthat already contains aDockable. TheDockablethat was in theDockingPortprior to splitting the layout is the 'elder'Componentand, in many circumstances, may be used to control initial divider location and resize weight.If this split pane contains
DockingPortsas its child components, then this method will return theComponentdetermined by callinggetDockedComponent()for theDockingPortin this split pane's elder region.The elder region of this
DockingSplitPaneis determined using the value returned fromgetRegion(), wheregetRegion()indicates the docking region of the 'new'Dockablefor thisDockingSplitPane.- Returns:
- the 'oldest'
Componentto have been added to thisDockingSplitPaneas a result of a docking operation. - See Also:
-
getRegion
Returns the docking region for which thisDockingSplitPanewas created. ADockingSplitPaneis created based upon the need to share space within aDockingPortbetween twoDockables. This happens when a newDockableis introduced into an outer region of aDockingPortthat already contains aDockable. This method returns that outer region for which thisDockingSplitPanewas created and may be used to control the orientation of the split pane. The region returned by this method will be the same passed into theDockingSplitPaneconstructor on instantiation.- Returns:
- the docking region for which this
DockingSplitPanewas created. - See Also:
-
isElderTopLeft
public boolean isElderTopLeft()Indicates whether the 'oldest'Componentto have been added to thisDockingSplitPaneas a result of a docking operation is in the TOP or LEFT side of the split pane. ADockingSplitPaneis created based upon the need to share space within aDockingPortbetween twoDockables. This happens when a newDockableis introduced into an outer region of aDockingPortthat already contains aDockable. TheDockablethat was in theDockingPortprior to splitting the layout is the 'elder'Componentand is returned bygetElderComponent(). This method indicates whether or not thatComponentis in the TOP or LEFT side of thisDockingSplitPane.The elder region of this
DockingSplitPaneis determined using the value returned fromgetRegion(), wheregetRegion()indicates the docking region of the 'new'Dockablefor thisDockingSplitPane.- Returns:
trueif the 'oldest'Componentto have been added to thisDockingSplitPaneis in the TOP or LEFT side of the split pane;falseotherwise.- See Also:
-
doLayout
public void doLayout()Overridden to ensure proper divider location on initial rendering. Sometimes, a split divider location is set as a proportion before the split pane itself has been fully realized in the container hierarchy. This results in a layout calculation based on a proportion of zero width or height, rather than the desired proportion of width or height after the split pane has been fully rendered. This method ensures that defaultJSplitPanelayout behavior is deferred until after the initial dimensions of this split pane have been properly determined. -
cleanup
public void cleanup()Releases any internal references to external objects to aid garbage collection. This method ispublicand may be invoked manually for proactive memory management. Otherwise, this method is invoked by thisDockingSplitPane'sfinalize()method. -
setInitialDividerRatio
public void setInitialDividerRatio(double ratio) Sets the initial divider ration for creating split panes. The default value is0.5.- Parameters:
ratio- a ratio for determining weighting between the two sides of a split pane.- Throws:
IllegalArgumentException- ifratiois less than 0.0 or greater than 1.0.
-
finalize
-