Home » openjdk-7 » javax » swing » plaf » basic » [javadoc | source]
javax.swing.plaf.basic
public class: BasicSplitPaneDivider [javadoc | source]
java.lang.Object
   Container
      javax.swing.plaf.basic.BasicSplitPaneDivider

All Implemented Interfaces:
    PropertyChangeListener

Direct Known Subclasses:
    MetalSplitPaneDivider, SynthSplitPaneDivider

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 java.beans.XMLEncoder .

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

 

protected class  BasicSplitPaneDivider.DragController  Handles the events during a dragging session for a HORIZONTAL_SPLIT oriented split pane. This continually messages dragDividerTo and then when done messages finishDraggingTo. When an instance is created it should be messaged with isValid to insure that dragging can happen (dragging won't be allowed if the two views can not be resized).

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}. 

protected class  BasicSplitPaneDivider.VerticalDragController  Handles the events during a dragging session for a VERTICAL_SPLIT oriented split pane. This continually messages dragDividerTo and then when done messages finishDraggingTo. When an instance is created it should be messaged with isValid to insure that dragging can happen (dragging won't be allowed if the two views can not be resized). 
protected class  BasicSplitPaneDivider.DividerLayout  Used to layout a BasicSplitPaneDivider. Layout for the divider involves appropriately moving the left/right buttons around.

 

Field Summary
protected static final  int ONE_TOUCH_SIZE    Width or height of the divider based on orientation BasicSplitPaneUI adds two to this. 
protected static final  int ONE_TOUCH_OFFSET     
protected  DragController dragger    Handles mouse dragging message to do the actual dragging. 
protected  BasicSplitPaneUI splitPaneUI    UI this instance was created from. 
protected  int dividerSize    Size of the divider. 
protected  Component hiddenDivider    Divider that is used for noncontinuous layout mode. 
protected  JSplitPane splitPane    JSplitPane the receiver is contained in. 
protected  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. 
protected  int orientation    Orientation of the JSplitPane. 
protected  JButton leftButton    Button for quickly toggling the left component. 
protected  JButton rightButton    Button for quickly toggling the right component. 
Constructor:
 public BasicSplitPaneDivider(BasicSplitPaneUI ui) 
    Creates an instance of BasicSplitPaneDivider. Registers this instance for mouse events and mouse dragged events.
Method from javax.swing.plaf.basic.BasicSplitPaneDivider Summary:
createLeftOneTouchButton,   createRightOneTouchButton,   dragDividerTo,   finishDraggingTo,   getBasicSplitPaneUI,   getBorder,   getDividerSize,   getInsets,   getMinimumSize,   getPreferredSize,   isMouseOver,   oneTouchExpandableChanged,   paint,   prepareForDragging,   propertyChange,   setBasicSplitPaneUI,   setBorder,   setDividerSize,   setMouseOver
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.plaf.basic.BasicSplitPaneDivider Detail:
 protected JButton createLeftOneTouchButton() 
    Creates and return an instance of JButton that can be used to collapse the left component in the split pane.
 protected JButton createRightOneTouchButton() 
    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.
 public BasicSplitPaneUI getBasicSplitPaneUI() 
    Returns the SplitPaneUI the receiver is currently in.
 public Border getBorder() 
    Returns the border of this component or null if no border is currently set.
 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.
 public Insets getInsets() 
    If a border has been set on this component, returns the border's insets, else calls super.getInsets.
 public Dimension getMinimumSize() 
    Returns dividerSize x dividerSize
 public Dimension getPreferredSize() 
    Returns dividerSize x dividerSize
 public boolean isMouseOver() 
    Returns whether or not the mouse is currently over the divider
 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.
 public  void paint(Graphics g) 
    Paints the divider.
 protected  void prepareForDragging() 
    Message to prepare for dragging. This messages the BasicSplitPaneUI with startDragging.
 public  void propertyChange(PropertyChangeEvent e) 
    Property change event, presumably from the JSplitPane, will message updateOrientation if necessary.
 public  void setBasicSplitPaneUI(BasicSplitPaneUI newUI) 
    Sets the SplitPaneUI that is using the receiver.
 public  void setBorder(Border border) 
    Sets the border of this component.
 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.
 protected  void setMouseOver(boolean mouseOver) 
    Sets whether or not the mouse is currently over the divider.