All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.SplitterPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----symantec.itools.awt.SplitterPanel
- public class SplitterPanel
- extends Panel
Use to create a container that can be divided into a number of subpanels which
holds visual components and other panels, and specifically to:
- ╖ Create a subcontainer that organizes container space within an Applet,
Frame or Dialog container. This simplifies your component layout task.
- ╖ Hold other specialized Panel containers.
The SplitterPanel component is the parent Panel containing a set of
subpanels. You must write code to divide the parent panel into subpanels.
You must set panel defaults in your project source code.
The SplitterPanel automatically recognizes the MOUSE_DRAG event as the command
to resize the appropriate subpanel boundary.
Subpanels can be resized at runtime by dragging panel borders with the mouse.
This code example splits a SplitterPanel into four subpanels and adds a
button to two of the subpanels.
splitterPanel1.split(splitterPanel1.SPLIT_HOR);
splitterPanel1.getTopPanel().split(splitterPanel1.SPLIT_VER);
splitterPanel1.getBottomPanel().split(splitterPanel1.SPLIT_VER);
// add a button to the top left panel
splitterPanel1.getTopLeftPanel().add(new Button("Top Left"));
// add a button to the lower right panel
splitterPanel1.getBottomRightPanel().add(new Button("Bottom Right"));
Individual subpanels can be accessed in code using any of these methods:
getBottomLeftPanel,
getBottomPanel,
getBottomRightPanel,
getLeftPanel,
getRightPanel,
getSub2Panel,
getSubPanel,
getTopLeftPanel,
getTopPanel,
getTopRightPanel.
-
moveSplitCursor
- Determines the cursor to use when dragging the split between panels.
-
SPLIT3_BOTTOM
- Panel split constant for the SplitterPanel constructor.
-
SPLIT3_LEFT
- Panel split constant for the SplitterPanel constructor.
-
SPLIT3_RIGHT
- Panel split constant for the SplitterPanel constructor.
-
SPLIT3_TOP
- Panel split constant for the SplitterPanel constructor.
-
SPLIT_BOTH
- Panel split constant for the SplitterPanel constructor.
-
SPLIT_BOTH_V
- Panel split constant for the SplitterPanel constructor.
-
SPLIT_HOR
- Indicates a horizontal panel split.
-
SPLIT_HORIZONTAL
- Horizontal panel split constant for the SplitterPanel constructor.
-
SPLIT_VER
- Indicates a vertical panel split.
-
SPLIT_VERTICAL
- Vertical panel split constant for the SplitterPanel constructor.
-
use3dBdr
- This flag specifies how to draw the border around panels.
-
SplitterPanel()
- Constructs a new default SplitterPanel.
-
SplitterPanel(int)
- Constructs a new SplitterPanel which is split into panels.
-
SplitterPanel(int, Component, Component, Component, Component)
- Constructs a new SplitterPanel which is split into panels
to which components are added.
-
SplitterPanel(int, int)
- Constructs a new SplitterPanel of the specified size which
is ready to be split into panels.
-
SplitterPanel(int, int, int)
- Constructs a new SplitterPanel of specified size which is
split into panels.
-
add(Component)
- Adds a component to the end of this container.
-
add(Component, int)
- Adds a component to the end of this container.
-
gapColor()
- Gets the color of the gap between and around panels.
-
getBottomLeftPanel()
- Gets the bottom left panel.
-
getBottomPanel()
- Gets the bottom panel of a horizontally split SplitterPanel.
-
getBottomRightPanel()
- Gets the bottom right panel.
-
getComponent()
- Gets the component in this SplitterPanel.
-
getComponents()
- Returns all of the components in this container.
-
getEnforceMinDim()
- Gets the current "enforce minimum dimension" mode.
-
getGapColor()
- Gets the color of the gap between panels and around the outside border.
-
getLeftPanel()
- Gets the left panel of a vertically split SplitterPanel.
-
getPropResize()
- Gets the current "resize propagation" mode.
-
getRightPanel()
- Gets the right panel of a vertically split SplitterPanel.
-
getSplitType()
- Gets the type of split for this SplitterPanel.
-
getSub2Panel(int, int, int, int)
- Gets a panel within a doubly split SplitterPanel with
specified split types.
-
getSubPanel(int)
- Gets a panel within a SplitterPanel.
-
getSubPanel(int, int)
- Gets a panel within a SplitterPanel of specified type.
-
getTopLeftPanel()
- Gets the top left panel.
-
getTopPanel()
- Gets the top panel of a horizontally split SplitterPanel.
-
getTopRightPanel()
- Gets the top right panel.
-
handleEvent(Event)
- Processes events for this component.
-
iBdrSize()
- Gets the size of the border drawn between panels.
-
iGapHeight()
- Gets the size of the split between panels.
-
iGapWidth()
- Gets the size of the split between panels.
-
layout()
- Handles the laying out of components within this component.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
moveSplit(int, int)
- Moves the location of the gap between panels.
-
oBdrSize()
- Gets the size of the border drawn around the outside of the SplitterPanel.
-
oGapHeight()
- Gets the size of the split around the inside of the SplitterPanel border.
-
oGapThis(Event)
- Override this method if you want a behavior when events
occur in the outer gap.
-
oGapWidth()
- Gets the size of the split around the inside of the SplitterPanel border.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
remove(Component)
- Removes the specified component from this container.
-
removeAll()
- Removes all the components from this container.
-
reshape(int, int, int, int)
- Moves and/or resizes this component.
-
reshapeHeight(int, int)
- Reshapes the height and/or vertical position.
-
reshapeWidth(int, int)
- Reshapes the width and/or horizontal position.
-
setBdrSizes(int)
- Sets the size of the border drawn between panels and around the
outside of the SplitterPanel.
-
setBdrSizes(int, int)
- Sets the size of the border drawn between panels and around the
outside of the SplitterPanel.
-
setEnforceMinDim(boolean)
- Sets the "enforce minimum dimension" mode.
-
setGapColor(Color)
- Sets the color of the gap between panels and around the outside
border.
-
setGapSizes(int)
- Sets the size of the split between panels and around the inside of the
SplitterPanel border.
-
setGapSizes(int, int)
- Sets the size of the split between panels and around the inside of the
SplitterPanel border.
-
setGapSizes(int, int, int, int)
- Sets the size of the split between panels and around the inside of the
SplitterPanel border.
-
setLayout(LayoutManager)
- Takes no action.
-
setMinimumSize(Dimension)
- Sets the minimum size of this SplitterPanel.
-
setPreferredSize(Dimension)
- Sets the preferred size of this SplitterPanel.
-
setPropResize(boolean)
- Sets the "resize propagation" mode.
-
split(int)
- Splits a SplitterPanel into two panels.
-
split(int, Component, Component)
- Splits a SplitterPanel into two panels and adds two components.
-
toString()
- Returns a string representation of this component.
-
update(Graphics)
- Handles redrawing of this component on the screen.
SPLIT_VER
public final static int SPLIT_VER
- Indicates a vertical panel split. The panel contains/will
contain two subpanels, left and right.
- See Also:
- split
SPLIT_HOR
public final static int SPLIT_HOR
- Indicates a horizontal panel split. The panel contains/will
contain two subpanels, top and bottom.
- See Also:
- split
SPLIT_VERTICAL
public final static int SPLIT_VERTICAL
- Vertical panel split constant for the SplitterPanel constructor.
This splits the panel into two vertical panels.
SPLIT_HORIZONTAL
public final static int SPLIT_HORIZONTAL
- Horizontal panel split constant for the SplitterPanel constructor.
This splits the panel into two horizontal panels.
SPLIT_BOTH
public final static int SPLIT_BOTH
- Panel split constant for the SplitterPanel constructor.
This splits the panel into four panels by first splitting horizontally then
splitting vertically.
SPLIT_BOTH_V
public final static int SPLIT_BOTH_V
- Panel split constant for the SplitterPanel constructor.
This splits the panel into four panels by first splitting vertically then
splitting horizontally.
SPLIT3_LEFT
public final static int SPLIT3_LEFT
- Panel split constant for the SplitterPanel constructor.
This splits the panel into three panels, with a single larger panel on the
right.
SPLIT3_RIGHT
public final static int SPLIT3_RIGHT
- Panel split constant for the SplitterPanel constructor.
This splits the panel into three panels, with a single larger panel on the
left.
SPLIT3_TOP
public final static int SPLIT3_TOP
- Panel split constant for the SplitterPanel constructor.
This splits the panel into three panels, with a single larger panel on the
bottom.
SPLIT3_BOTTOM
public final static int SPLIT3_BOTTOM
- Panel split constant for the SplitterPanel constructor.
This splits the panel into three panels, with a single larger panel on the
top.
use3dBdr
public boolean use3dBdr
- This flag specifies how to draw the border around panels.
If true, the border around the panel is drawn with a three-dimensional effect.
moveSplitCursor
public int moveSplitCursor
- Determines the cursor to use when dragging the split between panels.
Use Frame.HAND_CURSOR, etc to choose a cursor or
set to Integer.MIN_VALUE to prevent cursor change.
- See Also:
- Frame
SplitterPanel
public SplitterPanel()
- Constructs a new default SplitterPanel.
By default, all the gap sizes are 3 and all the border sizes 2.
- See Also:
- setGapSizes, setBdrSizes
SplitterPanel
public SplitterPanel(int spWidth,
int spHeight)
- Constructs a new SplitterPanel of the specified size which
is ready to be split into panels.
By default, all the gap sizes are 3 and all the border sizes 2.
- Parameters:
- spWidth - the initial width of the SplitterPanel, in pixels
- spHeight - the initial height of the SplitterPanel, in pixels
- See Also:
- setGapSizes, setBdrSizes
SplitterPanel
public SplitterPanel(int spWidth,
int spHeight,
int splitSpec)
- Constructs a new SplitterPanel of specified size which is
split into panels.
By default, all the gap sizes are 3 and all the border sizes 2.
- Parameters:
- spWidth - the initial width of the SplitterPanel, in pixels
- spHeight - the initial height of the SplitterPanel, in pixels
- splitSpec - specifies how to split up the panel
- See Also:
- SPLIT_VERTICAL, SPLIT_HORIZONTAL, SPLIT_BOTH, SPLIT_BOTH_V, SPLIT3_LEFT, SPLIT3_RIGHT, SPLIT3_TOP, SPLIT3_BOTTOM, setGapSizes, setBdrSizes
SplitterPanel
public SplitterPanel(int splitSpec)
- Constructs a new SplitterPanel which is split into panels.
By default, all the gap sizes are 3 and all the border sizes 2.
- Parameters:
- splitSpec - specifies how to split up the panel
- See Also:
- SPLIT_VERTICAL, SPLIT_HORIZONTAL, SPLIT_BOTH, SPLIT_BOTH_V, SPLIT3_LEFT, SPLIT3_RIGHT, SPLIT3_TOP, SPLIT3_BOTTOM, setGapSizes, setBdrSizes
SplitterPanel
public SplitterPanel(int splitSpec,
Component compR1C1,
Component compR1C2,
Component compR2C1,
Component compR2C2)
- Constructs a new SplitterPanel which is split into panels
to which components are added.
By default, all the gap sizes are 3 and all the border sizes 2.
- Parameters:
- splitSpec - specifies how to split up the panel
- compR1C1 - specifies the component in row 1, column 1 (top, left)
- compR1C2 - specifies the component in row 1, column 2 (top, right)
- compR2C1 - specifies the component in row 2, column 1 (bottom, left)
- compR2C2 - specifies the component in row 2, column 2 (bottom, right)
- See Also:
- SPLIT_VERTICAL, SPLIT_HORIZONTAL, SPLIT_BOTH, SPLIT_BOTH_V, SPLIT3_LEFT, SPLIT3_RIGHT, SPLIT3_TOP, SPLIT3_BOTTOM, setGapSizes, setBdrSizes
setGapColor
public void setGapColor(Color c)
- Sets the color of the gap between panels and around the outside
border.
- Parameters:
- c - the color to use
- See Also:
- getGapColor
getGapColor
public Color getGapColor()
- Gets the color of the gap between panels and around the outside border.
- Returns:
- the current gap color
- See Also:
- setGapColor
setGapSizes
public void setGapSizes(int gapSize)
- Sets the size of the split between panels and around the inside of the
SplitterPanel border.
The default for all gap sizes is 3.
- Parameters:
- gapSize - the split size in pixels
setGapSizes
public void setGapSizes(int gapWidth,
int gapHeight)
- Sets the size of the split between panels and around the inside of the
SplitterPanel border.
The default for all gap sizes is 3.
- Parameters:
- gapWidth - the split width in pixels
- gapHeight - the split height in pixels
setGapSizes
public void setGapSizes(int iGapWidth,
int iGapHeight,
int oGapWidth,
int oGapHeight)
- Sets the size of the split between panels and around the inside of the
SplitterPanel border.
The default for all gap sizes is 3.
- Parameters:
- iGapWidth - the split width between panels, in pixels
- iGapHeight - the split height between panels, in pixels
- oGapWidth - the gap width inside the border, in pixels
- oGapHeight - the gap height inside the border, in pixels
setBdrSizes
public void setBdrSizes(int iBdrSize,
int oBdrSize)
- Sets the size of the border drawn between panels and around the
outside of the SplitterPanel.
The default for all border sizes is 2.
- Parameters:
- iBdrSize - the border size between panels, in pixels
- oBdrSize - the border size around the outside of the SplitterPanel, in pixels
setBdrSizes
public void setBdrSizes(int bdrSize)
- Sets the size of the border drawn between panels and around the
outside of the SplitterPanel.
- Parameters:
- bdrSize - the size in pixels
gapColor
public Color gapColor()
- Gets the color of the gap between and around panels.
- Returns:
- the current gap color
- See Also:
- setGapColor
setEnforceMinDim
public void setEnforceMinDim(boolean theFlag)
- Sets the "enforce minimum dimension" mode.
This mode prevents the dragging of a split between panels
from making a panel smaller than the minimum size of its component.
- Parameters:
- theFlag - if true enforces minimum panel dimensions
- See Also:
- getEnforceMinDim
getEnforceMinDim
public boolean getEnforceMinDim()
- Gets the current "enforce minimum dimension" mode.
This mode prevents the dragging of a split between panels
from making a panel smaller than the minimum size of its component.
- Returns:
- true if minimum panel dimensions are enforced
- See Also:
- setEnforceMinDim
setPropResize
public void setPropResize(boolean theFlag)
- Sets the "resize propagation" mode.
Set this to false to prevent the automatic resizing of SplitterPanel
panels from also calling resize() for the component that you add.
The default behavior propagates the resizing effect of dragging the
split between panes by calling move and resize for the panels that have
been added to those panes. Clearing this introduces a clipping effect,
rather than a scaling effect.
- Parameters:
- theFlag - if true, resize propagation is enabled; if false,
resize propagation is disabled
- See Also:
- getPropResize
getPropResize
public boolean getPropResize()
- Gets the current "resize propagation" mode.
When this mode is enabled, the resizing effect of dragging the split
between panes is propagated by reshaping the panels that have been
added to those panes. This results in a scaling effect.
When this mode is disabled this doesn't happen, resulting in a
clipping effect.
This mode is enabled by default.
- Returns:
- the current "resize propagation" mode
- See Also:
- setPropResize
getSplitType
public int getSplitType()
- Gets the type of split for this SplitterPanel.
- Returns:
- the splitType: SPLIT_VER or SPLIT_HOR
- See Also:
- SPLIT_VER, SPLIT_HOR
getSubPanel
public SplitterPanel getSubPanel(int n)
- Gets a panel within a SplitterPanel.
- Parameters:
- n - panel number (1 for first panel, or 2 for second
panel)
- Returns:
- the panel, or null if none
- See Also:
- getSub2Panel
getSubPanel
public SplitterPanel getSubPanel(int n,
int theSplitType)
- Gets a panel within a SplitterPanel of specified type.
For example, if "aPanel" was a horizontally split SplitterPanel,
the call aPanel.getSubPanel(1,SPLIT_HOR) would retrieve the first
(topmost) panel, and the call aPanel.getSubPanel(1,SPLIT_VER) would
return null since aPanel is not split vertically.
- Parameters:
- n - panel number (1 for first panel, or 2 for second
panel)
- theSplitType - the type of split this panel has
(SPLIT_VER or SPLIT_HOR)
- Returns:
- the panel, or null if none of the specified type
- See Also:
- SPLIT_VER, SPLIT_HOR, getSub2Panel
getSub2Panel
public SplitterPanel getSub2Panel(int n1,
int theSplitType1,
int n2,
int theSplitType2)
- Gets a panel within a doubly split SplitterPanel with
specified split types.
This method is equivalent to calling getSubPanel() twice, the
second time with the results from the first.
- Parameters:
- n1 - panel number (1 for first panel, or 2 for second panel)
- theSplitType1 - the type of split this panel has
(SPLIT_VER or SPLIT_HOR)
- n2 - panel number (1 for first panel, or 2 for second panel)
- theSplitType2 - the type of split the subpanel has
(SPLIT_VER or SPLIT_HOR)
- Returns:
- the panel, or null if none of the specified type
- See Also:
- SPLIT_VER, SPLIT_HOR, getSubPanel
getTopPanel
public SplitterPanel getTopPanel()
- Gets the top panel of a horizontally split SplitterPanel.
- Returns:
- the panel, or null if this panel is not split or is
split vertically
- See Also:
- getBottomPanel, getLeftPanel, getRightPanel, getTopLeftPanel, getTopRightPanel, getBottomLeftPanel, getBottomRightPanel
getBottomPanel
public SplitterPanel getBottomPanel()
- Gets the bottom panel of a horizontally split SplitterPanel.
- Returns:
- the panel, or null if this panel is not split or is
split vertically
- See Also:
- getTopPanel, getLeftPanel, getRightPanel, getTopLeftPanel, getTopRightPanel, getBottomLeftPanel, getBottomRightPanel
getLeftPanel
public SplitterPanel getLeftPanel()
- Gets the left panel of a vertically split SplitterPanel.
- Returns:
- the panel, or null if this panel is not split or is
split horizontally
- See Also:
- getTopPanel, getBottomPanel, getRightPanel, getTopLeftPanel, getTopRightPanel, getBottomLeftPanel, getBottomRightPanel
getRightPanel
public SplitterPanel getRightPanel()
- Gets the right panel of a vertically split SplitterPanel.
- Returns:
- the panel, or null if this panel is not split or is
split horizontally
- See Also:
- getTopPanel, getBottomPanel, getLeftPanel, getTopLeftPanel, getTopRightPanel, getBottomLeftPanel, getBottomRightPanel
getTopLeftPanel
public SplitterPanel getTopLeftPanel()
- Gets the top left panel.
It doesn't matter if this SplitterPanel is initially split horizontally
or vertically.
- Returns:
- the panel, or null if it doesn't exist
- See Also:
- getTopPanel, getBottomPanel, getLeftPanel, getRightPanel, getTopRightPanel, getBottomLeftPanel, getBottomRightPanel
getTopRightPanel
public SplitterPanel getTopRightPanel()
- Gets the top right panel.
It doesn't matter if this SplitterPanel is initially split horizontally
or vertically.
- Returns:
- the panel, or null if it doesn't exist
- See Also:
- getTopPanel, getBottomPanel, getLeftPanel, getRightPanel, getTopLeftPanel, getBottomLeftPanel, getBottomRightPanel
getBottomLeftPanel
public SplitterPanel getBottomLeftPanel()
- Gets the bottom left panel.
It doesn't matter if this SplitterPanel is initially split horizontally
or vertically.
- Returns:
- the panel, or null if it doesn't exist
- See Also:
- getTopPanel, getBottomPanel, getLeftPanel, getRightPanel, getTopLeftPanel, getTopRightPanel, getBottomRightPanel
getBottomRightPanel
public SplitterPanel getBottomRightPanel()
- Gets the bottom right panel.
It doesn't matter if this SplitterPanel is initially split horizontally
or vertically.
- Returns:
- the panel, or null if it doesn't exist
- See Also:
- getTopPanel, getBottomPanel, getLeftPanel, getRightPanel, getTopLeftPanel, getTopRightPanel, getBottomLeftPanel
handleEvent
public boolean handleEvent(Event evt)
- Processes events for this component.
This is a standard Java AWT method which gets called by the AWT
to handle this component's events. The default handler for
components dispatches to one of the following methods as needed:
action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(),
mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp().
If the event is for a topmost (outer) SplitterPanel, it is dispatched
to method oGapThis() for handling.
Do not override this method.
- Parameters:
- evt - the event to handle
- Returns:
- true if the event was handled and no further action is needed,
false to pass the event to this component's parent
- Overrides:
- handleEvent in class Component
- See Also:
- action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp, oGapThis
iGapWidth
public int iGapWidth()
- Gets the size of the split between panels.
- Returns:
- the split width between panels, in pixels
- See Also:
- iGapHeight, oGapWidth, oGapHeight
iGapHeight
public int iGapHeight()
- Gets the size of the split between panels.
- Returns:
- the split height between panels, in pixels
- See Also:
- iGapWidth, oGapWidth, oGapHeight
oGapWidth
public int oGapWidth()
- Gets the size of the split around the inside of the SplitterPanel border.
- Returns:
- the gap width inside the border, in pixels
- See Also:
- iGapWidth, iGapHeight, oGapHeight
oGapHeight
public int oGapHeight()
- Gets the size of the split around the inside of the SplitterPanel border.
- Returns:
- the gap height inside the border, in pixels
- See Also:
- iGapWidth, iGapHeight, oGapWidth
iBdrSize
public int iBdrSize()
- Gets the size of the border drawn between panels.
- Returns:
- the border size between panels, in pixels
- See Also:
- oBdrSize
oBdrSize
public int oBdrSize()
- Gets the size of the border drawn around the outside of the SplitterPanel.
- Returns:
- the border size around the outside of the SplitterPanel, in pixels
- See Also:
- iBdrSize
layout
public synchronized void layout()
- Handles the laying out of components within this component.
This is a standard Java AWT method which gets called by the AWT
when this component is validated with the validate() method.
- Overrides:
- layout in class Container
- See Also:
- validate
moveSplit
public void moveSplit(int spX,
int spY)
- Moves the location of the gap between panels.
- Parameters:
- spX - specifies relative movement in pixels along horizontal axis
- spY - specifies relative movement in pixels along vertical axis
update
public void update(Graphics g)
- Handles redrawing of this component on the screen.
This is a standard Java AWT method which gets called by the Java
AWT (repaint()) to handle repainting this component on the screen.
The graphics context clipping region is set to the bounding rectangle
of this component and its <0,0> coordinate is this component's
top-left corner.
Typically this method paints the background color to clear the
component's drawing space, sets graphics context to be the foreground
color, and then calls paint() to draw the component.
It is overridden here to reduce flicker by eliminating the unnecessary
clearing of the background.
- Parameters:
- g - the graphics context
- Overrides:
- update in class Component
- See Also:
- repaint, paint
paint
public synchronized void paint(Graphics g)
- Paints this component using the given graphics context.
This is a standard Java AWT method which typically gets called
by the AWT to handle painting this component. It paints this component
using the given graphics context. The graphics context clipping region
is set to the bounding rectangle of this component and its <0,0>
coordinate is this component's top-left corner.
Overriding this method is not advised.
- Parameters:
- g - the graphics context used for painting
- Overrides:
- paint in class Container
- See Also:
- repaint, update
getComponent
public Component getComponent()
- Gets the component in this SplitterPanel.
- Returns:
- the component in this SplitterPanel
getComponents
public Component[] getComponents()
- Returns all of the components in this container.
This is a standard Java AWT method which gets called to return
an array of all of the components in this container.
- Returns:
- an array of components in this container
- Overrides:
- getComponents in class Container
preferredSize
public Dimension preferredSize()
- Returns the recommended dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the recommended size of this component.
For each axis, returns the larger of the actual size needed to show all
the components at their preferred size, and the preferred size set by
the setPreferredSize() method.
- Overrides:
- preferredSize in class Container
- See Also:
- minimumSize, setPreferredSize
minimumSize
public Dimension minimumSize()
- Returns the minimum dimensions to properly display this component.
This is a standard Java AWT method which gets called to determine
the minimum size of this component.
For each axis, returns the larger of the actual size needed to show all
the components at their minimum size, and the minimum size set by
the setMinimumSize() method.
- Overrides:
- minimumSize in class Container
- See Also:
- preferredSize
setPreferredSize
public void setPreferredSize(Dimension theDim)
- Sets the preferred size of this SplitterPanel.
This will override the calculated preferred size when the calculated
size is smaller.
- Parameters:
- theDim - the preferred dimensions
setMinimumSize
public void setMinimumSize(Dimension theDim)
- Sets the minimum size of this SplitterPanel.
This will override the calculated minimum size when the calculated
size is smaller.
- Parameters:
- theDim - the minimum dimensions
reshape
public synchronized void reshape(int x,
int y,
int width,
int height)
- Moves and/or resizes this component.
This is a standard Java AWT method which gets called to move and/or
resize this component. Components that are in containers with layout
managers should not call this method, but rely on the layout manager
instead.
- Parameters:
- x - horizontal position in the parent's coordinate space
- y - vertical position in the parent's coordinate space
- width - the new width
- height - the new height
- Overrides:
- reshape in class Component
- See Also:
- reshapeHeight, reshapeWidth
reshapeWidth
public synchronized void reshapeWidth(int x,
int width)
- Reshapes the width and/or horizontal position.
This prevents vertical adjustments when the layout is computed.
- Parameters:
- x - horizontal position in the parent's coordinate space
- width - the new width, in pixels
- See Also:
- reshapeHeight, reshape
reshapeHeight
public synchronized void reshapeHeight(int y,
int height)
- Reshapes the height and/or vertical position.
This prevents horizontal adjustments when the layout is computed.
- Parameters:
- y - vertical position in the parent's coordinate space
- height - the new height, in pixels
- See Also:
- reshapeWidth, reshape
add
public synchronized Component add(Component comp,
int pos)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. Typically, the specified component is added to
this container at the given zero-relative position index. A
position index of -1 would append the component to the end.
It is overridden here to set the only
component in this SplitterPanel. This is the component that is displayed
in a panel. The SplitterPanel can only contain one component.
Any previous component will be removed before the new one is added.
- Parameters:
- comp - the component to add
- pos - the zero-relative index at which to add the component or -1
for end (IGNORED)
- Returns:
- the added component
- Overrides:
- add in class Container
- See Also:
- remove
add
public Component add(Component comp)
- Adds a component to the end of this container.
This is a standard Java AWT method which gets called to add a
component to a container. Typically, the specified component is added to
the end of this container.
It is overridden here to set the only
component in this SplitterPanel. This is the component that is displayed
in a panel. The SplitterPanel can only contain one component.
Any previous component will be removed before the new one is added.
- Parameters:
- comp - the component to add
- Returns:
- the added component
- Overrides:
- add in class Container
- See Also:
- remove
remove
public synchronized void remove(Component comp)
- Removes the specified component from this container.
This is a standard Java AWT method which gets called to remove a
component from a container. When this happens the component's
removeNotify() will also get called to indicate component removal.
- Parameters:
- comp - the component to remove
- Overrides:
- remove in class Container
- See Also:
- removeAll, add
removeAll
public synchronized void removeAll()
- Removes all the components from this container.
This is a standard Java AWT method which gets called to remove all
the components from a container. When this happens each component's
removeNotify() will also get called to indicate component removal.
Split panels are preserved.
- Overrides:
- removeAll in class Container
- See Also:
- remove, add
split
public SplitterPanel split(int splitType)
- Splits a SplitterPanel into two panels.
This creates two new SplitterPanels which are nested within the original
SplitterPanel. If the split type is SPLIT_VER the new panels are arranged
side-by-side with a splitter bar vertically between them.
If the split type is SPLIT_HOR the new panels are arranged one above the
other with a splitter bar horizontally between them.
- Parameters:
- splitType - SPLIT_VER or SPLIT_HOR to request a
vertical or horizontal split
- Returns:
- the first new SplitterPanel if successful (left or top)
- See Also:
- SPLIT_VER, SPLIT_HOR
split
public synchronized SplitterPanel split(int splitType,
Component theComp1,
Component theComp2)
- Splits a SplitterPanel into two panels and adds two components.
This creates two new SplitterPanels which are nested within the original
SplitterPanel.
If the split type is SPLIT_VER the new panels are arranged
side-by-side with a splitter bar vertically between them.
Component theComp1 would be placed in the left panel, theComp2 in the right.
If the split type is SPLIT_HOR the new panels are arranged one above the
other with a splitter bar horizontally between them.
Component theComp1 would be placed in the top panel, theComp2 in the bottom.
- Parameters:
- splitType - SPLIT_VER or SPLIT_HOR to request
vertical or horizontal splits
- theComp1 - the first component (left or top)
- theComp2 - the second component (right or bottom)
- Returns:
- the first new SplitterPanel if successful (left or top)
- See Also:
- SPLIT_VER, SPLIT_HOR
setLayout
public void setLayout(LayoutManager mgr)
- Takes no action.
This is a standard Java AWT method which gets called to specify
which layout manager should be used to layout the components in
standard containers.
Since layout managers CANNOT BE USED with this container the standard
setLayout has been OVERRIDDEN for this container and does nothing.
- Parameters:
- l - the layout manager to use to layout this container's components
(IGNORED)
- Overrides:
- setLayout in class Container
- See Also:
- getLayout
oGapThis
public boolean oGapThis(Event evt)
- Override this method if you want a behavior when events
occur in the outer gap. Be sure to call super.oGapThis
if you do override this method. Note that it is recommended
that you place a SplitterPanel inside of a frame and set
outer border and gap sizes to zero if you want the end user
to be able to resize.
- Parameters:
- evt - the event that occurred in the outer gap around
a SplitterPanel
toString
public String toString()
- Returns a string representation of this component.
This is a standard Java AWT method which gets called to generate
a string that represents this component.
- Returns:
- a meaningful string about this object
- Overrides:
- toString in class Component
All Packages Class Hierarchy This Package Previous Next Index