JComponentPack 1.5.0

com.zfqjava.swing
Class JDockPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.zfqjava.swing.JDockPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class JDockPane
extends JComponent
implements Accessible

JDockPane provides a dock pane. Client Property:

NameValueDefault Value
JDockPane.scrollableWrapEnabled
  • Boolean.TRUE
  • Boolean.FALSE
Boolean.TRUE
JDockPane.centerLayout
  • SDI
  • Desktop_MDI
  • Tabbed_MDI
SDI

See Also:
ValueAction, Serialized Form

Nested Class Summary
protected  class JDockPane.AccessibleJDockPane
          This class implements accessibility support for the JDockPane class.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
JDockPane()
          Constructors a JDockPane.
 
Method Summary
protected  void addImpl(Component comp, Object constraints, int index)
           
 void addPart(Component comp, Action a)
          Adds the part component.
 void addPart(Component comp, Action a, DockMode dockMode, SideMode sideMode)
          Adds the part component for specified side.
 void addPartAt(Component comp, Action a, DockMode dockMode, SideMode sideMode, int index)
          Adds the part component at the specify index for specified side.
 AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JDockPane.
 Action getAction(Component comp)
          Returns the action for the specify component.
 Component getComponentAt(int index, SideMode sideMode)
          Returns the component at the specified index and side.
 int getComponentCount(SideMode sideMode)
          Returns the component count for the specified side.
 int getDividerSize()
          Returns the divider size.
 DockMode getDockMode(Component comp)
          Returns the dock mode for the specify component.
 Component getSelectedComponent()
          Returns the selected component.
 SideMode getSideMode(Component comp)
          Returns the side mode for the specified component.
 DockPaneUI getUI()
          Returns the look and feel (L&F) object that renders this component.
 String getUIClassID()
          Returns a string that specifies the name of the L&F class that renders this component.
 int indexOfComponent(Component comp, SideMode sideMode)
          Returns the index for the specified component at the specified side.
 boolean isSelected(Component comp)
          Returns the selected state for the specify component.
protected  String paramString()
          Returns a string representation of this JDockPane.
 void removeAllPart(SideMode sideMode)
          Removes all part component for the specified side.
 void removePart(Component comp)
          Removes the part component.
 void removePartAt(SideMode sideMode, int index)
          Removes the part component at the specified index for specified side.
 void setAction(Component comp, Action action)
          Sets the action for the specify component.
 void setDividerSize(int dividerSize)
          Sets the divider size for the JDockPane.
 void setDockMode(Component comp, DockMode dockMode)
          Sets the dock mode for the specify component.
 void setSelectedComponent(Component comp)
          Sets the selected component to the specified component.
 void setUI(DockPaneUI ui)
          Sets the look and feel (L&F) object that renders this component.
 void updateUI()
          Resets the UI property with a value from the current look and feel.
 
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, 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, transferFocusBackward, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDockPane

public JDockPane()
Constructors a JDockPane.

Method Detail

updateUI

public void updateUI()
Resets the UI property with a value from the current look and feel.

Overrides:
updateUI in class JComponent
See Also:
JComponent.updateUI()

getUI

public DockPaneUI getUI()
Returns the look and feel (L&F) object that renders this component.

Returns:
the DockPaneUI object that renders this component

setUI

public void setUI(DockPaneUI ui)
Sets the look and feel (L&F) object that renders this component.

Parameters:
ui - the DockPaneUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent)

getUIClassID

public String getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.

Overrides:
getUIClassID in class JComponent
Returns:
"DockPaneUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

setDividerSize

public void setDividerSize(int dividerSize)
Sets the divider size for the JDockPane.

Parameters:
dividerSize - the divider size
See Also:
getDividerSize()

getDividerSize

public int getDividerSize()
Returns the divider size.

Returns:
the divider size
See Also:
setDividerSize(int)

setDockMode

public void setDockMode(Component comp,
                        DockMode dockMode)
Sets the dock mode for the specify component.

Parameters:
comp - the specify component
dockMode - the dock mode
See Also:
getDockMode(java.awt.Component)

getDockMode

public DockMode getDockMode(Component comp)
Returns the dock mode for the specify component.

Parameters:
comp - the specify componet
Returns:
the dock mode
See Also:
setDockMode(java.awt.Component, com.zfqjava.layout.DockMode)

setAction

public void setAction(Component comp,
                      Action action)
Sets the action for the specify component.

Parameters:
comp - the specify component
action - the action
See Also:
getAction(java.awt.Component)

getAction

public Action getAction(Component comp)
Returns the action for the specify component.

Parameters:
comp - the specify component
Returns:
the action
See Also:
setAction(java.awt.Component, javax.swing.Action)

isSelected

public boolean isSelected(Component comp)
Returns the selected state for the specify component.

Parameters:
comp - the specify component
Returns:
the selected state
See Also:
#setSelected

setSelectedComponent

public void setSelectedComponent(Component comp)
Sets the selected component to the specified component.

Parameters:
comp - the component to be selected
See Also:
getSelectedComponent()

getSelectedComponent

public Component getSelectedComponent()
Returns the selected component.

Returns:
the selected component
See Also:
setSelectedComponent(java.awt.Component)

getSideMode

public SideMode getSideMode(Component comp)
Returns the side mode for the specified component.

Parameters:
comp - the specified component
Returns:
the side mode for the specified component

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
Overrides:
addImpl in class Container

addPart

public void addPart(Component comp,
                    Action a)
Adds the part component. The default DockMode is DockMode.DOCKED, the default SideMode is SideMode.CENTER.

Parameters:
comp - the part component to add
action - the action for the component
Throws:
NullPointerException - if the comp is null

addPart

public void addPart(Component comp,
                    Action a,
                    DockMode dockMode,
                    SideMode sideMode)
Adds the part component for specified side.

Parameters:
comp - the part component to add
action - the action for the component
dockMode - the dock mode for the component
sideMode - the specified side
Throws:
NullPointerException - if the comp is null

addPartAt

public void addPartAt(Component comp,
                      Action a,
                      DockMode dockMode,
                      SideMode sideMode,
                      int index)
Adds the part component at the specify index for specified side.

Parameters:
comp - the part component to add
action - the action for the component
dockMode - the dock mode for the component
sideMode - the specified side
index - the specify index
Throws:
NullPointerException - if the comp is null
IndexOutOfBoundsException - if index is out of range (index < 0 || index > side count)

removePart

public void removePart(Component comp)
Removes the part component.

Parameters:
part - the part compnent to remvoe
Throws:
NullPointerException - if the comp is null
IllegalArgumentException - if the comp have not added into this JDockPane

removePartAt

public void removePartAt(SideMode sideMode,
                         int index)
Removes the part component at the specified index for specified side.

Parameters:
sideMode - the specified side
index - the specified part index
Throws:
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= side count)

removeAllPart

public void removeAllPart(SideMode sideMode)
Removes all part component for the specified side.

Parameters:
sideMode - the specified side

getComponentAt

public Component getComponentAt(int index,
                                SideMode sideMode)
Returns the component at the specified index and side.

Parameters:
index - the specified index
sideMode - the side mode
Returns:
the component at the specified index and side
Throws:
IndexOutOfBoundsException - if index is out of range (index < 0 || index >= side count)

indexOfComponent

public int indexOfComponent(Component comp,
                            SideMode sideMode)
Returns the index for the specified component at the specified side.

Parameters:
comp - the specified component
sideMode - the side mode of the specified component
Returns:
the index for the specified component
Throws:
NullPointerException - if the comp is null

getComponentCount

public int getComponentCount(SideMode sideMode)
Returns the component count for the specified side.

Parameters:
sideMode - the side mode
Returns:
the component count for the specified side

paramString

protected String paramString()
Returns a string representation of this JDockPane. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString in class JComponent
Returns:
a string representation of this JDockPane.

getAccessibleContext

public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JDockPane. For JDockPanes, the AccessibleContext takes the form of an AccessibleJDockPane. A new AccessibleJDockPane instance is created if necessary.

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
an AccessibleJDockPane that serves as the AccessibleContext of this JDockPane

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.