|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--com.ultraswing.CPanel | +--com.ultraswing.CSplitPane
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);
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int VERTICAL_SPLIT
public static final int HORIZONTAL_SPLIT
Constructor Detail |
public CSplitPane()
public CSplitPane(boolean isHorizontal)
isHorizontal
- if true, constructs a horizontal split pane, otherwise a vertical split panepublic CSplitPane(boolean isHorizontal, int dividerWidth)
isHorizontal
- if true, constructs a horizontal split pane, otherwise a vertical split panedividerWidth
- the width of dividerMethod Detail |
public Component addFirst(Component comp)
comp
at the beginning of this split pane.
The weight property of added comp
is 1.
comp
- component to be addedpublic Component addFirst(Component comp, float weight)
comp
at the beginning of this split pane
comp
- component to be addedweight
- the weight of this component. The initial size of the comp
will be determined by its own weight and total weight of all componentspublic Component addLast(Component comp)
comp
to the end of this split pane.
The weight property of added comp
is 1.
comp
- component to be addedpublic Component addLast(Component comp, float weight)
comp
to the end of this split pane.
comp
- component to be addedweight
- the weight of this component. The initial size of the comp
will be determined by its own weight and total weight of all componentspublic Component addPaneAfter(Component comp, Component ref)
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.
comp
- component to be addedref
- the reference componentpublic Component addPaneAfter(Component comp, Component ref, float weight)
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.
comp
- component to be addedref
- the reference componentweight
- the weight of this component. The initial size of the comp
will be determined by its own weight and total weight of all componentspublic Component addPaneBefore(Component comp, Component ref)
comp
before the existing component ref
The weight property of added comp
is 1.
comp
- component to be addedref
- the reference componentpublic Component addPaneBefore(Component comp, Component ref, float weight)
comp
before the existing component ref
comp
- component to be addedref
- the reference componentweight
- the weight of this component. The initial size of the comp
will be determined by its own weight and total weight of all componentspublic Component addPane(Component comp)
comp
to the end of this split pane.
The weight property of added comp
is 1.
comp
- component to be addedpublic Component addPane(Component comp, float weight)
comp
to the end of this split pane
comp
- component to be addedweight
- the weight property of this component. The initial size of the comp
will be determined by its own weight and total weight of all componentspublic void setRemoveFromParent(boolean b)
public boolean isRemoveFromParent()
public void removePane(Component comp)
comp
- component to be removedpublic void setDividerSize(int size)
size
- the new divider sizepublic int getDividerSize()
public int getOrientation()
getOrientation
in interface Orientation
public Component getPrevious(Component c)
c
public Component getNext(Component c)
c
, , or null if the passed component is
the last one or passed component is not contained in this split pane
public Component[] getPanes()
public int getPaneCount()
public Component getComponentAt(int x, int y)
getComponentAt
in class Container
x
- the x coordinatey
- the y coordinatepublic Component getComponentAt(Point p)
getComponentAt
in class Container
p
- the pointpublic boolean isDroppable(Component comp)
public float getCurrentWeight(Component c)
getWeight(java.awt.Component)
public float getWeight(Component c)
getCurrentWeight(java.awt.Component)
public float getTotalWeight()
public void updateWeight(Component c, float w)
c
c
- the compoent to be set new weightw
- new weightpublic void setDividerTransparent(boolean b)
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |