This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.plaf.basic
class BasicSplitPaneDivider

java.lang.Object extended by java.awt.Component extended by java.awt.Container extended by javax.swing.plaf.basic.BasicSplitPaneDivider
All Implemented Interfaces:
MenuContainer, ImageObserver, PropertyChangeListener, Serializable

public class BasicSplitPaneDivider
extends Container
implements PropertyChangeListener

Divider used by BasicSplitPaneUI. Subclassers may wish to override paint to do something more interesting. The border effect is drawn in BasicSplitPaneUI, so if you don't like that border, reset it there. To conditionally drag from certain areas subclass mousePressed and call super when you wish the dragging to begin.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}.


Nested Class Summary
protected class

           Used to layout a BasicSplitPaneDivider.
protected class

           Handles the events during a dragging session for a HORIZONTAL_SPLIT oriented split pane.
protected class

           MouseHandler is responsible for converting mouse events (released, dragged...) into the appropriate DragController methods.
protected class

           Handles the events during a dragging session for a VERTICAL_SPLIT oriented split pane.
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
   
Field Summary
protected int dividerSize
          Size of the divider.
protected BasicSplitPaneDivider.DragController dragger
          Handles mouse dragging message to do the actual dragging.
protected Component hiddenDivider
          Divider that is used for noncontinuous layout mode.
protected JButton leftButton
          Button for quickly toggling the left component.
protected BasicSplitPaneDivider.MouseHandler mouseHandler
          Handles mouse events from both this class, and the split pane.
protected static int ONE_TOUCH_OFFSET
          
protected static int ONE_TOUCH_SIZE
          Width or height of the divider based on orientation BasicSplitPaneUI adds two to this.
protected int orientation
          Orientation of the JSplitPane.
protected JButton rightButton
          Button for quickly toggling the right component.
protected JSplitPane splitPane
          JSplitPane the receiver is contained in.
protected BasicSplitPaneUI splitPaneUI
          UI this instance was created from.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary

          Creates an instance of BasicSplitPaneDivider.
 
Method Summary
protected JButton

          Creates and return an instance of JButton that can be used to collapse the left component in the split pane.
protected JButton

          Creates and return an instance of JButton that can be used to collapse the right component in the split pane.
protected void
dragDividerTo(int location)

          Messages the BasicSplitPaneUI with dragDividerTo that this instance is contained in.
protected void
finishDraggingTo(int location)

          Messages the BasicSplitPaneUI with finishDraggingTo that this instance is contained in.
 BasicSplitPaneUI

          Returns the SplitPaneUI the receiver is currently in.
 Border

          Returns the border of this component or null if no border is currently set.
 int

          Returns the size of the divider, that is the width if the splitpane is HORIZONTAL_SPLIT, or the height of VERTICAL_SPLIT.
 Insets

          If a border has been set on this component, returns the border's insets, else calls super.getInsets.
 Dimension

          Returns dividerSize x dividerSize
 Dimension

          Returns dividerSize x dividerSize
 boolean

          Returns whether or not the mouse is currently over the divider
protected void

          Messaged when the oneTouchExpandable value of the JSplitPane the receiver is contained in changes.
 void

          Paints the divider.
protected void

          Message to prepare for dragging.
 void

          Property change event, presumably from the JSplitPane, will message updateOrientation if necessary.
 void

          Sets the SplitPaneUI that is using the receiver.
 void
setBorder(Border border)

          Sets the border of this component.
 void
setDividerSize(int newSize)

          Sets the size of the divider to newSize.
protected void
setMouseOver(boolean mouseOver)

          Sets whether or not the mouse is currently over the divider.
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dividerSize

protected int dividerSize
Size of the divider.

dragger

protected BasicSplitPaneDivider.DragController dragger
Handles mouse dragging message to do the actual dragging.

hiddenDivider

protected Component hiddenDivider
Divider that is used for noncontinuous layout mode.

leftButton

protected JButton leftButton
Button for quickly toggling the left component.

mouseHandler

protected BasicSplitPaneDivider.MouseHandler mouseHandler
Handles mouse events from both this class, and the split pane. Mouse events are handled for the splitpane since you want to be able to drag when clicking on the border of the divider, which is not drawn by the divider.

ONE_TOUCH_OFFSET

protected static final int ONE_TOUCH_OFFSET

ONE_TOUCH_SIZE

protected static final int ONE_TOUCH_SIZE
Width or height of the divider based on orientation BasicSplitPaneUI adds two to this.

orientation

protected int orientation
Orientation of the JSplitPane.

rightButton

protected JButton rightButton
Button for quickly toggling the right component.

splitPane

protected JSplitPane splitPane
JSplitPane the receiver is contained in.

splitPaneUI

protected BasicSplitPaneUI splitPaneUI
UI this instance was created from.
Constructor Detail

BasicSplitPaneDivider

public BasicSplitPaneDivider(BasicSplitPaneUI ui)
Creates an instance of BasicSplitPaneDivider. Registers this instance for mouse events and mouse dragged events.

Parameters:
ui
Method Detail

createLeftOneTouchButton

protected JButton createLeftOneTouchButton()
Creates and return an instance of JButton that can be used to collapse the left component in the split pane.


createRightOneTouchButton

protected JButton createRightOneTouchButton()
Creates and return an instance of JButton that can be used to collapse the right component in the split pane.


dragDividerTo

protected void dragDividerTo(int location)
Messages the BasicSplitPaneUI with dragDividerTo that this instance is contained in.

Parameters:
location

finishDraggingTo

protected void finishDraggingTo(int location)
Messages the BasicSplitPaneUI with finishDraggingTo that this instance is contained in.

Parameters:
location

getBasicSplitPaneUI

public BasicSplitPaneUI getBasicSplitPaneUI()
Returns the SplitPaneUI the receiver is currently in.


getBorder

public Border getBorder()
Returns the border of this component or null if no border is currently set.

Returns:
the border object for this component

getDividerSize

public int getDividerSize()
Returns the size of the divider, that is the width if the splitpane is HORIZONTAL_SPLIT, or the height of VERTICAL_SPLIT.


getInsets

public Insets getInsets()
If a border has been set on this component, returns the border's insets, else calls super.getInsets.

Overrides:
getInsets in class Container
Returns:
the value of the insets property.

getMinimumSize

public Dimension getMinimumSize()
Returns dividerSize x dividerSize

Overrides:
getMinimumSize in class Container

getPreferredSize

public Dimension getPreferredSize()
Returns dividerSize x dividerSize

Overrides:
getPreferredSize in class Container

isMouseOver

public boolean isMouseOver()
Returns whether or not the mouse is currently over the divider

Returns:
whether or not the mouse is currently over the divider

oneTouchExpandableChanged

protected void oneTouchExpandableChanged()
Messaged when the oneTouchExpandable value of the JSplitPane the receiver is contained in changes. Will create the leftButton and rightButton if they are null. invalidates the receiver as well.


paint

public void paint(Graphics g)
Paints the divider.

Overrides:
paint in class Container
Parameters:
g

prepareForDragging

protected void prepareForDragging()
Message to prepare for dragging. This messages the BasicSplitPaneUI with startDragging.


propertyChange

public void propertyChange(PropertyChangeEvent e)
Property change event, presumably from the JSplitPane, will message updateOrientation if necessary.

Parameters:
e

setBasicSplitPaneUI

public void setBasicSplitPaneUI(BasicSplitPaneUI newUI)
Sets the SplitPaneUI that is using the receiver.

Parameters:
newUI

setBorder

public void setBorder(Border border)
Sets the border of this component.

Parameters:
border

setDividerSize

public void setDividerSize(int newSize)
Sets the size of the divider to newSize. That is the width if the splitpane is HORIZONTAL_SPLIT, or the height of VERTICAL_SPLIT.

Parameters:
newSize

setMouseOver

protected void setMouseOver(boolean mouseOver)
Sets whether or not the mouse is currently over the divider.

Parameters:
mouseOver - whether or not the mouse is currently over the divider


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.