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..
| Modifier and Type | Class and Description |
|---|---|
| protected class | BasicSplitPaneDivider.
Used to layout a |
| protected class | BasicSplitPaneDivider.
Handles the events during a dragging session for a HORIZONTAL_SPLIT oriented split pane. |
| protected class | BasicSplitPaneDivider.
MouseHandler is responsible for converting mouse events (released, dragged...) into the appropriate DragController methods. |
| private class | BasicSplitPaneDivider.
Listeners installed on the one touch expandable buttons. |
| protected class | BasicSplitPaneDivider.
Handles the events during a dragging session for a VERTICAL_SPLIT oriented split pane. |
| Modifier and Type | Field 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. | dragger
Handles mouse dragging message to do the actual dragging. |
| protected JButton | leftButton
Button for quickly toggling the left component. |
| protected BasicSplitPaneDivider. | 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
|
| 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. |
| Access | Constructor and Description |
|---|---|
| public | BasicSplitPaneDivider(BasicSplitPaneUI
an instance of ui)BasicSplitPaneUICreates an instance of |
| Modifier and Type | Method and Description |
|---|---|
| protected JButton | Returns: an instance ofJButtonCreates and return an instance of |
| protected JButton | Returns: an instance ofJButtonCreates and return an instance of |
| 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: theSplitPaneUI the receiver is currently inReturns the |
| public Border | Returns: the border object for this componentReturns the border of this component or null if no border is currently set. |
| public int | Returns: the size of the dividerReturns 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.Overrides java. If a border has been set on this component, returns the border's insets, else calls super.getInsets. |
| public Dimension | Returns: aDimension object containing the minimum size of
BasicSplitPaneDividerOverrides java. Returns the minimum size of the divider. |
| public Dimension | Returns: aDimension object containing the preferred size of
BasicSplitPaneDividerOverrides java. Returns the preferred size of the divider. |
| public boolean | Returns: whether or not the mouse is currently over the dividerReturns 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 | |
| protected void | |
| public void | propertyChange(PropertyChangeEvent e)
Implements java. Property change event, presumably from the JSplitPane, will message updateOrientation if necessary. |
| private void | |
| public void | setBasicSplitPaneUI(BasicSplitPaneUI
the new newUI)SplitPaneUISets the |
| public void | |
| public void | |
| public void | setEnabled(boolean enabled)
Overrides java. Enables or disables this component, depending on the value of the
parameter |
| 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. |
| border | back to summary |
|---|---|
| private Border border Border. | |
| centerOneTouchButtons | back to summary |
|---|---|
| private boolean centerOneTouchButtons If true the one touch buttons are centered on the divider. | |
| dividerSize | back to summary |
|---|---|
| protected int dividerSize Size of the divider. | |
| dragger | back to summary |
|---|---|
| protected BasicSplitPaneDivider. Handles mouse dragging message to do the actual dragging. | |
| leftButton | back to summary |
|---|---|
| protected JButton leftButton Button for quickly toggling the left component. | |
| mouseHandler | back to summary |
|---|---|
| protected BasicSplitPaneDivider. 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. | |
| mouseOver | back to summary |
|---|---|
| private boolean mouseOver Is the mouse over the divider? | |
| ONE_TOUCH_OFFSET | back to summary |
|---|---|
| protected static final int ONE_TOUCH_OFFSET The offset of the divider. | |
| ONE_TOUCH_SIZE | back to summary |
|---|---|
| protected static final int ONE_TOUCH_SIZE Width or height of the divider based on orientation
| |
| oneTouchOffset | back to summary |
|---|---|
| private int oneTouchOffset | |
| oneTouchSize | back to summary |
|---|---|
| private int oneTouchSize | |
| orientation | back to summary |
|---|---|
| protected int orientation Orientation of the JSplitPane. | |
| rightButton | back to summary |
|---|---|
| protected JButton rightButton Button for quickly toggling the right component. | |
| splitPane | back to summary |
|---|---|
| protected JSplitPane splitPane JSplitPane the receiver is contained in. | |
| splitPaneUI | back to summary |
|---|---|
| protected BasicSplitPaneUI splitPaneUI UI this instance was created from. | |
| BasicSplitPaneDivider | back to summary |
|---|---|
| public BasicSplitPaneDivider(BasicSplitPaneUI ui) Creates an instance of
| |
| createLeftOneTouchButton | back to summary |
|---|---|
| protected JButton createLeftOneTouchButton() Creates and return an instance of
| |
| createRightOneTouchButton | back to summary |
|---|---|
| protected JButton createRightOneTouchButton() Creates and return an instance of
| |
| dragDividerTo | back to summary |
|---|---|
| protected void dragDividerTo(int location) Messages the BasicSplitPaneUI with dragDividerTo that this instance is contained in.
| |
| finishDraggingTo | back to summary |
|---|---|
| protected void finishDraggingTo(int location) Messages the BasicSplitPaneUI with finishDraggingTo that this instance is contained in.
| |
| getBasicSplitPaneUI | back to summary |
|---|---|
| public BasicSplitPaneUI getBasicSplitPaneUI() Returns the
| |
| getBorder | back to summary |
|---|---|
| public Border getBorder() Returns the border of this component or null if no border is currently set. | |
| getDividerSize | back 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.
| |
| getInsets | back to summary |
|---|---|
| public Insets getInsets() Overrides java. If a border has been set on this component, returns the border's insets, else calls super.getInsets. | |
| getMinimumSize | back to summary |
|---|---|
| public Dimension getMinimumSize() Overrides java. 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
| |
| getPreferredSize | back to summary |
|---|---|
| public Dimension getPreferredSize() Overrides java. 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
| |
| isMouseOver | back to summary |
|---|---|
| public boolean isMouseOver() Returns whether or not the mouse is currently over the divider
| |
| oneTouchExpandableChanged | back 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
| |
| paint | back to summary |
|---|---|
| public void paint(Graphics g) Overrides java. Paints the divider. | |
| prepareForDragging | back to summary |
|---|---|
| protected void prepareForDragging() Message to prepare for dragging. This messages the BasicSplitPaneUI with startDragging. | |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent e) Implements java. Property change event, presumably from the JSplitPane, will message updateOrientation if necessary. | |
| revalidateSplitPane | back to summary |
|---|---|
| private void revalidateSplitPane() | |
| setBasicSplitPaneUI | back to summary |
|---|---|
| public void setBasicSplitPaneUI(BasicSplitPaneUI newUI) Sets the
| |
| setBorder | back to summary |
|---|---|
| public void setBorder(Border border) Sets the border of this component.
| |
| setDividerSize | back to summary |
|---|---|
| public void setDividerSize(int newSize) Sets the size of the divider to
| |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean enabled) Overrides java. Doc from java. Enables or disables this component, depending on the value of the
parameter 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.
| |
| setMouseOver | back to summary |
|---|---|
| protected void setMouseOver(boolean mouseOver) Sets whether or not the mouse is currently over the divider.
| |
BasicSplitPaneDivider.
Layout for the divider
involves appropriately moving the left/right buttons around.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addLayoutComponent(String string, Component c)
Implements java. If the layout manager uses a per-component string,
adds the component |
| public void | layoutContainer(Container c)
Implements java. Lays out the specified container. |
| public Dimension | minimumLayoutSize(Container c)
Implements java. Calculates the minimum size dimensions for the specified container, given the components it contains. |
| public Dimension | preferredLayoutSize(Container c)
Implements java. Calculates the preferred size dimensions for the specified container, given the components it contains. |
| public void | removeLayoutComponent(Component c)
Implements java. Removes the specified component from the layout. |
| DividerLayout | back to summary |
|---|---|
| protected DividerLayout() Constructs a | |
| addLayoutComponent | back to summary |
|---|---|
| public void addLayoutComponent(String string, Component c) Implements java. Doc from java. If the layout manager uses a per-component string,
adds the component | |
| layoutContainer | back to summary |
|---|---|
| public void layoutContainer(Container c) Implements java. Doc from java. Lays out the specified container. | |
| minimumLayoutSize | back to summary |
|---|---|
| public Dimension minimumLayoutSize(Container c) Implements java. Doc from java. Calculates the minimum size dimensions for the specified container, given the components it contains. | |
| preferredLayoutSize | back to summary |
|---|---|
| public Dimension preferredLayoutSize(Container c) Implements java. Doc from java. Calculates the preferred size dimensions for the specified container, given the components it contains. | |
| removeLayoutComponent | back to summary |
|---|---|
| public void removeLayoutComponent(Component c) Implements java. Doc from java. Removes the specified component from the layout. | |
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..
| Modifier and Type | Field 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. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method 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 argumentan 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 validReturns |
| protected int | Returns: the new positiona mouse event e)Returns the new position to put the divider at based on the passed in MouseEvent. |
| initialX | back to summary |
|---|---|
| pack-priv int initialX Initial location of the divider. | |
| maxX | back to summary |
|---|---|
| pack-priv int maxX Maximum and minimum positions to drag to. | |
| minX | back to summary |
|---|---|
| pack-priv int minX Maximum and minimum positions to drag to. | |
| offset | back to summary |
|---|---|
| pack-priv int offset Initial location the mouse down happened at. | |
| DragController | back to summary |
|---|---|
| protected DragController(MouseEvent e) Constructs a new instance of
| |
| completeDrag | back to summary |
|---|---|
| protected void completeDrag(int x, int y) Messages finishDraggingTo with the new location for the mouse event.
| |
| completeDrag | back to summary |
|---|---|
| protected void completeDrag(MouseEvent e) Messages finishDraggingTo with the new location for the mouse event.
| |
| continueDrag | back to summary |
|---|---|
| protected void continueDrag(int newX, int newY) Messages dragDividerTo with the new location for the mouse event.
| |
| continueDrag | back to summary |
|---|---|
| protected void continueDrag(MouseEvent e) Messages dragDividerTo with the new location for the mouse event.
| |
| getNeededLocation | back to summary |
|---|---|
| protected int getNeededLocation(int x, int y) Returns the x argument, since this is used for horizontal splits.
| |
| isValid | back to summary |
|---|---|
| protected boolean isValid() Returns
| |
| positionForMouseEvent | back to summary |
|---|---|
| protected int positionForMouseEvent(MouseEvent e) Returns the new position to put the divider at based on the passed in MouseEvent.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | mouseDragged(MouseEvent e)
Overrides java. Implements java. 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. Implements java. Invoked when the mouse enters a component. |
| public void | mouseExited(MouseEvent
MouseEvent describing the details of the exit event. e)Overrides java. Implements java. Invoked when the mouse exits a component. |
| public void | mouseMoved(MouseEvent e)
Overrides java. Implements java. Resets the cursor based on the orientation. |
| public void | mousePressed(MouseEvent e)
Overrides java. Implements java. Starts the dragging session by creating the appropriate instance of DragController. |
| public void | mouseReleased(MouseEvent e)
Overrides java. Implements java. If dragger is not null it is messaged with completeDrag. |
| MouseHandler | back to summary |
|---|---|
| protected MouseHandler() Constructs a | |
| mouseDragged | back to summary |
|---|---|
| public void mouseDragged(MouseEvent e) Overrides java. Implements java. If dragger is not null it is messaged with continueDrag. | |
| mouseEntered | back to summary |
|---|---|
| public void mouseEntered(MouseEvent e) Overrides java. Implements java. Invoked when the mouse enters a component.
| |
| mouseExited | back to summary |
|---|---|
| public void mouseExited(MouseEvent e) Overrides java. Implements java. Invoked when the mouse exits a component.
| |
| mouseMoved | back to summary |
|---|---|
| public void mouseMoved(MouseEvent e) Overrides java. Implements java. Resets the cursor based on the orientation. | |
| mousePressed | back to summary |
|---|---|
| public void mousePressed(MouseEvent e) Overrides java. Implements java. Starts the dragging session by creating the appropriate instance of DragController. | |
| mouseReleased | back to summary |
|---|---|
| public void mouseReleased(MouseEvent e) Overrides java. Implements java. If dragger is not null it is messaged with completeDrag. | |
| Modifier and Type | Field 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. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | actionPerformed(ActionEvent e)
Implements java. Invoked when an action occurs. |
| toMinimum | back 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. | |
| OneTouchActionHandler | back to summary |
|---|---|
| pack-priv OneTouchActionHandler(boolean toMinimum) | |
| actionPerformed | back to summary |
|---|---|
| public void actionPerformed(ActionEvent e) Implements java. Doc from java. Invoked when an action occurs. | |
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).
| Access | Constructor and Description |
|---|---|
| protected | VerticalDragController(MouseEvent
a mouse event e)Constructs a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| protected int | getNeededLocation(int x, int y)
Overrides javax. Returns the y argument, since this is used for vertical splits. |
| protected int | positionForMouseEvent(MouseEvent e)
Overrides javax. Returns the new position to put the divider at based on the passed in MouseEvent. |
| VerticalDragController | back to summary |
|---|---|
| protected VerticalDragController(MouseEvent e) Constructs a new instance of
| |
| getNeededLocation | back to summary |
|---|---|
| protected int getNeededLocation(int x, int y) Overrides javax. Returns the y argument, since this is used for vertical splits. | |
| positionForMouseEvent | back to summary |
|---|---|
| protected int positionForMouseEvent(MouseEvent e) Overrides javax. Returns the new position to put the divider at based on the passed in MouseEvent. | |