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 classComponentSplitter.SplitPaneContains 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 ComponentgetSplitAncestor(Component c, int index)Deprecated.static voidmain(String[] args)static ComponentSplitter.SplitPanesplit(Component base, Component newComponent, int hideablePosition, boolean resize)Create a new hideable panel beside the base component.static ComponentsplitAncestorOf(Component c, int index)Search the containment hierarchy for the ithComponentSplitter.SplitPaneancestor of a target componentComponentSplitter.SplitPanesplitBottom(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)Deprecated.ComponentSplitter.SplitPanesplitLeft(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)Deprecated.Usesplit(Component, Component, int, boolean)instead.ComponentSplitter.SplitPanesplitRight(Component base, Component hideableComponent, boolean resizeOnVisibilityChange)Deprecated.Usesplit(Component, Component, int, boolean)instead.ComponentSplitter.SplitPanesplitTop(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.SplitPanecontaining 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.SplitPanecontaining 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.SplitPanecontaining 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.SplitPanecontaining the two components
-
getSplitAncestor
Deprecated.Search the containment hierarchy for the index-thComponentSplitter.SplitPaneancestor of a target component- Parameters:
c- the target componentindex- If -1, return the lastComponentSplitter.SplitPaneancestor- Returns:
- the
ComponentSplitter.SplitPaneancestor, or the original component if none is found
-
splitAncestorOf
Search the containment hierarchy for the ithComponentSplitter.SplitPaneancestor of a target component- Parameters:
c- the target componentindex- If -1, return the lastComponentSplitter.SplitPaneancestor- Returns:
- the
ComponentSplitter.SplitPaneancestor, 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_LEFThideablePosition- 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.SplitPanecontaining the two components
-
main
-
split(Component, Component, int, boolean)instead.