Package VASSAL.tools
Class ComponentSplitter
java.lang.Object
VASSAL.tools.ComponentSplitter
public class ComponentSplitter extends Object
Provides support for hidden panels. Use the split methods to create an
instance of
ComponentSplitter.SplitPane
, which can then be manipulated to show and
hide the panel-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ComponentSplitter.SplitPane
Contains methods to automatically show/hide one of its components (the "hideable" component) while the other (the "base" component) remains always visible. -
Constructor Summary
Constructors Constructor Description ComponentSplitter()
-
Method Summary
Modifier and Type Method Description Component
getSplitAncestor(Component c, int index)
Deprecated.static void
main(String[] args)
static ComponentSplitter.SplitPane
split(Component base, Component newComponent, int hideablePosition, boolean resize)
Create a new hideable panel beside the base component.static Component
splitAncestorOf(Component c, int index)
Search the containment hierarchy for the ithComponentSplitter.SplitPane
ancestor of a target componentComponentSplitter.SplitPane
splitBottom(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)
Deprecated.ComponentSplitter.SplitPane
splitLeft(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)
Deprecated.Usesplit(Component, Component, int, boolean)
instead.ComponentSplitter.SplitPane
splitRight(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)
Deprecated.Usesplit(Component, Component, int, boolean)
instead.ComponentSplitter.SplitPane
splitTop(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)
Deprecated.Usesplit(Component, Component, int, boolean)
instead.
-
Constructor Details
-
ComponentSplitter
public ComponentSplitter()
-
-
Method Details
-
splitRight
@Deprecated public ComponentSplitter.SplitPane splitRight(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)Deprecated.Usesplit(Component, Component, int, boolean)
instead.Create a new hideable panel to the right of the base component. The base component is replaced by aComponentSplitter.SplitPane
- Parameters:
base
- the base componenthideableComponent
- the hideable componentresizeOnVisibilityChange
- If true, the containing window will expand or shrink to an appropriate size when the hideable component is shown or hidden- Returns:
- the
ComponentSplitter.SplitPane
containing the two components
-
splitLeft
@Deprecated public ComponentSplitter.SplitPane splitLeft(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)Deprecated.Usesplit(Component, Component, int, boolean)
instead.Create a new hideable panel to the left of the base component. The base component is replaced by aComponentSplitter.SplitPane
- Parameters:
base
- the base componenthideableComponent
- the hideable componentresizeOnVisibilityChange
- If true, the containing window will expand or shrink to an appropriate size when the hideable component is shown or hidden- Returns:
- the
ComponentSplitter.SplitPane
containing the two components
-
splitBottom
@Deprecated public ComponentSplitter.SplitPane splitBottom(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)Deprecated.Usesplit(Component, Component, int, boolean)
instead.Create a new hideable panel to the bottom of the base component. The base component is replaced by aComponentSplitter.SplitPane
- Parameters:
base
- the base componenthideableComponent
- the hideable componentresizeOnVisibilityChange
- If true, the containing window will expand or shrink to an appropriate size when the hideable component is shown or hidden- Returns:
- the
ComponentSplitter.SplitPane
containing the two components
-
splitTop
@Deprecated public ComponentSplitter.SplitPane splitTop(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)Deprecated.Usesplit(Component, Component, int, boolean)
instead.Create a new hideable panel to the top of the base component. The base component is replaced by aComponentSplitter.SplitPane
- Parameters:
base
- the base componenthideableComponent
- the hideable componentresizeOnVisibilityChange
- If true, the containing window will expand or shrink to an appropriate size when the hideable component is shown or hidden- Returns:
- the
ComponentSplitter.SplitPane
containing the two components
-
getSplitAncestor
Deprecated.Search the containment hierarchy for the index-thComponentSplitter.SplitPane
ancestor of a target component- Parameters:
c
- the target componentindex
- If -1, return the lastComponentSplitter.SplitPane
ancestor- Returns:
- the
ComponentSplitter.SplitPane
ancestor, or the original component if none is found
-
splitAncestorOf
Search the containment hierarchy for the ithComponentSplitter.SplitPane
ancestor of a target component- Parameters:
c
- the target componentindex
- If -1, return the lastComponentSplitter.SplitPane
ancestor- Returns:
- the
ComponentSplitter.SplitPane
ancestor, or the original component if none is found
-
split
public static ComponentSplitter.SplitPane split(Component base, Component newComponent, int hideablePosition, boolean resize)Create a new hideable panel beside the base component. The base component is replaced by aComponentSplitter.SplitPane
- Parameters:
base
- the base componentnewComponent
- the hideable component, one ofComponentSplitter.SplitPane.HIDE_TOP
,ComponentSplitter.SplitPane.HIDE_RIGHT
,ComponentSplitter.SplitPane.HIDE_BOTTOM
,ComponentSplitter.SplitPane.HIDE_LEFT
hideablePosition
- the position of the hideable componentresize
- If true, the containing window will expand or shrink to an appropriate size when the hideable component is shown or hidden- Returns:
- the
ComponentSplitter.SplitPane
containing the two components
-
main
-
split(Component, Component, int, boolean)
instead.