public class JideSplitPaneDivider
extends javax.swing.JPanel
implements java.beans.PropertyChangeListener
Modifier and Type | Class and Description |
---|---|
protected class |
JideSplitPaneDivider.DragController
Handles the events during a dragging session for a HORIZONTAL_SPLIT oriented split pane.
|
protected class |
JideSplitPaneDivider.MouseHandler
MouseHandler is responsible for converting mouse events (released, dragged...) into the appropriate
DragController methods.
|
protected class |
JideSplitPaneDivider.OneTouchActionHandler
The actionListener that will listen for button presses on either the leftButton or the rightButton.
|
protected class |
JideSplitPaneDivider.VerticalDragController
Handles the events during a dragging session for a VERTICAL_SPLIT oriented split pane.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected int |
_dividerSize
Size of the divider.
|
protected JideSplitPaneDivider.DragController |
_dragger
Handles mouse dragging message to do the actual dragging.
|
protected JideSplitPane |
_jideSplitPane
JideSplitPane the receiver is contained in.
|
protected javax.swing.JButton |
_leftButton
Button for quickly toggling the left component.
|
protected JideSplitPaneDivider.MouseHandler |
_mouseHandler
Handles mouse events from both this class, and the split pane.
|
protected int |
_orientation
Orientation of the JideSplitPane.
|
protected javax.swing.JButton |
_rightButton
Button for quickly toggling the right component.
|
static int |
COLLAPSED_STATE
Indicates that the pane of the left of this component has been collapse by the one-touch button.
|
static int |
DEFAULT_STATE
Indicates that this divider has not been expanded or collapsed.
|
static int |
EXPANDED_STATE
Indicates that the pane of the right of this component has been collapse by the one-touch button.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
JideSplitPaneDivider(JideSplitPane splitPane)
Creates an instance of BasicJideSplitPaneDivider.
|
Modifier and Type | Method and Description |
---|---|
void |
collapse()
Collapses the divider to the left side (or to the top if vertically).
|
protected javax.swing.JButton |
createLeftOneTouchButton()
Builds the Button that can be used to collapse the component to the left/above this divider.
|
protected JideSplitPaneDivider.MouseHandler |
createMouseHandler() |
protected javax.swing.JButton |
createRightOneTouchButton()
Builds the rightButton that can be used to expand/collapse a split panes divider to the right.
|
protected void |
dragDividerTo(int location) |
void |
expand()
Expands the divider to the right side (or to the bottom if vertically).
|
protected void |
finishDraggingTo(int location) |
protected java.awt.Color |
getDarkShadowColor()
Returns a dark shadow color.
|
int |
getDividerSize()
Returns the size of the divider, that is the width if the split pane is HORIZONTAL_SPLIT, or the height of
VERTICAL_SPLIT.
|
java.awt.Component |
getFirstComponent(boolean ignoreVisibility)
Gets the first component.
|
JideSplitPane |
getJideSplitPane()
Gets the
JideSplitPane . |
java.awt.Dimension |
getMinimumSize()
Returns dividerSize x dividerSize
|
protected int |
getNextDividerLocation(boolean ignoreVisibility,
boolean reversed) |
java.awt.Dimension |
getPreferredSize()
Returns dividerSize x dividerSize
|
protected int |
getPreviousDividerLocation(boolean ignoreVisibility,
boolean reversed) |
java.awt.Component |
getSecondComponent(boolean ignoreVisibility)
Gets the second component.
|
protected void |
oneTouchExpandableChanged()
Invoked when the oneTouchExpandable value of the JideSplitPane changes.
|
void |
paintComponent(java.awt.Graphics g)
Paints the divider.
|
protected void |
prepareForDragging()
Message to prepare for dragging.
|
void |
propertyChange(java.beans.PropertyChangeEvent e)
Property change event, presumably from the JideSplitPane, will message updateOrientation if necessary.
|
void |
setDefaultResizeCursor() |
void |
setDividerSize(int newSize)
Sets the size of the divider to
newSize . |
void |
setJideSplitPane(JideSplitPane splitPane)
Sets the JideSplitPane that is using this divider.
|
void |
updateUI()
Resets the UI property to a value from the current look and feel.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI
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, getNextFocusableComponent, getPopupLocation, 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, isValidateRoot, paint, paintBorder, paintChildren, 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, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected JideSplitPaneDivider.DragController _dragger
protected int _dividerSize
protected JideSplitPane _jideSplitPane
protected JideSplitPaneDivider.MouseHandler _mouseHandler
protected int _orientation
public static final int COLLAPSED_STATE
public static final int DEFAULT_STATE
public static final int EXPANDED_STATE
protected javax.swing.JButton _leftButton
protected javax.swing.JButton _rightButton
public JideSplitPaneDivider(JideSplitPane splitPane)
splitPane
- the JideSplitPane.public void setDefaultResizeCursor()
public JideSplitPane getJideSplitPane()
JideSplitPane
.JideSplitPane
public void setJideSplitPane(JideSplitPane splitPane)
splitPane
- the JideSplitPane.protected JideSplitPaneDivider.MouseHandler createMouseHandler()
public void setDividerSize(int newSize)
newSize
. That is the width if the split pane is
HORIZONTAL_SPLIT
, or the height of VERTICAL_SPLIT
.newSize
- the new divider size.public int getDividerSize()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
public void updateUI()
JComponent
subclasses must
override this method like this:
public void updateUI() { setUI((SliderUI)UIManager.getUI(this); }
updateUI
in class javax.swing.JPanel
JPanel.setUI(javax.swing.plaf.PanelUI)
,
UIManager.getLookAndFeel()
,
UIManager.getUI(javax.swing.JComponent)
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
protected void prepareForDragging()
protected void dragDividerTo(int location)
protected void finishDraggingTo(int location)
protected int getPreviousDividerLocation(boolean ignoreVisibility, boolean reversed)
protected int getNextDividerLocation(boolean ignoreVisibility, boolean reversed)
public java.awt.Component getFirstComponent(boolean ignoreVisibility)
ignoreVisibility
- true to not check if the component is visible.public java.awt.Component getSecondComponent(boolean ignoreVisibility)
ignoreVisibility
- true to not check if the component is visible.protected void oneTouchExpandableChanged()
Responsible for creating the one-touch buttons and revalidating the UI. #see JideSplitePane#setOneTouchExpandable(boolean)
protected javax.swing.JButton createLeftOneTouchButton()
protected javax.swing.JButton createRightOneTouchButton()
protected java.awt.Color getDarkShadowColor()
public void collapse()
public void expand()