APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicSplitPaneDivider

extends Container
implements PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener
Known Direct Subclasses
javax.swing.plaf.metal.MetalSplitPaneDivider, javax.swing.plaf.synth.SynthSplitPaneDivider, com.sun.java.swing.plaf.motif.MotifSplitPaneDivider
Annotations
@SuppressWarnings:serial
Imports
java.awt.*, java.awt.event.*, javax.swing.*, javax.swing.event.*, javax.swing.plaf.*, javax.swing.border.Border, java.beans.*, sun.swing.DefaultLookup

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 JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Scott Violet

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
BasicSplitPaneDivider.DividerLayout

Used to layout a BasicSplitPaneDivider.

protected class
BasicSplitPaneDivider.DragController

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

protected class
BasicSplitPaneDivider.MouseHandler

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

private class
BasicSplitPaneDivider.OneTouchActionHandler

Listeners installed on the one touch expandable buttons.

protected class
BasicSplitPaneDivider.VerticalDragController

Handles the events during a dragging session for a VERTICAL_SPLIT oriented split pane.

Field Summary

Modifier and TypeField and Description
private Border
border

Border.

private boolean
centerOneTouchButtons

If true the one touch buttons are centered on the divider.

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.

private boolean
mouseOver

Is the mouse over the divider?

protected static final int
ONE_TOUCH_OFFSET

The offset of the divider.

protected static final int
ONE_TOUCH_SIZE

Width or height of the divider based on orientation BasicSplitPaneUI adds two to this.

private int
private int
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.

Constructor Summary

AccessConstructor and Description
public
BasicSplitPaneDivider(BasicSplitPaneUI
an instance of BasicSplitPaneUI
ui
)

Creates an instance of BasicSplitPaneDivider.

Method Summary

Modifier and TypeMethod and Description
protected JButton

Returns:

an instance of JButton
createLeftOneTouchButton
()

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

protected JButton

Returns:

an instance of 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
a location
location
)

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

protected void
finishDraggingTo(int
a location
location
)

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

public BasicSplitPaneUI

Returns:

the SplitPaneUI the receiver is currently in
getBasicSplitPaneUI
()

Returns the SplitPaneUI the receiver is currently in.

public Border

Returns:

the border object for this component
getBorder
()

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

public int

Returns:

the size of the divider
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

Returns:

the value of the insets property.
getInsets
()

Overrides java.awt.Container.getInsets.

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

public Dimension

Returns:

a Dimension object containing the minimum size of BasicSplitPaneDivider
getMinimumSize
()

Overrides java.awt.Container.getMinimumSize.

Returns the minimum size of the divider.

public Dimension

Returns:

a Dimension object containing the preferred size of BasicSplitPaneDivider
getPreferredSize
()

Overrides java.awt.Container.getPreferredSize.

Returns the preferred size of the divider.

public boolean

Returns:

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

Returns whether or not the mouse is currently over the divider

protected void
oneTouchExpandableChanged()

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

public void
paint(Graphics g)

Overrides java.awt.Container.paint.

Paints the divider.

protected void
prepareForDragging()

Message to prepare for dragging.

public void
propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

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

private void
public void
setBasicSplitPaneUI(BasicSplitPaneUI
the new SplitPaneUI
newUI
)

Sets the SplitPaneUI that is using the receiver.

public void
setBorder(Border
a new border
border
)

Sets the border of this component.

public void
setDividerSize(int
a new size
newSize
)

Sets the size of the divider to newSize.

public void
setEnabled(boolean enabled)

Overrides java.awt.Component.setEnabled.

Enables or disables this component, depending on the value of the parameter b.

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

Sets whether or not the mouse is currently over the divider.

Inherited from java.awt.Container:
addaddaddaddaddaddContainerListeneraddImpladdNotifyaddPropertyChangeListeneraddPropertyChangeListenerapplyComponentOrientationareFocusTraversalKeysSetcountComponentsdeliverEventdoLayoutfindComponentAtfindComponentAtgetAlignmentXgetAlignmentYgetComponentgetComponentAtgetComponentAtgetComponentCountgetComponentsgetComponentZOrdergetContainerListenersgetFocusTraversalKeysgetFocusTraversalPolicygetLayoutgetListenersgetMaximumSizegetMousePositioninsetsinvalidateisAncestorOfisFocusCycleRootisFocusCycleRootisFocusTraversalPolicyProviderisFocusTraversalPolicySetisValidateRootlayoutlistlistlocateminimumSizepaintComponentsparamStringpreferredSizeprintprintComponentsprocessContainerEventprocessEventremoveremoveremoveAllremoveContainerListenerremoveNotifysetComponentZOrdersetFocusCycleRootsetFocusTraversalKeyssetFocusTraversalPolicysetFocusTraversalPolicyProvidersetFontsetLayouttransferFocusDownCycleupdatevalidatevalidateTree

Field Detail

borderback to summary
private Border border

Border.

centerOneTouchButtonsback to summary
private boolean centerOneTouchButtons

If true the one touch buttons are centered on the divider.

dividerSizeback to summary
protected int dividerSize

Size of the divider.

draggerback to summary
protected BasicSplitPaneDivider.DragController dragger

Handles mouse dragging message to do the actual dragging.

hiddenDividerback to summary
protected Component hiddenDivider

Divider that is used for noncontinuous layout mode.

leftButtonback to summary
protected JButton leftButton

Button for quickly toggling the left component.

mouseHandlerback to summary
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.

mouseOverback to summary
private boolean mouseOver

Is the mouse over the divider?

ONE_TOUCH_OFFSETback to summary
protected static final int ONE_TOUCH_OFFSET

The offset of the divider.

ONE_TOUCH_SIZEback to summary
protected static final int ONE_TOUCH_SIZE

Width or height of the divider based on orientation BasicSplitPaneUI adds two to this.

oneTouchOffsetback to summary
private int oneTouchOffset
oneTouchSizeback to summary
private int oneTouchSize
orientationback to summary
protected int orientation

Orientation of the JSplitPane.

rightButtonback to summary
protected JButton rightButton

Button for quickly toggling the right component.

splitPaneback to summary
protected JSplitPane splitPane

JSplitPane the receiver is contained in.

splitPaneUIback to summary
protected BasicSplitPaneUI splitPaneUI

UI this instance was created from.

Constructor Detail

BasicSplitPaneDividerback to summary
public BasicSplitPaneDivider(BasicSplitPaneUI ui)

Creates an instance of BasicSplitPaneDivider. Registers this instance for mouse events and mouse dragged events.

Parameters
ui:BasicSplitPaneUI

an instance of BasicSplitPaneUI

Method Detail

createLeftOneTouchButtonback to summary
protected JButton createLeftOneTouchButton()

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

Returns:JButton

an instance of JButton

createRightOneTouchButtonback to summary
protected JButton createRightOneTouchButton()

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

Returns:JButton

an instance of JButton

dragDividerToback to summary
protected void dragDividerTo(int location)

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

Parameters
location:int

a location

finishDraggingToback to summary
protected void finishDraggingTo(int location)

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

Parameters
location:int

a location

getBasicSplitPaneUIback to summary
public BasicSplitPaneUI getBasicSplitPaneUI()

Returns the SplitPaneUI the receiver is currently in.

Returns:BasicSplitPaneUI

the SplitPaneUI the receiver is currently in

getBorderback to summary
public Border getBorder()

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

Returns:Border

the border object for this component

Since
1.3
See Also
setBorder
getDividerSizeback to summary
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.

Returns:int

the size of the divider

getInsetsback to summary
public Insets getInsets()

Overrides java.awt.Container.getInsets.

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

Returns:Insets

the value of the insets property.

See Also
setBorder
getMinimumSizeback to summary
public Dimension getMinimumSize()

Overrides java.awt.Container.getMinimumSize.

Returns the minimum size of the divider.

Implementation Note

In current implementation, if the splitpane is HORIZONTAL_SPLIT, the minimum size is obtained from width of getDividerSize pixels and height of 1 pixel If the splitpane is VERTICAL_SPLIT, the minimum size is obtained from height of getDividerSize pixels and width of 1 pixel

Returns:Dimension

a Dimension object containing the minimum size of BasicSplitPaneDivider

getPreferredSizeback to summary
public Dimension getPreferredSize()

Overrides java.awt.Container.getPreferredSize.

Returns the preferred size of the divider.

Implementation Note

In current implementation, if the splitpane is HORIZONTAL_SPLIT, the preferred size is obtained from width of getDividerSize pixels and height of 1 pixel If the splitpane is VERTICAL_SPLIT, the preferred size is obtained from height of getDividerSize pixels and width of 1 pixel

Returns:Dimension

a Dimension object containing the preferred size of BasicSplitPaneDivider

isMouseOverback to summary
public boolean isMouseOver()

Returns whether or not the mouse is currently over the divider

Returns:boolean

whether or not the mouse is currently over the divider

Since
1.5
oneTouchExpandableChangedback to summary
protected void oneTouchExpandableChanged()

Messaged when the oneTouchExpandable value of the JSplitPane the divider is contained in changes. If a particular L&F supports this Swing "SplitPane.supportsOneTouchButtons" property it will create the leftButton and rightButton if they are null and corresponding JSplitPane supports oneTouchExpandable property. Invalidates the corresponding JSplitPane as well.

paintback to summary
public void paint(Graphics g)

Overrides java.awt.Container.paint.

Paints the divider.

prepareForDraggingback to summary
protected void prepareForDragging()

Message to prepare for dragging. This messages the BasicSplitPaneUI with startDragging.

propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

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

revalidateSplitPaneback to summary
private void revalidateSplitPane()
setBasicSplitPaneUIback to summary
public void setBasicSplitPaneUI(BasicSplitPaneUI newUI)

Sets the SplitPaneUI that is using the receiver.

Parameters
newUI:BasicSplitPaneUI

the new SplitPaneUI

setBorderback to summary
public void setBorder(Border border)

Sets the border of this component.

Parameters
border:Border

a new border

Since
1.3
setDividerSizeback to summary
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. Divider sizes newSize < 0 are ignored.

Parameters
newSize:int

a new size

setEnabledback to summary
public void setEnabled(boolean enabled)

Overrides java.awt.Component.setEnabled.

Doc from java.awt.Component.setEnabled.

Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default.

Note

Disabling a lightweight component does not prevent it from receiving MouseEvents.

Note

Disabling a heavyweight container prevents all components in this container from receiving any input events. But disabling a lightweight container affects only this container.

Annotations
@Override
setMouseOverback to summary
protected void setMouseOver(boolean mouseOver)

Sets whether or not the mouse is currently over the divider.

Parameters
mouseOver:boolean

whether or not the mouse is currently over the divider

Since
1.5
javax.swing.plaf.basic back to summary

protected Class BasicSplitPaneDivider.DividerLayout

extends Object
implements LayoutManager
Class Inheritance
All Implemented Interfaces
java.awt.LayoutManager

Used to layout a BasicSplitPaneDivider. Layout for the divider involves appropriately moving the left/right buttons around.

Constructor Summary

AccessConstructor and Description
protected
DividerLayout()

Constructs a DividerLayout.

Method Summary

Modifier and TypeMethod and Description
public void
addLayoutComponent(String string, Component c)

Implements java.awt.LayoutManager.addLayoutComponent.

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

public void
layoutContainer(Container c)

Implements java.awt.LayoutManager.layoutContainer.

Lays out the specified container.

public Dimension
minimumLayoutSize(Container c)

Implements java.awt.LayoutManager.minimumLayoutSize.

Calculates the minimum size dimensions for the specified container, given the components it contains.

public Dimension
preferredLayoutSize(Container c)

Implements java.awt.LayoutManager.preferredLayoutSize.

Calculates the preferred size dimensions for the specified container, given the components it contains.

public void
removeLayoutComponent(Component c)

Implements java.awt.LayoutManager.removeLayoutComponent.

Removes the specified component from the layout.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DividerLayoutback to summary
protected DividerLayout()

Constructs a DividerLayout.

Method Detail

addLayoutComponentback to summary
public void addLayoutComponent(String string, Component c)

Implements java.awt.LayoutManager.addLayoutComponent.

Doc from java.awt.LayoutManager.addLayoutComponent.

If the layout manager uses a per-component string, adds the component comp to the layout, associating it with the string specified by name.

layoutContainerback to summary
public void layoutContainer(Container c)

Implements java.awt.LayoutManager.layoutContainer.

Doc from java.awt.LayoutManager.layoutContainer.

Lays out the specified container.

minimumLayoutSizeback to summary
public Dimension minimumLayoutSize(Container c)

Implements java.awt.LayoutManager.minimumLayoutSize.

Doc from java.awt.LayoutManager.minimumLayoutSize.

Calculates the minimum size dimensions for the specified container, given the components it contains.

preferredLayoutSizeback to summary
public Dimension preferredLayoutSize(Container c)

Implements java.awt.LayoutManager.preferredLayoutSize.

Doc from java.awt.LayoutManager.preferredLayoutSize.

Calculates the preferred size dimensions for the specified container, given the components it contains.

removeLayoutComponentback to summary
public void removeLayoutComponent(Component c)

Implements java.awt.LayoutManager.removeLayoutComponent.

Doc from java.awt.LayoutManager.removeLayoutComponent.

Removes the specified component from the layout.

javax.swing.plaf.basic back to summary

protected Class BasicSplitPaneDivider.DragController

extends Object
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.basic.BasicSplitPaneDivider.VerticalDragController

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 JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Field Summary

Modifier and TypeField and Description
pack-priv int
initialX

Initial location of the divider.

pack-priv int
maxX

Maximum and minimum positions to drag to.

pack-priv int
minX

Maximum and minimum positions to drag to.

pack-priv int
offset

Initial location the mouse down happened at.

Constructor Summary

AccessConstructor and Description
protected
DragController(MouseEvent
a mouse event
e
)

Constructs a new instance of DragController.

Method Summary

Modifier and TypeMethod and Description
protected void
completeDrag(int
an X coordinate
x
,
int
an Y coordinate
y
)

Messages finishDraggingTo with the new location for the mouse event.

protected void
completeDrag(MouseEvent
a mouse event
e
)

Messages finishDraggingTo with the new location for the mouse event.

protected void
continueDrag(int
an X coordinate
newX
,
int
an Y coordinate
newY
)

Messages dragDividerTo with the new location for the mouse event.

protected void
continueDrag(MouseEvent
a mouse event
e
)

Messages dragDividerTo with the new location for the mouse event.

protected int

Returns:

the X argument
getNeededLocation
(int
an X coordinate
x
,
int
an Y coordinate
y
)

Returns the x argument, since this is used for horizontal splits.

protected boolean

Returns:

true if the dragging session is valid
isValid
()

Returns true if the dragging session is valid.

protected int

Returns:

the new position
positionForMouseEvent
(MouseEvent
a mouse event
e
)

Returns the new position to put the divider at based on the passed in MouseEvent.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

initialXback to summary
pack-priv int initialX

Initial location of the divider.

maxXback to summary
pack-priv int maxX

Maximum and minimum positions to drag to.

minXback to summary
pack-priv int minX

Maximum and minimum positions to drag to.

offsetback to summary
pack-priv int offset

Initial location the mouse down happened at.

Constructor Detail

DragControllerback to summary
protected DragController(MouseEvent e)

Constructs a new instance of DragController.

Parameters
e:MouseEvent

a mouse event

Method Detail

completeDragback to summary
protected void completeDrag(int x, int y)

Messages finishDraggingTo with the new location for the mouse event.

Parameters
x:int

an X coordinate

y:int

an Y coordinate

completeDragback to summary
protected void completeDrag(MouseEvent e)

Messages finishDraggingTo with the new location for the mouse event.

Parameters
e:MouseEvent

a mouse event

continueDragback to summary
protected void continueDrag(int newX, int newY)

Messages dragDividerTo with the new location for the mouse event.

Parameters
newX:int

an X coordinate

newY:int

an Y coordinate

continueDragback to summary
protected void continueDrag(MouseEvent e)

Messages dragDividerTo with the new location for the mouse event.

Parameters
e:MouseEvent

a mouse event

getNeededLocationback to summary
protected int getNeededLocation(int x, int y)

Returns the x argument, since this is used for horizontal splits.

Parameters
x:int

an X coordinate

y:int

an Y coordinate

Returns:int

the X argument

isValidback to summary
protected boolean isValid()

Returns true if the dragging session is valid.

Returns:boolean

true if the dragging session is valid

positionForMouseEventback to summary
protected int positionForMouseEvent(MouseEvent e)

Returns the new position to put the divider at based on the passed in MouseEvent.

Parameters
e:MouseEvent

a mouse event

Returns:int

the new position

javax.swing.plaf.basic back to summary

protected Class BasicSplitPaneDivider.MouseHandler

extends MouseAdapter
implements MouseMotionListener
Class Inheritance
All Implemented Interfaces
java.awt.event.MouseMotionListener, java.util.EventListener
Known Direct Subclasses
com.sun.java.swing.plaf.motif.MotifSplitPaneDivider.MotifMouseHandler

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

Constructor Summary

AccessConstructor and Description
protected
MouseHandler()

Constructs a MouseHandler.

Method Summary

Modifier and TypeMethod and Description
public void
mouseDragged(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseDragged.

Implements java.awt.event.MouseMotionListener.mouseDragged.

If dragger is not null it is messaged with continueDrag.

public void
mouseEntered(MouseEvent
MouseEvent describing the details of the enter event.
e
)

Overrides java.awt.event.MouseAdapter.mouseEntered.

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

public void
mouseExited(MouseEvent
MouseEvent describing the details of the exit event.
e
)

Overrides java.awt.event.MouseAdapter.mouseExited.

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

public void
mouseMoved(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseMoved.

Implements java.awt.event.MouseMotionListener.mouseMoved.

Resets the cursor based on the orientation.

public void
mousePressed(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mousePressed.

Implements java.awt.event.MouseListener.mousePressed.

Starts the dragging session by creating the appropriate instance of DragController.

public void
mouseReleased(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseReleased.

Implements java.awt.event.MouseListener.mouseReleased.

If dragger is not null it is messaged with completeDrag.

Inherited from java.awt.event.MouseAdapter:
mouseClickedmouseWheelMoved

Constructor Detail

MouseHandlerback to summary
protected MouseHandler()

Constructs a MouseHandler.

Method Detail

mouseDraggedback to summary
public void mouseDragged(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseDragged.

Implements java.awt.event.MouseMotionListener.mouseDragged.

If dragger is not null it is messaged with continueDrag.

mouseEnteredback to summary
public void mouseEntered(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseEntered.

Implements java.awt.event.MouseListener.mouseEntered.

Invoked when the mouse enters a component.

Parameters
e:MouseEvent

MouseEvent describing the details of the enter event.

Since
1.5
mouseExitedback to summary
public void mouseExited(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseExited.

Implements java.awt.event.MouseListener.mouseExited.

Invoked when the mouse exits a component.

Parameters
e:MouseEvent

MouseEvent describing the details of the exit event.

Since
1.5
mouseMovedback to summary
public void mouseMoved(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseMoved.

Implements java.awt.event.MouseMotionListener.mouseMoved.

Resets the cursor based on the orientation.

mousePressedback to summary
public void mousePressed(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mousePressed.

Implements java.awt.event.MouseListener.mousePressed.

Starts the dragging session by creating the appropriate instance of DragController.

mouseReleasedback to summary
public void mouseReleased(MouseEvent e)

Overrides java.awt.event.MouseAdapter.mouseReleased.

Implements java.awt.event.MouseListener.mouseReleased.

If dragger is not null it is messaged with completeDrag.

javax.swing.plaf.basic back to summary

private Class BasicSplitPaneDivider.OneTouchActionHandler

extends Object
implements ActionListener
Class Inheritance
  • java.lang.Object
  • javax.swing.plaf.basic.BasicSplitPaneDivider.OneTouchActionHandler
All Implemented Interfaces
java.awt.event.ActionListener, java.util.EventListener

Listeners installed on the one touch expandable buttons.

Field Summary

Modifier and TypeField and Description
private boolean
toMinimum

True indicates the resize should go the minimum (top or left) vs false which indicates the resize should go to the maximum.

Constructor Summary

AccessConstructor and Description
pack-priv
OneTouchActionHandler(boolean toMinimum)

Method Summary

Modifier and TypeMethod and Description
public void
actionPerformed(ActionEvent e)

Implements java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

toMinimumback to summary
private boolean toMinimum

True indicates the resize should go the minimum (top or left) vs false which indicates the resize should go to the maximum.

Constructor Detail

OneTouchActionHandlerback to summary
pack-priv OneTouchActionHandler(boolean toMinimum)

Method Detail

actionPerformedback to summary
public void actionPerformed(ActionEvent e)

Implements java.awt.event.ActionListener.actionPerformed.

Doc from java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

javax.swing.plaf.basic back to summary

protected Class BasicSplitPaneDivider.VerticalDragController

extends DragController
Class Inheritance

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

Field Summary

Inherited from javax.swing.plaf.basic.BasicSplitPaneDivider.DragController:
initialXmaxXminXoffset

Constructor Summary

AccessConstructor and Description
protected
VerticalDragController(MouseEvent
a mouse event
e
)

Constructs a new instance of VerticalDragController.

Method Summary

Modifier and TypeMethod and Description
protected int
getNeededLocation(int x, int y)

Overrides javax.swing.plaf.basic.BasicSplitPaneDivider.DragController.getNeededLocation.

Returns the y argument, since this is used for vertical splits.

protected int
positionForMouseEvent(MouseEvent e)

Overrides javax.swing.plaf.basic.BasicSplitPaneDivider.DragController.positionForMouseEvent.

Returns the new position to put the divider at based on the passed in MouseEvent.

Inherited from javax.swing.plaf.basic.BasicSplitPaneDivider.DragController:
completeDragcompleteDragcontinueDragcontinueDragisValid

Constructor Detail

VerticalDragControllerback to summary
protected VerticalDragController(MouseEvent e)

Constructs a new instance of VerticalDragController.

Parameters
e:MouseEvent

a mouse event

Method Detail

getNeededLocationback to summary
protected int getNeededLocation(int x, int y)

Overrides javax.swing.plaf.basic.BasicSplitPaneDivider.DragController.getNeededLocation.

Returns the y argument, since this is used for vertical splits.

positionForMouseEventback to summary
protected int positionForMouseEvent(MouseEvent e)

Overrides javax.swing.plaf.basic.BasicSplitPaneDivider.DragController.positionForMouseEvent.

Returns the new position to put the divider at based on the passed in MouseEvent.