org.tigris.swidgets

Class Splitter


public class Splitter
extends JComponent

Acts as a seperator between components and will automatically resize those components when the splitter is moved by dragging the mouse across it.
Author:
Bob Tarling TODO: Bring splitter to top when not dynamic resize TODO: Add constructor and getter/setter for dynamic resize TODO: Implement the setLocation method, anything currently calling setLocation should then call super.setLocation.

Field Summary

protected static int
EAST
The side of the splitter to be hidden on a quick hide action: EAST
static Orientation
HORIZONTAL_SPLIT
The orientation for a horizontal splitter
protected static int
NONE
The side of the splitter of the component to be hidden on a quick hide action.
protected static int
NORTH
The side of the splitter to be hidden on a quick hide action: NORTH
protected static int
SOUTH
The side of the splitter to be hidden on a quick hide action: SOUTH
static Orientation
VERTICAL_SPLIT
The orientation for a vertical splitter
protected static int
WEST
The side of the splitter to be hidden on a quick hide action: WEST

Constructor Summary

Splitter(Orientation orientation)
The constructor

Method Summary

Component
getRegisteredComponent(int side)
Get a registered component.
void
paintComponent(Graphics g)
Delegates painting to the UI component responsible for the split pane divider.
void
registerComponent(int side, Component comp)
Register a component to be resized by this splitter.
void
setQuickHide(int side)
Change the quick hide action.
void
setSize(Dimension d)
Resizes the divider delegate when this component is resized.
void
setSize(int width, int height)
Resizes the divider delegate when this component is resized.
void
toggleHide()

Field Details

EAST

protected static final int EAST
The side of the splitter to be hidden on a quick hide action: EAST
Field Value:
1

HORIZONTAL_SPLIT

public static final Orientation HORIZONTAL_SPLIT
The orientation for a horizontal splitter

NONE

protected static final int NONE
The side of the splitter of the component to be hidden on a quick hide action.
Field Value:
-1

NORTH

protected static final int NORTH
The side of the splitter to be hidden on a quick hide action: NORTH
Field Value:
0

SOUTH

protected static final int SOUTH
The side of the splitter to be hidden on a quick hide action: SOUTH
Field Value:
1

VERTICAL_SPLIT

public static final Orientation VERTICAL_SPLIT
The orientation for a vertical splitter

WEST

protected static final int WEST
The side of the splitter to be hidden on a quick hide action: WEST
Field Value:
0

Constructor Details

Splitter

public Splitter(Orientation orientation)
The constructor

Method Details

getRegisteredComponent

public Component getRegisteredComponent(int side)
Get a registered component.
Returns:
the registered component

paintComponent

public void paintComponent(Graphics g)
Delegates painting to the UI component responsible for the split pane divider.

registerComponent

public void registerComponent(int side,
                              Component comp)
Register a component to be resized by this splitter.
Parameters:
comp - the component to be resized

setQuickHide

public void setQuickHide(int side)
Change the quick hide action. If quick hide is turned on then an arrow button appears on the splitter to allow the user to instantly reposition the splitter to hide one of the components.

setSize

public void setSize(Dimension d)
Resizes the divider delegate when this component is resized.
See Also:
java.awt.Component.setSize(java.awt.Dimension)

setSize

public void setSize(int width,
                    int height)
Resizes the divider delegate when this component is resized.
See Also:
java.awt.Component.setSize(int, int)

toggleHide

public void toggleHide()