HOME

com.ultraswing
Class CSplitPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ultraswing.CPanel
                                |
                                +--com.ultraswing.CSplitPane
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Orientation, Serializable
Direct Known Subclasses:
CListReportCtrl

public class CSplitPane
extends CPanel
implements Orientation

A split panel which can contain multiple components. Each panel is assigned a weight property, which determines its initial size.

Usage example:

       CSplitPane paneDown = new CSplitPane(true);
       paneDown.addPane(comp1);
       paneDown.addPane(comp2);
       paneDown.addPane(comp3);
 

See Also:
Serialized Form

Field Summary
static int HORIZONTAL_SPLIT
          A horizontal split pane
static int VERTICAL_SPLIT
          A vertical split pane
 
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.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
CSplitPane()
          Constructs a horizontal CSplitPane
CSplitPane(boolean isHorizontal)
          Constructs a CSplitPane
CSplitPane(boolean isHorizontal, int dividerWidth)
          Constructs a CSplitPane
 
Method Summary
 Component addFirst(Component comp)
          Inserts the given comp at the beginning of this split pane.
 Component addFirst(Component comp, float weight)
          Inserts the given comp at the beginning of this split pane
 Component addLast(Component comp)
          Appends the given comp to the end of this split pane.
 Component addLast(Component comp, float weight)
          Appends the given comp to the end of this split pane.
 Component addPane(Component comp)
          Adds the comp to the end of this split pane.
 Component addPane(Component comp, float weight)
          Adds the comp to the end of this split pane
 Component addPaneAfter(Component comp, Component ref)
          Inserts the comp after the existing component ref.
 Component addPaneAfter(Component comp, Component ref, float weight)
          Inserts the comp after the existing component ref.
 Component addPaneBefore(Component comp, Component ref)
          Inserts the comp before the existing component ref The weight property of added comp is 1.
 Component addPaneBefore(Component comp, Component ref, float weight)
          Inserts the comp before the existing component ref
 Component getComponentAt(int x, int y)
          Determines if this component or one of its immediate subcomponents contains the (x, y) location, and if so, returns the containing component.
 Component getComponentAt(Point p)
          Returns the component or subcomponent that contains the specified point.
 float getCurrentWeight(Component c)
          Returns the current weight value of passed component.
 int getDividerSize()
          Returns the divider size
 Component getNext(Component c)
          Returns the next component of the passed component c, , or null if the passed component is the last one or passed component is not contained in this split pane
 int getOrientation()
          Returns orientation, either CSplitPane.HORIZONTAL_SPLIT or CSplitPane.VERTICAL_SPLIT.
 int getPaneCount()
          Returns the number of panes contained in this split pane
 Component[] getPanes()
          Returns all panes contained in this split pane
 Component getPrevious(Component c)
          Returns the previous component of the passed component c
 float getTotalWeight()
          Returns the total weight of all components
 float getWeight(Component c)
          Returns the initial weight value of passed Component.
 boolean isDroppable(Component comp)
          Tests if the passed comp can be dropped into this pane
 boolean isRemoveFromParent()
          Determines whether this split pane will be remove from its parent container when it has no pane
 void removePane(Component comp)
          Removes component and its associated splitter bar
 void setDividerSize(int size)
          Sets the divider size
 void setDividerTransparent(boolean b)
          If true the divider will be transparent
 void setRemoveFromParent(boolean b)
          If passed b is true, this split pane will be removed from its parent container when it has no pane
 void updateWeight(Component c, float w)
          Sets new weght for the passed component c
 
Methods inherited from class com.ultraswing.CPanel
contains, getPrefferedSize, onResize, paintBorder, processComponentEvent, setBackground, setBackgroundImage, setGradientBackground
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, 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, isValidateRoot, paint, paintChildren, 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, 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, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, 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, 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

VERTICAL_SPLIT

public static final int VERTICAL_SPLIT
A vertical split pane

See Also:
Constant Field Values

HORIZONTAL_SPLIT

public static final int HORIZONTAL_SPLIT
A horizontal split pane

See Also:
Constant Field Values
Constructor Detail

CSplitPane

public CSplitPane()
Constructs a horizontal CSplitPane


CSplitPane

public CSplitPane(boolean isHorizontal)
Constructs a CSplitPane

Parameters:
isHorizontal - if true, constructs a horizontal split pane, otherwise a vertical split pane

CSplitPane

public CSplitPane(boolean isHorizontal,
                  int dividerWidth)
Constructs a CSplitPane

Parameters:
isHorizontal - if true, constructs a horizontal split pane, otherwise a vertical split pane
dividerWidth - the width of divider
Method Detail

addFirst

public Component addFirst(Component comp)
Inserts the given comp at the beginning of this split pane. The weight property of added comp is 1.

Parameters:
comp - component to be added

addFirst

public Component addFirst(Component comp,
                          float weight)
Inserts the given comp at the beginning of this split pane

Parameters:
comp - component to be added
weight - the weight of this component. The initial size of the comp will be determined by its own weight and total weight of all components

addLast

public Component addLast(Component comp)
Appends the given comp to the end of this split pane. The weight property of added comp is 1.

Parameters:
comp - component to be added

addLast

public Component addLast(Component comp,
                         float weight)
Appends the given comp to the end of this split pane.

Parameters:
comp - component to be added
weight - the weight of this component. The initial size of the comp will be determined by its own weight and total weight of all components

addPaneAfter

public Component addPaneAfter(Component comp,
                              Component ref)
Inserts the comp after the existing component ref. If ref is null or not in this split pane, insert comp at the end of the list of children. The weight property of added comp is 1.

Parameters:
comp - component to be added
ref - the reference component

addPaneAfter

public Component addPaneAfter(Component comp,
                              Component ref,
                              float weight)
Inserts the comp after the existing component ref. If ref is null or not in this split pane, insert comp at the end of the list of children.

Parameters:
comp - component to be added
ref - the reference component
weight - the weight of this component. The initial size of the comp will be determined by its own weight and total weight of all components

addPaneBefore

public Component addPaneBefore(Component comp,
                               Component ref)
Inserts the comp before the existing component ref The weight property of added comp is 1.

Parameters:
comp - component to be added
ref - the reference component

addPaneBefore

public Component addPaneBefore(Component comp,
                               Component ref,
                               float weight)
Inserts the comp before the existing component ref

Parameters:
comp - component to be added
ref - the reference component
weight - the weight of this component. The initial size of the comp will be determined by its own weight and total weight of all components

addPane

public Component addPane(Component comp)
Adds the comp to the end of this split pane. The weight property of added comp is 1.

Parameters:
comp - component to be added

addPane

public Component addPane(Component comp,
                         float weight)
Adds the comp to the end of this split pane

Parameters:
comp - component to be added
weight - the weight property of this component. The initial size of the comp will be determined by its own weight and total weight of all components

setRemoveFromParent

public void setRemoveFromParent(boolean b)
If passed b is true, this split pane will be removed from its parent container when it has no pane


isRemoveFromParent

public boolean isRemoveFromParent()
Determines whether this split pane will be remove from its parent container when it has no pane


removePane

public void removePane(Component comp)
Removes component and its associated splitter bar

Parameters:
comp - component to be removed

setDividerSize

public void setDividerSize(int size)
Sets the divider size

Parameters:
size - the new divider size

getDividerSize

public int getDividerSize()
Returns the divider size


getOrientation

public int getOrientation()
Returns orientation, either CSplitPane.HORIZONTAL_SPLIT or CSplitPane.VERTICAL_SPLIT.

Specified by:
getOrientation in interface Orientation

getPrevious

public Component getPrevious(Component c)
Returns the previous component of the passed component c

getNext

public Component getNext(Component c)
Returns the next component of the passed component c, , or null if the passed component is the last one or passed component is not contained in this split pane


getPanes

public Component[] getPanes()
Returns all panes contained in this split pane


getPaneCount

public int getPaneCount()
Returns the number of panes contained in this split pane


getComponentAt

public Component getComponentAt(int x,
                                int y)
Determines if this component or one of its immediate subcomponents contains the (x, y) location, and if so, returns the containing component. This method only looks one level deep. If the point (x, y) is inside a subcomponent that itself has subcomponents, it does not go looking down the subcomponent tree.

Overrides:
getComponentAt in class Container
Parameters:
x - the x coordinate
y - the y coordinate

getComponentAt

public Component getComponentAt(Point p)
Returns the component or subcomponent that contains the specified point.

Overrides:
getComponentAt in class Container
Parameters:
p - the point

isDroppable

public boolean isDroppable(Component comp)
Tests if the passed comp can be dropped into this pane


getCurrentWeight

public float getCurrentWeight(Component c)
Returns the current weight value of passed component. Current weight value might be different from its initial value when the size of this pane was changed. If passed Component doesn't exist, it returns -1f.

See Also:
getWeight(java.awt.Component)

getWeight

public float getWeight(Component c)
Returns the initial weight value of passed Component. If passed Component doesn't exist, it returns -1f.

See Also:
getCurrentWeight(java.awt.Component)

getTotalWeight

public float getTotalWeight()
Returns the total weight of all components


updateWeight

public void updateWeight(Component c,
                         float w)
Sets new weght for the passed component c

Parameters:
c - the compoent to be set new weight
w - new weight

setDividerTransparent

public void setDividerTransparent(boolean b)
If true the divider will be transparent


HOME

Copyright © 2002 iReasoning Networks. All Rights Reserved.