VASSAL.tools
Class ComponentSplitter

java.lang.Object
  |
  +--VASSAL.tools.ComponentSplitter

public class ComponentSplitter
extends java.lang.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


Inner Class Summary
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
ComponentSplitter()
           
 
Method Summary
 java.awt.Component getSplitAncestor(java.awt.Component c, int index)
          Search the containment hierarchy for the index-th ComponentSplitter.SplitPane ancestor of a target component
static void main(java.lang.String[] args)
           
 ComponentSplitter.SplitPane splitBottom(java.awt.Component base, java.awt.Component hideableComponent, boolean resizeOnVisibilityChange)
          Create a new hideable panel to the bottom of the base component.
 ComponentSplitter.SplitPane splitLeft(java.awt.Component base, java.awt.Component hideableComponent, boolean resizeOnVisibilityChange)
          Create a new hideable panel to the left of the base component.
 ComponentSplitter.SplitPane splitRight(java.awt.Component base, java.awt.Component hideableComponent, boolean resizeOnVisibilityChange)
          Create a new hideable panel to the right of the base component.
 ComponentSplitter.SplitPane splitTop(java.awt.Component base, java.awt.Component hideableComponent, boolean resizeOnVisibilityChange)
          Create a new hideable panel to the top of the base component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentSplitter

public ComponentSplitter()
Method Detail

splitRight

public ComponentSplitter.SplitPane splitRight(java.awt.Component base,
                                              java.awt.Component hideableComponent,
                                              boolean resizeOnVisibilityChange)
Create a new hideable panel to the right of the base component. The base component is replaced by a ComponentSplitter.SplitPane
Parameters:
base - the base component
hideableComponent - the hideable component
resizeOnVisibilityChange - 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

public ComponentSplitter.SplitPane splitLeft(java.awt.Component base,
                                             java.awt.Component hideableComponent,
                                             boolean resizeOnVisibilityChange)
Create a new hideable panel to the left of the base component. The base component is replaced by a ComponentSplitter.SplitPane
Parameters:
base - the base component
hideableComponent - the hideable component
resizeOnVisibilityChange - 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

public ComponentSplitter.SplitPane splitBottom(java.awt.Component base,
                                               java.awt.Component hideableComponent,
                                               boolean resizeOnVisibilityChange)
Create a new hideable panel to the bottom of the base component. The base component is replaced by a ComponentSplitter.SplitPane
Parameters:
base - the base component
hideableComponent - the hideable component
resizeOnVisibilityChange - 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

public ComponentSplitter.SplitPane splitTop(java.awt.Component base,
                                            java.awt.Component hideableComponent,
                                            boolean resizeOnVisibilityChange)
Create a new hideable panel to the top of the base component. The base component is replaced by a ComponentSplitter.SplitPane
Parameters:
base - the base component
hideableComponent - the hideable component
resizeOnVisibilityChange - 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

public java.awt.Component getSplitAncestor(java.awt.Component c,
                                           int index)
Search the containment hierarchy for the index-th ComponentSplitter.SplitPane ancestor of a target component
Parameters:
c - the target component
index - If -1, return the last ComponentSplitter.SplitPane ancestor
Returns:
the ComponentSplitter.SplitPane ancestor, or the original component if none is found

main

public static void main(java.lang.String[] args)