com.lightdev.app.shtm
Class SplitPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.lightdev.app.shtm.SplitPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class SplitPanel
extends javax.swing.JPanel

A panel to manage a pluggable panel layout, i.e. around a center panel, other panels can be placed very similar to BorderLayout. The difference of this class to BorderLayout is that it creates JSplitPanes for each panel.

This uses JTabbedPanes for each of the panels surrounding the center panel.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int CENTER
          constant for the center panel of this SplitPanel
static int EAST
          constant for the east plug-in container of this SplitPanel
static int MAJOR_AXIS_HORIZONTAL
          constant for the major axis being the horizontal one
static int MAJOR_AXIS_VERTICAL
          constant for the major axis being the vertical one
static int NORTH
          constant for the north plug-in container of this SplitPanel
static int SOUTH
          constant for the south plug-in container of this SplitPanel
static int WEST
          constant for the west plug-in container of this SplitPanel
 
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
SplitPanel()
          Constructor
 
Method Summary
 void addComponent(javax.swing.JTabbedPane c, int location)
          add a plug-in container to this SplitPanel ata given location
 void adjustDividerSizes()
          show/hide dividers according to visibility of their associated plug-in containers
 int getDivLoc(int panel)
          get the divider location for a given panel
 javax.swing.JTabbedPane getPanel(int location)
          get the plug-in container for a given panel
 void removeAllOuterPanels()
          remove panels surrounding the center panel
 void restorePrefs()
          restore divider locations from preferences
 void savePrefs()
          save divider locations to preferences
 void setDivLoc(int panel, double loc)
          set the location of a given divider
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAJOR_AXIS_HORIZONTAL

public static final int MAJOR_AXIS_HORIZONTAL
constant for the major axis being the horizontal one

See Also:
Constant Field Values

MAJOR_AXIS_VERTICAL

public static final int MAJOR_AXIS_VERTICAL
constant for the major axis being the vertical one

See Also:
Constant Field Values

NORTH

public static final int NORTH
constant for the north plug-in container of this SplitPanel

See Also:
Constant Field Values

EAST

public static final int EAST
constant for the east plug-in container of this SplitPanel

See Also:
Constant Field Values

SOUTH

public static final int SOUTH
constant for the south plug-in container of this SplitPanel

See Also:
Constant Field Values

WEST

public static final int WEST
constant for the west plug-in container of this SplitPanel

See Also:
Constant Field Values

CENTER

public static final int CENTER
constant for the center panel of this SplitPanel

See Also:
Constant Field Values
Constructor Detail

SplitPanel

public SplitPanel()
Constructor

Method Detail

removeAllOuterPanels

public void removeAllOuterPanels()
remove panels surrounding the center panel


setDivLoc

public void setDivLoc(int panel,
                      double loc)
set the location of a given divider

Parameters:
panel - the panel to set the location for
loc - the relative location of the divider (0, 0.1, ..., 0.9, 1)

getDivLoc

public int getDivLoc(int panel)
get the divider location for a given panel

Parameters:
panel - the panel to get the divider location for
Returns:
the divider location

savePrefs

public void savePrefs()
save divider locations to preferences


restorePrefs

public void restorePrefs()
restore divider locations from preferences


getPanel

public javax.swing.JTabbedPane getPanel(int location)
get the plug-in container for a given panel

Parameters:
location - the location of the desired container (SplitPanel.NORTH, SOUTH, etc.)
Returns:
the plug-in container

adjustDividerSizes

public void adjustDividerSizes()
show/hide dividers according to visibility of their associated plug-in containers


addComponent

public void addComponent(javax.swing.JTabbedPane c,
                         int location)
add a plug-in container to this SplitPanel ata given location

Parameters:
c - the plug-in container to add
location - the location to add to (SplitPanel.NORTH, SOUTH, etc.)