com.vlsolutions.swing.docking
Class AutoHideExpandPanel

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.vlsolutions.swing.docking.AutoHideExpandPanel
All Implemented Interfaces:
DockableContainer, SingleDockableContainer, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class AutoHideExpandPanel
extends javax.swing.JPanel
implements SingleDockableContainer

A component used to show the currently expanded view.

Auto-Hide / Auto-Expand feature is a means to save space of screen replacing a Dockable by a Button on one of the Desktop borders.

When the user clicks on the button or his mouse rolls over it, the component is shown (with an expansion animation) as if it was coming from behind the button's border.

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 java.lang.String PROPERTY_EXPANDED
          Constant for the Expanded property (a bound property)
static java.lang.String uiClassID
           
 
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
AutoHideExpandPanel()
           
 
Method Summary
 void clear()
          Clears the state of this expand panel.
 void collapse()
          Collapse the expand panel (making it unvisible)
protected  DockViewTitleBar createTitleBar()
          creates the shared title bar for all expanded panels
 void expand()
          Expands the currently selected button
 javax.swing.JPanel getBottomDragger()
          Returns the component used to modify the expand panel size when expanded from the top
 Dockable getDockable()
          Returns the dockable this container is displaying
 javax.swing.JPanel getLeftDragger()
          Returns the component used to modify the expand panel size when expanded from the right
 javax.swing.JPanel getRightDragger()
          Returns the component used to modify the expand panel size when expanded from the right
 DockViewTitleBar getTitleBar()
           
 javax.swing.JPanel getTopDragger()
          Returns the component used to modify the expand panel size when expanded from the bottom
 java.lang.String getUIClassID()
           
protected  void initBorders()
          Installs borders used to drag the expand panel around
 void installDocking(DockingDesktop desktop)
          Invoked once after creation, in order to let this component register its DockableDragSources to the DockingDesktop, and have a reference of this Desktop.
 boolean isActive()
          Returns true if this panel is the ancestor of the focused component
 boolean isOptimizedDrawingEnabled()
           
 void remove(Dockable dockable)
          Removes a dockable (if it was the currently expanded one)
 void resetBorders()
          Creates the default borders for the expand panel
 void select(AutoHideButton btn)
          Selects a button (may collapse a prevoiusly selected button)
 boolean shouldCollapse()
          Returns true if this panel agrees to beeing hidden.
 void uninstallDocking(DockingDesktop desktop)
          Called once, when the dockablecontainer is no longer used by the desktop, in order to releases resources and listeners taken on installDocking().
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, 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, 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

uiClassID

public static final java.lang.String uiClassID
See Also:
Constant Field Values

PROPERTY_EXPANDED

public static final java.lang.String PROPERTY_EXPANDED
Constant for the Expanded property (a bound property)

See Also:
Constant Field Values
Constructor Detail

AutoHideExpandPanel

public AutoHideExpandPanel()
Method Detail

isOptimizedDrawingEnabled

public boolean isOptimizedDrawingEnabled()
Overrides:
isOptimizedDrawingEnabled in class javax.swing.JComponent

isActive

public boolean isActive()
Returns true if this panel is the ancestor of the focused component


shouldCollapse

public boolean shouldCollapse()
Returns true if this panel agrees to beeing hidden.

During drag operations (resizing), some mouseEnter/mouseExit events can be lost. In that case, the desktop relies on this method to request collaping or not.


getTopDragger

public javax.swing.JPanel getTopDragger()
Returns the component used to modify the expand panel size when expanded from the bottom


getLeftDragger

public javax.swing.JPanel getLeftDragger()
Returns the component used to modify the expand panel size when expanded from the right


getBottomDragger

public javax.swing.JPanel getBottomDragger()
Returns the component used to modify the expand panel size when expanded from the top


getRightDragger

public javax.swing.JPanel getRightDragger()
Returns the component used to modify the expand panel size when expanded from the right


createTitleBar

protected DockViewTitleBar createTitleBar()
creates the shared title bar for all expanded panels


getTitleBar

public DockViewTitleBar getTitleBar()

resetBorders

public void resetBorders()
Creates the default borders for the expand panel


initBorders

protected void initBorders()
Installs borders used to drag the expand panel around


select

public void select(AutoHideButton btn)
Selects a button (may collapse a prevoiusly selected button)


expand

public void expand()
Expands the currently selected button


remove

public void remove(Dockable dockable)
Removes a dockable (if it was the currently expanded one)


collapse

public void collapse()
Collapse the expand panel (making it unvisible)


uninstallDocking

public void uninstallDocking(DockingDesktop desktop)
Description copied from interface: DockableContainer
Called once, when the dockablecontainer is no longer used by the desktop, in order to releases resources and listeners taken on installDocking().

Specified by:
uninstallDocking in interface DockableContainer

installDocking

public void installDocking(DockingDesktop desktop)
Description copied from interface: DockableContainer
Invoked once after creation, in order to let this component register its DockableDragSources to the DockingDesktop, and have a reference of this Desktop.

basic implementation use a single DragSource, and thus calls desk.installDockableDragSource(dragSource).

Specified by:
installDocking in interface DockableContainer

getDockable

public Dockable getDockable()
Description copied from interface: SingleDockableContainer
Returns the dockable this container is displaying

Specified by:
getDockable in interface SingleDockableContainer

getUIClassID

public java.lang.String getUIClassID()
Overrides:
getUIClassID in class javax.swing.JPanel

clear

public void clear()
Clears the state of this expand panel.

This is useful when re-installing a desktop from readXml (for example, it resets dockable expand sizes)



© Copyright 2004-2007 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications