org.jcreme.swing
Class JQuadSplitPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JSplitPane
                  extended byorg.jcreme.swing.JQuadSplitPane
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JQuadSplitPane
extends javax.swing.JSplitPane

Version:
$Revision: 1.1 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JSplitPane
javax.swing.JSplitPane.AccessibleJSplitPane
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int BUTTONS
          Constant used to describe horizontal and vertical modes.
static int DIVIDERS
          Constant used to describe horizontal and vertical modes.
 
Fields inherited from class javax.swing.JSplitPane
BOTTOM, CONTINUOUS_LAYOUT_PROPERTY, continuousLayout, DIVIDER, DIVIDER_LOCATION_PROPERTY, DIVIDER_SIZE_PROPERTY, dividerSize, HORIZONTAL_SPLIT, LAST_DIVIDER_LOCATION_PROPERTY, lastDividerLocation, LEFT, leftComponent, ONE_TOUCH_EXPANDABLE_PROPERTY, oneTouchExpandable, orientation, ORIENTATION_PROPERTY, RESIZE_WEIGHT_PROPERTY, RIGHT, rightComponent, TOP, VERTICAL_SPLIT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JQuadSplitPane()
          Default constructor for the JQuadSplitPane
JQuadSplitPane(java.awt.Component viewedComponent)
          Creates new JQuadSplitPane
JQuadSplitPane(java.awt.Component viewedComponent, boolean newContinuousLayout)
          Creates new JQuadSplitPane
 
Method Summary
 void addMouseListener(java.awt.event.MouseListener l)
           
protected  void bindScrollBars()
          Binds the four scrollpanes' scrollbars so that they move according to each other.
protected  void bindSplitPanes()
          Binds the two sub splitpanes using BindingMouseHandler to transmit mouse events.
protected  void buildUI(java.awt.Component vComponent, boolean newContinuousLayout)
          Builds the UI of this QuadSPlitPane.
protected  java.awt.Component createHorizontalSplitButton()
          Creates the horizontal split button that is used in place of the horizontal divider when it is "minimized".
protected  java.awt.Component createVerticalSplitButton()
          Creates the vertical split button that is used in place of the vertical divider when it is "minimized".
protected  javax.swing.JScrollPane getBottomLeftScrollPane()
           
protected  javax.swing.JScrollPane getBottomRightScrollPane()
           
protected  java.awt.event.ContainerListener getColumnHeaderListener()
           
protected  RepaintingMouseHandler getColumnHeaderRepainter()
           
 int getHorizontalDividerLocation()
           
 int getHorizontalMode()
           
 int getHorizontalTreshold()
          Returns the treshold the horizontal splitpane divider should not go past.
protected  javax.swing.plaf.basic.BasicSplitPaneDivider getLeftDivider()
           
protected  javax.swing.JSplitPane getLeftSubSplitPane()
           
protected  javax.swing.plaf.basic.BasicSplitPaneDivider getMainDivider()
           
protected  javax.swing.plaf.basic.BasicSplitPaneDivider getRightDivider()
           
protected  javax.swing.JSplitPane getRightSubSplitPane()
           
protected  java.awt.event.ContainerListener getRowHeaderListener()
           
protected  RepaintingMouseHandler getRowHeaderRepainter()
           
protected  javax.swing.JScrollPane getTopLeftScrollPane()
           
protected  javax.swing.JScrollPane getTopRightScrollPane()
           
 int getVerticalMode()
           
 int getVerticalTreshold()
          Returns the treshold the vertical splitpane divider should not go past.
protected  java.awt.Component getViewedComponent()
          Returns the viewed component of this QuadSplitPane.
protected  boolean isContinuousDragging()
           
protected  void leftButtonActionPerformed()
          This method is triggered when the left one-touch button is used.
protected  void rightButtonActionPerformed()
          This method is triggered when the right one-touch button is used.
protected  void setBottomLeftHeader(java.awt.Component c)
           
protected  void setComponentsOptions()
          This convenience method sets various components options.
protected  void setContinuousDragging(boolean b)
           
 void setHorizontalDividerLocation(int location)
          Sets the horizontal divider's location to the value given as parameter.
protected  void setHorizontalMode(int mode)
           
protected  void setHorizontalScrollBarsVisibleValues(boolean topLeft, boolean topRight, boolean bottomLeft, boolean bottomRight)
          Sets the four scrollpanes' horizontal scrollbar policies according to the boolean parameters, representing whether the corresponding scrollbar should be displayed or not.
protected  void setTopRightHeader(java.awt.Component c)
           
protected  void setupTresholdHandling()
          This method sets up the treshold handling interface insures that the dividers be minimized when their location goes past a given treshold.
protected  void setVerticalMode(int mode)
           
protected  void setVerticalScrollBarsVisibleValues(boolean topLeft, boolean topRight, boolean bottomLeft, boolean bottomRight)
          Sets the four scrollpanes' vertical scrollbar policies according to the boolean parameters, representing whether the corresponding scrollbar should be displayed or not.
 void setViewedComponent(java.awt.Component component)
          This method enables to create the UI and to display the given component in the JQuadSplitPane.
protected  void switchUpdate()
           
 
Methods inherited from class javax.swing.JSplitPane
addImpl, getAccessibleContext, getBottomComponent, getDividerLocation, getDividerSize, getLastDividerLocation, getLeftComponent, getMaximumDividerLocation, getMinimumDividerLocation, getOrientation, getResizeWeight, getRightComponent, getTopComponent, getUI, getUIClassID, isContinuousLayout, isOneTouchExpandable, isValidateRoot, paintChildren, paramString, remove, remove, removeAll, resetToPreferredSizes, setBottomComponent, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerSize, setLastDividerLocation, setLeftComponent, setOneTouchExpandable, setOrientation, setResizeWeight, setRightComponent, setTopComponent, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIVIDERS

public static final int DIVIDERS
Constant used to describe horizontal and vertical modes.

See Also:
Constant Field Values

BUTTONS

public static final int BUTTONS
Constant used to describe horizontal and vertical modes.

See Also:
Constant Field Values
Constructor Detail

JQuadSplitPane

public JQuadSplitPane()
Default constructor for the JQuadSplitPane


JQuadSplitPane

public JQuadSplitPane(java.awt.Component viewedComponent,
                      boolean newContinuousLayout)
Creates new JQuadSplitPane

Parameters:
viewedComponent - The component to be viewed.
newContinuousLayout - Whether the splitpane dividers should use a continuous layout.

JQuadSplitPane

public JQuadSplitPane(java.awt.Component viewedComponent)
Creates new JQuadSplitPane

Parameters:
viewedComponent - The component to be viewed.
Method Detail

isContinuousDragging

protected final boolean isContinuousDragging()

setContinuousDragging

protected final void setContinuousDragging(boolean b)

setTopRightHeader

protected void setTopRightHeader(java.awt.Component c)
Parameters:
c -

setBottomLeftHeader

protected void setBottomLeftHeader(java.awt.Component c)
Parameters:
c -

setViewedComponent

public void setViewedComponent(java.awt.Component component)
This method enables to create the UI and to display the given component in the JQuadSplitPane.

Parameters:
component - the component to be displayed.

getColumnHeaderListener

protected final java.awt.event.ContainerListener getColumnHeaderListener()

getRowHeaderListener

protected final java.awt.event.ContainerListener getRowHeaderListener()

getMainDivider

protected final javax.swing.plaf.basic.BasicSplitPaneDivider getMainDivider()

getLeftDivider

protected final javax.swing.plaf.basic.BasicSplitPaneDivider getLeftDivider()

getRightDivider

protected final javax.swing.plaf.basic.BasicSplitPaneDivider getRightDivider()

getTopLeftScrollPane

protected final javax.swing.JScrollPane getTopLeftScrollPane()

getTopRightScrollPane

protected final javax.swing.JScrollPane getTopRightScrollPane()

getBottomLeftScrollPane

protected final javax.swing.JScrollPane getBottomLeftScrollPane()

getBottomRightScrollPane

protected final javax.swing.JScrollPane getBottomRightScrollPane()

getLeftSubSplitPane

protected final javax.swing.JSplitPane getLeftSubSplitPane()

getRightSubSplitPane

protected final javax.swing.JSplitPane getRightSubSplitPane()

getColumnHeaderRepainter

protected final RepaintingMouseHandler getColumnHeaderRepainter()

getRowHeaderRepainter

protected final RepaintingMouseHandler getRowHeaderRepainter()

buildUI

protected void buildUI(java.awt.Component vComponent,
                       boolean newContinuousLayout)
                throws java.security.InvalidParameterException
Builds the UI of this QuadSPlitPane. It first calls UI-building methods specific to the kind of component that is used, and then builds the common part of the UI.

Parameters:
vComponent - The component to be viewed.
newContinuousLayout - Whether the splitpane dividers should use a continuous layout.
Throws:
java.security.InvalidParameterException - if the kind of component given in the constructor is not handled.

getViewedComponent

protected java.awt.Component getViewedComponent()
Returns the viewed component of this QuadSplitPane.

Returns:
The viewed component of this QuadSplitPane.

setHorizontalDividerLocation

public void setHorizontalDividerLocation(int location)
Sets the horizontal divider's location to the value given as parameter.

Parameters:
location - The new value of the location.

getHorizontalDividerLocation

public int getHorizontalDividerLocation()
Returns:
the current location of the horizontal divider.

getHorizontalTreshold

public int getHorizontalTreshold()
Returns the treshold the horizontal splitpane divider should not go past.

Returns:
The value of the actualized horizontal treshold.

getVerticalTreshold

public int getVerticalTreshold()
Returns the treshold the vertical splitpane divider should not go past.

Returns:
The value of the actualized vertical threshold.

setComponentsOptions

protected void setComponentsOptions()
This convenience method sets various components options.


setupTresholdHandling

protected void setupTresholdHandling()
This method sets up the treshold handling interface insures that the dividers be minimized when their location goes past a given treshold.


bindScrollBars

protected void bindScrollBars()
Binds the four scrollpanes' scrollbars so that they move according to each other.


bindSplitPanes

protected void bindSplitPanes()
Binds the two sub splitpanes using BindingMouseHandler to transmit mouse events.


leftButtonActionPerformed

protected void leftButtonActionPerformed()
This method is triggered when the left one-touch button is used. It makes the right part of the horizontal divider take that into account and move accordingly.


rightButtonActionPerformed

protected void rightButtonActionPerformed()
This method is triggered when the right one-touch button is used. It makes the right part of the horizontal divider take that into account and move accordingly.


switchUpdate

protected void switchUpdate()

createHorizontalSplitButton

protected java.awt.Component createHorizontalSplitButton()
Creates the horizontal split button that is used in place of the horizontal divider when it is "minimized".

Returns:
A JPanel the button to be used.

createVerticalSplitButton

protected java.awt.Component createVerticalSplitButton()
Creates the vertical split button that is used in place of the vertical divider when it is "minimized".

Returns:
A JPanel containing the button to be used.

setHorizontalScrollBarsVisibleValues

protected void setHorizontalScrollBarsVisibleValues(boolean topLeft,
                                                    boolean topRight,
                                                    boolean bottomLeft,
                                                    boolean bottomRight)
Sets the four scrollpanes' horizontal scrollbar policies according to the boolean parameters, representing whether the corresponding scrollbar should be displayed or not.

Parameters:
topLeft - Whether the top-left horizontal scrollbar should be displayed.
topRight - Whether the top-right horizontal scrollbar should be displayed.
bottomLeft - Whether the bottom-left horizontal scrollbar should be displayed.
bottomRight - Whether the bottom-right horizontal scrollbar should be displayed.

setVerticalScrollBarsVisibleValues

protected void setVerticalScrollBarsVisibleValues(boolean topLeft,
                                                  boolean topRight,
                                                  boolean bottomLeft,
                                                  boolean bottomRight)
Sets the four scrollpanes' vertical scrollbar policies according to the boolean parameters, representing whether the corresponding scrollbar should be displayed or not.

Parameters:
topLeft - Whether the top-left vertical scrollbar should be displayed.
topRight - Whether the top-right vertical scrollbar should be displayed.
bottomLeft - Whether the bottom-left vertical scrollbar should be displayed.
bottomRight - Whether the bottom-right vertical scrollbar should be displayed.

getHorizontalMode

public int getHorizontalMode()
Returns:
the current horizontal mode (either BUTTONS or DIVIDERS)

setHorizontalMode

protected final void setHorizontalMode(int mode)

getVerticalMode

public int getVerticalMode()
Returns:
the current vertical mode (either BUTTONS or DIVIDERS)

setVerticalMode

protected final void setVerticalMode(int mode)

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
See Also:
Component.addMouseListener(java.awt.event.MouseListener)


Copyright 2006 null. All Rights Reserved.