com.bff.musicjukebox.ui.components
Class RetractPanel

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.bff.musicjukebox.ui.components.RetractPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class RetractPanel
extends javax.swing.JPanel

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 BOTTOM_UP
          Constant to indicate a bottom-up display.
static int LEFT_TO_RIGHT
          Constant to indicate a left-to-right display.
static int RIGHT_TO_LEFT
          Constant to indicate a right-to-left display.
static int TOP_DOWN
          Constant to indicate a top-down display.
 
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
RetractPanel(javax.swing.JComponent contents, int direction)
          Creates a new RetractPanel object.
 
Method Summary
 int getDirection()
          Gets the direction the component expands.
 java.awt.Point getPosition()
          Gets the position of the component.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of the component.
 float getTabAlignment()
          Gets the tab component alignment.
 javax.swing.JComponent getTabComponent()
          Gets the component to use as a tab.
 int getTabPlacement()
          Gets the tab component placement.
 void install(javax.swing.RootPaneContainer parent, int x, int y)
          Installs the component in the palette layer of the specified root pane container.
 boolean isMaximized()
          Checks if the panel is at it's maximized state.
 boolean isMinimized()
          Checks if the panel is at it's minimized state.
 boolean isToggling()
           
 void setDirection(int d)
          Sets the direction the component expands.
 void setMaximized(boolean animated)
          Sets the panel to it's maximized state.
 void setMinimized(boolean animated)
          Sets the panel to it's minimized state.
 void setPosition(int x, int y)
          Sets the position of the component.
 void setPosition(java.awt.Point p)
          Sets the position of the component.
 void setTabAlignment(float a)
          Sets the tab component alignment.
 void setTabComponent(javax.swing.JComponent c)
          Sets the component to use as a tab.
 void setTabPlacement(int p)
          Sets the tab component placement.
 void setToggling(boolean toggling)
           
 void setVisible(boolean v)
          Sets the visibility of the component.
 void show(float pct)
          Sets the panel to display the given visible percentage.
 void toggle(boolean animated)
          Toggles the state between minimized or maximized state.
 
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, 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, 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

TOP_DOWN

public static final int TOP_DOWN
Constant to indicate a top-down display.

See Also:
Constant Field Values

BOTTOM_UP

public static final int BOTTOM_UP
Constant to indicate a bottom-up display.

See Also:
Constant Field Values

LEFT_TO_RIGHT

public static final int LEFT_TO_RIGHT
Constant to indicate a left-to-right display.

See Also:
Constant Field Values

RIGHT_TO_LEFT

public static final int RIGHT_TO_LEFT
Constant to indicate a right-to-left display.

See Also:
Constant Field Values
Constructor Detail

RetractPanel

public RetractPanel(javax.swing.JComponent contents,
                    int direction)
Creates a new RetractPanel object.

Parameters:
contents - the content component
direction - the display direction
Method Detail

install

public void install(javax.swing.RootPaneContainer parent,
                    int x,
                    int y)
Installs the component in the palette layer of the specified root pane container.

Parameters:
parent - the root pane container
x - the x-position of the component
y - the y-position of the component

getTabComponent

public javax.swing.JComponent getTabComponent()
Gets the component to use as a tab.

Returns:
the component used as a tab

setTabComponent

public void setTabComponent(javax.swing.JComponent c)
Sets the component to use as a tab.

Parameters:
c - the component used as a tab

getTabPlacement

public int getTabPlacement()
Gets the tab component placement.

Returns:
the component placement
See Also:
SwingConstants.TOP, SwingConstants.BOTTOM, SwingConstants.LEFT, SwingConstants.RIGHT

setTabPlacement

public void setTabPlacement(int p)
Sets the tab component placement.

Parameters:
p - the component placement
See Also:
SwingConstants.TOP, SwingConstants.BOTTOM, SwingConstants.LEFT, SwingConstants.RIGHT

getTabAlignment

public float getTabAlignment()
Gets the tab component alignment.

Returns:
the component alignment
See Also:
Component.TOP_ALIGNMENT, Component.BOTTOM_ALIGNMENT, Component.CENTER_ALIGNMENT, Component.LEFT_ALIGNMENT, Component.RIGHT_ALIGNMENT

setTabAlignment

public void setTabAlignment(float a)
Sets the tab component alignment. The alignment is a float value representing a percentage from top to bottom or left to right of the main panel to place the tab component.

Parameters:
a - the component alignment
See Also:
Component.TOP_ALIGNMENT, Component.BOTTOM_ALIGNMENT, Component.CENTER_ALIGNMENT, Component.LEFT_ALIGNMENT, Component.RIGHT_ALIGNMENT

setVisible

public void setVisible(boolean v)
Sets the visibility of the component.

Overrides:
setVisible in class javax.swing.JComponent
Parameters:
v - if true, sets the component to be visible

getDirection

public int getDirection()
Gets the direction the component expands.

Returns:
the direction the component expands
See Also:
TOP_DOWN, BOTTOM_UP, LEFT_TO_RIGHT, RIGHT_TO_LEFT

setDirection

public void setDirection(int d)
Sets the direction the component expands.

Parameters:
d - the direction the component expands
See Also:
TOP_DOWN, BOTTOM_UP, LEFT_TO_RIGHT, RIGHT_TO_LEFT

getPosition

public java.awt.Point getPosition()
Gets the position of the component.

Returns:
the position of the component

setPosition

public void setPosition(java.awt.Point p)
Sets the position of the component. Use this instead of setLocation().

Parameters:
p - the position of the component

setPosition

public void setPosition(int x,
                        int y)
Sets the position of the component. Use this instead of setLocation().

Parameters:
x - the x-position of the component
y - the y-position of the component

toggle

public void toggle(boolean animated)
Toggles the state between minimized or maximized state.

Parameters:
animated - if the panel should be animated

isMinimized

public boolean isMinimized()
Checks if the panel is at it's minimized state.

Returns:
true if the panel is at it's minimized state

setMinimized

public void setMinimized(boolean animated)
Sets the panel to it's minimized state.

Parameters:
animated - if the minimizing should be animated

isMaximized

public boolean isMaximized()
Checks if the panel is at it's maximized state.

Returns:
true if the panel is at it's maximized state

setMaximized

public void setMaximized(boolean animated)
Sets the panel to it's maximized state.

Parameters:
animated - if the maximizing should be animated

show

public void show(float pct)
Sets the panel to display the given visible percentage. The value is a ratio from 0.0 to 1.0. Generally, this is not used. Instead, use:

Parameters:
pct - the percentage of the component visible

isToggling

public boolean isToggling()

setToggling

public void setToggling(boolean toggling)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of the component.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
the preferred size of the component